Skip to content

Commit

Permalink
Improve reporting of fatal error: "minimum required OpenGL version no…
Browse files Browse the repository at this point in the history
…t supported"
  • Loading branch information
lhog committed Feb 10, 2025
1 parent 2791a36 commit ebec01e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rts/Rendering/GlobalRendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ebec01e

Please sign in to comment.