\latexignore{\rtfignore{\wxheading{Members}}}
 
+
 \membersection{wxGLCanvas::wxGLCanvas}\label{wxglcanvasconstr}
 
 \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos},
 \docparam{palette}{If the window has the palette, it should by pass this value.
 Note: palette and WX\_GL\_RGBA are mutually exclusive.}
 
+
 \membersection{wxGLCanvas::GetContext}\label{wxglcanvasgetcontext}
 
 \func{wxGLContext*}{GetContext}{\void}
 
 Obtains the context that is associated with this canvas.
 
+
 \membersection{wxGLCanvas::SetCurrent}\label{wxglcanvassetcurrent}
 
 \func{void}{SetCurrent}{\void}
 the creation of this window. So this call sets the current device context
 as the target device context for OpenGL operations.
 
+Note that this function may only be called after the window has been shown.
+
+
 \membersection{wxGLCanvas::SetColour}\label{wxglcanvassetcolour}
 
 \func{void}{SetColour}{\param{const char*}{ colour}}
 
 Sets the current colour for this window, using the wxWidgets colour database to find a named colour.
 
+
 \membersection{wxGLCanvas::SwapBuffers}\label{wxglcanvasswapbuffers}
 
 \func{void}{SwapBuffers}{\void}
 
   {
     wglMakeCurrent((HDC) m_hDC, m_glContext);
   }
-
-  /*
-  setupPixelFormat(hDC);
-  setupPalette(hDC);
-  */
 }
 
 void wxGLContext::SetColour(const wxChar *colour)
 
 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();