]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
Final and global PRIOR/NEXT change: keep consistency using only PAGE versions, deprec...
[wxWidgets.git] / src / msw / glcanvas.cpp
index 21e44ab4b556406b35cfdd294c152a5e00bcddeb..a463d64c6d275af5a5c4a13809b05652f2b5867a 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "glcanvas.h"
-#endif
-
 #include "wx/wxprec.h"
 
 #if defined(__BORLANDC__)
@@ -243,11 +239,6 @@ void wxGLContext::SetCurrent()
   {
     wglMakeCurrent((HDC) m_hDC, m_glContext);
   }
-
-  /*
-  setupPixelFormat(hDC);
-  setupPalette(hDC);
-  */
 }
 
 void wxGLContext::SetColour(const wxChar *colour)
@@ -586,6 +577,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();