mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
GlCanvas Cleanup - This works fine.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,8 +21,8 @@ except ImportError:
|
||||
|
||||
|
||||
buttonDefs = {
|
||||
wx.NewId() : ('CubeCanvas', 'Cube'),
|
||||
wx.NewId() : ('ConeCanvas', 'Cone'),
|
||||
wx.NewId() : ('CubeCanvas', 'Cube'),
|
||||
wx.NewId() : ('ConeCanvas', 'Cone'),
|
||||
}
|
||||
|
||||
class ButtonPanel(wx.Panel):
|
||||
@@ -79,7 +79,7 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
glcanvas.GLCanvas.__init__(self, parent, -1)
|
||||
self.init = False
|
||||
self.context = glcanvas.GLContext(self)
|
||||
|
||||
|
||||
# initial mouse position
|
||||
self.lastx = self.x = 30
|
||||
self.lasty = self.y = 30
|
||||
@@ -100,11 +100,11 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
wx.CallAfter(self.DoSetViewport)
|
||||
event.Skip()
|
||||
|
||||
|
||||
def DoSetViewport(self):
|
||||
size = self.size = self.GetClientSize()
|
||||
self.SetCurrent(self.context)
|
||||
glViewport(0, 0, size.width, size.height)
|
||||
|
||||
|
||||
|
||||
def OnPaint(self, event):
|
||||
@@ -132,8 +132,6 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
self.Refresh(False)
|
||||
|
||||
|
||||
|
||||
|
||||
class CubeCanvas(MyCanvasBase):
|
||||
def InitGL(self):
|
||||
# set viewing projection
|
||||
@@ -209,9 +207,6 @@ class CubeCanvas(MyCanvasBase):
|
||||
self.SwapBuffers()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ConeCanvas(MyCanvasBase):
|
||||
def InitGL( self ):
|
||||
glMatrixMode(GL_PROJECTION)
|
||||
@@ -260,7 +255,6 @@ class ConeCanvas(MyCanvasBase):
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -271,8 +265,6 @@ def runTest(frame, nb, log):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
overview = """\
|
||||
"""
|
||||
|
||||
@@ -283,8 +275,3 @@ if __name__ == '__main__':
|
||||
import run
|
||||
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user