@@ -270,6 +270,16 @@ static void APIENTRY glShadeModelDummy(GLenum mode __attribute__((unused))) {
270270 // Modern applications should use shaders for all rendering
271271}
272272
273+ static void APIENTRY glTexCoord2fvDummy (const GLfloat * v __attribute__((unused ))) {
274+ // Texture coordinates are deprecated in modern OpenGL - this is a no-op
275+ // Modern applications should use vertex attributes and shaders
276+ }
277+
278+ static void APIENTRY glTexEnviDummy (GLenum target __attribute__((unused )), GLenum pname __attribute__((unused )), GLint param __attribute__((unused ))) {
279+ // Texture environment is deprecated in modern OpenGL - this is a no-op
280+ // Modern applications should use shaders for all texture operations
281+ }
282+
273283static void APIENTRY glBindTextureDummy (GLenum target __attribute__((unused )), GLuint texture __attribute__((unused ))) {
274284 // This should not be called - indicates OpenGL context issues
275285 // In a proper fix, this would be replaced with static linking
@@ -661,14 +671,24 @@ static const char *R_ResolveSymbols( sym_t *syms, int count )
661671 {
662672 * syms [ i ].symbol = ri .GL_GetProcAddress ( syms [ i ].name );
663673
674+ // Force glShadeModel to use dummy implementation
675+ if (Q_stricmp (syms [i ].name , "glShadeModel" ) == 0 ) {
676+ * syms [i ].symbol = (void * )& glShadeModelDummy ;
677+ continue ;
678+ }
679+ // Force glTexCoord2fv to use dummy implementation
680+ if (Q_stricmp (syms [i ].name , "glTexCoord2fv" ) == 0 ) {
681+ * syms [i ].symbol = (void * )& glTexCoord2fvDummy ;
682+ continue ;
683+ }
684+ // Force glTexEnvi to use dummy implementation
685+ if (Q_stricmp (syms [i ].name , "glTexEnvi" ) == 0 ) {
686+ * syms [i ].symbol = (void * )& glTexEnviDummy ;
687+ continue ;
688+ }
689+
664690 if ( * syms [ i ].symbol == NULL )
665691 {
666- // Fallback for glShadeModel - use dummy since it's deprecated in modern OpenGL
667- if (Q_stricmp (syms [i ].name , "glShadeModel" ) == 0 ) {
668- ri .Printf (PRINT_WARNING , "glShadeModel not available in this OpenGL context, using compatibility fallback\n" );
669- * syms [i ].symbol = (void * )& glShadeModelDummy ;
670- continue ;
671- }
672692 // If core symbol is missing, attempt ARB fallback for glActiveTexture
673693 if (Q_stricmp (syms [i ].name , "glActiveTexture" ) == 0 ) {
674694 void * addrARB = ri .GL_GetProcAddress ("glActiveTextureARB" );
@@ -1065,12 +1085,24 @@ static const char *R_ResolveSymbols( sym_t *syms, int count )
10651085 * syms [i ].symbol = (void * )& glPolygonOffsetDummy ;
10661086 continue ;
10671087 }
1068- if (Q_stricmp (syms [i ].name , "glShadeModel " ) == 0 ) {
1069- ri .Printf (PRINT_WARNING , "glShadeModel not available in this OpenGL context, using compatibility fallback\n" );
1070- * syms [i ].symbol = (void * )& glShadeModelDummy ;
1088+ if (Q_stricmp (syms [i ].name , "glTexCoord2fv " ) == 0 ) {
1089+ ri .Printf (PRINT_WARNING , "glTexCoord2fv not available in this OpenGL context, using compatibility fallback\n" );
1090+ * syms [i ].symbol = (void * )& glTexCoord2fvDummy ;
10711091 continue ;
10721092 }
10731093 // If we can't resolve core functions, this indicates a deeper OpenGL context issue
1094+ // Special case: glTexCoord2fv is not essential in modern OpenGL (handled by shaders)
1095+ if (Q_stricmp (syms [i ].name , "glTexCoord2fv" ) == 0 ) {
1096+ ri .Printf (PRINT_WARNING , "glTexCoord2fv not available, using dummy (texture coordinates handled by shaders in modern OpenGL)\n" );
1097+ * syms [i ].symbol = (void * )& glTexCoord2fvDummy ;
1098+ continue ;
1099+ }
1100+ // Special case: glTexEnvi is used for texture environment but deprecated in modern OpenGL
1101+ if (Q_stricmp (syms [i ].name , "glTexEnvi" ) == 0 ) {
1102+ ri .Printf (PRINT_WARNING , "glTexEnvi not available, using dummy (texture environment handled by shaders in modern OpenGL)\n" );
1103+ * syms [i ].symbol = (void * )& glTexEnviDummy ;
1104+ continue ;
1105+ }
10741106 ri .Printf (PRINT_ERROR , "Failed to resolve core OpenGL function '%s' - OpenGL context may not be properly initialized\n" , syms [i ].name );
10751107 return syms [ i ].name ;
10761108 }
@@ -2134,7 +2166,7 @@ static void GL_SetDefaultState( void )
21342166 GL_TextureMode ( r_textureMode -> string );
21352167 GL_TexEnv ( GL_MODULATE );
21362168
2137- qglShadeModel ( GL_SMOOTH );
2169+ // qglShadeModel( GL_SMOOTH ); // Commented out - GL_SMOOTH is default in modern OpenGL
21382170 qglDepthFunc ( GL_LEQUAL );
21392171
21402172 // the vertex array is always enabled, but the color and texture
0 commit comments