]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/glcanvas.h
FloodFill correction, wxQuantize correction
[wxWidgets.git] / include / wx / motif / glcanvas.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: glcanvas.h
3 // Purpose: wxGLCanvas, for using OpenGL with wxWindows 2.0 for Motif.
4 // Uses the GLX extension.
5 // Author: Julian Smart and Wolfram Gloger
6 // Modified by:
7 // Created: 1995, 1999
8 // RCS-ID: $Id$
9 // Copyright: (c) Julian Smart, Wolfram Gloger
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifdef __GNUG__
14 #pragma interface "glcanvas.h"
15 #endif
16
17 #ifndef _WX_GLCANVAS_H_
18 #define _WX_GLCANVAS_H_
19
20 #include <wx/setup.h>
21
22 #if wxUSE_GLCANVAS
23
24 #include <wx/gdicmn.h>
25 #include <wx/palette.h>
26 #include <wx/scrolwin.h>
27
28 #include <GL/glx.h>
29
30 enum
31 {
32 WX_GL_RGBA=1, /* use true color palette */
33 WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */
34 WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */
35 WX_GL_DOUBLEBUFFER, /* use doublebuffer */
36 WX_GL_STEREO, /* use stereoscopic display */
37 WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */
38 WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */
39 WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */
40 WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */
41 WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */
42 WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */
43 WX_GL_STENCIL_SIZE, /* bits for stencil buffer */
44 WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */
45 WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */
46 WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */
47 WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */
48 };
49
50 //---------------------------------------------------------------------------
51 // classes
52 //---------------------------------------------------------------------------
53
54 class WXDLLEXPORT wxGLCanvas: public wxScrolledWindow
55 {
56 DECLARE_CLASS(wxGLCanvas)
57 public:
58 GLXContext glx_cx;
59
60 inline wxGLCanvas() { glx_cx = 0; }
61
62 wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
63 const wxSize& size = wxDefaultSize, long style = 0,
64 const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
65 ~wxGLCanvas(void);
66
67 void SetCurrent();
68 void SwapBuffers();
69 void SetColour(const char *col);
70 };
71
72 #endif
73 // wxUSE_GLCANVAS
74
75 #endif
76 // _WX_GLCANVAS_H_