# Can't Create 4.0 Context on GeForce 970GTX

**URL:** <https://discourse.glfw.org/t/cant-create-4-0-context-on-geforce-970gtx/881>\
**Category:** support\
**Created:** [March 19, 2017, 2:42pm UTC](https://discourse.glfw.org/t/cant-create-4-0-context-on-geforce-970gtx/881 "2017-03-19T14:42:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinnie](https://avatars.discourse-cdn.com/v4/letter/v/71e660/32.png) [@Vinnie](https://discourse.glfw.org/u/Vinnie)\
**Post date:** [March 19, 2017, 2:42pm UTC](https://discourse.glfw.org/t/cant-create-4-0-context-on-geforce-970gtx/881/1 "2017-03-19T14:42:47Z")

</div>

Hi Guys

I’ve copied and pasted the sample code in the “Putting it together” section from [http://www.glfw.org/docs/latest/quick.html](http://www.glfw.org/docs/latest/quick.html). The default code compiles and render the rotating colored triangle.

However when I try to change the context version from 2.0 to 3.2+, it simply stops rendering and I am left with a blank screen. No error messages are printed to the terminal either. When checking the version, it always return 3.2.1. I simply changed version hint lines from:

```
  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);

```

to:

```
  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);

```

and added the following lines directly after:

```
  glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

```

**Config:**  
GLFW 3.2.1  
Visual Studio 2015 (x64)  
nVidia GeForce 970 GTX (OpenGL 4.4)  
Windows 7, Ultimate SP1, x64

(Please note that if I specify the profile as GLFW\_OPENGL\_COMPAT\_PROFILE, it works, but it is still using a 3.2.1 context. I’m pretty sure the code in that example is compatible with OpenGL 4.0 Core profile as well. )

Am I doing something obviously wrong?

Cheers  
-Vinnie

---

<div class="post-metadata">

**Author:** ![elmindreda](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/elmindreda/32/26_2.png) [@elmindreda](https://discourse.glfw.org/u/elmindreda)\
**Post date:** [March 19, 2017, 3:04pm UTC](https://discourse.glfw.org/t/cant-create-4-0-context-on-geforce-970gtx/881/2 "2017-03-19T15:04:00Z")

</div>

The [glfwGetVersion](http://www.glfw.org/docs/latest/group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197) function returns the version of GLFW, not the version of the current context. See [glfwGetWindowAttrib](http://www.glfw.org/docs/latest/window_guide.html#window_attribs) instead.

Also, if the code uses OpenGL 2.0 then it will fail on a core profile context, among other reasons because it doesn’t set up a vertex array object.

---

<div class="post-metadata">

**Author:** ![Vinnie](https://avatars.discourse-cdn.com/v4/letter/v/71e660/32.png) [@Vinnie](https://discourse.glfw.org/u/Vinnie)\
**Post date:** [March 19, 2017, 4:08pm UTC](https://discourse.glfw.org/t/cant-create-4-0-context-on-geforce-970gtx/881/3 "2017-03-19T16:08:36Z")

</div>

Cheers, that cleared up the version issue.

I’ll try and write a bare minimum core profile test tomorrow.
