From ebec01eda67a035b4898ffab0edd4db1b059fa2e Mon Sep 17 00:00:00 2001 From: LHoG <1476261+lhog@users.noreply.github.com> Date: Mon, 10 Feb 2025 00:57:28 +0100 Subject: [PATCH] Improve reporting of fatal error: "minimum required OpenGL version not supported" --- rts/Rendering/GlobalRendering.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rts/Rendering/GlobalRendering.cpp b/rts/Rendering/GlobalRendering.cpp index 8cb9d9dd15..b3a1293eb0 100644 --- a/rts/Rendering/GlobalRendering.cpp +++ b/rts/Rendering/GlobalRendering.cpp @@ -574,7 +574,15 @@ bool CGlobalRendering::CreateWindowAndContext(const char* title) GLX::Load(sdlWindow); if (!CheckGLContextVersion(minCtx)) { - handleerror(nullptr, "minimum required OpenGL version not supported, aborting", "ERROR", MBF_OK | MBF_EXCL); + int ctxProfile = 0; + SDL_GL_GetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, &ctxProfile); + + const std::string errStr = fmt::format("current OpenGL version {}.{}(core={}) is less than required {}.{}(core={}), aborting", + globalRenderingInfo.glContextVersion.x, globalRenderingInfo.glContextVersion.y, globalRenderingInfo.glContextIsCore, + minCtx.x, minCtx.y, (ctxProfile == SDL_GL_CONTEXT_PROFILE_CORE) + ); + + handleerror(nullptr, errStr.c_str(), "ERROR", MBF_OK | MBF_EXCL); return false; }