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

main
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_DUMMYVIDEO TRUE)
set(HAVE_SDL_VIDEO TRUE) set(HAVE_SDL_VIDEO TRUE)
endif() 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() endif()
# Platform-specific options and settings # Platform-specific options and settings
@ -2748,6 +2741,16 @@ endif()
# Platform-independent options # Platform-independent options
CheckLibSampleRate() 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 # Dummies
# configure.ac does it differently: # configure.ac does it differently:
# if not have X # if not have X

View File

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