X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8aaef28406647d6aa706c34f57dd151f00b18e5b..12c1b46a2f848ce995590997d5a28559ee6e3ae9:/utils/glcanvas/win/glcanvas.cpp diff --git a/utils/glcanvas/win/glcanvas.cpp b/utils/glcanvas/win/glcanvas.cpp index 48651358b6..28defce46d 100644 --- a/utils/glcanvas/win/glcanvas.cpp +++ b/utils/glcanvas/win/glcanvas.cpp @@ -29,7 +29,7 @@ wxChar wxGLCanvasClassName[] = wxT("wxGLCanvasClass"); -LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, +LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); /* @@ -48,8 +48,8 @@ wxGLContext::wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette) wglMakeCurrent((HDC) m_hDC, m_glContext); } -wxGLContext::wxGLContext( - bool isRGB, wxGLCanvas *win, +wxGLContext::wxGLContext( + bool isRGB, wxGLCanvas *win, const wxPalette& palette, const wxGLContext *other /* for sharing display lists */ ) @@ -129,23 +129,35 @@ 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()); + + SetupPixelFormat(); + SetupPalette(palette); + + m_glContext = new wxGLContext(TRUE, this, palette); - m_glContext = new wxGLContext(TRUE, this, palette); } -wxGLCanvas::wxGLCanvas( wxWindow *parent, +wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLContext *shared, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attribList, const wxPalette& palette ) : wxScrolledWindow() -// : wxScrolledWindow(parent, id, pos, size, style, name) -{ +{ + m_glContext = (wxGLContext*) NULL; + bool ret = Create(parent, id, pos, size, style, name); if ( ret )