1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/glcanvas.h
3 // Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GLCANVAS_H_
13 #define _WX_GLCANVAS_H_
15 #include "wx/unix/glx11.h"
17 //---------------------------------------------------------------------------
19 //---------------------------------------------------------------------------
21 class WXDLLIMPEXP_GL wxGLCanvas
: public wxGLCanvasX11
24 wxGLCanvas(wxWindow
*parent
,
25 wxWindowID id
= wxID_ANY
,
26 const int *attribList
= NULL
,
27 const wxPoint
& pos
= wxDefaultPosition
,
28 const wxSize
& size
= wxDefaultSize
,
30 const wxString
& name
= wxGLCanvasName
,
31 const wxPalette
& palette
= wxNullPalette
);
33 bool Create(wxWindow
*parent
,
34 wxWindowID id
= wxID_ANY
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
38 const wxString
& name
= wxGLCanvasName
,
39 const int *attribList
= NULL
,
40 const wxPalette
& palette
= wxNullPalette
);
42 virtual bool SetBackgroundStyle(wxBackgroundStyle style
);
44 // implement wxGLCanvasX11 methods
45 // --------------------------------
47 virtual Window
GetXWindow() const;
53 #if WXWIN_COMPATIBILITY_2_8
55 wxGLCanvas(wxWindow
*parent
,
56 wxWindowID id
= wxID_ANY
,
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
,
60 const wxString
& name
= wxGLCanvasName
,
61 const int *attribList
= NULL
,
62 const wxPalette
& palette
= wxNullPalette
)
66 wxGLCanvas(wxWindow
*parent
,
67 const wxGLContext
*shared
,
68 wxWindowID id
= wxID_ANY
,
69 const wxPoint
& pos
= wxDefaultPosition
,
70 const wxSize
& size
= wxDefaultSize
,
72 const wxString
& name
= wxGLCanvasName
,
73 const int *attribList
= NULL
,
74 const wxPalette
& palette
= wxNullPalette
)
78 wxGLCanvas(wxWindow
*parent
,
79 const wxGLCanvas
*shared
,
80 wxWindowID id
= wxID_ANY
,
81 const wxPoint
& pos
= wxDefaultPosition
,
82 const wxSize
& size
= wxDefaultSize
,
84 const wxString
& name
= wxGLCanvasName
,
85 const int *attribList
= NULL
,
86 const wxPalette
& palette
= wxNullPalette
)
89 // called from "realized" callback to create the implicit context if needed
90 void GTKInitImplicitContext();
91 #endif // WXWIN_COMPATIBILITY_2_8
93 // implementation from now on
94 void OnInternalIdle();
98 cairo_t
* m_cairoPaintContext
;
101 #if WXWIN_COMPATIBILITY_2_8
102 wxGLContext
*m_sharedContext
;
103 wxGLCanvas
*m_sharedContextOf
;
104 const bool m_createImplicitContext
;
105 #endif // WXWIN_COMPATIBILITY_2_8
108 DECLARE_CLASS(wxGLCanvas
)
111 #endif // _WX_GLCANVAS_H_