From 0914aa550be6440554ab02e5bd1c9408976644a9 Mon Sep 17 00:00:00 2001 From: uis Date: Sat, 25 Nov 2023 01:13:44 +0300 Subject: [PATCH] Move SDL_GL_GetProcAddress after creating window SDL2 documentation says so. In reality it fixes error for kmsdrm driver. --- vid_sdl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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; -- 2.39.2