1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/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
);
42 // implement wxGLCanvasX11 methods
43 // -------------------------------
45 virtual Window
GetXWindow() const;
51 #if WXWIN_COMPATIBILITY_2_8
52 wxDEPRECATED_CONSTRUCTOR(
53 wxGLCanvas(wxWindow
*parent
,
54 wxWindowID id
= wxID_ANY
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
58 const wxString
& name
= wxGLCanvasName
,
59 const int *attribList
= NULL
,
60 const wxPalette
& palette
= wxNullPalette
)
63 wxDEPRECATED_CONSTRUCTOR(
64 wxGLCanvas(wxWindow
*parent
,
65 const wxGLContext
*shared
,
66 wxWindowID id
= wxID_ANY
,
67 const wxPoint
& pos
= wxDefaultPosition
,
68 const wxSize
& size
= wxDefaultSize
,
70 const wxString
& name
= wxGLCanvasName
,
71 const int *attribList
= NULL
,
72 const wxPalette
& palette
= wxNullPalette
)
75 wxDEPRECATED_CONSTRUCTOR(
76 wxGLCanvas(wxWindow
*parent
,
77 const wxGLCanvas
*shared
,
78 wxWindowID id
= wxID_ANY
,
79 const wxPoint
& pos
= wxDefaultPosition
,
80 const wxSize
& size
= wxDefaultSize
,
82 const wxString
& name
= wxGLCanvasName
,
83 const int *attribList
= NULL
,
84 const wxPalette
& palette
= wxNullPalette
)
87 // called from "realized" callback to create the implicit context if needed
88 void GTKInitImplicitContext();
89 #endif // WXWIN_COMPATIBILITY_2_8
91 // implementation from now on
92 virtual void OnInternalIdle();
95 GtkWidget
*m_glWidget
;
97 #if WXWIN_COMPATIBILITY_2_8
98 wxGLContext
*m_sharedContext
;
99 wxGLCanvas
*m_sharedContextOf
;
100 const bool m_createImplicitContext
;
101 #endif // WXWIN_COMPATIBILITY_2_8
104 DECLARE_CLASS(wxGLCanvas
)
107 #endif // _WX_GLCANVAS_H_