X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..8a31648287be0ef976f133de2786b137f1e98340:/samples/opengl/penguin/penguin.cpp diff --git a/samples/opengl/penguin/penguin.cpp b/samples/opengl/penguin/penguin.cpp index a50f6dfd4d..c0c894069e 100644 --- a/samples/opengl/penguin/penguin.cpp +++ b/samples/opengl/penguin/penguin.cpp @@ -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);