コード例 #1
0
ファイル: Engine.py プロジェクト: AsmaaMghodia/PyUnity-Engine
def start():
    """
        Start the engine hence the game.
    """
    __init()
    EventManager.loadScripts()
    EventManager.castStart()
    glutMainLoop()
コード例 #2
0
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)
コード例 #3
0
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()
コード例 #4
0
def start():
    """
        Start the engine hence the game.
    """
    __init()
    DataBase.__LoadDataBase()
    EventManager.loadScripts()
    EventManager.castStart()
    EventManager.updateDictionary()
    glutMainLoop()
コード例 #5
0
def __FrameUpdate():
    EventManager.castUpdate()
コード例 #6
0
def __LateFrameUpdate():
    EventManager.castLateUpdate()