X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3103e8a97e834e9793f0eb149aa82a99fd64ef9a..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/msw/glcanvas.cpp diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index 21e44ab4b5..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) @@ -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();