JuliaGL / GLFW.jl

Julia interface to GLFW, a multi-platform library for creating windows with OpenGL contexts and managing input and events.
http://www.glfw.org/
MIT License
138 stars 32 forks source link

Version Mismatch #176

Closed wsrinin closed 5 years ago

wsrinin commented 5 years ago

Hi,

It am not sure whether the following snippet give me the correct version of my openGL

`window = GLFW.CreateWindow(10, 10, "OpenGL Example")

Make the window's context current

GLFW.HideWindow(window)
GLFW.MakeContextCurrent(window)
glversion = unsafe_string(glGetString(GL_VERSION))`

I am pretty confident that the version of the openGL on my mac book is 4.1 but somehow the above snippet give me 2.4. What could be the possible source of this disagreement?

Best,

jayschwa commented 5 years ago

You probably need to pass context hints before creating the window. Some platforms return older versions of OpenGL to remain backwards compatible with older applications.

https://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx

wsrinin commented 5 years ago

Thank you for the clarification. Indeed, that is precisely what I need to do.