From: uis Date: Fri, 24 Nov 2023 22:13:44 +0000 (+0300) Subject: Move SDL_GL_GetProcAddress after creating window X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0914aa550be6440554ab02e5bd1c9408976644a9;p=xonotic%2Fdarkplaces.git Move SDL_GL_GetProcAddress after creating window SDL2 documentation says so. In reality it fixes error for kmsdrm driver. --- diff --git a/vid_sdl.c b/vid_sdl.c index bad18352..27f4ce5f 100644 --- 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;