Esempio n. 1
0
File: main.py Progetto: Tofs/Pygel
def main():
    global window
    initLogger()
    Utils.init()

    # Create a windowed mode window and its OpenGL context
    window = glfw.create_window(640, 480, "Hello World", None, None)
    if not window:
        glfw.terminate()
        print("fail Window")
        return
    # Make the window's context current
    glfw.make_context_current(window)

    vertexPos, vertexColor, triangle = tmf.load("testData.tmf")

    #define input
    inputHandler.addEvent(KillProgram, "Esc")
    inputHandler.addEvent(Culling, "c")

    print vertexPos
    VAO, VertexSize, indexs = Utils.createVAO(vertexPos, vertexColor, triangle, 4)
    shaderProgram = ShaderM.compileShaderFromFile("shaders/basic.vert", "shaders/basic.frag")

    objectToRender = { "Indexs" : indexs, "VAO" : VAO, "VertexCount" : VertexSize, "ShaderProgram" : shaderProgram}

    mainLoop(objectToRender,window)
    glfw.terminate()
Esempio n. 2
0
File: main.py Progetto: Tofs/Pygel
def main():
    global window
    initLogger()
    Utils.init()
    window = Utils.createWindow(inputHandler.keyboardListner)
    # triangle position and color

    Utils.ToggleCulling(True)
    vertexPos, vertexColor, triangle = tmf.load("testData.tmf")
    glEnable(GL_DEPTH_TEST)
    #define input
    inputHandler.addEvent(KillProgram, "Esc")
    inputHandler.addEvent(Utils.ToggleCulling, "c")

    print vertexPos
    VAO,pos, VertexSize, indexs = Utils.createVAO(vertexPos, vertexColor, triangle, 4)
    shaderProgram = ShaderM.compileShaderFromFile("shaders/basic.vert", "shaders/basic.frag")

    objectToRender = { "Indexs" : indexs,"VertexBuffer" : pos, "VAO" :  VAO, "VertexCount" : VertexSize, "ShaderProgram" : shaderProgram}

    mainLoop(objectToRender,window)
    glfw.terminate()