// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "glcanvas.h"
-#endif
-
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
{
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();