X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b8ee9a863c033bb720c4da9344c3987b4c71f38d..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/msw/glcanvas.cpp?ds=sidebyside diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index 3b635873d7..d0867503fa 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -243,11 +243,6 @@ void wxGLContext::SetCurrent() { wglMakeCurrent((HDC) m_hDC, m_glContext); } - - /* - setupPixelFormat(hDC); - setupPalette(hDC); - */ } void wxGLContext::SetColour(const wxChar *colour) @@ -476,7 +471,7 @@ void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC) PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER, /* support double-buffering */ PFD_TYPE_RGBA, /* color type */ - 16, /* prefered color depth */ + 16, /* preferred color depth */ 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ 0, /* no alpha buffer */ 0, /* alpha bits (ignored) */ @@ -586,6 +581,12 @@ void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event)) void wxGLCanvas::SetCurrent() { + // although on MSW it works even if the window is still hidden, it doesn't + // under wxGTK and documentation mentions that SetCurrent() can only be + // called for a shown window, so check it + wxASSERT_MSG( GetParent()->IsShown(), + _T("can't make hidden GL canvas current") ); + if (m_glContext) { m_glContext->SetCurrent(); @@ -785,7 +786,7 @@ bool wxGLApp::InitGLVisual(int *attribList) PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER, /* support double-buffering */ PFD_TYPE_RGBA, /* color type */ - 16, /* prefered color depth */ + 16, /* preferred color depth */ 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ 0, /* no alpha buffer */ 0, /* alpha bits (ignored) */