Exemplo n.º 1
0
def screen_mode(mode='window'):
    """
        Set the screen display mode from ['window', 'full_screen']
    :param mode: string
    """
    if mode == 'window':
        glutReshapeWindow(800, 600)
    elif mode == 'full_screen':
        glutFullScreen()
Exemplo n.º 2
0
    def resize(self, width, height):
        if width < 400:
            glutReshapeWindow(400, height)
        if height < 300:
            glutReshapeWindow(width, 300)
        if height == 0:
            height = 1

        glViewport(0, 0, width, height)
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        gluPerspective(45.0, float(width)/float(height), 0.1, 10000.0)
        glMatrixMode(GL_MODELVIEW)
Exemplo n.º 3
0
 def _set_size(self, size):
     if super(MTWindowGlut, self)._set_size(size):
         glutReshapeWindow(*size)
         return True
Exemplo n.º 4
0
 def _set_size(self, size):
     if super(MTWindowGlut, self)._set_size(size):
         glutReshapeWindow(*size)
         return True