]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Move SDL_GL_GetProcAddress after creating window uis/sdl-fix
authoruis <uis9936@gmail.com>
Fri, 24 Nov 2023 22:13:44 +0000 (01:13 +0300)
committeruis <uis9936@gmail.com>
Fri, 24 Nov 2023 22:13:44 +0000 (01:13 +0300)
SDL2 documentation says so. In reality it fixes error for kmsdrm driver.

vid_sdl.c

index bad183525e54b2491d2839e115512c58b45c35ee..27f4ce5f23a706c767d951f996682a8bf2959e34 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -2550,14 +2550,6 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        // hide the menu with SDL_WINDOW_BORDERLESS
        windowflags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS;
 #endif
-#ifndef USE_GLES2
-       if ((qglGetString = (const GLubyte* (GLAPIENTRY *)(GLenum name))GL_GetProcAddress("glGetString")) == NULL)
-       {
-               VID_Shutdown();
-               Con_Print("Required OpenGL function glGetString not found\n");
-               return false;
-       }
-#endif
 
        // Knghtbrd: should do platform-specific extension string function here
 
@@ -2676,6 +2668,15 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        }
 #endif
 
+#ifndef USE_GLES2
+       if ((qglGetString = (const GLubyte* (GLAPIENTRY *)(GLenum name))GL_GetProcAddress("glGetString")) == NULL)
+       {
+               VID_Shutdown();
+               Con_Print("Required OpenGL function glGetString not found\n");
+               return false;
+       }
+#endif
+
        vid_softsurface = NULL;
        vid.softpixels = NULL;