]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Explicitly request the desired GL profile type.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 31 Dec 2019 03:44:08 +0000 (03:44 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 31 Dec 2019 03:44:08 +0000 (03:44 +0000)
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

vid_sdl.c

index 248baac760cecccfade6af4180ae8ff37fb0de3a..36ccf89f42360b184b99fb6a7618dd1426f573c7 100644 (file)
--- 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);