guiscreen.cpp: Reduce minimum required OpenGL version

3.3.0 was required only because one shader, namely car.frag, was
arbitrarily requiring GLSL 3.3.0. However, it was already compatible
with GLSL 1.1.0, [1] so the minimum required OpenGL version can be
safely lowered to 2.1. [2]

[1]: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.10.pdf
[2]: https://en.wikipedia.org/wiki/OpenGL#Version_history
This commit is contained in:
Xavier Del Campo Romero 2025-01-02 00:45:10 +01:00
parent 63db0b910a
commit 37726340eb
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2
2 changed files with 3 additions and 3 deletions

View file

@ -184,7 +184,7 @@ MACRO(CHECK_LIBRARIES)
ENDIF(ENET_FOUND)
# OpenGL
Find_Package(OpenGL)
Find_Package(OpenGL 2.1.0)
IF(OPENGL_FOUND)
SET(HAVE_LIBGL 1)

View file

@ -431,8 +431,8 @@ bool GfScrInitSDL2(int nWinWidth, int nWinHeight, int nFullScreen)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
#else
// Version d'OpenGL
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
#endif