def __init__(self): self.params['mode'] = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH self.params['timeout'] = 20 self.params['x'] = -1 self.params['y'] = -1 self.params['width'] = 640 self.params['height'] = 400 self.params['title'] = registry.getValue('programname') self.initParams() glutInit(sys.argv) glutInitWindowPosition(self.params['x'],self.params['y']) glutInitWindowSize(self.params['width'],self.params['height']) glutInitDisplayMode(self.params['mode']) self.windowId = glutCreateWindow(self.params['title']) glutSetWindow(self.windowId) glutDisplayFunc(self.render) glutIdleFunc(self.idle) glutMouseFunc(self.mouse) glutMotionFunc(self.mouseMotion) glutKeyboardFunc(self.keyboard) glutSpecialFunc(self.keyboardSpecial) glutTimerFunc(self.params['timeout'], self.timer, 0) glutReshapeFunc(self.reshape) self.init() return
def __init__(self): self.params['timeout'] = 20 self.params['sleeptime'] = 1 self.params['x'] = -1 self.params['y'] = -1 self.params['width'] = 640 self.params['height'] = 400 self.params['title'] = registry.getValue('programname') self.initParams() self.surface = pygame.display.set_mode((self.params['width'], self.params['height'])) pygame.display.set_caption(self.params['title']) self.init() return
def initParams(self): self.params['filename'] = registry.getValue("path")["data"] + "/window/mainwindow0.glade" return