This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved simultaneous support for OpenGL and OpenGL ES
From Scott Percival Okay, I think I have something for this. Tested it on GL and GLES machines, it seems to work okay. - Add a new SDL GL attribute SDL_GL_CONTEXT_EGL: - Only useful for the X11 video driver at the moment - Set to 1 for an EGL context, 0 to use the default for the video driver - Default is 0, unless library is built for EGL only - Should be set after SDL init, but before window/context creation (i.e. same place you'd specify attributes for major/minor GL version) - After a lot of agony pondering the least-terrible way to go about it, made it so that X11_GL_LoadLibrary and X11_GLES_LoadLibrary check SDL_GL_CONTEXT_EGL. If no GL context exists yet, and the attribute choice doesn't match with the checking function, then it changes all the function pointers in the video driver and passes control on to the new LoadLibrary method. - Likewise, make X11_CreateWindow check this attribute before firing off a call to X11_GL_GetVisual/X11_GLES_GetVisual - Added a sanity check to the start of X11_GL_LoadLibrary - Tidied up SDL_x11opengles.h - Moved ownership of the gles_data structure over to X11_GLES_LoadLibrary/UnloadLibrary - Should incorporate the 3 fixes posted by Andre Heider This is obviously quite a bit to take in, but is (at least) a proof of concept for the approach I think EGL/GLX mingling should take. Any comments/criticism is much appreciated.
- Loading branch information
Showing
9 changed files
with
128 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.