def main(): # Initialize the library if not glfw.init(): return glfw.set_error_callback(error_callback) # Create a windowed mode window and its OpenGL context window = glfw.create_window(640, 480, "Hello World", None, None) if not window: glfw.terminate() return # Make the window's context current glfw.make_context_current(window) program = common2d.init_shader_program() # Loop until the user closes the window while not glfw.window_should_close(window): # Render here common2d.display(program) # Swap front and back buffers glfw.swap_buffers(window) # Poll for and process events glfw.poll_events() glfw.terminate()
def displayFunc(): global _myProg common2d.display(_myProg) glut.glutSwapBuffers()
# coding=utf-8 import pyglfw.pyglfw as glfw import common2d if __name__ == '__main__': glfw.init() w = glfw.Window(640, 480, "Hello world!") w.make_current() program = common2d.init_shader_program() while not w.should_close: # Render here common2d.display(program) w.swap_buffers() glfw.poll_events() if w.keys.escape: w.should_close = True glfw.terminate()