Skip to content

Commit

Permalink
sdl_glimp: update the error message when OpenGL is too old.
Browse files Browse the repository at this point in the history
Also fixes the version printing.
  • Loading branch information
illwieckz committed Jun 11, 2024
1 parent b1ec808 commit 1b58b39
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/engine/sys/sdl_glimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,10 @@ static bool GLimp_StartDriverAndSetMode( int mode, bool fullscreen, bool bordere

rserr_t err = GLimp_SetMode(mode, fullscreen, bordered);

const char* glRequirements =
"You need a graphics card with drivers supporting at least\n"
"OpenGL 3.2 or OpenGL 2.1 with EXT_framebuffer_object.";

switch ( err )
{
case rserr_t::RSERR_OK:
Expand All @@ -1564,21 +1568,13 @@ static bool GLimp_StartDriverAndSetMode( int mode, bool fullscreen, bool bordere
break;

case rserr_t::RSERR_MISSING_GL:
Sys::Error(
"OpenGL is not available.\n\n"
"You need a graphic card with drivers supporting\n"
"at least OpenGL 3.2 or OpenGL 2.1 with\n"
"ARB_half_float_vertex and EXT_framebuffer_object." );
Sys::Error( "OpenGL is not available.\n\n%s", glRequirements );

// Sys:Error calls OSExit() so the break and the return is unreachable.
break;

case rserr_t::RSERR_OLD_GL:
Sys::Error(
"OpenGL %d.%d is too old.\n\n"
"You need a graphic card with drivers supporting\n"
"at least OpenGL 3.2 or OpenGL 2.1 with\n"
"ARB_half_float_vertex and EXT_framebuffer_object." );
Sys::Error( "OpenGL %d.%d is too old.\n\n%s", glConfig2.glMajor, glConfig2.glMinor, glRequirements );

// Sys:Error calls OSExit() so the break and the return is unreachable.
break;
Expand Down

0 comments on commit 1b58b39

Please sign in to comment.