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()
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)
def _set_size(self, size): if super(MTWindowGlut, self)._set_size(size): glutReshapeWindow(*size) return True