How do I go to an older version on OpenGL?

A program I got needs an older version of OpenGL, does anyone know how to get it?

You typically can’t control the version(s) of OpenGL supported by the system. OpenGL is fundamentally an interface to video hardware. The supported version depends upon the hardware and the drivers for that hardware. With the exception of OpenGL 3.1, each version is backward-compatible with all previous versions.

If some code won’t work with versions later than the one for which it was written, that’s almost always a bug in the code. And there is rarely any alternative to fixing the code. Drivers don’t provide the option to limit the supported version; it’s too much effort with not enough benefit. Most software written for OpenGL 1.1 still works fine with the latest hardware and OpenGL 4.6.

If you are using GLFW, you can specify an exact version of OpenGL using the glfwWindowHint function.
Sample code for setting OpenGL to version 4.6 would look like:
C++:

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);

Python:

glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 4)
glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 4)

You can request a specific version; that doesn’t mean that you’ll actually get it. An implementation is free to use any version which is compatible with the requested version. On Windows and Linux, drivers typically just use the highest supported version. The requested version only affects the choice of profile; if you request a version prior to 3.1, you’ll get the compatibility profile, as the core profile is incompatible with most pre-3.1 code.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.