From f36156614ecb7236f8b31b9432e486e4ac64d0ce Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 2 Jan 2025 00:45:10 +0100 Subject: [PATCH] guiscreen.cpp: Reduce minimum required OpenGL version 3.3.0 was required only because two shaders, namely car.frag and water.frag, were arbitrarily requiring GLSL 3.3.0. However, those were 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 --- cmake/checks.cmake | 2 +- src/libs/tgfclient/guiscreen.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/checks.cmake b/cmake/checks.cmake index d00d760a3..f5cabaa82 100644 --- a/cmake/checks.cmake +++ b/cmake/checks.cmake @@ -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) diff --git a/src/libs/tgfclient/guiscreen.cpp b/src/libs/tgfclient/guiscreen.cpp index 09febfc99..67566d079 100644 --- a/src/libs/tgfclient/guiscreen.cpp +++ b/src/libs/tgfclient/guiscreen.cpp @@ -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