]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
Hopefully fixed library names generated by wx-config for OS/2's PM port.
[wxWidgets.git] / src / msw / glcanvas.cpp
index 21e44ab4b556406b35cfdd294c152a5e00bcddeb..d0867503fae02cdf003fc9b3ddb6ff78a30d334e 100644 (file)
@@ -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();