]>
Commit | Line | Data |
---|---|---|
83df96d6 | 1 | ///////////////////////////////////////////////////////////////////////////// |
b73e73f9 | 2 | // Name: wx/x11/glcanvas.h |
77ffb593 | 3 | // Purpose: wxGLCanvas, for using OpenGL with wxWidgets 2.0 for Motif. |
83df96d6 JS |
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 | |
b73e73f9 | 10 | // Licence: wxWindows licence |
83df96d6 JS |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | ||
db4c39a9 VZ |
13 | #ifndef _WX_GLCANVAS_H_ |
14 | #define _WX_GLCANVAS_H_ | |
15 | ||
83df96d6 | 16 | #include "wx/gdicmn.h" |
83df96d6 JS |
17 | |
18 | #include <GL/glx.h> | |
19 | ||
83df96d6 JS |
20 | //--------------------------------------------------------------------------- |
21 | // classes | |
22 | //--------------------------------------------------------------------------- | |
23 | ||
dc3065a5 | 24 | class WXDLLEXPORT wxGLContext : public wxGLContextBase |
83df96d6 JS |
25 | { |
26 | public: | |
dc3065a5 | 27 | wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL); |
d3c7fc99 | 28 | virtual ~wxGLContext(); |
b73e73f9 | 29 | |
dc3065a5 | 30 | virtual void SetCurrent(const wxGLCanvas& win) const; |
b73e73f9 | 31 | |
dc3065a5 | 32 | private: |
83df96d6 | 33 | GLXContext m_glContext; |
b73e73f9 | 34 | |
83df96d6 JS |
35 | DECLARE_CLASS(wxGLContext) |
36 | }; | |
37 | ||
38 | ||
dc3065a5 | 39 | class WXDLLEXPORT wxGLCanvas : public wxGLCanvasBase |
83df96d6 JS |
40 | { |
41 | public: | |
dc3065a5 VZ |
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); | |
b73e73f9 | 59 | |
d3c7fc99 | 60 | virtual ~wxGLCanvas(); |
b73e73f9 | 61 | |
dc3065a5 | 62 | virtual void SwapBuffers(); |
b73e73f9 | 63 | |
b73e73f9 | 64 | |
83df96d6 | 65 | // implementation |
dc3065a5 | 66 | void *m_vi; |
b73e73f9 | 67 | |
dc3065a5 VZ |
68 | protected: |
69 | virtual int GetColourIndex(const wxColour& col); | |
b73e73f9 | 70 | |
dc3065a5 | 71 | DECLARE_CLASS(wxGLCanvas) |
83df96d6 JS |
72 | }; |
73 | ||
dc3065a5 | 74 | #endif // _WX_GLCANVAS_H_ |