From 4e9a2dace0725b1b0f0f79abb4ff189581c15d2e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 11 Mar 2026 08:39:58 +0500 Subject: [PATCH] ref: gl: only check for GL errors if both gl_check_errors and developer mode are enabled --- ref/gl/gl_opengl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 8ebace5c..458ac74d 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -1351,12 +1351,12 @@ obsolete */ void GL_CheckForErrors_( const char *filename, const int fileline ) { - int err; - - if( !gl_check_errors.value ) + if( !gl_check_errors.value || !gpGlobals->developer ) return; - if(( err = pglGetError( )) == GL_NO_ERROR ) + int err = pglGetError( ); + + if( err == GL_NO_ERROR ) return; gEngfuncs.Con_Printf( S_OPENGL_ERROR "%s (at %s:%i)\n", GL_ErrorString( err ), filename, fileline );