FlorianRhiem / pyGLFW

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

Resizable and Visible hints not working? #17

Closed adamarbour closed 6 years ago

adamarbour commented 6 years ago

I can't seem to get window hints to work. The following produces a window that can be resized and is visible. Any idea on how I can get this to work? Primary goal is to get the OpenGL stuff working on the core profile but can't seem to get it to work.

Mac 10.13 High Sierra

import glfw

def main():
    if not glfw.init():
        exit()

    window = glfw.create_window(640, 480, "HELLO WORLD", None, None)
    if not window:
        glfw.terminate()
        exit()

    glfw.window_hint(glfw.RESIZABLE, False)
    glfw.window_hint(glfw.VISIBLE, False)
    #glfw.WindowHint(glfw.CONTEXT_VERSION_MAJOR, 3)
    #glfw.WindowHint(glfw.CONTEXT_VERSION_MINOR, 3)
    #glfw.WindowHint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
    #glfw.WindowHint(glfw.OPENGL_FORWARD_COMPAT, True)

    glfw.make_context_current(window)

    while not glfw.window_should_close(window):

        glfw.swap_interval(1)
        glfw.swap_buffers(window)
        glfw.poll_events()

    glfw.terminate()

main()
adamarbour commented 6 years ago

Promise this is the last thing :)

FlorianRhiem commented 6 years ago

Try setting the window hints before creating the window. ;)

FlorianRhiem commented 6 years ago

And yeah, the commented out window hints should give you a core context on macOS.

adamarbour commented 6 years ago

F*#k - feel like an idiot... put them in the wrong place screwing with multiple packages.

FlorianRhiem commented 6 years ago

It's all good, I'm glad to help :)