FlorianRhiem / pyGLFW

Python bindings for GLFW
MIT License
232 stars 36 forks source link

'VideoMode' object is not iterable #7

Closed Tcll closed 9 years ago

Tcll commented 9 years ago

I'm trying to set my main loop rate to my monitor refresh rate for more control:

...

mon = GLFW.get_primary_monitor()
mode = mon.video_mode

size, bits, refresh_rate = mode

...

while not win.should_close:
    GLFW.poll_events()

    _display(W,H)

    win.swap_buffers()
    time.sleep(1./refresh_rate)

swap interval is not guaranteed at 75Hz

Tcll commented 9 years ago

looked into an example here and found the refresh_rate attribute (finally found something useful after scouring google for 3h)

so just mode.refresh_rate solves it