hints: replace SDL_HINT_VIDEO_X11_FORCE_EGL with platform-agnostic SDL_HINT_VIDEO_FORCE_EGL

This adds support for forcing the use of EGL on Windows and MacOS. The
SDL_HINT_VIDEO_X11_FORCE_EGL hint is retained for backwards
compatibility but is now deprecated.
This commit is contained in:
Steven Noonan
2022-08-25 19:35:41 -07:00
parent f430ef5ddc
commit 5a7c20b945
8 changed files with 58 additions and 24 deletions

View File

@@ -253,6 +253,7 @@ X11_GL_LoadLibrary(_THIS, const char *path)
* GLX_EXT_create_context_es2_profile extension, switch over to X11_GLES functions
*/
if (((_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) ||
SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE) ||
SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) &&
X11_GL_UseEGL(_this) ) {
#if SDL_VIDEO_OPENGL_EGL
@@ -691,7 +692,8 @@ SDL_bool
X11_GL_UseEGL(_THIS)
{
SDL_assert(_this->gl_data != NULL);
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE))
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE) ||
SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE))
{
/* use of EGL has been requested, even for desktop GL */
return SDL_TRUE;