1

While many people come here with issues about contexts higher than 3, I want to create a context of a lower version.

My hardware supports OpenGL version 3.3. I create an OpenGL context using glfw3 and it reports that v3.3 context was created. But I want to check my code for lower versions compatibility and create a lower version context.

I tried

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

or

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR,2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,0);
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT,GL_TRUE);

but version remained 3.3.

So how do I create a lower version context with glfw? Or maybe there is any other way to limit OpenGL version? For example using driver settings or environment variables.

Sergey
  • 7,985
  • 4
  • 48
  • 80
  • 1
    FYI: OpenGL debug contexts are not supported for OpenGL-2 – datenwolf Dec 20 '14 at 19:20
  • The behavior of GLFW is fine here. Have a look at [my answer here](http://stackoverflow.com/questions/23697832/changing-opengl-version-in-lwjgl/23721984#23721984) for an explanation. – derhass Dec 20 '14 at 20:47
  • possible duplicate of [GLFW returning the wrong GL\_VERSION](http://stackoverflow.com/questions/20022237/glfw-returning-the-wrong-gl-version) – derhass Dec 20 '14 at 20:51
  • @derhass It's not a duplicate. I understand the behavior of OpenGL in that question. I tried the same code, but the result didn't satisfy me, so I asked how to change that, but not why does it show the wrong version. What about your first comment, I don't need compatibility to older versions, I need to restrict OpenGL functionality to that versions. For example, I use explicit vertex attribute layout in my shader and it shouldn't work in OGL 2.0, so I want to check that and check the code which will deal with it. – Sergey Dec 20 '14 at 20:58
  • So, as I understand, there is no way to restrict OGL functionality to lower versions. – Sergey Dec 20 '14 at 20:58

0 Answers0