]> 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 3b635873d7f1a4ab491b02932f8dedb2491308cf..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)
@@ -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) */