From a9cf3357c760af84d40816a3c7549d79d5cc6874 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 4 Apr 2019 22:43:33 +0300 Subject: [PATCH] ref: move GLES driver hint to SetAttribute as we don't choose GLES renderer in compile-time anymore --- engine/common/host.c | 3 --- engine/platform/sdl/vid_sdl.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/engine/common/host.c b/engine/common/host.c index e117abb5..40f49847 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -819,9 +819,6 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha host.type = HOST_DEDICATED; } SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); -#if defined XASH_GLES && !defined __EMSCRIPTEN__ && !TARGET_OS_IOS - SDL_SetHint( SDL_HINT_OPENGL_ES_DRIVER, "1" ); -#endif SDL_StopTextInput(); #endif diff --git a/engine/platform/sdl/vid_sdl.c b/engine/platform/sdl/vid_sdl.c index a602c326..4a5d5560 100644 --- a/engine/platform/sdl/vid_sdl.c +++ b/engine/platform/sdl/vid_sdl.c @@ -501,6 +501,16 @@ void GL_SwapBuffers() int GL_SetAttribute( int attr, int val ) { + switch( attr ) + { + case REF_GL_CONTEXT_PROFILE_MASK: + if( val == REF_GL_CONTEXT_PROFILE_ES ) + SDL_SetHint( SDL_HINT_OPENGL_ES_DRIVER, "1" ); + break; + default: + break; + } + return SDL_GL_SetAttribute( (SDL_GLattr)attr, val ); }