سؤال

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.

هل كانت مفيدة؟

المحلول

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 );
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top