Disable the offscreen video driver if EGL is unavailable (#6234)

This commit is contained in:
Cameron Cawley 2022-11-23 18:55:34 +00:00 committed by GitHub
parent a94d2e929d
commit 84781a7b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 16 deletions

View File

@ -1177,13 +1177,6 @@ if(SDL_VIDEO)
set(HAVE_DUMMYVIDEO TRUE)
set(HAVE_SDL_VIDEO TRUE)
endif()
if(SDL_OFFSCREEN)
set(SDL_VIDEO_DRIVER_OFFSCREEN 1)
file(GLOB VIDEO_OFFSCREEN_SOURCES ${SDL3_SOURCE_DIR}/src/video/offscreen/*.c)
list(APPEND SOURCE_FILES ${VIDEO_OFFSCREEN_SOURCES})
set(HAVE_OFFSCREEN TRUE)
set(HAVE_SDL_VIDEO TRUE)
endif()
endif()
# Platform-specific options and settings
@ -2748,6 +2741,16 @@ endif()
# Platform-independent options
CheckLibSampleRate()
if(SDL_VIDEO)
if(SDL_OFFSCREEN AND SDL_VIDEO_OPENGL_EGL)
set(SDL_VIDEO_DRIVER_OFFSCREEN 1)
file(GLOB VIDEO_OFFSCREEN_SOURCES ${SDL3_SOURCE_DIR}/src/video/offscreen/*.c)
list(APPEND SOURCE_FILES ${VIDEO_OFFSCREEN_SOURCES})
set(HAVE_OFFSCREEN TRUE)
set(HAVE_SDL_VIDEO TRUE)
endif()
endif()
# Dummies
# configure.ac does it differently:
# if not have X

View File

@ -2177,7 +2177,11 @@ CheckOffscreenVideo()
AC_ARG_ENABLE(video-offscreen,
[AS_HELP_STRING([--enable-video-offscreen], [use offscreen video driver [default=yes]])],
, enable_video_offscreen=yes)
if test x$enable_video_offscreen = xyes; then
if test x$enable_video = xyes && \
test x$enable_video_offscreen = xyes && \
test x$video_opengl_egl = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_OFFSCREEN, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/offscreen/*.c"
have_video=yes
@ -3470,7 +3474,6 @@ case "$host" in
CheckWerror
CheckDeclarationAfterStatement
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
@ -3487,8 +3490,9 @@ case "$host" in
# Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
CheckRPI
CheckX11
# Need to check for EGL first because KMSDRM and Wayland depends on it.
# Need to check for EGL first because Offscreen, KMSDRM and Wayland depend on it.
CheckEGL
CheckOffscreenVideo
CheckKMSDRM
CheckGLX
CheckOpenGL
@ -3686,12 +3690,12 @@ case "$host" in
CheckWerror
CheckDeclarationAfterStatement
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckWINDOWS
CheckWINDOWSGL
CheckWINDOWSGLES
CheckOffscreenVideo
CheckVulkan
CheckDIRECTX
CheckHIDAPI
@ -3847,7 +3851,6 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
ARCH=haiku
ac_default_prefix=/boot/system
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
@ -3909,7 +3912,6 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
CheckNoErrorDeprecatedDeclarationsWerror
CheckDeclarationAfterStatement
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
@ -4026,7 +4028,6 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
CheckNoErrorDeprecatedDeclarationsWerror
CheckDeclarationAfterStatement
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
@ -4038,6 +4039,7 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
CheckMacGLES
CheckGLX
CheckOpenGL
CheckOffscreenVideo
CheckVulkan
CheckPTHREAD
CheckHIDAPI
@ -4129,13 +4131,13 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
CheckWerror
CheckDeclarationAfterStatement
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckPTHREAD
CheckDLOPEN
CheckClockGettime
CheckEmscriptenGLES
CheckOffscreenVideo
# Set up files for the misc library
if test x$enable_misc = xyes; then
@ -4181,7 +4183,6 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
CheckWerror
CheckDeclarationAfterStatement
CheckDummyVideo
CheckOffscreenVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN