1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/glcanvas.h
3 // Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GLCANVAS_H_
12 #define _WX_GLCANVAS_H_
14 #include "wx/unix/glx11.h"
16 //---------------------------------------------------------------------------
18 //---------------------------------------------------------------------------
20 class WXDLLIMPEXP_GL wxGLCanvas
: public wxGLCanvasX11
23 wxGLCanvas(wxWindow
*parent
,
24 wxWindowID id
= wxID_ANY
,
25 const int *attribList
= NULL
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
29 const wxString
& name
= wxGLCanvasName
,
30 const wxPalette
& palette
= wxNullPalette
);
32 bool Create(wxWindow
*parent
,
33 wxWindowID id
= wxID_ANY
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
37 const wxString
& name
= wxGLCanvasName
,
38 const int *attribList
= NULL
,
39 const wxPalette
& palette
= wxNullPalette
);
41 virtual bool SetBackgroundStyle(wxBackgroundStyle style
);
43 // implement wxGLCanvasX11 methods
44 // --------------------------------
46 virtual Window
GetXWindow() const;
52 #if WXWIN_COMPATIBILITY_2_8
54 wxGLCanvas(wxWindow
*parent
,
55 wxWindowID id
= wxID_ANY
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
59 const wxString
& name
= wxGLCanvasName
,
60 const int *attribList
= NULL
,
61 const wxPalette
& palette
= wxNullPalette
)
65 wxGLCanvas(wxWindow
*parent
,
66 const wxGLContext
*shared
,
67 wxWindowID id
= wxID_ANY
,
68 const wxPoint
& pos
= wxDefaultPosition
,
69 const wxSize
& size
= wxDefaultSize
,
71 const wxString
& name
= wxGLCanvasName
,
72 const int *attribList
= NULL
,
73 const wxPalette
& palette
= wxNullPalette
)
77 wxGLCanvas(wxWindow
*parent
,
78 const wxGLCanvas
*shared
,
79 wxWindowID id
= wxID_ANY
,
80 const wxPoint
& pos
= wxDefaultPosition
,
81 const wxSize
& size
= wxDefaultSize
,
83 const wxString
& name
= wxGLCanvasName
,
84 const int *attribList
= NULL
,
85 const wxPalette
& palette
= wxNullPalette
)
88 // called from "realized" callback to create the implicit context if needed
89 void GTKInitImplicitContext();
90 #endif // WXWIN_COMPATIBILITY_2_8
92 // implementation from now on
93 void OnInternalIdle();
97 cairo_t
* m_cairoPaintContext
;
100 #if WXWIN_COMPATIBILITY_2_8
101 wxGLContext
*m_sharedContext
;
102 wxGLCanvas
*m_sharedContextOf
;
103 const bool m_createImplicitContext
;
104 #endif // WXWIN_COMPATIBILITY_2_8
107 DECLARE_CLASS(wxGLCanvas
)
110 #endif // _WX_GLCANVAS_H_