Jeroen
Jeroen

Reputation: 16815

Request a Specific OpenGL Context Version in GLFW3

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.

Upvotes: 2

Views: 1475

Answers (1)

Sergey K.
Sergey K.

Reputation: 25386

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 );

Upvotes: 3

Related Questions