示例#1
0
 def _resize(self, width, height):
     """Resize the OpenGL scene (only called by event handlers)"""
     gl.glViewport(0, 0, width, height)
     gl.glMatrixMode(gl.GL_PROJECTION)
     gl.glLoadIdentity()
     width = width or 1
     height = height or 1
     gl.glOrtho(0, width, 0, height, -1, 1)
     gl.glMatrixMode(gl.GL_MODELVIEW)
     self.set_rect([0, 0, width, height])
示例#2
0
    def _ResizeGL(self, width, height):
        """
        Default _ResizeGL. This should be overridden by subclasses of GLPanel

        This function should not be called directly.
        To inform the GLPanel that it needs to resize call __OnSize().
        """
        gl.glViewport(0, 0, width, height)
        gl.glMatrixMode(gl.GL_PROJECTION)
        gl.glLoadIdentity()
        gl.glOrtho(-1,1,-1,1,-1,1)
        gl.glMatrixMode(gl.GL_MODELVIEW)