From 0b5ea813f9d8368f87fb2e9500f9b29ada314360 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 11 Jun 2024 08:41:30 +0200 Subject: [PATCH] sdl_glimp: update the error message when OpenGL is too old Also fixes the version printing. --- src/engine/sys/sdl_glimp.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/engine/sys/sdl_glimp.cpp b/src/engine/sys/sdl_glimp.cpp index 4080d4851e..f425dee77e 100644 --- a/src/engine/sys/sdl_glimp.cpp +++ b/src/engine/sys/sdl_glimp.cpp @@ -1753,6 +1753,10 @@ static rserr_t GLimp_StartDriverAndSetMode( int mode, bool fullscreen, bool bord 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: @@ -1768,21 +1772,13 @@ static rserr_t GLimp_StartDriverAndSetMode( int mode, bool fullscreen, bool bord 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;