Commit 0bf68ece authored by Guillaume Seguin's avatar Guillaume Seguin

Initialize GL in OnReshape if needed

parent 7c78d539
...@@ -132,6 +132,9 @@ class wxGLPanel(wx.Panel): ...@@ -132,6 +132,9 @@ class wxGLPanel(wx.Panel):
def OnReshape(self, width, height): def OnReshape(self, width, height):
'''Reshape the OpenGL viewport based on the dimensions of the window.''' '''Reshape the OpenGL viewport based on the dimensions of the window.'''
if not self.GLinitialized:
self.OnInitGL()
self.GLinitialized = True
glViewport(0, 0, width, height) glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION) glMatrixMode(GL_PROJECTION)
glLoadIdentity() glLoadIdentity()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment