def start(): """ Start the engine hence the game. """ __init() EventManager.loadScripts() EventManager.castStart() glutMainLoop()
def __GameLoopManager(): """ The main loop in which everything take place in order. """ Time.__UpdateDeltaTime() __FrameUpdate() __RenderUpdate() __LateFrameUpdate() __PhysicsUpdate() __InputUpdate() EventManager.collectGarbage() EventManager.updateDictionary() Time.__SleepTimeToLockFramsOn(60)
def __RenderUpdate(): glLoadIdentity() glClearColor(Camera.clearColor.x, Camera.clearColor.y, Camera.clearColor.z, .0) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) screenWidthRatio = glutGet(GLUT_WINDOW_WIDTH) / 500 screenHeightRatio = glutGet(GLUT_WINDOW_HEIGHT) / 500 glOrtho(-Camera.size * screenWidthRatio, Camera.size * screenWidthRatio, -Camera.size * screenHeightRatio, Camera.size * screenHeightRatio, Camera.near, -Camera.far) Camera.applyTransformation(screenWidthRatio, screenHeightRatio) EventManager.castRender() glutSwapBuffers()
def start(): """ Start the engine hence the game. """ __init() DataBase.__LoadDataBase() EventManager.loadScripts() EventManager.castStart() EventManager.updateDictionary() glutMainLoop()
def __FrameUpdate(): EventManager.castUpdate()
def __LateFrameUpdate(): EventManager.castLateUpdate()