supertux icon indicating copy to clipboard operation
supertux copied to clipboard

Better OpenGL detection

Open mrkubax10 opened this issue 2 years ago • 4 comments

This PR makes VideoSystem use OpenGL version information reported by OS when determining which OpenGL version to use.

mrkubax10 avatar Mar 21 '22 16:03 mrkubax10

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.

lorn10 avatar Mar 24 '22 09:03 lorn10

Relevant:

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.

Semphriss avatar Mar 26 '22 01:03 Semphriss

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. ...

mrkubax10 avatar Mar 26 '22 08:03 mrkubax10

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.

lorn10 avatar Mar 27 '22 10:03 lorn10