Compare commits
214 commits
Author | SHA1 | Date | |
---|---|---|---|
634705851d | |||
1194f52a5c | |||
45e5f0f10b | |||
a23d1af0ac | |||
2b66ef0df4 | |||
7285f0d441 | |||
ca3468cb55 | |||
7d2012af87 | |||
17515f4aef | |||
f71178a16f | |||
d77eb8a8d5 | |||
3fb9118cb6 | |||
71fb4e3d76 | |||
2518e32de8 | |||
e8938fc66a | |||
fde6323662 | |||
7154605982 | |||
c68cfcdb2d | |||
7bf3e28dc6 | |||
3fa5a2f794 | |||
af5efadd9f | |||
5b5a72e33c | |||
58fa43e7c3 | |||
4266cf8504 | |||
4f7f72c257 | |||
c5035d8ffd | |||
92779a5bd8 | |||
0dc4373aad | |||
06b305d232 | |||
c4a493de97 | |||
4a87abc966 | |||
2290d71338 | |||
17ecb11ed6 | |||
8800d40442 | |||
7ac43cfb6b | |||
dfc56cfc0e | |||
c83428475d | |||
d5680c5d20 | |||
1069c8931d | |||
507fc462db | |||
d9d84c8d73 | |||
e927e5d440 | |||
33ec2a5e94 | |||
a8a5bd3d6b | |||
038ccd764a | |||
c0445c23bf | |||
9670f233cc | |||
ea179abdb7 | |||
eabd88ed28 | |||
a44b646105 | |||
880ac537a5 | |||
7b8f0ba8b7 | |||
73a68c6ea5 | |||
44dc90dcc8 | |||
8efa1f8fc6 | |||
5d1e6b28d9 | |||
c638b4a682 | |||
01a4cf8a10 | |||
f51f7fbb94 | |||
b47b6e02fd | |||
381312a02a | |||
f836b465aa | |||
a47a045128 | |||
e8ae155585 | |||
2cb422360c | |||
fa934dd4df | |||
6a52017724 | |||
32fd45cf48 | |||
c5a09ca7a9 | |||
b425036808 | |||
0479df53ca | |||
0b0d256a69 | |||
d09d0aaab6 | |||
460b7b247f | |||
ebc2fb411f | |||
0d5467a6e9 | |||
305e7b55bd | |||
ad0d1e2ad5 | |||
7bf4319eb2 | |||
0ebda87425 | |||
a099172754 | |||
988866ca4a | |||
2cb7a0a0bb | |||
b8d5fa4aef | |||
0a9f61fbf1 | |||
c7f22f0324 | |||
d234f7a498 | |||
2fd9e63f1a | |||
874ebed14d | |||
5b904a103a | |||
0a8f9777a7 | |||
78d3a713de | |||
74229d4a41 | |||
29a4c5ebc2 | |||
903df79b2d | |||
d47ff8ae73 | |||
738442b82a | |||
68073c6276 | |||
920acb75c3 | |||
3dbc6a40ae | |||
af54c82138 | |||
232ed540db | |||
c542aef600 | |||
abffa1194a | |||
3b3c141ff9 | |||
6969b3be3b | |||
311b02f0b5 | |||
36c87d9f27 | |||
4e3fc0c1dc | |||
187708e542 | |||
3b0cd44158 | |||
741499dea7 | |||
a53382e460 | |||
e99b9ca9c0 | |||
8e72be3117 | |||
7a9966af9d | |||
d59caffe2c | |||
582fb3901a | |||
c709741871 | |||
817454cfe6 | |||
e986c7984b | |||
dfd7efaf13 | |||
802b5ef7dc | |||
e580e087ff | |||
b79732b967 | |||
faa7e3cc2e | |||
5efc9bd194 | |||
4bae75387a | |||
f57776836f | |||
569fa3f57f | |||
be3b1cff0b | |||
ab479b4961 | |||
264da8c127 | |||
cfc7cac3c9 | |||
8b74be464f | |||
fc689a6cb3 | |||
b4d547905d | |||
4ee36a9474 | |||
c2b2f2a71e | |||
d1b4810542 | |||
bcccbbd894 | |||
4e465f25d0 | |||
7ac66972b7 | |||
3e9ae3ea64 | |||
0a91a793cf | |||
07d6d116ed | |||
b5483f2c68 | |||
b990e9145b | |||
3bdc62215e | |||
423c558e44 | |||
42238f88ea | |||
d0bbfdbfb8 | |||
e29c0661cc | |||
e57554ea65 | |||
09ee811f4b | |||
b067ab9202 | |||
6e40c7a9b8 | |||
01541bc350 | |||
4504c10f3b | |||
7b1000013e | |||
9e997cc787 | |||
d87048fd5a | |||
6926d046c0 | |||
b8d85c6939 | |||
5c4bc807f7 | |||
8eeca8c7db | |||
d7664a6ef1 | |||
5df106603d | |||
69f0223474 | |||
724845110c | |||
84039e2514 | |||
2d24baaad4 | |||
b7cc4dce70 | |||
0b7a9a8e9f | |||
8cda5102fc | |||
ee13e8c76b | |||
fcd7d658dc | |||
89e9f7b42b | |||
b6c875a923 | |||
a65d1bfb14 | |||
37d244ea81 | |||
a937b5c4ad | |||
fb0ce375f0 | |||
0739d237ad | |||
8145212103 | |||
2df39e64ab | |||
8fddf146bf | |||
3f5593d613 | |||
dcd1252368 | |||
edb75bc29e | |||
660cec69b1 | |||
a2611edcf3 | |||
e19c532ebf | |||
e426617c9c | |||
192cdf3d04 | |||
64a5e7be98 | |||
66bd15555c | |||
4c7156c1e6 | |||
33e5de31d8 | |||
3eaf56894e | |||
242ce20cbf | |||
f52e7199df | |||
e12c831b15 | |||
cd399caf6f | |||
f6144dfe03 | |||
ac2fcfcb62 | |||
4ac2d45a06 | |||
dce6ed56d7 | |||
e3d430b83e | |||
511bab5bbf | |||
156bf7e6aa | |||
938b720a9e | |||
44975d40ef | |||
ea8f8b6dc3 |
|
@ -16,8 +16,8 @@ AllowShortFunctionsOnASingleLine: All
|
|||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
|
||||
AlwaysBreakAfterDefinitionReturnType: All
|
||||
AlwaysBreakAfterReturnType: AllDefinitions
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
|
||||
|
@ -35,7 +35,7 @@ BraceWrapping:
|
|||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeElse: false
|
||||
BeforeWhile: true
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
|
@ -62,7 +62,8 @@ IndentGotoLabels: true
|
|||
IndentPPDirectives: None
|
||||
IndentExternBlock: NoIndent
|
||||
|
||||
SpaceAfterCStyleCast: true
|
||||
PointerAlignment: Right
|
||||
SpaceAfterCStyleCast: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
|
|
|
@ -7,6 +7,8 @@ root = true
|
|||
[*.{c,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
|
||||
indent_size = 2
|
||||
|
|
16
.github/cmake/CMakeLists.txt
vendored
Normal file
16
.github/cmake/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(ci_utils C CXX)
|
||||
|
||||
set(txt "CC=${CMAKE_C_COMPILER}
|
||||
CXX=${CMAKE_CXX_COMPILER}
|
||||
CFLAGS=${CMAKE_C_FLAGS}
|
||||
CXXFLAGS=${CMAKE_CXX_FLAGS}
|
||||
LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_C_STANDARD_LIBRARIES}
|
||||
")
|
||||
|
||||
message("${txt}")
|
||||
|
||||
set(VAR_PATH "/tmp/env.txt" CACHE PATH "Where to write environment file")
|
||||
message(STATUS "Writing CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS environment to ${VAR_PATH}")
|
||||
|
||||
file(WRITE "${VAR_PATH}" "${txt}")
|
17
.github/workflows/n3ds.yml
vendored
17
.github/workflows/n3ds.yml
vendored
|
@ -38,5 +38,18 @@ jobs:
|
|||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build cmake_config_build --verbose
|
||||
# Not running test_pkgconfig.sh and test_sdlconfig.sh
|
||||
# as invoking the compiler manually is not supported
|
||||
- name: Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain
|
||||
run: |
|
||||
cmake -S .github/cmake -B /tmp/cmake_extract \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DVAR_PATH=/tmp/n3ds_env.txt
|
||||
cat /tmp/n3ds_env.txt >> $GITHUB_ENV
|
||||
- name: Verify sdl2-config
|
||||
run: |
|
||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
run: |
|
||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||
cmake/test/test_pkgconfig.sh
|
||||
|
|
4
.github/workflows/ps2.yaml
vendored
4
.github/workflows/ps2.yaml
vendored
|
@ -50,13 +50,13 @@ jobs:
|
|||
- name: Verify sdl2-config
|
||||
run: |
|
||||
export CC=mips64r5900el-ps2-elf-gcc
|
||||
export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
run: |
|
||||
export CC=mips64r5900el-ps2-elf-gcc
|
||||
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
||||
export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||
cmake/test/test_pkgconfig.sh
|
||||
|
||||
|
|
4
.github/workflows/psp.yaml
vendored
4
.github/workflows/psp.yaml
vendored
|
@ -39,12 +39,12 @@ jobs:
|
|||
- name: Verify sdl2-config
|
||||
run: |
|
||||
export CC=psp-gcc
|
||||
export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
run: |
|
||||
export CC=psp-gcc
|
||||
export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
||||
cmake/test/test_pkgconfig.sh
|
||||
|
|
42
.github/workflows/vita.yaml
vendored
42
.github/workflows/vita.yaml
vendored
|
@ -8,19 +8,61 @@ defaults:
|
|||
|
||||
jobs:
|
||||
vita:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: vitasdk/vitasdk:latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: GLES (pib), os: windows-latest, pib: true }
|
||||
- { name: GLES (PVR_PSP2 + gl4es4vita), os: windows-latest, pvr: true }
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install build requirements
|
||||
run: |
|
||||
apk update
|
||||
apk add cmake ninja pkgconf bash
|
||||
|
||||
- name: Configure PVR_PSP2 (GLES)
|
||||
if: ${{ !!matrix.platform.pvr }}
|
||||
run: |
|
||||
pvr_psp2_version=3.9
|
||||
|
||||
# Configure PVR_PSP2 headers
|
||||
wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
|
||||
unzip /tmp/v$pvr_psp2_version.zip -d/tmp
|
||||
cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* ${VITASDK}/arm-vita-eabi/include
|
||||
rm /tmp/v$pvr_psp2_version.zip
|
||||
|
||||
# Configure PVR_PSP2 stub libraries
|
||||
wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
|
||||
unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
|
||||
find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} ${VITASDK}/arm-vita-eabi/lib \;
|
||||
rm /tmp/vitasdk_stubs.zip
|
||||
rm -rf /tmp/pvr_psp2_stubs
|
||||
|
||||
- name: Configure gl4es4vita (OpenGL)
|
||||
if: ${{ !!matrix.platform.pvr }}
|
||||
run: |
|
||||
gl4es4vita_version=1.1.4
|
||||
|
||||
# Configure gl4es4vita headers
|
||||
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
|
||||
unzip -o /tmp/include.zip -d${VITASDK}/arm-vita-eabi/include
|
||||
rm /tmp/include.zip
|
||||
|
||||
# Configure gl4es4vita stub libraries
|
||||
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
|
||||
unzip /tmp/vitasdk_stubs.zip -d${VITASDK}/arm-vita-eabi/lib
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
|
||||
-DVIDEO_VITA_PIB=${{ !!matrix.platform.pib }} \
|
||||
-DVIDEO_VITA_PVR=${{ !!matrix.platform.pvr }} \
|
||||
-DSDL_WERROR=ON \
|
||||
-DSDL_TESTS=ON \
|
||||
-DSDL_INSTALL_TESTS=ON \
|
||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -62,6 +62,11 @@ cmake-build-*
|
|||
xcuserdata
|
||||
*.xcworkspace
|
||||
|
||||
# for QtCreator
|
||||
CMakeLists.txt.user
|
||||
build*/
|
||||
*.pro.user*
|
||||
|
||||
# for Visual C++
|
||||
.vs
|
||||
Debug
|
||||
|
@ -173,6 +178,7 @@ test/testyuv
|
|||
test/torturethread
|
||||
|
||||
builddir/
|
||||
!build-scripts/
|
||||
debian/*.debhelper.log
|
||||
debian/*.substvars
|
||||
debian/*.tar.gz
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
projectfullname = SDL_mixer
|
||||
projectshortname = SDL_mixer
|
||||
projectfullname = SDL2
|
||||
projectshortname = SDL2
|
||||
incsubdir = include
|
||||
wikisubdir =
|
||||
wikisubdir = SDL2
|
||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
||||
mainincludefname = SDL.h
|
||||
versionfname = include/SDL_version.h
|
||||
|
@ -10,6 +10,7 @@ versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
|
|||
versionpatchregex = \A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z
|
||||
selectheaderregex = \ASDL.*?\.h\Z
|
||||
projecturl = https://libsdl.org/
|
||||
wikiurl = https://wiki.libsdl.org
|
||||
wikiurl = https://wiki.libsdl.org/SDL2
|
||||
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
||||
warn_about_missing = 0
|
||||
wikipreamble = (This is the legacy documentation for stable SDL2, the current stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current development version.)
|
||||
|
|
|
@ -12,7 +12,7 @@ LOCAL_MODULE := SDL2
|
|||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)/include
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(subst $(LOCAL_PATH)/,, \
|
||||
|
|
273
CMakeLists.txt
273
CMakeLists.txt
|
@ -18,6 +18,9 @@ endif()
|
|||
set(EXTRA_LIBS)
|
||||
set(EXTRA_LDFLAGS)
|
||||
|
||||
set(CMAKE_DEPENDS)
|
||||
set(PKGCONFIG_DEPENDS)
|
||||
|
||||
# This is a virtual "library" that just exists to collect up compiler and
|
||||
# linker options that used to be global to this CMake project. When you
|
||||
# specify it as part of a real library's target_link_libraries(), that
|
||||
|
@ -27,7 +30,6 @@ set(EXTRA_LDFLAGS)
|
|||
add_library(sdl-build-options INTERFACE)
|
||||
|
||||
if(WINDOWS_STORE)
|
||||
cmake_minimum_required(VERSION 3.11.0)
|
||||
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
|
||||
target_compile_options(sdl-build-options INTERFACE "-ZW")
|
||||
endif()
|
||||
|
@ -74,6 +76,7 @@ find_package(PkgConfig)
|
|||
list(APPEND CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake")
|
||||
include(${SDL2_SOURCE_DIR}/cmake/macros.cmake)
|
||||
include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
|
||||
include(${SDL2_SOURCE_DIR}/cmake/sdlplatform.cmake)
|
||||
include(${SDL2_SOURCE_DIR}/cmake/CheckCPUArchitecture.cmake)
|
||||
|
||||
# Enable large file support on 32-bit glibc, so that we can access files
|
||||
|
@ -85,7 +88,7 @@ endif()
|
|||
|
||||
# See docs/release_checklist.md
|
||||
set(SDL_MAJOR_VERSION 2)
|
||||
set(SDL_MINOR_VERSION 26)
|
||||
set(SDL_MINOR_VERSION 27)
|
||||
set(SDL_MICRO_VERSION 0)
|
||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||
|
||||
|
@ -135,8 +138,12 @@ set(SDL_GENERATED_HEADERS)
|
|||
|
||||
#message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
|
||||
|
||||
# General settings & flags
|
||||
set(LIBRARY_OUTPUT_DIRECTORY "build")
|
||||
check_cpu_architecture(x86 SDL_CPU_X86)
|
||||
check_cpu_architecture(x64 SDL_CPU_X64)
|
||||
check_cpu_architecture(arm32 SDL_CPU_ARM32)
|
||||
check_cpu_architecture(arm64 SDL_CPU_ARM64)
|
||||
check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64)
|
||||
|
||||
# Check for 64 or 32 bit
|
||||
set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P})
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
@ -152,56 +159,7 @@ if(NOT LIBTYPE)
|
|||
endif()
|
||||
|
||||
# Get the platform
|
||||
if(WIN32)
|
||||
if(NOT WINDOWS)
|
||||
set(WINDOWS TRUE)
|
||||
endif()
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
|
||||
set(LINUX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
|
||||
set(FREEBSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
|
||||
set(NETBSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
|
||||
set(OPENBSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
|
||||
set(GNU TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
|
||||
set(BSDI TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
|
||||
set(FREEBSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*")
|
||||
set(SYSV5 TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*")
|
||||
set(SOLARIS TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*")
|
||||
set(HPUX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*")
|
||||
set(AIX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
|
||||
set(MINIX TRUE)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
||||
set(DARWIN TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
|
||||
set(MACOSX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
|
||||
set(TVOS TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
|
||||
# !!! FIXME: remove the version check when we start requiring >= 3.14.0
|
||||
if(CMAKE_VERSION VERSION_LESS 3.14)
|
||||
set(IOS TRUE)
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
||||
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
|
||||
set(HAIKU TRUE)
|
||||
elseif(NINTENDO_3DS)
|
||||
set(N3DS TRUE)
|
||||
endif()
|
||||
SDL_DetectCMakePlatform()
|
||||
|
||||
# Don't mistake osx for unix
|
||||
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS)
|
||||
|
@ -277,11 +235,6 @@ if(USE_GCC OR USE_CLANG)
|
|||
endif()
|
||||
|
||||
# Default option knobs
|
||||
if(APPLE OR ARCH_64 OR MSVC_CLANG)
|
||||
if(NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm")
|
||||
set(OPT_DEF_SSEMATH ON)
|
||||
endif()
|
||||
endif()
|
||||
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS)
|
||||
set(OPT_DEF_LIBC ON)
|
||||
endif()
|
||||
|
@ -336,6 +289,8 @@ if(WINDOWS)
|
|||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1")
|
||||
|
||||
# Emscripten toolchain has a nonempty default value for this, and the checks
|
||||
# in this file need to change that, so remember the original value, and
|
||||
# restore back to that afterwards. For check_function_exists() to work in
|
||||
|
@ -369,7 +324,6 @@ endif()
|
|||
|
||||
# All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
|
||||
# you only need to have a platform override them if they are disabling.
|
||||
set(OPT_DEF_ASM TRUE)
|
||||
if(EMSCRIPTEN)
|
||||
# Set up default values for the currently supported set of subsystems:
|
||||
# Emscripten/Javascript does not have assembly support, a dynamic library
|
||||
|
@ -433,18 +387,21 @@ set_option(SDL2_DISABLE_UNINSTALL "Disable uninstallation of SDL2" OFF)
|
|||
|
||||
option_string(SDL_ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto")
|
||||
#set_option(SDL_DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON)
|
||||
set_option(SDL_ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM})
|
||||
dep_option(SDL_SSEMATH "Allow GCC to use SSE floating point math" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||
dep_option(SDL_SSE "Use SSE assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||
dep_option(SDL_SSE2 "Use SSE2 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||
dep_option(SDL_SSE3 "Use SSE3 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||
dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||
dep_option(SDL_3DNOW "Use 3Dnow! MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||
dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY" OFF)
|
||||
dep_option(SDL_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
|
||||
dep_option(SDL_ARMNEON "Use NEON assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
|
||||
dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)
|
||||
dep_option(SDL_LASX "Use LASX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)
|
||||
|
||||
set_option(SDL_LIBC "Use the system C library" ${OPT_DEF_LIBC})
|
||||
set_option(SDL_GCC_ATOMICS "Use gcc builtin atomics" ${OPT_DEF_GCC_ATOMICS})
|
||||
set_option(SDL_ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM})
|
||||
set_option(SDL_SSEMATH "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
|
||||
set_option(SDL_MMX "Use MMX assembly routines" ${OPT_DEF_ASM})
|
||||
set_option(SDL_3DNOW "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM})
|
||||
set_option(SDL_SSE "Use SSE assembly routines" ${OPT_DEF_ASM})
|
||||
set_option(SDL_SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
|
||||
set_option(SDL_SSE3 "Use SSE3 assembly routines" ${OPT_DEF_SSEMATH})
|
||||
set_option(SDL_ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM})
|
||||
set_option(SDL_ARMSIMD "use SIMD assembly blitters on ARM" OFF)
|
||||
set_option(SDL_ARMNEON "use NEON assembly blitters on ARM" OFF)
|
||||
dep_option(SDL_DBUS "Enable D-Bus support" ON ${UNIX_SYS} OFF)
|
||||
set_option(SDL_DISKAUDIO "Support the disk writer audio driver" ON)
|
||||
set_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON)
|
||||
|
@ -511,6 +468,7 @@ set_option(SDL_HIDAPI "Enable the HIDAPI subsystem" ON)
|
|||
dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" OFF SDL_HIDAPI OFF)
|
||||
dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF)
|
||||
dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF)
|
||||
set_option(SDL_LIBUDEV "Enable libudev support" ON)
|
||||
set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF)
|
||||
option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "")
|
||||
set_option(SDL_CCACHE "Use Ccache to speed up build" ON)
|
||||
|
@ -527,26 +485,6 @@ set_option(SDL_INSTALL_TESTS "Install test-cases" OFF)
|
|||
|
||||
set(HAVE_STATIC_PIC "${SDL_STATIC_PIC}")
|
||||
|
||||
if(SDL_WERROR)
|
||||
if(MSVC)
|
||||
cmake_push_check_state(RESET)
|
||||
check_c_compiler_flag(/WX HAVE_WX)
|
||||
if(HAVE_WX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||
endif()
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
cmake_push_check_state(RESET)
|
||||
check_c_compiler_flag(-Werror HAVE_WERROR)
|
||||
if(HAVE_WERROR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -Werror")
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_HIDAPI)
|
||||
if(HIDAPI_ONLY_LIBUSB)
|
||||
set(SDL_HIDAPI_LIBUSB ON CACHE BOOL "" FORCE)
|
||||
|
@ -835,8 +773,9 @@ if(SDL_ASSEMBLY)
|
|||
#ifndef __SSE2__
|
||||
#error Assembler CPP flag not enabled
|
||||
#endif
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_SSE2)
|
||||
if(HAVE_SSE2)
|
||||
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_SSE2)
|
||||
if(CPU_SUPPORTS_SSE2)
|
||||
set(HAVE_SSE2 TRUE)
|
||||
list(APPEND EXTRA_CFLAGS "-msse2")
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||
|
@ -858,8 +797,9 @@ if(SDL_ASSEMBLY)
|
|||
#ifndef __SSE3__
|
||||
#error Assembler CPP flag not enabled
|
||||
#endif
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_SSE3)
|
||||
if(HAVE_SSE3)
|
||||
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_SSE3)
|
||||
if(CPU_SUPPORTS_SSE3)
|
||||
set(HAVE_SSE3 TRUE)
|
||||
list(APPEND EXTRA_CFLAGS "-msse3")
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||
|
@ -892,9 +832,9 @@ if(SDL_ASSEMBLY)
|
|||
vector unsigned int vzero() {
|
||||
return vec_splat_u32(0);
|
||||
}
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_ALTIVEC)
|
||||
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_ALTIVEC)
|
||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||
if(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
|
||||
if(CPU_SUPPORTS_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
|
||||
set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set
|
||||
list(APPEND EXTRA_CFLAGS "-maltivec")
|
||||
set(SDL_ALTIVEC_BLITTERS 1)
|
||||
|
@ -904,6 +844,39 @@ if(SDL_ASSEMBLY)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_LSX)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS "-mlsx")
|
||||
check_c_source_compiles("
|
||||
#ifndef __loongarch_sx
|
||||
#error Assembler CPP flag not enabled
|
||||
#endif
|
||||
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LSX)
|
||||
check_include_file("lsxintrin.h" HAVE_LSXINTRIN_H)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(CPU_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
|
||||
list(APPEND EXTRA_CFLAGS "-mlsx")
|
||||
set(HAVE_LSX TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_LASX)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS "-mlasx")
|
||||
check_c_source_compiles("
|
||||
#ifndef __loongarch_asx
|
||||
#error Assembler CPP flag not enabled
|
||||
#endif
|
||||
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LASX)
|
||||
check_include_file("lasxintrin.h" HAVE_LASXINTRIN_H)
|
||||
cmake_pop_check_state()
|
||||
if(CPU_SUPPORTS_LASX AND HAVE_LASXINTRIN_H)
|
||||
list(APPEND EXTRA_CFLAGS "-mlasx")
|
||||
set(HAVE_LASX TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_ARMSIMD)
|
||||
set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x assembler-with-cpp")
|
||||
|
@ -962,12 +935,22 @@ if(SDL_ASSEMBLY)
|
|||
# TODO: SDL_cpuinfo.h needs to support the user's configuration wish
|
||||
# for MSVC - right now it is always activated
|
||||
if(NOT ARCH_64)
|
||||
if(SDL_MMX)
|
||||
set(HAVE_MMX TRUE)
|
||||
endif()
|
||||
if(SDL_3DNOW)
|
||||
set(HAVE_3DNOW TRUE)
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_SSE)
|
||||
set(HAVE_SSE TRUE)
|
||||
endif()
|
||||
if(SDL_SSE2)
|
||||
set(HAVE_SSE2 TRUE)
|
||||
endif()
|
||||
if(SDL_SSE3)
|
||||
set(HAVE_SSE3 TRUE)
|
||||
endif()
|
||||
check_include_file("immintrin.h" HAVE_IMMINTRIN_H)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1067,6 +1050,7 @@ if(SDL_LIBC)
|
|||
check_library_exists(m pow "" HAVE_LIBM)
|
||||
if(HAVE_LIBM)
|
||||
set(CMAKE_REQUIRED_LIBRARIES m)
|
||||
endif()
|
||||
foreach(_FN
|
||||
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
|
||||
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
|
||||
|
@ -1076,6 +1060,7 @@ if(SDL_LIBC)
|
|||
set(_HAVEVAR "HAVE_${_UPPER}")
|
||||
check_symbol_exists("${_FN}" "math.h" ${_HAVEVAR})
|
||||
endforeach()
|
||||
if(HAVE_LIBM)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
if(NOT VITA)
|
||||
list(APPEND EXTRA_LIBS m)
|
||||
|
@ -1485,6 +1470,18 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||
ioctl(0, KDENABIO, 1);
|
||||
return 0;
|
||||
}" HAVE_INPUT_KBIO)
|
||||
elseif(OPENBSD OR NETBSD)
|
||||
check_c_source_compiles("
|
||||
#include <sys/time.h>
|
||||
#include <dev/wscons/wsconsio.h>
|
||||
#include <dev/wscons/wsksymdef.h>
|
||||
#include <dev/wscons/wsksymvar.h>
|
||||
#include <sys/ioctl.h>
|
||||
int main(int argc, char **argv) {
|
||||
struct wskbd_map_data data;
|
||||
ioctl(0, WSKBDIO_GETMAP, &data);
|
||||
return 0;
|
||||
}" HAVE_INPUT_WSCONS)
|
||||
endif()
|
||||
|
||||
if(HAVE_INPUT_EVENTS)
|
||||
|
@ -1506,7 +1503,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||
set(SDL_INPUT_FBSDKBIO 1)
|
||||
endif()
|
||||
|
||||
check_include_file("libudev.h" HAVE_LIBUDEV_H)
|
||||
if(HAVE_INPUT_WSCONS)
|
||||
set(SDL_INPUT_WSCONS 1)
|
||||
endif()
|
||||
|
||||
CheckLibUDev()
|
||||
check_include_file("sys/inotify.h" HAVE_SYS_INOTIFY_H)
|
||||
check_symbol_exists(inotify_init "sys/inotify.h" HAVE_INOTIFY_INIT)
|
||||
check_symbol_exists(inotify_init1 "sys/inotify.h" HAVE_INOTIFY_INIT1)
|
||||
|
@ -2484,6 +2485,9 @@ elseif(VITA)
|
|||
set(SDL_VIDEO_OPENGL_ES2 1)
|
||||
list(APPEND EXTRA_LIBS
|
||||
pib
|
||||
libScePiglet_stub_weak
|
||||
taihen_stub_weak
|
||||
SceShaccCg_stub_weak
|
||||
)
|
||||
set(HAVE_VIDEO_VITA_PIB ON)
|
||||
set(SDL_VIDEO_VITA_PIB 1)
|
||||
|
@ -2496,7 +2500,6 @@ elseif(VITA)
|
|||
check_include_file(gpu_es4/psp2_pvr_hint.h HAVE_PVR_H)
|
||||
if(HAVE_PVR_H)
|
||||
target_compile_definitions(sdl-build-options INTERFACE "-D__psp2__")
|
||||
check_include_file(gl4esinit.h HAVE_GL4ES_H)
|
||||
set(SDL_VIDEO_OPENGL_EGL 1)
|
||||
set(HAVE_OPENGLES TRUE)
|
||||
set(SDL_VIDEO_OPENGL_ES 1)
|
||||
|
@ -2507,11 +2510,14 @@ elseif(VITA)
|
|||
list(APPEND EXTRA_LIBS
|
||||
libgpu_es4_ext_stub_weak
|
||||
libIMGEGL_stub_weak
|
||||
SceIme_stub
|
||||
)
|
||||
|
||||
set(HAVE_VIDEO_VITA_PVR ON)
|
||||
set(SDL_VIDEO_VITA_PVR 1)
|
||||
|
||||
if(SDL_OPENGL)
|
||||
check_include_file(gl4esinit.h HAVE_GL4ES_H)
|
||||
if(HAVE_GL4ES_H)
|
||||
set(HAVE_OPENGL TRUE)
|
||||
set(SDL_VIDEO_OPENGL 1)
|
||||
|
@ -2519,6 +2525,7 @@ elseif(VITA)
|
|||
list(APPEND EXTRA_LIBS libGL_stub)
|
||||
set(SDL_VIDEO_VITA_PVR_OGL 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else()
|
||||
set(HAVE_VIDEO_VITA_PVR OFF)
|
||||
|
@ -2547,19 +2554,6 @@ elseif(VITA)
|
|||
SceProcessmgr_stub
|
||||
m
|
||||
)
|
||||
if(HAVE_VITA_PIB)
|
||||
list(PREPEND EXTRA_LIBS
|
||||
pib
|
||||
libScePiglet_stub
|
||||
SceShaccCg_stub
|
||||
taihen_stub
|
||||
)
|
||||
endif()
|
||||
if(HAVE_VITA_PVR)
|
||||
list(PREPEND EXTRA_LIBS
|
||||
SceIme_stub
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(HAVE_ARMSIMD TRUE)
|
||||
|
@ -2642,7 +2636,7 @@ elseif(PSP)
|
|||
)
|
||||
if(NOT SDL2_DISABLE_SDL2MAIN)
|
||||
list(INSERT SDL_LIBS 0 "-lSDL2main")
|
||||
endif(NOT SDL2_DISABLE_SDL2MAIN)
|
||||
endif()
|
||||
|
||||
elseif(PS2)
|
||||
list(APPEND EXTRA_CFLAGS "-DPS2" "-D__PS2__" "-I$ENV{PS2SDK}/ports/include" "-I$ENV{PS2DEV}/gsKit/include")
|
||||
|
@ -2840,6 +2834,17 @@ elseif(N3DS)
|
|||
else()
|
||||
message_error("SDL_FILE must be enabled to build on N3DS")
|
||||
endif()
|
||||
|
||||
if(NOT SDL2_DISABLE_SDL2MAIN)
|
||||
list(INSERT SDL_LIBS 0 "-lSDL2main")
|
||||
endif()
|
||||
|
||||
foreach(lib ${CMAKE_C_STANDARD_LIBRARIES})
|
||||
if(lib MATCHES "^-l")
|
||||
string(SUBSTRING "${lib}" 2 -1 lib)
|
||||
endif()
|
||||
list(APPEND EXTRA_LIBS ${lib})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(HAVE_VULKAN AND NOT SDL_LOADSO)
|
||||
|
@ -2926,6 +2931,26 @@ if(NOT SDLMAIN_SOURCES)
|
|||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c)
|
||||
endif()
|
||||
|
||||
if(SDL_WERROR)
|
||||
if(MSVC)
|
||||
cmake_push_check_state(RESET)
|
||||
check_c_compiler_flag(/WX HAVE_WX)
|
||||
if(HAVE_WX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||
endif()
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
cmake_push_check_state(RESET)
|
||||
check_c_compiler_flag(-Werror HAVE_WERROR)
|
||||
if(HAVE_WERROR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -Werror")
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Append the -MMD -MT flags
|
||||
# if(DEPENDENCY_TRACKING)
|
||||
# if(COMPILER_IS_GNUCC)
|
||||
|
@ -3059,6 +3084,7 @@ string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_STATIC_LIBS "$
|
|||
if(NOT SDL_SHARED)
|
||||
string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_LIBS "${SDL_LIBS}")
|
||||
endif()
|
||||
listtostr(PKGCONFIG_DEPENDS PKGCONFIG_DEPENDS)
|
||||
|
||||
if(SDL_STATIC AND SDL_SHARED AND NOT sdl_static_libname STREQUAL "SDL2")
|
||||
message(STATUS "\"pkg-config --static --libs sdl2\" will return invalid information")
|
||||
|
@ -3139,7 +3165,7 @@ if (SDL_ASAN)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_CCACHE)
|
||||
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
find_program(CCACHE_BINARY ccache)
|
||||
if(CCACHE_BINARY)
|
||||
|
@ -3150,6 +3176,8 @@ if(SDL_CCACHE)
|
|||
else()
|
||||
set(HAVE_CCACHE OFF)
|
||||
endif()
|
||||
else()
|
||||
set(HAVE_CCACHE OFF)
|
||||
endif()
|
||||
|
||||
if(SDL_TESTS)
|
||||
|
@ -3241,11 +3269,10 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
|
|||
target_link_libraries(SDL2main PRIVATE shell32)
|
||||
endif()
|
||||
if(MINGW OR CYGWIN)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
|
||||
target_link_libraries(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
|
||||
else()
|
||||
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
|
||||
target_link_libraries(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
|
||||
endif()
|
||||
endif()
|
||||
if (NOT ANDROID)
|
||||
|
@ -3281,8 +3308,7 @@ if(SDL_SHARED)
|
|||
add_library(SDL2::SDL2 ALIAS SDL2)
|
||||
set_target_properties(SDL2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
if(NOT SDL_LIBC)
|
||||
check_cpu_architecture(x86 HAS_X86)
|
||||
if(HAS_X86)
|
||||
if(SDL_CPU_X86)
|
||||
# FIXME: should be added for all architectures (missing symbols for ARM)
|
||||
target_link_libraries(SDL2 PRIVATE "-nodefaultlib:MSVCRT")
|
||||
endif()
|
||||
|
@ -3321,12 +3347,13 @@ if(SDL_SHARED)
|
|||
set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
|
||||
endif()
|
||||
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
|
||||
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD})
|
||||
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD} ${CMAKE_DEPENDS})
|
||||
target_include_directories(SDL2 PUBLIC
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>"
|
||||
)
|
||||
# This picks up all the compiler options and such we've accumulated up to here.
|
||||
target_link_libraries(SDL2 PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
|
||||
if(MINGW OR CYGWIN)
|
||||
|
@ -3353,12 +3380,13 @@ if(SDL_STATIC)
|
|||
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
|
||||
# TODO: Win32 platforms keep the same suffix .lib for import and static
|
||||
# libraries - do we need to consider this?
|
||||
target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
|
||||
target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_DEPENDS})
|
||||
target_include_directories(SDL2-static PUBLIC
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>"
|
||||
)
|
||||
# This picks up all the compiler options and such we've accumulated up to here.
|
||||
target_link_libraries(SDL2-static PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
|
||||
if(NOT ANDROID)
|
||||
|
@ -3492,6 +3520,7 @@ if(NOT SDL2_DISABLE_INSTALL)
|
|||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake
|
||||
${SDL2_SOURCE_DIR}/cmake/sdlfind.cmake
|
||||
DESTINATION "${SDL_INSTALL_CMAKEDIR}"
|
||||
COMPONENT Devel
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -27,6 +27,7 @@ LDFLAGS = @BUILD_LDFLAGS@
|
|||
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
INSTALL = @INSTALL@
|
||||
FGREP = @FGREP@
|
||||
AR = @AR@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
|
@ -130,7 +131,7 @@ HDRS = \
|
|||
begin_code.h \
|
||||
close_code.h
|
||||
|
||||
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
|
||||
SDLTEST_HDRS = $(shell ls $(srcdir)/include | $(FGREP) SDL_test)
|
||||
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
LIBNAME = SDL2
|
||||
MAJOR_VERSION = 2
|
||||
MINOR_VERSION = 26
|
||||
MINOR_VERSION = 27
|
||||
MICRO_VERSION = 0
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
DESCRIPTION = Simple DirectMedia Layer 2
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
LIBNAME = SDL2
|
||||
MAJOR_VERSION = 2
|
||||
MINOR_VERSION = 26
|
||||
MINOR_VERSION = 27
|
||||
MICRO_VERSION = 0
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
|
||||
|
|
|
@ -30,6 +30,18 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake")
|
|||
set(SDL2_SDL2test_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/sdlfind.cmake")
|
||||
|
||||
set(SDL_ALSA @SDL_ALSA@)
|
||||
set(SDL_ALSA_SHARED @SDL_ALSA_SHARED@)
|
||||
if(SDL_ALSA AND NOT SDL_ALSA_SHARED AND TARGET SDL2::SDL2-static)
|
||||
sdlFindALSA()
|
||||
endif()
|
||||
unset(SDL_ALSA)
|
||||
unset(SDL_ALSA_SHARED)
|
||||
|
||||
|
||||
check_required_components(SDL2)
|
||||
|
||||
# Create SDL2::SDL2 alias for static-only builds
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -239,17 +239,17 @@ LoadSprite(const char *file)
|
|||
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h);
|
||||
if (!sprites[i]) {
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
|
||||
SDL_DestroyTexture(sprites[i]);
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* We're ready to roll. :) */
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -364,8 +364,9 @@ loop()
|
|||
#endif
|
||||
}
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
if (state->windows[i] == NULL)
|
||||
if (state->windows[i] == NULL) {
|
||||
continue;
|
||||
}
|
||||
DrawSprites(state->renderers[i], sprites[i]);
|
||||
}
|
||||
}
|
||||
|
@ -382,7 +383,7 @@ main(int argc, char *argv[])
|
|||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||
if (!state) {
|
||||
if (state == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -445,7 +446,7 @@ main(int argc, char *argv[])
|
|||
/* Create the windows, initialize the renderers, and load the textures */
|
||||
sprites =
|
||||
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
|
||||
if (!sprites) {
|
||||
if (sprites == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
|
||||
quit(2);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
This is a list of major changes in SDL's version history.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.28.0:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
General:
|
||||
* Added a display event SDL_DISPLAYEVENT_MOVED which is sent when the primary monitor changes or displays change position relative to each other
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.26.0:
|
||||
---------------------------------------------------------------------------
|
||||
|
|
|
@ -127,7 +127,7 @@ initializeTextures(SDL_Renderer *renderer)
|
|||
|
||||
/* create ship texture from surface */
|
||||
ship = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
if (!ship) {
|
||||
if (ship == NULL) {
|
||||
fatalError("could not create ship texture");
|
||||
}
|
||||
SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND);
|
||||
|
@ -145,7 +145,7 @@ initializeTextures(SDL_Renderer *renderer)
|
|||
}
|
||||
/* create space texture from surface */
|
||||
space = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
if (!space) {
|
||||
if (space == NULL) {
|
||||
fatalError("could not create space texture");
|
||||
}
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
|
|
|
@ -84,14 +84,16 @@ stepParticles(double deltaTime)
|
|||
/* is the particle actually active, or is it marked for deletion? */
|
||||
if (curr->isActive) {
|
||||
/* is the particle off the screen? */
|
||||
if (curr->y > screen_h)
|
||||
if (curr->y > screen_h) {
|
||||
curr->isActive = 0;
|
||||
else if (curr->y < 0)
|
||||
} else if (curr->y < 0) {
|
||||
curr->isActive = 0;
|
||||
if (curr->x > screen_w)
|
||||
}
|
||||
if (curr->x > screen_w) {
|
||||
curr->isActive = 0;
|
||||
else if (curr->x < 0)
|
||||
} else if (curr->x < 0) {
|
||||
curr->isActive = 0;
|
||||
}
|
||||
|
||||
/* step velocity, then step position */
|
||||
curr->yvel += ACCEL * deltaMilliseconds;
|
||||
|
@ -133,15 +135,17 @@ stepParticles(double deltaTime)
|
|||
}
|
||||
|
||||
/* if we're a dust particle, shrink our size */
|
||||
if (curr->type == dust)
|
||||
if (curr->type == dust) {
|
||||
curr->size -= deltaMilliseconds * 0.010f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* if we're still active, pack ourselves in the array next
|
||||
to the last active guy (pack the array tightly) */
|
||||
if (curr->isActive)
|
||||
if (curr->isActive) {
|
||||
*(slot++) = *curr;
|
||||
}
|
||||
} /* endif (curr->isActive) */
|
||||
curr++;
|
||||
}
|
||||
|
@ -188,8 +192,9 @@ explodeEmitter(struct particle *emitter)
|
|||
int i;
|
||||
for (i = 0; i < 200; i++) {
|
||||
|
||||
if (num_active_particles >= MAX_PARTICLES)
|
||||
if (num_active_particles >= MAX_PARTICLES) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* come up with a random angle and speed for new particle */
|
||||
float theta = randomFloat(0, 2.0f * 3.141592);
|
||||
|
@ -226,8 +231,9 @@ void
|
|||
spawnTrailFromEmitter(struct particle *emitter)
|
||||
{
|
||||
|
||||
if (num_active_particles >= MAX_PARTICLES)
|
||||
if (num_active_particles >= MAX_PARTICLES) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* select the particle at the slot at the end of our array */
|
||||
struct particle *p = &particles[num_active_particles];
|
||||
|
@ -262,8 +268,9 @@ void
|
|||
spawnEmitterParticle(GLfloat x, GLfloat y)
|
||||
{
|
||||
|
||||
if (num_active_particles >= MAX_PARTICLES)
|
||||
if (num_active_particles >= MAX_PARTICLES) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* find particle at endpoint of array */
|
||||
struct particle *p = &particles[num_active_particles];
|
||||
|
|
|
@ -117,7 +117,7 @@ initializeTexture(SDL_Renderer *renderer)
|
|||
|
||||
/* convert RGBA surface to texture */
|
||||
texture = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
if (!texture) {
|
||||
if (texture == NULL) {
|
||||
fatalError("could not create texture");
|
||||
}
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||
|
|
|
@ -165,7 +165,7 @@ loadFont(void)
|
|||
{
|
||||
SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp");
|
||||
|
||||
if (!surface) {
|
||||
if (surface == NULL) {
|
||||
printf("Error loading bitmap: %s\n", SDL_GetError());
|
||||
return 0;
|
||||
} else {
|
||||
|
@ -183,7 +183,7 @@ loadFont(void)
|
|||
SDL_BlitSurface(surface, NULL, converted, NULL);
|
||||
/* create our texture */
|
||||
texture = SDL_CreateTextureFromSurface(renderer, converted);
|
||||
if (!texture) {
|
||||
if (texture == NULL) {
|
||||
printf("texture creation failed: %s\n", SDL_GetError());
|
||||
} else {
|
||||
/* set blend mode for our texture */
|
||||
|
|
|
@ -207,10 +207,10 @@ playSound(struct sound *s)
|
|||
break;
|
||||
}
|
||||
/* if this channel's sound is older than the oldest so far, set it to oldest */
|
||||
if (mixer.channels[i].timestamp <
|
||||
mixer.channels[oldest_channel].timestamp)
|
||||
if (mixer.channels[i].timestamp < mixer.channels[oldest_channel].timestamp) {
|
||||
oldest_channel = i;
|
||||
}
|
||||
}
|
||||
|
||||
/* no empty channels, take the oldest one */
|
||||
if (selected_channel == -1)
|
||||
|
|
|
@ -58,11 +58,11 @@ main(int argc, char *argv[])
|
|||
|
||||
/* create window and renderer */
|
||||
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
if (!window) {
|
||||
if (window == NULL) {
|
||||
fatalError("Could not initialize Window");
|
||||
}
|
||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||
if (!renderer) {
|
||||
if (renderer == NULL) {
|
||||
fatalError("Could not create renderer");
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ initializeTexture(SDL_Renderer *renderer)
|
|||
brush =
|
||||
SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
if (!brush) {
|
||||
if (brush == NULL) {
|
||||
fatalError("could not create brush texture");
|
||||
}
|
||||
/* additive blending -- laying strokes on top of eachother makes them brighter */
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.26.0</string>
|
||||
<string>2.27.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SDLX</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.26.0</string>
|
||||
<string>2.27.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -9528,8 +9528,8 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 2701.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2701.0.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||
|
@ -9570,7 +9570,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
MARKETING_VERSION = 2.0.17;
|
||||
MARKETING_VERSION = 2.27.0;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
};
|
||||
name = Release;
|
||||
|
@ -9613,8 +9613,8 @@
|
|||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 2701.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2701.0.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
|
@ -9656,7 +9656,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
MARKETING_VERSION = 2.0.17;
|
||||
MARKETING_VERSION = 2.27.0;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -9862,8 +9862,8 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 2701.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2701.0.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
|
@ -9914,8 +9914,8 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 2701.0.0;
|
||||
DYLIB_CURRENT_VERSION = 2701.0.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Title SDL 2.0.0
|
||||
Title SDL 2.27.0
|
||||
Version 1
|
||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||
DefaultLocation /Library/Frameworks
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -251,6 +251,7 @@ public class HIDDeviceManager {
|
|||
0x20d6, // PowerA
|
||||
0x24c6, // PowerA
|
||||
0x2c22, // Qanba
|
||||
0x2dc8, // 8BitDo
|
||||
};
|
||||
|
||||
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
|
||||
|
@ -271,6 +272,7 @@ public class HIDDeviceManager {
|
|||
final int XB1_IFACE_SUBCLASS = 71;
|
||||
final int XB1_IFACE_PROTOCOL = 208;
|
||||
final int[] SUPPORTED_VENDORS = {
|
||||
0x044f, // Thrustmaster
|
||||
0x045e, // Microsoft
|
||||
0x0738, // Mad Catz
|
||||
0x0e6f, // PDP
|
||||
|
@ -278,7 +280,7 @@ public class HIDDeviceManager {
|
|||
0x1532, // Razer Wildcat
|
||||
0x20d6, // PowerA
|
||||
0x24c6, // PowerA
|
||||
0x2dc8, /* 8BitDo */
|
||||
0x2dc8, // 8BitDo
|
||||
0x2e24, // Hyperkin
|
||||
};
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ public class SDL {
|
|||
|
||||
// This function stores the current activity (SDL or not)
|
||||
public static void setContext(Context context) {
|
||||
SDLAudioManager.setContext(context);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ import java.util.Locale;
|
|||
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 2;
|
||||
private static final int SDL_MINOR_VERSION = 26;
|
||||
private static final int SDL_MINOR_VERSION = 27;
|
||||
private static final int SDL_MICRO_VERSION = 0;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
|
@ -393,7 +393,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
mHIDDeviceManager = HIDDeviceManager.acquire(this);
|
||||
|
||||
// Set up the surface
|
||||
mSurface = createSDLSurface(getApplication());
|
||||
mSurface = createSDLSurface(this);
|
||||
|
||||
mLayout = new RelativeLayout(this);
|
||||
mLayout.addView(mSurface);
|
||||
|
@ -588,6 +588,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
mHIDDeviceManager = null;
|
||||
}
|
||||
|
||||
SDLAudioManager.release(this);
|
||||
|
||||
if (SDLActivity.mBrokenLibraries) {
|
||||
super.onDestroy();
|
||||
return;
|
||||
|
@ -969,15 +971,18 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
/* If set, hint "explicitly controls which UI orientations are allowed". */
|
||||
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
|
||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
|
||||
} else if (hint.contains("LandscapeRight")) {
|
||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||
} else if (hint.contains("LandscapeLeft")) {
|
||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||
} else if (hint.contains("LandscapeRight")) {
|
||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
||||
}
|
||||
|
||||
if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) {
|
||||
/* exact match to 'Portrait' to distinguish with PortraitUpsideDown */
|
||||
boolean contains_Portrait = hint.contains("Portrait ") || hint.endsWith("Portrait");
|
||||
|
||||
if (contains_Portrait && hint.contains("PortraitUpsideDown")) {
|
||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
|
||||
} else if (hint.contains("Portrait")) {
|
||||
} else if (contains_Portrait) {
|
||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||
} else if (hint.contains("PortraitUpsideDown")) {
|
||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package org.libsdl.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioDeviceCallback;
|
||||
import android.media.AudioDeviceInfo;
|
||||
import android.media.AudioFormat;
|
||||
import android.media.AudioManager;
|
||||
import android.media.AudioRecord;
|
||||
|
@ -8,16 +11,49 @@ import android.media.MediaRecorder;
|
|||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
public class SDLAudioManager
|
||||
{
|
||||
import java.util.Arrays;
|
||||
|
||||
public class SDLAudioManager {
|
||||
protected static final String TAG = "SDLAudio";
|
||||
|
||||
protected static AudioTrack mAudioTrack;
|
||||
protected static AudioRecord mAudioRecord;
|
||||
protected static Context mContext;
|
||||
|
||||
private static final int[] NO_DEVICES = {};
|
||||
|
||||
private static AudioDeviceCallback mAudioDeviceCallback;
|
||||
|
||||
public static void initialize() {
|
||||
mAudioTrack = null;
|
||||
mAudioRecord = null;
|
||||
mAudioDeviceCallback = null;
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
{
|
||||
mAudioDeviceCallback = new AudioDeviceCallback() {
|
||||
@Override
|
||||
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
|
||||
Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
|
||||
Arrays.stream(removedDevices).forEach(deviceInfo -> removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static void setContext(Context context) {
|
||||
mContext = context;
|
||||
if (context != null) {
|
||||
registerAudioDeviceCallback();
|
||||
}
|
||||
}
|
||||
|
||||
public static void release(Context context) {
|
||||
unregisterAudioDeviceCallback(context);
|
||||
}
|
||||
|
||||
// Audio
|
||||
|
@ -35,7 +71,7 @@ public class SDLAudioManager
|
|||
}
|
||||
}
|
||||
|
||||
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
||||
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
||||
int channelConfig;
|
||||
int sampleSize;
|
||||
int frameSize;
|
||||
|
@ -201,6 +237,10 @@ public class SDLAudioManager
|
|||
return null;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && deviceId != 0) {
|
||||
mAudioRecord.setPreferredDevice(getOutputAudioDeviceInfo(deviceId));
|
||||
}
|
||||
|
||||
mAudioRecord.startRecording();
|
||||
}
|
||||
|
||||
|
@ -224,6 +264,10 @@ public class SDLAudioManager
|
|||
return null;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && deviceId != 0) {
|
||||
mAudioTrack.setPreferredDevice(getInputAudioDeviceInfo(deviceId));
|
||||
}
|
||||
|
||||
mAudioTrack.play();
|
||||
}
|
||||
|
||||
|
@ -238,11 +282,73 @@ public class SDLAudioManager
|
|||
return results;
|
||||
}
|
||||
|
||||
private static AudioDeviceInfo getInputAudioDeviceInfo(int deviceId) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS))
|
||||
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static AudioDeviceInfo getOutputAudioDeviceInfo(int deviceId) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS))
|
||||
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerAudioDeviceCallback() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
audioManager.registerAudioDeviceCallback(mAudioDeviceCallback, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static void unregisterAudioDeviceCallback(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||
audioManager.unregisterAudioDeviceCallback(mAudioDeviceCallback);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
||||
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames);
|
||||
public static int[] getAudioOutputDevices() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
|
||||
} else {
|
||||
return NO_DEVICES;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int[] getAudioInputDevices() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
|
||||
} else {
|
||||
return NO_DEVICES;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
||||
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -254,6 +360,11 @@ public class SDLAudioManager
|
|||
return;
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||
Log.e(TAG, "Attempted to make an incompatible audio call with uninitialized audio! (floating-point output is supported since Android 5.0 Lollipop)");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < buffer.length;) {
|
||||
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
|
||||
if (result > 0) {
|
||||
|
@ -326,14 +437,18 @@ public class SDLAudioManager
|
|||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
||||
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames);
|
||||
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
||||
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
|
||||
}
|
||||
|
||||
/** This method is called by SDL using JNI. */
|
||||
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
|
||||
if (Build.VERSION.SDK_INT < 23) {
|
||||
return 0;
|
||||
} else {
|
||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||
}
|
||||
}
|
||||
|
||||
/** This method is called by SDL using JNI. */
|
||||
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
|
||||
|
@ -391,4 +506,9 @@ public class SDLAudioManager
|
|||
}
|
||||
|
||||
public static native int nativeSetupJNI();
|
||||
|
||||
public static native void removeAudioDevice(boolean isCapture, int deviceId);
|
||||
|
||||
public static native void addAudioDevice(boolean isCapture, int deviceId);
|
||||
|
||||
}
|
||||
|
|
4
android-project/gradlew
vendored
4
android-project/gradlew
vendored
|
@ -126,8 +126,8 @@ if $cygwin ; then
|
|||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
|
|
32
build-scripts/clang-format-src.sh
Executable file
32
build-scripts/clang-format-src.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd "$(dirname $0)/../src"
|
||||
|
||||
echo "Running clang-format in $(pwd)"
|
||||
|
||||
find . -regex '.*\.[chm]p*' -exec clang-format -i {} \;
|
||||
|
||||
# Revert third-party code
|
||||
git checkout \
|
||||
events/imKStoUCS.* \
|
||||
hidapi \
|
||||
joystick/controller_type.c \
|
||||
joystick/controller_type.h \
|
||||
joystick/hidapi/steam/controller_constants.h \
|
||||
joystick/hidapi/steam/controller_structs.h \
|
||||
libm \
|
||||
stdlib/SDL_malloc.c \
|
||||
stdlib/SDL_qsort.c \
|
||||
stdlib/SDL_strtokr.c \
|
||||
video/arm \
|
||||
video/khronos \
|
||||
video/x11/edid-parse.c \
|
||||
video/yuv2rgb
|
||||
clang-format -i hidapi/SDL_hidapi.c
|
||||
|
||||
# Revert generated code
|
||||
git checkout dynapi/SDL_dynapi_overrides.h
|
||||
git checkout dynapi/SDL_dynapi_procs.h
|
||||
git checkout render/metal/SDL_shaders_metal_*.h
|
||||
|
||||
echo "clang-format complete!"
|
2
build-scripts/config.sub
vendored
2
build-scripts/config.sub
vendored
|
@ -1075,7 +1075,7 @@ case $cpu-$vendor in
|
|||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
cpu=i586
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
|
||||
cpu=i686
|
||||
;;
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -395,7 +395,7 @@ int main(void)
|
|||
printf(
|
||||
"/*\n"
|
||||
" Simple DirectMedia Layer\n"
|
||||
" Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
"\n"
|
||||
" This software is provided 'as-is', without any express or implied\n"
|
||||
" warranty. In no event will the authors be held liable for any damages\n"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -113,7 +113,7 @@ int main(void)
|
|||
printf(
|
||||
"/*\n"
|
||||
" Simple DirectMedia Layer\n"
|
||||
" Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
"\n"
|
||||
" This software is provided 'as-is', without any express or implied\n"
|
||||
" warranty. In no event will the authors be held liable for any damages\n"
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
set -eu
|
||||
|
||||
cd `dirname $0`/..
|
||||
|
||||
ref_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL_version.h)
|
||||
ref_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL_version.h)
|
||||
ref_micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL_version.h)
|
||||
|
@ -139,6 +141,25 @@ else
|
|||
not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_version.h $ref_version"
|
||||
fi
|
||||
|
||||
version=$(sed -Ene 's/Title SDL (.*)/\1/p' Xcode/SDL/pkg-support/SDL.info)
|
||||
|
||||
if [ "$ref_version" = "$version" ]; then
|
||||
ok "SDL.info Title $version"
|
||||
else
|
||||
not_ok "SDL.info Title $version disagrees with SDL_version.h $ref_version"
|
||||
fi
|
||||
|
||||
marketing=$(sed -Ene 's/.*MARKETING_VERSION = (.*);/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
|
||||
|
||||
ref="$ref_version
|
||||
$ref_version"
|
||||
|
||||
if [ "$ref" = "$marketing" ]; then
|
||||
ok "project.pbxproj MARKETING_VERSION is consistent"
|
||||
else
|
||||
not_ok "project.pbxproj MARKETING_VERSION is inconsistent, expected $ref, got $marketing"
|
||||
fi
|
||||
|
||||
# For simplicity this assumes we'll never break ABI before SDL 3.
|
||||
dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
|
||||
|
||||
|
|
|
@ -30,6 +30,10 @@ echo "Updating version to '$NEWVERSION' ..."
|
|||
# !!! FIXME: This first one is a kinda scary search/replace that might fail later if another X.Y.Z version is added to the file.
|
||||
perl -w -pi -e 's/(\<string\>)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/Info-Framework.plist
|
||||
|
||||
perl -w -pi -e 's/(Title SDL )\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/pkg-support/SDL.info
|
||||
|
||||
perl -w -pi -e 's/(MARKETING_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
|
||||
DYVER=`expr $MINOR \* 100 + 1`
|
||||
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
|
||||
|
|
|
@ -415,6 +415,7 @@ my @standard_wiki_sections = (
|
|||
'Function Parameters',
|
||||
'Return Value',
|
||||
'Remarks',
|
||||
'Thread Safety',
|
||||
'Version',
|
||||
'Code Examples',
|
||||
'Related Functions'
|
||||
|
@ -729,6 +730,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
my $remarks = %$sectionsref{'Remarks'};
|
||||
my $params = %$sectionsref{'Function Parameters'};
|
||||
my $returns = %$sectionsref{'Return Value'};
|
||||
my $threadsafety = %$sectionsref{'Thread Safety'};
|
||||
my $version = %$sectionsref{'Version'};
|
||||
my $related = %$sectionsref{'Related Functions'};
|
||||
my $deprecated = %$sectionsref{'Deprecated'};
|
||||
|
@ -821,6 +823,21 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
}
|
||||
}
|
||||
|
||||
if (defined $threadsafety) {
|
||||
# !!! FIXME: lots of code duplication in all of these.
|
||||
$str .= "\n" if $addblank; $addblank = 1;
|
||||
my $v = dewikify($wikitype, $threadsafety);
|
||||
my $whitespacelen = length("\\threadsafety") + 1;
|
||||
my $whitespace = ' ' x $whitespacelen;
|
||||
$v = wordwrap($v, -$whitespacelen);
|
||||
my @desclines = split /\n/, $v;
|
||||
my $firstline = shift @desclines;
|
||||
$str .= "\\threadsafety $firstline\n";
|
||||
foreach (@desclines) {
|
||||
$str .= "${whitespace}$_\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $version) {
|
||||
# !!! FIXME: lots of code duplication in all of these.
|
||||
$str .= "\n" if $addblank; $addblank = 1;
|
||||
|
@ -1047,6 +1064,21 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
}
|
||||
$desc =~ s/[\s\n]+\Z//ms;
|
||||
$sections{'Version'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
||||
} elsif ($l =~ /\A\\threadsafety\s+(.*)\Z/) {
|
||||
my $desc = $1;
|
||||
while (@doxygenlines) {
|
||||
my $subline = $doxygenlines[0];
|
||||
$subline =~ s/\A\s*//;
|
||||
last if $subline =~ /\A\\/; # some sort of doxygen command, assume we're past this thing.
|
||||
shift @doxygenlines; # dump this line from the array; we're using it.
|
||||
if ($subline eq '') { # empty line, make sure it keeps the newline char.
|
||||
$desc .= "\n";
|
||||
} else {
|
||||
$desc .= " $subline";
|
||||
}
|
||||
}
|
||||
$desc =~ s/[\s\n]+\Z//ms;
|
||||
$sections{'Thread Safety'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
||||
} elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
|
||||
my $sa = $1;
|
||||
$sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
||||
|
@ -1137,10 +1169,11 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
$$sectionsref{'[footer]'} = $footer;
|
||||
|
||||
if (defined $wikipreamble) {
|
||||
my $wikified_preamble = wikify($wikitype, $wikipreamble);
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
print FH "====== $wikipreamble ======\n";
|
||||
print FH "====== $wikified_preamble ======\n";
|
||||
} elsif ($wikitype eq 'md') {
|
||||
print FH "###### $wikipreamble\n";
|
||||
print FH "###### $wikified_preamble\n";
|
||||
} else { die("Unexpected wikitype '$wikitype'\n"); }
|
||||
}
|
||||
|
||||
|
@ -1239,6 +1272,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
my $params = %$sectionsref{'Function Parameters'};
|
||||
my $returns = %$sectionsref{'Return Value'};
|
||||
my $version = %$sectionsref{'Version'};
|
||||
my $threadsafety = %$sectionsref{'Thread Safety'};
|
||||
my $related = %$sectionsref{'Related Functions'};
|
||||
my $examples = %$sectionsref{'Code Examples'};
|
||||
my $deprecated = %$sectionsref{'Deprecated'};
|
||||
|
@ -1346,6 +1380,11 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
$dewikify_manpage_code_indent = 1;
|
||||
}
|
||||
|
||||
if (defined $threadsafety) {
|
||||
$str .= ".SH THREAD SAFETY\n";
|
||||
$str .= dewikify($wikitype, $threadsafety) . "\n";
|
||||
}
|
||||
|
||||
if (defined $version) {
|
||||
$str .= ".SH AVAILABILITY\n";
|
||||
$str .= dewikify($wikitype, $version) . "\n";
|
||||
|
|
|
@ -32,6 +32,8 @@ function(check_cpu_architecture ARCH VARIABLE)
|
|||
_internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "arm64")
|
||||
_internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "loongarch64")
|
||||
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
|
||||
else()
|
||||
message(WARNING "Unknown CPU architectures (${ARCH}).")
|
||||
set(${VARIABLE} FALSE)
|
||||
|
|
|
@ -29,7 +29,7 @@ ENDMACRO()
|
|||
|
||||
# Message Output
|
||||
macro(MESSAGE_WARN _TEXT)
|
||||
message(STATUS "*** WARNING: ${_TEXT}")
|
||||
message(WARNING "${_TEXT}")
|
||||
endmacro()
|
||||
|
||||
macro(MESSAGE_ERROR _TEXT)
|
||||
|
@ -64,7 +64,7 @@ macro(MESSAGE_TESTED_OPTION _NAME)
|
|||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
||||
endmacro()
|
||||
|
||||
macro(LISTTOSTR _LIST _OUTPUT)
|
||||
function(LISTTOSTR _LIST _OUTPUT)
|
||||
if(${ARGC} EQUAL 3)
|
||||
# prefix for each element
|
||||
set(_LPREFIX ${ARGV2})
|
||||
|
@ -73,10 +73,12 @@ macro(LISTTOSTR _LIST _OUTPUT)
|
|||
endif()
|
||||
# Do not use string(REPLACE ";" " ") here to avoid messing up list
|
||||
# entries
|
||||
set(res)
|
||||
foreach(_ITEM ${${_LIST}})
|
||||
set(${_OUTPUT} "${${_OUTPUT}} ${_LPREFIX}${_ITEM}")
|
||||
set(res "${res} ${_LPREFIX}${_ITEM}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
set(${_OUTPUT} "${res}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(LISTTOSTRREV _LIST _OUTPUT)
|
||||
if(${ARGC} EQUAL 3)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
include(CMakeParseArguments)
|
||||
include(${SDL2_SOURCE_DIR}/cmake/sdlfind.cmake)
|
||||
macro(FindLibraryAndSONAME _LIB)
|
||||
cmake_parse_arguments(FLAS "" "" "LIBDIRS" ${ARGN})
|
||||
|
||||
|
@ -6,6 +7,13 @@ macro(FindLibraryAndSONAME _LIB)
|
|||
string(REGEX REPLACE "\\-" "_" _LNAME "${_UPPERLNAME}")
|
||||
|
||||
find_library(${_LNAME}_LIB ${_LIB} PATHS ${FLAS_LIBDIRS})
|
||||
|
||||
if(${_LNAME}_LIB MATCHES ".*\\${CMAKE_SHARED_LIBRARY_SUFFIX}.*" AND NOT ${_LNAME}_LIB MATCHES ".*\\${CMAKE_STATIC_LIBRARY_SUFFIX}.*")
|
||||
set(${_LNAME}_SHARED TRUE)
|
||||
else()
|
||||
set(${_LNAME}_SHARED FALSE)
|
||||
endif()
|
||||
|
||||
if(${_LNAME}_LIB)
|
||||
# reduce the library name for shared linking
|
||||
|
||||
|
@ -83,26 +91,35 @@ endmacro()
|
|||
# - HAVE_SDL_LOADSO opt
|
||||
macro(CheckALSA)
|
||||
if(SDL_ALSA)
|
||||
CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H)
|
||||
if(HAVE_ASOUNDLIB_H)
|
||||
CHECK_LIBRARY_EXISTS(asound snd_pcm_recover "" HAVE_LIBASOUND)
|
||||
endif()
|
||||
if(HAVE_LIBASOUND)
|
||||
set(HAVE_ALSA TRUE)
|
||||
file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c)
|
||||
sdlFindALSA()
|
||||
if(ALSA_FOUND)
|
||||
file(GLOB ALSA_SOURCES "${SDL2_SOURCE_DIR}/src/audio/alsa/*.c")
|
||||
list(APPEND SOURCE_FILES ${ALSA_SOURCES})
|
||||
set(SDL_AUDIO_DRIVER_ALSA 1)
|
||||
if(SDL_ALSA_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||
message_warn("You must have SDL_LoadObject() support for dynamic ALSA loading")
|
||||
endif()
|
||||
set(HAVE_ALSA TRUE)
|
||||
set(HAVE_ALSA_SHARED FALSE)
|
||||
if(SDL_ALSA_SHARED)
|
||||
if(HAVE_SDL_LOADSO)
|
||||
FindLibraryAndSONAME("asound")
|
||||
if(SDL_ALSA_SHARED AND ASOUND_LIB AND HAVE_SDL_LOADSO)
|
||||
if(ASOUND_LIB AND ASOUND_SHARED)
|
||||
target_include_directories(sdl-build-options INTERFACE $<TARGET_PROPERTY:ALSA::ALSA,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"")
|
||||
set(HAVE_ALSA_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS asound)
|
||||
message(WARNING "Unable to find asound shared object")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "You must have SDL_LoadObject() support for dynamic ALSA loading")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_ALSA_SHARED)
|
||||
list(APPEND CMAKE_DEPENDS ALSA::ALSA)
|
||||
list(APPEND PKGCONFIG_DEPENDS alsa)
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
else()
|
||||
set(HAVE_ALSA FALSE)
|
||||
message(WARNING "Unable to found the alsa development library")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
@ -400,6 +417,7 @@ endmacro()
|
|||
# - SDL_X11_SHARED opt
|
||||
# - HAVE_SDL_LOADSO opt
|
||||
macro(CheckX11)
|
||||
cmake_push_check_state(RESET)
|
||||
if(SDL_X11)
|
||||
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss)
|
||||
FindLibraryAndSONAME("${_LIB}")
|
||||
|
@ -422,6 +440,7 @@ macro(CheckX11)
|
|||
|
||||
if(X_INCLUDEDIR)
|
||||
list(APPEND EXTRA_CFLAGS "-I${X_INCLUDEDIR}")
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${X_INCLUDEDIR})
|
||||
endif()
|
||||
|
||||
find_file(HAVE_XCURSOR_H NAMES "X11/Xcursor/Xcursor.h" HINTS "${X_INCLUDEDIR}")
|
||||
|
@ -597,6 +616,7 @@ macro(CheckX11)
|
|||
# Prevent Mesa from including X11 headers
|
||||
list(APPEND EXTRA_CFLAGS "-DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11")
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
endmacro()
|
||||
|
||||
macro(WaylandProtocolGen _SCANNER _CODE_MODE _XML _PROTL)
|
||||
|
@ -714,6 +734,17 @@ macro(CheckWayland)
|
|||
else()
|
||||
list(APPEND EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES})
|
||||
endif()
|
||||
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS ${PKG_LIBDECOR_CFLAGS})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${PKG_LIBDECOR_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${PKG_LIBDECOR_LINK_LIBRARIES})
|
||||
check_symbol_exists(libdecor_frame_get_max_content_size "libdecor.h" HAVE_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE)
|
||||
check_symbol_exists(libdecor_frame_get_min_content_size "libdecor.h" HAVE_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE)
|
||||
if(HAVE_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE AND HAVE_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE)
|
||||
set(SDL_HAVE_LIBDECOR_GET_MIN_MAX 1)
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -946,7 +977,6 @@ macro(CheckPTHREAD)
|
|||
list(APPEND SDL_CFLAGS ${PTHREAD_CFLAGS})
|
||||
|
||||
check_c_source_compiles("
|
||||
#define _GNU_SOURCE 1
|
||||
#include <pthread.h>
|
||||
int main(int argc, char **argv) {
|
||||
pthread_mutexattr_t attr;
|
||||
|
@ -957,7 +987,6 @@ macro(CheckPTHREAD)
|
|||
set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
|
||||
else()
|
||||
check_c_source_compiles("
|
||||
#define _GNU_SOURCE 1
|
||||
#include <pthread.h>
|
||||
int main(int argc, char **argv) {
|
||||
pthread_mutexattr_t attr;
|
||||
|
@ -988,10 +1017,13 @@ macro(CheckPTHREAD)
|
|||
check_include_files("pthread_np.h" HAVE_PTHREAD_NP_H)
|
||||
if (HAVE_PTHREAD_H)
|
||||
check_c_source_compiles("
|
||||
#define _GNU_SOURCE 1
|
||||
#include <pthread.h>
|
||||
int main(int argc, char **argv) {
|
||||
pthread_setname_np(pthread_self(), \"\");
|
||||
#ifdef __APPLE__
|
||||
pthread_setname_np(\"\");
|
||||
#else
|
||||
pthread_setname_np(pthread_self(),\"\");
|
||||
#endif
|
||||
return 0;
|
||||
}" HAVE_PTHREAD_SETNAME_NP)
|
||||
if (HAVE_PTHREAD_NP_H)
|
||||
|
@ -1291,3 +1323,16 @@ macro(CheckKMSDRM)
|
|||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(CheckLibUDev)
|
||||
if(SDL_LIBUDEV)
|
||||
check_include_file("libudev.h" have_libudev_header)
|
||||
if(have_libudev_header)
|
||||
set(HAVE_LIBUDEV_H TRUE)
|
||||
FindLibraryAndSONAME(udev)
|
||||
if(UDEV_LIB_SONAME)
|
||||
set(SDL_UDEV_DYNAMIC "\"${UDEV_LIB_SONAME}\"")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
|
9
cmake/sdlfind.cmake
Normal file
9
cmake/sdlfind.cmake
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
macro(sdlFindALSA)
|
||||
find_package(ALSA MODULE)
|
||||
if(ALSA_FOUND AND (NOT TARGET ALSA::ALSA) )
|
||||
add_Library(ALSA::ALSA UNKNOWN IMPORTED)
|
||||
set_property(TARGET ALSA::ALSA PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIRS})
|
||||
set_property(TARGET ALSA::ALSA APPEND PROPERTY IMPORTED_LOCATION ${ALSA_LIBRARY})
|
||||
endif()
|
||||
endmacro()
|
55
cmake/sdlplatform.cmake
Normal file
55
cmake/sdlplatform.cmake
Normal file
|
@ -0,0 +1,55 @@
|
|||
macro(SDL_DetectCMakePlatform)
|
||||
set(SDL_CMAKE_PLATFORM )
|
||||
# Get the platform
|
||||
if(WIN32)
|
||||
set(SDL_CMAKE_PLATFORM WINDOWS)
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
|
||||
set(SDL_CMAKE_PLATFORM LINUX)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
|
||||
set(SDL_CMAKE_PLATFORM FREEBSD)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
|
||||
set(SDL_CMAKE_PLATFORM NETBSD)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
|
||||
set(SDL_CMAKE_PLATFORM OPENBSD)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
|
||||
set(SDL_CMAKE_PLATFORM GNU)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
|
||||
set(SDL_CMAKE_PLATFORM BSDI)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
|
||||
set(SDL_CMAKE_PLATFORM FREEBSD)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*")
|
||||
set(SDL_CMAKE_PLATFORM SYSV5)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*")
|
||||
set(SDL_CMAKE_PLATFORM SOLARIS)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*")
|
||||
set(SDL_CMAKE_PLATFORM HPUX)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*")
|
||||
set(SDL_CMAKE_PLATFORM AIX)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
|
||||
set(SDL_CMAKE_PLATFORM MINIX)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
||||
set(SDL_CMAKE_PLATFORM DARWIN)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
|
||||
set(SDL_CMAKE_PLATFORM MACOSX)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
|
||||
set(SDL_CMAKE_PLATFORM TVOS)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
|
||||
# !!! FIXME: remove the version check when we start requiring >= 3.14.0
|
||||
if(CMAKE_VERSION VERSION_LESS 3.14)
|
||||
set(SDL_CMAKE_PLATFORM IOS)
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
||||
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
|
||||
set(SDL_CMAKE_PLATFORM HAIKU)
|
||||
elseif(NINTENDO_3DS)
|
||||
set(SDL_CMAKE_PLATFORM N3DS)
|
||||
endif()
|
||||
if(SDL_CMAKE_PLATFORM)
|
||||
set(${SDL_CMAKE_PLATFORM} TRUE)
|
||||
endif()
|
||||
endmacro()
|
|
@ -13,7 +13,7 @@ case "$machine" in
|
|||
*android* )
|
||||
EXEPREFIX="lib"
|
||||
EXESUFFIX=".so"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared"
|
||||
LDFLAGS="$LDFLAGS -shared"
|
||||
;;
|
||||
* )
|
||||
EXEPREFIX=""
|
||||
|
@ -25,20 +25,20 @@ set -e
|
|||
|
||||
# Get the canonical path of the folder containing this script
|
||||
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
||||
CFLAGS="$( pkg-config sdl2 --cflags )"
|
||||
LDFLAGS="$( pkg-config sdl2 --libs )"
|
||||
STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
|
||||
SDL_CFLAGS="$( pkg-config sdl2 --cflags )"
|
||||
SDL_LDFLAGS="$( pkg-config sdl2 --libs )"
|
||||
SDL_STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
|
||||
|
||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $CFLAGS $EXTRA_CFLAGS"
|
||||
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
|
||||
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
|
||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
|
||||
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
|
||||
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
|
||||
|
||||
echo "-- CC: $CC"
|
||||
echo "-- CFLAGS: $CFLAGS"
|
||||
echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS"
|
||||
echo "-- LDFLASG: $LDFLAGS"
|
||||
echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS"
|
||||
echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
|
||||
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
|
||||
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
|
||||
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
|
||||
|
||||
echo "-- COMPILE: $compile_cmd"
|
||||
echo "-- LINK: $link_cmd"
|
||||
|
|
|
@ -13,7 +13,7 @@ case "$machine" in
|
|||
*android* )
|
||||
EXEPREFIX="lib"
|
||||
EXESUFFIX=".so"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared"
|
||||
LDFLAGS="$LDFLAGS -shared"
|
||||
;;
|
||||
* )
|
||||
EXEPREFIX=""
|
||||
|
@ -25,20 +25,20 @@ set -e
|
|||
|
||||
# Get the canonical path of the folder containing this script
|
||||
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
||||
CFLAGS="$( sdl2-config --cflags )"
|
||||
LDFLAGS="$( sdl2-config --libs )"
|
||||
STATIC_LDFLAGS="$( sdl2-config --static-libs )"
|
||||
SDL_CFLAGS="$( sdl2-config --cflags )"
|
||||
SDL_LDFLAGS="$( sdl2-config --libs )"
|
||||
SDL_STATIC_LDFLAGS="$( sdl2-config --static-libs )"
|
||||
|
||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $EXTRA_CFLAGS"
|
||||
link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
|
||||
static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
|
||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $SDL_CFLAGS"
|
||||
link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
|
||||
static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
|
||||
|
||||
echo "-- CC: $CC"
|
||||
echo "-- CFLAGS: $CFLAGS"
|
||||
echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS"
|
||||
echo "-- LDFLAGS: $LDFLAGS"
|
||||
echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS"
|
||||
echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
|
||||
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
|
||||
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
|
||||
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
|
||||
|
||||
echo "-- COMPILE: $compile_cmd"
|
||||
echo "-- LINK: $link_cmd"
|
||||
|
|
250
configure
vendored
250
configure
vendored
|
@ -677,6 +677,7 @@ ENABLE_STATIC_TRUE
|
|||
ENABLE_SHARED_FALSE
|
||||
ENABLE_SHARED_TRUE
|
||||
PKGCONFIG_LIBS_PRIV
|
||||
PKGCONFIG_DEPENDS
|
||||
SDL_RLD_FLAGS
|
||||
SDL_STATIC_LIBS
|
||||
SDL_LIBS
|
||||
|
@ -2448,6 +2449,58 @@ printf "%s\n" "$ac_res" >&6; }
|
|||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_c_check_member
|
||||
|
||||
# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
|
||||
# ------------------------------------------------------------------
|
||||
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
|
||||
# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
|
||||
ac_fn_check_decl ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
as_decl_name=`echo $2|sed 's/ *(.*//'`
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
|
||||
printf %s "checking whether $as_decl_name is declared... " >&6; }
|
||||
if eval test \${$3+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
|
||||
eval ac_save_FLAGS=\$$6
|
||||
as_fn_append $6 " $5"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
#ifndef $as_decl_name
|
||||
#ifdef __cplusplus
|
||||
(void) $as_decl_use;
|
||||
#else
|
||||
(void) $as_decl_name;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"
|
||||
then :
|
||||
eval "$3=yes"
|
||||
else $as_nop
|
||||
eval "$3=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
eval $6=\$ac_save_FLAGS
|
||||
|
||||
fi
|
||||
eval ac_res=\$$3
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
printf "%s\n" "$ac_res" >&6; }
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_check_decl
|
||||
ac_configure_args_raw=
|
||||
for ac_arg
|
||||
do
|
||||
|
@ -3453,7 +3506,7 @@ orig_CFLAGS="$CFLAGS"
|
|||
|
||||
# See docs/release_checklist.md
|
||||
SDL_MAJOR_VERSION=2
|
||||
SDL_MINOR_VERSION=26
|
||||
SDL_MINOR_VERSION=27
|
||||
SDL_MICRO_VERSION=0
|
||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||
|
||||
|
@ -17652,6 +17705,79 @@ printf "%s\n" "$ac_cv_path_EGREP" >&6; }
|
|||
EGREP="$ac_cv_path_EGREP"
|
||||
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
|
||||
printf %s "checking for fgrep... " >&6; }
|
||||
if test ${ac_cv_path_FGREP+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
|
||||
then ac_cv_path_FGREP="$GREP -F"
|
||||
else
|
||||
if test -z "$FGREP"; then
|
||||
ac_path_FGREP_found=false
|
||||
# Loop through the user's path and test for each of PROGNAME-LIST
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
case $as_dir in #(((
|
||||
'') as_dir=./ ;;
|
||||
*/) ;;
|
||||
*) as_dir=$as_dir/ ;;
|
||||
esac
|
||||
for ac_prog in fgrep
|
||||
do
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext"
|
||||
as_fn_executable_p "$ac_path_FGREP" || continue
|
||||
# Check for GNU ac_path_FGREP and select it if it is found.
|
||||
# Check for GNU $ac_path_FGREP
|
||||
case `"$ac_path_FGREP" --version 2>&1` in
|
||||
*GNU*)
|
||||
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
|
||||
*)
|
||||
ac_count=0
|
||||
printf %s 0123456789 >"conftest.in"
|
||||
while :
|
||||
do
|
||||
cat "conftest.in" "conftest.in" >"conftest.tmp"
|
||||
mv "conftest.tmp" "conftest.in"
|
||||
cp "conftest.in" "conftest.nl"
|
||||
printf "%s\n" 'FGREP' >> "conftest.nl"
|
||||
"$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
|
||||
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
|
||||
as_fn_arith $ac_count + 1 && ac_count=$as_val
|
||||
if test $ac_count -gt ${ac_path_FGREP_max-0}; then
|
||||
# Best one so far, save it but keep looking for a better one
|
||||
ac_cv_path_FGREP="$ac_path_FGREP"
|
||||
ac_path_FGREP_max=$ac_count
|
||||
fi
|
||||
# 10*(2^10) chars as input seems more than enough
|
||||
test $ac_count -gt 10 && break
|
||||
done
|
||||
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
|
||||
esac
|
||||
|
||||
$ac_path_FGREP_found && break 3
|
||||
done
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
if test -z "$ac_cv_path_FGREP"; then
|
||||
as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
|
||||
fi
|
||||
else
|
||||
ac_cv_path_FGREP=$FGREP
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
|
||||
printf "%s\n" "$ac_cv_path_FGREP" >&6; }
|
||||
FGREP="$ac_cv_path_FGREP"
|
||||
|
||||
|
||||
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
|
@ -18292,8 +18418,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
|
|||
|
||||
find_lib()
|
||||
{
|
||||
gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
||||
gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
||||
gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | $FGREP programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
||||
gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | $FGREP libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
||||
env_lib_path=`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`
|
||||
if test "$cross_compiling" = yes; then
|
||||
host_lib_path=""
|
||||
|
@ -23329,6 +23455,122 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR \"$decor_lib\""
|
|||
else
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS"
|
||||
fi
|
||||
|
||||
saved_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS $DECOR_CFLAGS"
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
|
||||
printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
|
||||
if test ${ac_cv_c_undeclared_builtin_options+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
ac_save_CFLAGS=$CFLAGS
|
||||
ac_cv_c_undeclared_builtin_options='cannot detect'
|
||||
for ac_arg in '' -fno-builtin; do
|
||||
CFLAGS="$ac_save_CFLAGS $ac_arg"
|
||||
# This test program should *not* compile successfully.
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
(void) strchr;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"
|
||||
then :
|
||||
|
||||
else $as_nop
|
||||
# This test program should compile successfully.
|
||||
# No library function is consistently available on
|
||||
# freestanding implementations, so test against a dummy
|
||||
# declaration. Include always-available headers on the
|
||||
# off chance that they somehow elicit warnings.
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
extern void ac_decl (int, char *);
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
(void) ac_decl (0, (char *) 0);
|
||||
(void) ac_decl;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"
|
||||
then :
|
||||
if test x"$ac_arg" = x
|
||||
then :
|
||||
ac_cv_c_undeclared_builtin_options='none needed'
|
||||
else $as_nop
|
||||
ac_cv_c_undeclared_builtin_options=$ac_arg
|
||||
fi
|
||||
break
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
done
|
||||
CFLAGS=$ac_save_CFLAGS
|
||||
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
|
||||
printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
|
||||
case $ac_cv_c_undeclared_builtin_options in #(
|
||||
'cannot detect') :
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error $? "cannot make $CC report undeclared builtins
|
||||
See \`config.log' for more details" "$LINENO" 5; } ;; #(
|
||||
'none needed') :
|
||||
ac_c_undeclared_builtin_options='' ;; #(
|
||||
*) :
|
||||
ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
|
||||
esac
|
||||
|
||||
ac_fn_check_decl "$LINENO" "libdecor_frame_get_min_content_size" "ac_cv_have_decl_libdecor_frame_get_min_content_size" "#include <libdecor.h>
|
||||
" "$ac_c_undeclared_builtin_options" "CFLAGS"
|
||||
if test "x$ac_cv_have_decl_libdecor_frame_get_min_content_size" = xyes
|
||||
then :
|
||||
ac_have_decl=1
|
||||
else $as_nop
|
||||
ac_have_decl=0
|
||||
fi
|
||||
printf "%s\n" "#define HAVE_DECL_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE $ac_have_decl" >>confdefs.h
|
||||
if test $ac_have_decl = 1
|
||||
then :
|
||||
libdecor_get_min_max=yes
|
||||
fi
|
||||
ac_fn_check_decl "$LINENO" "libdecor_frame_get_max_content_size" "ac_cv_have_decl_libdecor_frame_get_max_content_size" "#include <libdecor.h>
|
||||
" "$ac_c_undeclared_builtin_options" "CFLAGS"
|
||||
if test "x$ac_cv_have_decl_libdecor_frame_get_max_content_size" = xyes
|
||||
then :
|
||||
ac_have_decl=1
|
||||
else $as_nop
|
||||
ac_have_decl=0
|
||||
fi
|
||||
printf "%s\n" "#define HAVE_DECL_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE $ac_have_decl" >>confdefs.h
|
||||
if test $ac_have_decl = 1
|
||||
then :
|
||||
libdecor_get_min_max=yes
|
||||
fi
|
||||
|
||||
if test x$libdecor_get_min_max = xyes; then
|
||||
|
||||
printf "%s\n" "#define SDL_HAVE_LIBDECOR_GET_MIN_MAX 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
CFLAGS="$saved_cflags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -29800,6 +30042,8 @@ done
|
|||
|
||||
|
||||
|
||||
PKGCONFIG_DEPENDS=""
|
||||
|
||||
if test x$enable_shared = xyes; then
|
||||
PKGCONFIG_LIBS_PRIV="
|
||||
Libs.private:"
|
||||
|
|
17
configure.ac
17
configure.ac
|
@ -12,7 +12,7 @@ orig_CFLAGS="$CFLAGS"
|
|||
dnl Set various version strings - taken gratefully from the GTk sources
|
||||
# See docs/release_checklist.md
|
||||
SDL_MAJOR_VERSION=2
|
||||
SDL_MINOR_VERSION=26
|
||||
SDL_MINOR_VERSION=27
|
||||
SDL_MICRO_VERSION=0
|
||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||
|
||||
|
@ -62,6 +62,7 @@ AC_PROG_AWK
|
|||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_EGREP
|
||||
AC_PROG_FGREP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
@ -180,8 +181,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
|
|||
dnl Function to find a library in the compiler search path
|
||||
find_lib()
|
||||
{
|
||||
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
||||
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
||||
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | $FGREP programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
||||
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | $FGREP libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
||||
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
|
||||
if test "$cross_compiling" = yes; then
|
||||
host_lib_path=""
|
||||
|
@ -1786,6 +1787,14 @@ dnl See if libdecor is available
|
|||
else
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS"
|
||||
fi
|
||||
|
||||
saved_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS $DECOR_CFLAGS"
|
||||
AC_CHECK_DECLS([libdecor_frame_get_min_content_size, libdecor_frame_get_max_content_size], [libdecor_get_min_max=yes], [ ], [[#include <libdecor.h>]])
|
||||
if test x$libdecor_get_min_max = xyes; then
|
||||
AC_DEFINE(SDL_HAVE_LIBDECOR_GET_MIN_MAX, 1, [ ])
|
||||
fi
|
||||
CFLAGS="$saved_cflags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -4860,6 +4869,8 @@ AC_SUBST(SDL_CFLAGS)
|
|||
AC_SUBST(SDL_LIBS)
|
||||
AC_SUBST(SDL_STATIC_LIBS)
|
||||
AC_SUBST(SDL_RLD_FLAGS)
|
||||
PKGCONFIG_DEPENDS=""
|
||||
AC_SUBST(PKGCONFIG_DEPENDS)
|
||||
if test x$enable_shared = xyes; then
|
||||
PKGCONFIG_LIBS_PRIV="
|
||||
Libs.private:"
|
||||
|
|
|
@ -25,3 +25,4 @@ cmake --install build
|
|||
- SDL2main should be used to ensure ROMFS is enabled.
|
||||
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
||||
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
||||
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -249,9 +249,8 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
|||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
||||
#define SDL_CPUPauseInstruction() __yield()
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
/* watcom assembler rejects PAUSE if CPU < i686, and it refuses REP NOP as an invalid combination. Hardcode the bytes. */
|
||||
extern __inline void SDL_CPUPauseInstruction(void);
|
||||
#pragma aux SDL_CPUPauseInstruction = "db 0f3h,90h"
|
||||
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
|
||||
#else
|
||||
#define SDL_CPUPauseInstruction()
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -332,6 +332,7 @@
|
|||
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
|
||||
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
|
||||
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
|
||||
#cmakedefine SDL_INPUT_WSCONS @SDL_INPUT_WSCONS@
|
||||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
||||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
||||
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
|
||||
|
@ -359,6 +360,7 @@
|
|||
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
|
||||
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
|
||||
#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
|
||||
#cmakedefine SDL_UDEV_DYNAMIC @SDL_UDEV_DYNAMIC@
|
||||
|
||||
/* Enable various sensor drivers */
|
||||
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
|
||||
|
@ -539,7 +541,9 @@
|
|||
#cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@
|
||||
#cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#cmakedefine SDL_HAVE_LIBDECOR_GET_MIN_MAX @SDL_HAVE_LIBDECOR_GET_MIN_MAX@
|
||||
|
||||
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -491,4 +491,7 @@
|
|||
/* Enable dynamic libsamplerate support */
|
||||
#undef SDL_LIBSAMPLERATE_DYNAMIC
|
||||
|
||||
/* Libdecor get min/max content size functions */
|
||||
#undef SDL_HAVE_LIBDECOR_GET_MIN_MAX
|
||||
|
||||
#endif /* SDL_config_h_ */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -34,7 +34,7 @@
|
|||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -209,16 +209,21 @@
|
|||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_WINDOWS 1
|
||||
|
||||
/* #ifndef SDL_VIDEO_RENDER_D3D
|
||||
#define SDL_VIDEO_RENDER_D3D 1
|
||||
#endif*/
|
||||
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
|
||||
#define SDL_VIDEO_RENDER_D3D11 1
|
||||
#endif
|
||||
#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
|
||||
#define SDL_VIDEO_RENDER_D3D12 1
|
||||
#endif
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#ifndef SDL_VIDEO_OPENGL
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_WGL
|
||||
#define SDL_VIDEO_OPENGL_WGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_RENDER_OGL
|
||||
#define SDL_VIDEO_RENDER_OGL 1
|
||||
#endif
|
||||
|
||||
/* Enable system power support */
|
||||
/*#define SDL_POWER_WINDOWS 1*/
|
||||
#define SDL_POWER_HARDWIRED 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -724,10 +724,10 @@ typedef enum
|
|||
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
||||
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
||||
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */
|
||||
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */
|
||||
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
||||
SDL_CONTROLLER_BUTTON_MAX
|
||||
} SDL_GameControllerButton;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -1954,6 +1954,28 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
||||
|
||||
/**
|
||||
* \brief Controls whether menus can be opened with their keyboard shortcut (Alt+mnemonic).
|
||||
*
|
||||
* If the mnemonics are enabled, then menus can be opened by pressing the Alt
|
||||
* key and the corresponding mnemonic (for example, Alt+F opens the File menu).
|
||||
* However, in case an invalid mnemonic is pressed, Windows makes an audible
|
||||
* beep to convey that nothing happened. This is true even if the window has
|
||||
* no menu at all!
|
||||
*
|
||||
* Because most SDL applications don't have menus, and some want to use the Alt
|
||||
* key for other purposes, SDL disables mnemonics (and the beeping) by default.
|
||||
*
|
||||
* Note: This also affects keyboard events: with mnemonics enabled, when a
|
||||
* menu is opened from the keyboard, you will not receive a KEYUP event for
|
||||
* the mnemonic key, and *might* not receive one for Alt.
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
* "0" - Alt+mnemonic does nothing, no beeping. (default)
|
||||
* "1" - Alt+mnemonic opens menus, invalid mnemonics produce a beep.
|
||||
*/
|
||||
#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS "SDL_WINDOWS_ENABLE_MENU_MNEMONICS"
|
||||
|
||||
/**
|
||||
* \brief A variable controlling whether the windows message loop is processed by SDL
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -44,6 +44,7 @@
|
|||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_guid.h"
|
||||
#include "SDL_mutex.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
@ -66,6 +67,9 @@ extern "C" {
|
|||
/**
|
||||
* The joystick structure used to identify an SDL joystick
|
||||
*/
|
||||
#ifdef SDL_THREAD_SAFETY_ANALYSIS
|
||||
extern SDL_mutex *SDL_joystick_lock;
|
||||
#endif
|
||||
struct _SDL_Joystick;
|
||||
typedef struct _SDL_Joystick SDL_Joystick;
|
||||
|
||||
|
@ -131,7 +135,7 @@ typedef enum
|
|||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -146,7 +150,7 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
|||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
|
||||
|
||||
/**
|
||||
* Count the number of joysticks attached to the system.
|
||||
|
@ -284,13 +288,12 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
|
|||
/**
|
||||
* Get the instance ID of a joystick.
|
||||
*
|
||||
* This can be called before any joysticks are opened. If the index is out of
|
||||
* range, this function will return -1.
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the instance id of the selected joystick. If called on an invalid
|
||||
* index, this function returns zero
|
||||
* index, this function returns -1.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -263,6 +263,13 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
|
|||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
|
||||
|
||||
/**
|
||||
* Callback from the application to let the suspend continue.
|
||||
*
|
||||
* \since This function is available since SDL 2.28.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
||||
|
||||
#endif /* __GDK__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -389,6 +389,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
|||
/**
|
||||
* Get the default cursor.
|
||||
*
|
||||
* You do not have to call SDL_FreeCursor() on the return value,
|
||||
* but it is safe to do so.
|
||||
*
|
||||
* \returns the default cursor on success or NULL on failure.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -31,6 +31,80 @@
|
|||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* Enable thread safety attributes only with clang.
|
||||
* The attributes can be safely erased when compiling with other compilers.
|
||||
*/
|
||||
#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
|
||||
defined(__clang__) && (!defined(SWIG))
|
||||
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
|
||||
#else
|
||||
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
|
||||
#endif
|
||||
|
||||
#define SDL_CAPABILITY(x) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
|
||||
|
||||
#define SDL_SCOPED_CAPABILITY \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
|
||||
|
||||
#define SDL_GUARDED_BY(x) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
|
||||
|
||||
#define SDL_PT_GUARDED_BY(x) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
|
||||
|
||||
#define SDL_ACQUIRED_BEFORE(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
|
||||
|
||||
#define SDL_ACQUIRED_AFTER(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
|
||||
|
||||
#define SDL_REQUIRES(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_REQUIRES_SHARED(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_ACQUIRE(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_ACQUIRE_SHARED(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_RELEASE(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_RELEASE_SHARED(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_RELEASE_GENERIC(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_TRY_ACQUIRE(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_TRY_ACQUIRE_SHARED(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(__VA_ARGS__))
|
||||
|
||||
#define SDL_EXCLUDES(...) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
|
||||
|
||||
#define SDL_ASSERT_CAPABILITY(x) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
|
||||
|
||||
#define SDL_ASSERT_SHARED_CAPABILITY(x) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
|
||||
|
||||
#define SDL_RETURN_CAPABILITY(x) \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
|
||||
|
||||
#define SDL_NO_THREAD_SAFETY_ANALYSIS \
|
||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -96,7 +170,7 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
|
|||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
|
||||
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex);
|
||||
#define SDL_mutexP(m) SDL_LockMutex(m)
|
||||
|
||||
/**
|
||||
|
@ -119,7 +193,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
|
|||
* \sa SDL_LockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||
|
||||
/**
|
||||
* Unlock the mutex.
|
||||
|
@ -138,7 +212,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
|
|||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
|
||||
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex);
|
||||
#define SDL_mutexV(m) SDL_UnlockMutex(m)
|
||||
|
||||
/**
|
||||
|
@ -276,7 +350,7 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
|||
* successful it will atomically decrement the semaphore value.
|
||||
*
|
||||
* \param sem the semaphore to wait on
|
||||
* \param ms the length of the timeout, in milliseconds
|
||||
* \param timeout the length of the timeout, in milliseconds
|
||||
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
|
||||
* succeed in the allotted time, or a negative error code on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
|
@ -290,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
|||
* \sa SDL_SemValue
|
||||
* \sa SDL_SemWait
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
|
||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);
|
||||
|
||||
/**
|
||||
* Atomically increment a semaphore's value and wake waiting threads.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue