X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc3065a56f1febf3de3b3bbf0904cf8fdc7f7c50..194027acb360e71d5c378db3eb08d63e01e164d0:/include/wx/glcanvas.h diff --git a/include/wx/glcanvas.h b/include/wx/glcanvas.h index 9e1c89ea8e..bb4ffa498a 100644 --- a/include/wx/glcanvas.h +++ b/include/wx/glcanvas.h @@ -20,8 +20,8 @@ #include "wx/palette.h" #include "wx/window.h" -class WXDLLIMPEXP_GL wxGLCanvas; -class WXDLLIMPEXP_GL wxGLContext; +class WXDLLIMPEXP_FWD_GL wxGLCanvas; +class WXDLLIMPEXP_FWD_GL wxGLContext; // ---------------------------------------------------------------------------- // Constants for attributes list @@ -77,12 +77,7 @@ class WXDLLIMPEXP_GL wxGLCanvasBase : public wxWindow { public: // default ctor doesn't initialize the window, use Create() later - wxGLCanvasBase() - { -#if WXWIN_COMPATIBILITY_2_8 - m_glContext = NULL; -#endif - } + wxGLCanvasBase(); virtual ~wxGLCanvasBase(); @@ -120,7 +115,7 @@ public: // call glcolor() for the colour with the given name, return false if // colour not found - bool SetColour(const wxChar *colour); + bool SetColour(const wxString& colour); @@ -155,6 +150,22 @@ protected: #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; +}; + #if defined(__WXMSW__) #include "wx/msw/glcanvas.h" #elif defined(__WXMOTIF__) || defined(__WXX11__) @@ -171,20 +182,22 @@ protected: #error "wxGLCanvas not supported in this wxWidgets port" #endif -class WXDLLIMPEXP_GL wxGLApp : public wxApp +// wxMac and wxMSW don't need anything extra in wxGLAppBase, so declare it here +#ifndef wxGL_APP_DEFINED + +class WXDLLIMPEXP_GL wxGLApp : public wxGLAppBase { public: - wxGLApp() : wxApp() { } + wxGLApp() : wxGLAppBase() { } - // 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. - bool InitGLVisual(const int *attribList); + virtual bool InitGLVisual(const int *attribList); private: DECLARE_DYNAMIC_CLASS(wxGLApp) }; +#endif // !wxGL_APP_DEFINED + #endif // wxUSE_GLCANVAS #endif // _WX_GLCANVAS_H_BASE_