+// ----------------------------------------------------------------------------
+// wxGLContextBase: OpenGL rendering context
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_GL wxGLContextBase : public wxObject
+{
+public:
+ /*
+ The derived class should provide a ctor with this signature:
+
+ wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL);
+ */
+
+ // set this context as the current one
+ virtual void SetCurrent(const wxGLCanvas& win) const = 0;
+};
+
+// ----------------------------------------------------------------------------
+// wxGLCanvasBase: window which can be used for OpenGL rendering
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_GL wxGLCanvasBase : public wxWindow
+{
+public:
+ // default ctor doesn't initialize the window, use Create() later
+ wxGLCanvasBase();
+
+ virtual ~wxGLCanvasBase();
+
+
+ /*
+ The derived class should provide a ctor with this signature:
+
+ wxGLCanvas(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
+ int* attribList = 0,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxGLCanvasName,
+ const wxPalette& palette = wxNullPalette);
+ */
+
+ // operations
+ // ----------
+
+ // set the given context associated with this window as the current one
+ void SetCurrent(const wxGLContext& context) const;
+
+ // flush the back buffer (if we have it)
+ virtual void SwapBuffers() = 0;
+
+
+ // accessors
+ // ---------
+
+ const wxPalette *GetPalette() const { return &m_palette; }
+
+ // miscellaneous helper functions
+ // ------------------------------
+
+ // call glcolor() for the colour with the given name, return false if
+ // colour not found
+ bool SetColour(const wxString& colour);
+
+
+
+ // deprecated methods using the implicit wxGLContext
+#if WXWIN_COMPATIBILITY_2_8
+ wxDEPRECATED( wxGLContext* GetContext() const );
+
+ wxDEPRECATED( void SetCurrent() );
+
+ wxDEPRECATED( void OnSize(wxSizeEvent& event) );
+#endif // WXWIN_COMPATIBILITY_2_8
+
+#ifdef __WXUNIVERSAL__
+ // resolve the conflict with wxWindowUniv::SetCurrent()
+ virtual bool SetCurrent(bool doit) { return wxWindow::SetCurrent(doit); };
+#endif
+
+protected:
+ // override this to implement SetColour() in GL_INDEX_MODE
+ // (currently only implemented in wxX11 and wxMotif ports)
+ virtual int GetColourIndex(const wxColour& WXUNUSED(col)) { return -1; }
+
+ // create default palette if we're not using RGBA mode
+ // (not supported in most ports)
+ virtual wxPalette CreateDefaultPalette() { return wxNullPalette; }
+
+
+ wxPalette m_palette;
+
+#if WXWIN_COMPATIBILITY_2_8
+ wxGLContext *m_glContext;
+#endif // WXWIN_COMPATIBILITY_2_8
+};
+
+// ----------------------------------------------------------------------------
+// wxGLApp: a special wxApp subclass for OpenGL applications which must be used
+// to select a visual compatible with the given attributes
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_GL wxGLAppBase : public wxApp
+{
+public:
+ wxGLAppBase() : wxApp() { }
+
+ // use this in the constructor of the user-derived wxGLApp class to
+ // determine if an OpenGL rendering context with these attributes
+ // is available - returns true if so, false if not.
+ virtual bool InitGLVisual(const int *attribList) = 0;
+};
+