INVALID_ENUM after glfwMakeContextCurrent

ktcopache wrote on Tuesday, August 11, 2015:

Hello.

glGetError() returns INVALID_ENUM immediately after creating a window and calling glfwMakeContextCurrent. What might cause this? I can’t reproduce it on my own computer. It’s only happening to some users of my GLFW application.

Here’s my code:

int glfwErr = glfwInit();
assert( glfwErr == GL_TRUE );

glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 );
glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 2 );
glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE );
glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE );

glfwWindowHint( GLFW_SRGB_CAPABLE, GL_FALSE );
glfwWindowHint( GLFW_RESIZABLE, GL_FALSE );

m_wnd = glfwCreateWindow( w, h, name, nullptr, nullptr );
assert( m_wnd );

glfwMakeContextCurrent( m_wnd );
GLenum err = glGetError(); // INVALID_ENUM

elmindreda wrote on Tuesday, August 11, 2015:

You’re not using GLEW, then?

ktcopache wrote on Wednesday, August 12, 2015:

I am using GLEW and initializing it after the code I posted.

elmindreda wrote on Wednesday, August 12, 2015:

What is the output of glfwinfo?

ktcopache wrote on Wednesday, August 12, 2015:

I’ll attempt to get it when I can, but at the moment I’m not in contact with the person whose computer had the error.

I do at least know that glfwCreateWindow returned null for context version 3.3 with both GLFW_OPENGL_CORE_PROFILE and GLFW_OPENGL_ANY_PROFILE.

ktcopache wrote on Wednesday, August 12, 2015:

And here it is:

GLFW header version: 3.0.3
GLFW library version: 3.0.3
GLFW library version string: "3.0.3 Win32 WGL VisualC LoadLibrary(winmm)"
OpenGL context version string: "3.2.9704 Compatibility Profile Context"
OpenGL context version parsed by GLFW: 3.2.9704
OpenGL context flags (0x00d98a35): forward-compatible robustness
OpenGL context flags parsed by GLFW:
OpenGL profile mask (0x00000002): compat
OpenGL profile mask parsed by GLFW: compat
OpenGL context renderer string: "ATI Mobility Radeon HD 4200 Series"
OpenGL context vendor string: "ATI Technologies Inc."
OpenGL context shading language version: “1.50”

ktcopache wrote on Wednesday, August 12, 2015:

Well, a driver update fixed it, but another computer-savy user with a fancy gaming PC had the same problem, and I’m less optimistic that he also has old drivers.

elmindreda wrote on Wednesday, August 12, 2015:

Aside from the spurious error, does the application run correctly on their machines?

ktcopache wrote on Wednesday, August 12, 2015:

Yes, it seems to run correctly other than this error, at least for this one person.

Here’s the other person’s glfwinfo output. His drivers appear to be up to date:

GLFW header version: 3.0.3
GLFW library version: 3.0.3
GLFW library version string: "3.0.3 Win32 WGL VisualC LoadLibrary(winmm)"
OpenGL context version string: "4.5.0 NVIDIA 353.62"
OpenGL context version parsed by GLFW: 4.5.0
OpenGL context flags (0x00000000):
OpenGL context flags parsed by GLFW: debug robustness
OpenGL profile mask (0x00000000): unknown
OpenGL profile mask parsed by GLFW: unknown
OpenGL robustness strategy (0x00008261): none
OpenGL robustness strategy parsed by GLFW: none
OpenGL context renderer string: "GeForce GTX 980 Ti/PCIe/SSE2"
OpenGL context vendor string: "NVIDIA Corporation"
OpenGL context shading language version: “4.50 NVIDIA”