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:
@@ -323,10 +323,11 @@ void TestGLCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
// is wrong when next another canvas is repainted.
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
|
||||
TestGLContext& canvas = wxGetApp().GetContext(this);
|
||||
glViewport(0, 0, ClientSize.x, ClientSize.y);
|
||||
|
||||
// Render the graphics and swap the buffers.
|
||||
wxGetApp().GetContext(this).DrawRotatedCube(m_xangle, m_yangle);
|
||||
canvas.DrawRotatedCube(m_xangle, m_yangle);
|
||||
SwapBuffers();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user