]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/glcanvas.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / gtk1 / glcanvas.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/glcanvas.h
3 // Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
4 // Author: Robert Roebling
5 // Modified by:
6 // Created: 17/8/98
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_GLCANVAS_H_
12 #define _WX_GLCANVAS_H_
13
14 #include "wx/unix/glx11.h"
15
16 //---------------------------------------------------------------------------
17 // wxGLCanvas
18 //---------------------------------------------------------------------------
19
20 class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11
21 {
22 public:
23 wxGLCanvas(wxWindow *parent,
24 wxWindowID id = wxID_ANY,
25 const int *attribList = NULL,
26 const wxPoint& pos = wxDefaultPosition,
27 const wxSize& size = wxDefaultSize,
28 long style = 0,
29 const wxString& name = wxGLCanvasName,
30 const wxPalette& palette = wxNullPalette);
31
32 bool Create(wxWindow *parent,
33 wxWindowID id = wxID_ANY,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = 0,
37 const wxString& name = wxGLCanvasName,
38 const int *attribList = NULL,
39 const wxPalette& palette = wxNullPalette);
40
41
42 // implement wxGLCanvasX11 methods
43 // -------------------------------
44
45 virtual Window GetXWindow() const;
46
47
48 // deprecated methods
49 // ------------------
50
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,
57 long style = 0,
58 const wxString& name = wxGLCanvasName,
59 const int *attribList = NULL,
60 const wxPalette& palette = wxNullPalette)
61 );
62
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,
69 long style = 0,
70 const wxString& name = wxGLCanvasName,
71 const int *attribList = NULL,
72 const wxPalette& palette = wxNullPalette)
73 );
74
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,
81 long style = 0,
82 const wxString& name = wxGLCanvasName,
83 const int *attribList = NULL,
84 const wxPalette& palette = wxNullPalette)
85 );
86
87 // called from "realized" callback to create the implicit context if needed
88 void GTKInitImplicitContext();
89 #endif // WXWIN_COMPATIBILITY_2_8
90
91 // implementation from now on
92 virtual void OnInternalIdle();
93
94
95 GtkWidget *m_glWidget;
96
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
102
103 private:
104 DECLARE_CLASS(wxGLCanvas)
105 };
106
107 #endif // _WX_GLCANVAS_H_
108