From f734a2da9a5abf76edc6a6c425625f734ef13859 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 23 Oct 2021 07:31:38 -0400 Subject: [PATCH] Print full GL_EXTENSIONS list for OpenGL contexts before 3.0 Printing GL_EXTENSIONS list might be cut off for OpenGL contexts before 3.0 due to glConfig.extensions_string being a limited length. Instead get the full extensions list directly. This was already fixed for OpenGL 3.0 and later contexts. --- code/renderergl1/tr_init.c | 3 ++- code/renderergl2/tr_init.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/renderergl1/tr_init.c b/code/renderergl1/tr_init.c index 776f35df..1c502018 100644 --- a/code/renderergl1/tr_init.c +++ b/code/renderergl1/tr_init.c @@ -916,6 +916,7 @@ void GfxInfo_f( void ) ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string ); ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string ); ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " ); + // glConfig.extensions_string is a limited length so get the full list directly if ( qglGetStringi ) { GLint numExtensions; @@ -929,7 +930,7 @@ void GfxInfo_f( void ) } else { - R_PrintLongString( glConfig.extensions_string ); + R_PrintLongString( (char *) qglGetString( GL_EXTENSIONS ) ); } ri.Printf( PRINT_ALL, "\n" ); ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize ); diff --git a/code/renderergl2/tr_init.c b/code/renderergl2/tr_init.c index 945aa02c..0edfe6be 100644 --- a/code/renderergl2/tr_init.c +++ b/code/renderergl2/tr_init.c @@ -1048,6 +1048,7 @@ void GfxInfo_f( void ) ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string ); ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string ); ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " ); + // glConfig.extensions_string is a limited length so get the full list directly if ( qglGetStringi ) { GLint numExtensions; @@ -1061,7 +1062,7 @@ void GfxInfo_f( void ) } else { - R_PrintLongString( glConfig.extensions_string ); + R_PrintLongString( (char *) qglGetString( GL_EXTENSIONS ) ); } ri.Printf( PRINT_ALL, "\n" ); ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );