Commit 34f653fd authored by Guillaume Seguin's avatar Guillaume Seguin

Make resizing work in wx2.9

parent f2cab549
...@@ -63,13 +63,12 @@ class wxGLPanel(wx.Panel): ...@@ -63,13 +63,12 @@ class wxGLPanel(wx.Panel):
def processSizeEvent(self, event): def processSizeEvent(self, event):
'''Process the resize event.''' '''Process the resize event.'''
if self.canvas.GetContext(): if (wx.VERSION > (2,9) and self.canvas.IsShownOnScreen()) or self.canvas.GetContext():
# Make sure the frame is shown before calling SetCurrent. # Make sure the frame is shown before calling SetCurrent.
self.Show() size = self.GetClientSize()
self.canvas.SetCurrent(self.context)
size = self.canvas.GetClientSize()
self.winsize = (size.width, size.height) self.winsize = (size.width, size.height)
self.width, self.height = size.width, size.height self.width, self.height = size.width, size.height
self.canvas.SetCurrent(self.context)
self.OnReshape(size.width, size.height) self.OnReshape(size.width, size.height)
self.canvas.Refresh(False) self.canvas.Refresh(False)
event.Skip() event.Skip()
...@@ -127,7 +126,6 @@ class wxGLPanel(wx.Panel): ...@@ -127,7 +126,6 @@ class wxGLPanel(wx.Panel):
gluPerspective(60., width / float(height), .1, 1000.) gluPerspective(60., width / float(height), .1, 1000.)
glMatrixMode(GL_MODELVIEW) glMatrixMode(GL_MODELVIEW)
glLoadIdentity() glLoadIdentity()
#pyglet stuff
self.vpmat = (GLint * 4)(0, 0, *list(self.GetClientSize())) self.vpmat = (GLint * 4)(0, 0, *list(self.GetClientSize()))
glGetDoublev(GL_PROJECTION_MATRIX, self.pmat) glGetDoublev(GL_PROJECTION_MATRIX, self.pmat)
......
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