Fixes to OpenGL samples to avoid asserts/crashes.
Don't call wxGLCanvas::SetCurrent() when the window is not shown. Closes #13424. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -153,9 +153,6 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent,
|
||||
// Explicitly create a new rendering context instance for this canvas.
|
||||
m_glRC = new wxGLContext(this);
|
||||
|
||||
// Make the new context current (activate it for use) with this canvas.
|
||||
SetCurrent(*m_glRC);
|
||||
|
||||
m_gldata.initialized = false;
|
||||
|
||||
// initialize view matrix
|
||||
@@ -303,6 +300,9 @@ void TestGLCanvas::InitGL()
|
||||
|
||||
void TestGLCanvas::ResetProjectionMode()
|
||||
{
|
||||
if ( !IsShownOnScreen() )
|
||||
return;
|
||||
|
||||
// This is normally only necessary if there is more than one wxGLCanvas
|
||||
// or more than one wxGLContext in the application.
|
||||
SetCurrent(*m_glRC);
|
||||
|
Reference in New Issue
Block a user