From: divverent Date: Tue, 31 Dec 2019 03:44:08 +0000 (+0000) Subject: Explicitly request the desired GL profile type. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7e1e118c743ea5f229f8d2206ad05861cd6afda3;p=xonotic%2Fdarkplaces.git Explicitly request the desired GL profile type. Might make GLES2 mode work on desktop Linux with GLES2 supporting drivers. Also make the debug mode work in GLES2 too (if supported, that is; if not SDL is documented to ignore it anyway). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12482 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_sdl.c b/vid_sdl.c index 248baac7..36ccf89f 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1508,15 +1508,17 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode) } #ifdef USE_GLES2 + SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 2); SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 0); - SDL_GL_SetAttribute (SDL_GL_RETAINED_BACKING, 1); #else + SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, (gl_debug.integer > 0 ? SDL_GL_CONTEXT_DEBUG_FLAG : 0)); #endif + SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, (gl_debug.integer > 0 ? SDL_GL_CONTEXT_DEBUG_FLAG : 0)); + video_bpp = mode->bitsperpixel; window_flags = windowflags; window = SDL_CreateWindow(gamename, xPos, yPos, mode->width, mode->height, windowflags);