]>
git.saurik.com Git - wxWidgets.git/blob - utils/glcanvas/src/glcanvas.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWindows and GTK
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma interface "glcanvas.h"
16 #ifndef _WX_GLCANVAS_H_
17 #define _WX_GLCANVAS_H_
20 #include "wx/scrolwin.h"
26 //---------------------------------------------------------------------------
28 //---------------------------------------------------------------------------
33 //---------------------------------------------------------------------------
35 //---------------------------------------------------------------------------
38 class wxGLContext
: public wxObject
40 DECLARE_CLASS(wxGLContext
)
44 wxGLContext( bool isRGB
, wxWindow
*win
, const wxPalette
& palette
= wxNullPalette
);
48 void SetColour(const char *colour
);
51 void SetupPixelFormat();
52 void SetupPalette(const wxPalette
& palette
);
53 wxPalette
CreateDefaultPalette();
55 inline wxPalette
* GetPalette() const { return (wxPalette
*) & m_palette
; }
56 inline wxWindow
* GetWindow() const { return m_window
; }
57 inline GtkWidget
* GetWidget() const { return m_widget
; }
58 inline GLXContext
GetContext() const { return m_glContext
; }
62 GLXContext m_glContext
;
69 //---------------------------------------------------------------------------
71 //---------------------------------------------------------------------------
73 class wxGLCanvas
: public wxScrolledWindow
75 DECLARE_CLASS(wxGLCanvas
)
78 wxGLCanvas(wxWindow
*parent
, wxWindowID id
= -1, const wxPoint
& pos
= wxDefaultPosition
,
79 const wxSize
& size
= wxDefaultSize
, long style
= 0,
80 const wxString
& name
= "GLCanvas", int *attribList
= 0, const wxPalette
& palette
= wxNullPalette
);
84 void SetColour(const char *colour
);
87 void OnSize(wxSizeEvent
& event
);
89 inline wxGLContext
* GetContext() const { return m_glContext
; }
93 wxGLContext
* m_glContext
; // this is typedef-ed ptr, in fact