Question

How would I detect what OpenGL versions are supported on the current system, and how to 'choose' one of them to use? On context creation I know it automatically picks one for you which is backwards-compatible, but I want to select one my own.

I'm not using GLEW or any other library like that, just plain OpenGL and GLFW3.

Était-ce utile?

La solution

Here is a sample code for GLFW3 to create an OpenGL 3.3 Core profile context:

glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 );
glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 3 );
glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE );
glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE );
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top