x11: Remove deprecated/defunct X11 hints

SDL_HINT_VIDEO_X11_FORCE_EGL was deprecated in favor of the more general SDL_HINT_VIDEO_FORCE_EGL, and Xinerama and Xvidmode support was previously removed from SDL, rendering their associated hints nonfunctional.
This commit is contained in:
Frank Praznik 2022-11-25 16:37:57 -05:00 committed by Sam Lantinga
parent 346eeba210
commit 873ec097ea
6 changed files with 13 additions and 44 deletions

View file

@ -158,3 +158,10 @@ SDL_GetRevisionNumber() has been removed from the API, it always returned 0 in S
SDL_SetWindowBrightness and SDL_SetWindowGammaRamp have been removed from the API, because they interact poorly with modern operating systems and aren't able to limit their effects to the SDL window.
Programs which have access to shaders can implement more robust versions of those functions using custom shader code rendered as a post-process effect.
## SDL_hints.h
The following hints have been removed:
* SDL_HINT_VIDEO_X11_FORCE_EGL (use SDL_HINT_VIDEO_FORCE_EGL instead)
* SDL_HINT_VIDEO_X11_XINERAMA (Xinerama no longer supported by the X11 backend)
* SDL_HINT_VIDEO_X11_XVIDMODE (Xvidmode no longer supported by the X11 backend)

View file

@ -1835,20 +1835,6 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_FORCE_EGL "SDL_VIDEO_FORCE_EGL"
/**
* \brief A variable controlling whether X11 should use GLX or EGL by default
*
* This variable can be set to the following values:
* "0" - Use GLX
* "1" - Use EGL
*
* By default SDL will use GLX when both are present.
*
* \deprecated Use the platform-agnostic SDL_HINT_VIDEO_FORCE_EGL hint instead.
*
*/
#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL"
/**
* \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
*
@ -1881,15 +1867,6 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
/**
* \brief A no-longer-used variable controlling whether the X11 Xinerama extension should be used.
*
* Before SDL 2.0.24, this would let apps and users disable Xinerama support on X11.
* Now SDL never uses Xinerama, and does not check for this hint at all.
* The preprocessor define is left here for source compatibility.
*/
#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA"
/**
* \brief A variable controlling whether the X11 XRandR extension should be used.
*
@ -1901,15 +1878,6 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
/**
* \brief A no-longer-used variable controlling whether the X11 VidMode extension should be used.
*
* Before SDL 2.0.24, this would let apps and users disable XVidMode support on X11.
* Now SDL never uses XVidMode, and does not check for this hint at all.
* The preprocessor define is left here for source compatibility.
*/
#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE"
/**
* \brief Controls how the fact chunk affects the loading of a WAVE file.
*

View file

@ -251,8 +251,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)) &&
SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE)) &&
X11_GL_UseEGL(_this) ) {
#if SDL_VIDEO_OPENGL_EGL
X11_GL_UnloadLibrary(_this);
@ -690,9 +689,7 @@ SDL_bool
X11_GL_UseEGL(_THIS)
{
SDL_assert(_this->gl_data != NULL);
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE) ||
SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE))
{
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE)) {
/* use of EGL has been requested, even for desktop GL */
return SDL_TRUE;
}

View file

@ -36,8 +36,7 @@ X11_GLES_LoadLibrary(_THIS, const char *path)
/* If the profile requested is not GL ES, switch over to X11_GL 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)) {
!SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE)) {
#if SDL_VIDEO_OPENGL_GLX
X11_GLES_UnloadLibrary(_this);
_this->GL_LoadLibrary = X11_GL_LoadLibrary;

View file

@ -287,8 +287,7 @@ X11_CreateDevice(void)
#endif
#if SDL_VIDEO_OPENGL_EGL
#if SDL_VIDEO_OPENGL_GLX
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE) ||
SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) {
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE)) {
#endif
device->GL_LoadLibrary = X11_GLES_LoadLibrary;
device->GL_GetProcAddress = X11_GLES_GetProcAddress;

View file

@ -431,8 +431,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
#if SDL_VIDEO_OPENGL_EGL
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))
SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE))
#if SDL_VIDEO_OPENGL_GLX
&& ( !_this->gl_data || X11_GL_UseEGL(_this) )
#endif
@ -654,7 +653,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_OPENGL_EGL
if ((window->flags & SDL_WINDOW_OPENGL) &&
((_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) ||
SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE))
SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE))
#if SDL_VIDEO_OPENGL_GLX
&& ( !_this->gl_data || X11_GL_UseEGL(_this) )
#endif