# Problem setting required OpenGL version in glfwWindowHint()

**URL:** <https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181>\
**Category:** support\
**Created:** [December 2, 2015, 11:51am UTC](https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181 "2015-12-02T11:51:56Z")\
**Posts on this page:** 5\
**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:** [December 2, 2015, 11:51am UTC](https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181/1 "2015-12-02T11:51:56Z")

</div>

**[rensutheart](https://sourceforge.net/u/rensutheart/)** wrote on [Wednesday, December 02, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3872698c/#a1ce):

Hello,

I have a problem setting the required OpenGL version in my application. What is strange is that it used to work, but recently I upgraded to Windows 10 and updated all my graphics card drivers (NVIDIA GT540M) and now my my program creates NULL windows (with glfwCreateWindow()).

Using the exact code from [http://www.glfw.org/docs/3.0/quick.html](http://www.glfw.org/docs/3.0/quick.html) my programs funcions perfectly, but as soon as I call glfwWindowHint to set the OpenGL version I want to use (OpenGL 3.3) it causes the mentioned NULL windows to be created. However, if I set the version to OpenGL 2.1 or lower it works fine again.

I’m using Visual Studio Community 2013 (and 2015) and I’m quite sure I set up the libraries and includes up correctly (also included opengl32.lib).

Here is my code segment where I changed the example:

```auto
	GLFWwindow* window;
	glfwSetErrorCallback(error_callback);
	if (!glfwInit())
		exit(EXIT_FAILURE);

	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

	window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
	if (!window)
	{
		glfwTerminate();
		exit(EXIT_FAILURE);
	}
	glfwMakeContextCurrent(window);

```

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 2, 2015, 12:03pm UTC](https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181/2 "2015-12-02T12:03:57Z")

</div>

To help with diagnosis I would run the glfwinfo.c tests to check which OpenGL version is being reported. For a second check you could also try using glView [http://www.realtech-vr.com/glview/](http://www.realtech-vr.com/glview/).

This sounds like a driver issue, but if glView is reporting OGL \>= 3.3 then perhaps there is some other issue.

---

<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:** [December 2, 2015, 12:08pm UTC](https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181/3 "2015-12-02T12:08:05Z")

</div>

**[rensutheart](https://sourceforge.net/u/rensutheart/)** wrote on [Wednesday, December 02, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3872698c/#6014):

I found the solution to my problem. The problem was that my NVIDIA Control Panel was set to choose which graphics processor to use automatically, and it chose my Intel Integrated Graphics processor instead of the graphics card. So Under Mangage 3D settings, under the Global Settings tab, I just set the Preferred graphics processor to “High-performance NVIDIA processor”. That fixed it!

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 2, 2015, 12:36pm UTC](https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181/4 "2015-12-02T12:36:03Z")

</div>

Do check out the GLFW\_USE\_HYBRID\_HPG option:

[http://www.glfw.org/docs/latest/compile.html#compile\_options\_win32](http://www.glfw.org/docs/latest/compile.html#compile_options_win32)

---

<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:** [December 3, 2015, 10:28am UTC](https://discourse.glfw.org/t/problem-setting-required-opengl-version-in-glfwwindowhint/181/5 "2015-12-03T10:28:51Z")

</div>

**[rensutheart](https://sourceforge.net/u/rensutheart/)** wrote on [Thursday, December 03, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3872698c/#6014/b533/8fc8):

Thank you! Very useful!
