]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/x11/glcanvas.h | |
3 | // Purpose: wxGLCanvas, for using OpenGL with wxWidgets 2.0 for Motif. | |
4 | // Uses the GLX extension. | |
5 | // Author: Julian Smart and Wolfram Gloger | |
6 | // Modified by: | |
7 | // Created: 1995, 1999 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) Julian Smart, Wolfram Gloger | |
10 | // Licence: wxWindows licence | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef _WX_GLCANVAS_H_ | |
14 | #define _WX_GLCANVAS_H_ | |
15 | ||
16 | #include "wx/gdicmn.h" | |
17 | ||
18 | #include <GL/glx.h> | |
19 | ||
20 | //--------------------------------------------------------------------------- | |
21 | // classes | |
22 | //--------------------------------------------------------------------------- | |
23 | ||
24 | class WXDLLEXPORT wxGLContext : public wxGLContextBase | |
25 | { | |
26 | public: | |
27 | wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL); | |
28 | virtual ~wxGLContext(); | |
29 | ||
30 | virtual void SetCurrent(const wxGLCanvas& win) const; | |
31 | ||
32 | private: | |
33 | GLXContext m_glContext; | |
34 | ||
35 | DECLARE_CLASS(wxGLContext) | |
36 | }; | |
37 | ||
38 | ||
39 | class WXDLLEXPORT wxGLCanvas : public wxGLCanvasBase | |
40 | { | |
41 | public: | |
42 | wxGLCanvas(wxWindow *parent, | |
43 | wxWindowID id = wxID_ANY, | |
44 | const int *attribList = NULL, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | long style = 0, | |
48 | const wxString& name = wxGLCanvasName, | |
49 | const wxPalette& palette = wxNullPalette); | |
50 | ||
51 | bool Create(wxWindow *parent, | |
52 | wxWindowID id = wxID_ANY, | |
53 | const wxPoint& pos = wxDefaultPosition, | |
54 | const wxSize& size = wxDefaultSize, | |
55 | long style = 0, | |
56 | const wxString& name = wxGLCanvasName, | |
57 | const int *attribList = NULL, | |
58 | const wxPalette& palette = wxNullPalette); | |
59 | ||
60 | virtual ~wxGLCanvas(); | |
61 | ||
62 | virtual void SwapBuffers(); | |
63 | ||
64 | ||
65 | // implementation | |
66 | void *m_vi; | |
67 | ||
68 | protected: | |
69 | virtual int GetColourIndex(const wxColour& col); | |
70 | ||
71 | DECLARE_CLASS(wxGLCanvas) | |
72 | }; | |
73 | ||
74 | #endif // _WX_GLCANVAS_H_ |