# INVALID\_ENUM after glfwMakeContextCurrent

**URL:** <https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170>\
**Category:** support\
**Created:** [August 11, 2015, 6:09pm UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170 "2015-08-11T18:09:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 11, 2015, 6:09pm UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/1 "2015-08-11T18:09:47Z")

</div>

**[ktcopache](https://sourceforge.net/u/ktcopache/)** wrote on [Tuesday, August 11, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#5381):

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 11, 2015, 8:33pm UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/2 "2015-08-11T20:33:22Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, August 11, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#d734):

You’re not using GLEW, then?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 1:06am UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/3 "2015-08-12T01:06:34Z")

</div>

**[ktcopache](https://sourceforge.net/u/ktcopache/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#0002):

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 1:08am UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/4 "2015-08-12T01:08:35Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#6a50):

What is the output of `glfwinfo`?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 1:45am UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/5 "2015-08-12T01:45:43Z")

</div>

**[ktcopache](https://sourceforge.net/u/ktcopache/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#5622):

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 2:25am UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/6 "2015-08-12T02:25:15Z")

</div>

**[ktcopache](https://sourceforge.net/u/ktcopache/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#2af4):

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”

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 4:07am UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/7 "2015-08-12T04:07:47Z")

</div>

**[ktcopache](https://sourceforge.net/u/ktcopache/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#0909):

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 11:04am UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/8 "2015-08-12T11:04:30Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#1c69):

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 12, 2015, 2:19pm UTC](https://discourse.glfw.org/t/invalid-enum-after-glfwmakecontextcurrent/170/9 "2015-08-12T14:19:31Z")

</div>

**[ktcopache](https://sourceforge.net/u/ktcopache/)** wrote on [Wednesday, August 12, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/4a134475/#2e9b):

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”
