document that SetCurrent() must be called on a visible window; assert that this is the case

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-05-31 15:01:31 +00:00
parent 0cf1199546
commit 2d918775fa
2 changed files with 13 additions and 5 deletions

View 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();