supertux
supertux copied to clipboard
Better OpenGL detection
This PR makes VideoSystem use OpenGL version information reported by OS when determining which OpenGL version to use.
I mention that here too, - this "better OpenGL fallback" really works in my case. :+1: However, this is true for the ubuntu-latest-64-gcc-Release-appimage but not the glbinding version. More information can be found at my original bug report #2173.
GLint opengl_major_version;
glGetIntegerv(GL_MAJOR_VERSION, &opengl_major_version);
if (opengl_major_version > 3) {
...
Can be more reliable than fetching a string and parsing it.
Well I wanted to use this function too but according to this website: https://www.khronos.org/opengl/wiki/OpenGL_Context
glGetIntegerv(GL_MAJOR_VERSION, *);
glGetIntegerv(GL_MINOR_VERSION, *);
These are available on OpenGL version 3.0 and above contexts. ...
Again a short side-note. Regarding the Mesa drivers on Linux this is absolutely no problem, the GL_ARB_compatibility feature is available also on older OpenGL 2.x based hardware. :+1:
However, this may be an issue for (older?) Mac OS versions prior 10.7, see OpenGL Capabilities Tables - Apple Developer.