X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc3065a56f1febf3de3b3bbf0904cf8fdc7f7c50..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/msw/glcanvas.h diff --git a/include/wx/msw/glcanvas.h b/include/wx/msw/glcanvas.h index 83362b0167..52b82f42a0 100644 --- a/include/wx/msw/glcanvas.h +++ b/include/wx/msw/glcanvas.h @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -28,7 +27,7 @@ public: wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL); virtual ~wxGLContext(); - virtual void SetCurrent(const wxGLCanvas& win) const; + virtual bool SetCurrent(const wxGLCanvas& win) const; HGLRC GetGLRC() const { return m_glContext; } @@ -46,6 +45,7 @@ private: class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase { public: + wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, @@ -67,7 +67,7 @@ public: virtual ~wxGLCanvas(); // implement wxGLCanvasBase methods - virtual void SwapBuffers(); + virtual bool SwapBuffers(); // MSW-specific helpers @@ -133,8 +133,18 @@ protected: // common part of all ctors void Init(); + // the real window creation function, Create() may reuse it twice as we may + // need to create an OpenGL window to query the available extensions and + // then potentially delete and recreate it with another pixel format + bool CreateWindow(wxWindow *parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxGLCanvasName); + // set up the pixel format using the given attributes and palette - bool DoSetup(const int *attribList); + int DoSetup(PIXELFORMATDESCRIPTOR &pfd, const int *attribList); // HDC for this window, we keep it all the time @@ -146,4 +156,3 @@ private: }; #endif // _WX_GLCANVAS_H_ -