X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3135f4a7785f188af291c35ce5df6bdd13672300..d624fd67f82a90d74c7f796b241508663367134f:/utils/glcanvas/win/glcanvas.cpp diff --git a/utils/glcanvas/win/glcanvas.cpp b/utils/glcanvas/win/glcanvas.cpp index bbd7d026b9..aee52f2f2a 100644 --- a/utils/glcanvas/win/glcanvas.cpp +++ b/utils/glcanvas/win/glcanvas.cpp @@ -129,14 +129,24 @@ END_EVENT_TABLE() wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attribList /* not used yet! */, const wxPalette& palette): - wxScrolledWindow(parent, id, pos, size, style, name) + wxScrolledWindow() { - m_hDC = (WXHDC) ::GetDC((HWND) GetHWND()); + m_glContext = (wxGLContext*) NULL; - SetupPixelFormat(); - SetupPalette(palette); + bool ret = Create(parent, id, pos, size, style, name); + + if ( ret ) + { + SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); + SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + } + + m_hDC = (WXHDC) ::GetDC((HWND) GetHWND()); - m_glContext = new wxGLContext(TRUE, this, palette); + SetupPixelFormat(); + SetupPalette(palette); + + m_glContext = new wxGLContext(TRUE, this, palette); } wxGLCanvas::wxGLCanvas( wxWindow *parent, @@ -144,9 +154,10 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attribList, const wxPalette& palette ) : wxScrolledWindow() -// : wxScrolledWindow(parent, id, pos, size, style, name) { - bool ret = Create(parent, id, pos, size, style, name); + m_glContext = (wxGLContext*) NULL; + + bool ret = Create(parent, id, pos, size, style, name); if ( ret ) { @@ -162,6 +173,33 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent, m_glContext = new wxGLContext(TRUE, this, palette, shared ); } +// Not very usefull for wxMSW, but this is to be wxGTK compliant + +wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id, + const wxPoint& pos, const wxSize& size, long style, const wxString& name, + int *attribList, const wxPalette& palette ): + wxScrolledWindow() +{ + m_glContext = (wxGLContext*) NULL; + + bool ret = Create(parent, id, pos, size, style, name); + + if ( ret ) + { + SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); + SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + } + + m_hDC = (WXHDC) ::GetDC((HWND) GetHWND()); + + SetupPixelFormat(); + SetupPalette(palette); + + wxGLContext *sharedContext=0; + if (shared) sharedContext=shared->GetContext(); + m_glContext = new wxGLContext(TRUE, this, palette, sharedContext ); +} + wxGLCanvas::~wxGLCanvas() { if (m_glContext)