Closed mhalber closed 7 years ago
Sorry I didn't (and don't) have access to a Mac to test/debug this code.
If you add the following line:
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
to main
just before glfwCreateWindow
, does it fix the error?
Thanks! That made it work - any clue why that was necessary? Would be very interested to learn.
Edit: From a quick read of the glfw docs (http://www.glfw.org/faq.html - section 1.5) it appears that apple only provides modern profiles that are forward-compatible. Could it be that without it an incorrect context is created?
You're welcome! Yes, unfortunately MacOS only provides forward-compatible profiles.
I would have thought that without that hint context creation would fail completely, but the segfault indicates that something else is happening.
@skaslev I suggest we add the FORWARD_COMPAT
hint to the example code, and also investigate why the segfault occurs instead of exiting with an error.
Hi there,
I've been recently testing out gl3w and I was trying to compile&run provided examples. While compiling the test.c which uses glut worked correctly, the glfw_test.c results in a segfault. I've tried to track the issue with gdb and the code seems to be failing in _parseversion function, specifically a call to glGetIntegerv, complaining about unknown type.
I was wondering if someone else has encountered such issue? I am running a mac os 10.11.6, and my compilation command is:
clang -framework Cocoa -framework IOKit -framework OpenGL src/glfw_test.c src/gl3w.c -Iinclude -lglfw3 -ldl -ggdb -o test_gl3w
Thanks!