mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 11:28:15 +00:00
Compare commits
246 Commits
SDL2
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
79ec168f3c | ||
![]() |
40a3a80d45 | ||
![]() |
025fc35c87 | ||
![]() |
e9f5f3ac1f | ||
![]() |
235c87dc92 | ||
![]() |
b6535836aa | ||
![]() |
5e90dd3507 | ||
![]() |
d9139ff3de | ||
![]() |
5669b97fd7 | ||
![]() |
6f0fae7432 | ||
![]() |
1c4dd015ac | ||
![]() |
e9efcfb428 | ||
![]() |
d32189918b | ||
![]() |
38d3b1b6d6 | ||
![]() |
1df907b1ba | ||
![]() |
00a7191f67 | ||
![]() |
d53b22e8f0 | ||
![]() |
e5bb4fa90f | ||
![]() |
ba9b075eba | ||
![]() |
85b2733324 | ||
![]() |
9519b9916c | ||
![]() |
00494df2f1 | ||
![]() |
948196448f | ||
![]() |
7ca3d26e7a | ||
![]() |
f79d28085d | ||
![]() |
74a005f73f | ||
![]() |
6f7aa1e755 | ||
![]() |
847a6cce96 | ||
![]() |
95aed34a69 | ||
![]() |
21e0382edd | ||
![]() |
0cdfdb9970 | ||
![]() |
f75b0aa814 | ||
![]() |
403f87340f | ||
![]() |
07cfc34a2e | ||
![]() |
4222cebef6 | ||
![]() |
1e2aa2363b | ||
![]() |
0b25cd2196 | ||
![]() |
b7457ff61b | ||
![]() |
ba2f78a006 | ||
![]() |
dcbdf09709 | ||
![]() |
a9b11980d2 | ||
![]() |
906d0e9c03 | ||
![]() |
0952ab1ab9 | ||
![]() |
7635776ca4 | ||
![]() |
76a3457ad5 | ||
![]() |
881c4cb49e | ||
![]() |
0406d1c316 | ||
![]() |
1ca76a29d9 | ||
![]() |
e53df5b07e | ||
![]() |
e7a47e783b | ||
![]() |
279eb89ce5 | ||
![]() |
fe9020dcb8 | ||
![]() |
4927836b2d | ||
![]() |
5a072d38db | ||
![]() |
2d1ebf4850 | ||
![]() |
44ec2027f3 | ||
![]() |
000da98663 | ||
![]() |
87ba287f81 | ||
![]() |
d133701a72 | ||
![]() |
4635f8597d | ||
![]() |
802351be25 | ||
![]() |
d3765b27c2 | ||
![]() |
7b11fff2ee | ||
![]() |
de4573275a | ||
![]() |
275c94c900 | ||
![]() |
c084e647ed | ||
![]() |
2cdb419a21 | ||
![]() |
2eef7ca475 | ||
![]() |
d126e7bbba | ||
![]() |
e5024fae3d | ||
![]() |
eb053c7f3f | ||
![]() |
ed441c8289 | ||
![]() |
59b0a1dc65 | ||
![]() |
80d36aba5b | ||
![]() |
e1e36d213b | ||
![]() |
5c8d92e4d0 | ||
![]() |
8a39054b54 | ||
![]() |
c60e2704c8 | ||
![]() |
a9fdbf7f21 | ||
![]() |
ed86b02df8 | ||
![]() |
0811b4dc51 | ||
![]() |
d9901e0b85 | ||
![]() |
0f5752b0fc | ||
![]() |
31f77182d0 | ||
![]() |
620e875335 | ||
![]() |
c18173c260 | ||
![]() |
f08f458896 | ||
![]() |
53cf48f505 | ||
![]() |
c32a1a5023 | ||
![]() |
8b204815cc | ||
![]() |
a9bb92b3ae | ||
![]() |
630272eb55 | ||
![]() |
92fe3b19c8 | ||
![]() |
30e2b03a65 | ||
![]() |
f8943854fd | ||
![]() |
325465935d | ||
![]() |
1cdd37b32c | ||
![]() |
499bff9c3a | ||
![]() |
bd06e43b87 | ||
![]() |
72e5620202 | ||
![]() |
fbb9646806 | ||
![]() |
4b91f0793c | ||
![]() |
6243a80b3f | ||
![]() |
e0b0a98c8e | ||
![]() |
785eac863b | ||
![]() |
ab8659922d | ||
![]() |
d48f9c4af4 | ||
![]() |
5cc0644aa0 | ||
![]() |
91accc391d | ||
![]() |
3ee20388c5 | ||
![]() |
2449510673 | ||
![]() |
2c07ed320e | ||
![]() |
607f37dafd | ||
![]() |
acc2e040ce | ||
![]() |
faa9bbdc8e | ||
![]() |
cf6c760cd3 | ||
![]() |
e49349ac0c | ||
![]() |
1e5db996ff | ||
![]() |
793a0681a9 | ||
![]() |
825ffaa168 | ||
![]() |
9ad6a36b7b | ||
![]() |
c3b53c72c7 | ||
![]() |
0800d81fb4 | ||
![]() |
c27219695a | ||
![]() |
9dcfc308ef | ||
![]() |
77b3a6afaf | ||
![]() |
dd42795131 | ||
![]() |
fb1497566c | ||
![]() |
cc6c0fe230 | ||
![]() |
f9a46a319b | ||
![]() |
48a0592a45 | ||
![]() |
1c74a8b5ae | ||
![]() |
3d18043005 | ||
![]() |
6e1e00701e | ||
![]() |
5570d846ea | ||
![]() |
f5dcb8f7ad | ||
![]() |
f6f1b09b69 | ||
![]() |
bf540985aa | ||
![]() |
c39f86c28a | ||
![]() |
b5da8ad00d | ||
![]() |
f62b86263a | ||
![]() |
3449c734d5 | ||
![]() |
3f29d985fe | ||
![]() |
2f4a7bbced | ||
![]() |
a0522e4c21 | ||
![]() |
f461d91cd2 | ||
![]() |
ef54e0c4f4 | ||
![]() |
863f39fb9f | ||
![]() |
d33b28c9fe | ||
![]() |
c15a87a614 | ||
![]() |
45de0635ac | ||
![]() |
bca314c339 | ||
![]() |
f05490d0e2 | ||
![]() |
442e201705 | ||
![]() |
9c346b2321 | ||
![]() |
a6b684d05a | ||
![]() |
8fb82da226 | ||
![]() |
0949f89028 | ||
![]() |
350a49e1cc | ||
![]() |
bc19e38728 | ||
![]() |
228a2954d7 | ||
![]() |
3d6d4ca2cd | ||
![]() |
4c3e5cf1d1 | ||
![]() |
27b1b6d4eb | ||
![]() |
24269007d8 | ||
![]() |
d849036927 | ||
![]() |
5be47255ba | ||
![]() |
8f860b3698 | ||
![]() |
35992597ae | ||
![]() |
3f0d7a2937 | ||
![]() |
dae1232489 | ||
![]() |
8e388843b8 | ||
![]() |
5adbf3765a | ||
![]() |
e910e6f13d | ||
![]() |
2f2cca8ac6 | ||
![]() |
a2f39399a1 | ||
![]() |
c1149f88b6 | ||
![]() |
54adba6a31 | ||
![]() |
b48106f8a8 | ||
![]() |
f345428367 | ||
![]() |
e4287595c1 | ||
![]() |
73efbf2e14 | ||
![]() |
ad342dfca9 | ||
![]() |
f13d6d4b0f | ||
![]() |
dfb8241317 | ||
![]() |
c67f10e43f | ||
![]() |
932eea513e | ||
![]() |
5e51a37518 | ||
![]() |
372564299e | ||
![]() |
c397fe0c51 | ||
![]() |
95227e2732 | ||
![]() |
6f8d6da77f | ||
![]() |
6f15aec644 | ||
![]() |
9bed177f10 | ||
![]() |
7de4f16710 | ||
![]() |
beac43f41f | ||
![]() |
8538d5dcf1 | ||
![]() |
0fb294ade4 | ||
![]() |
0f6a682ea6 | ||
![]() |
c4fc20a033 | ||
![]() |
a24e2bfc76 | ||
![]() |
6a83588fdd | ||
![]() |
0092b3629e | ||
![]() |
c0eedcd4ce | ||
![]() |
d1b6d5f33d | ||
![]() |
fe297fc6d8 | ||
![]() |
384fcea585 | ||
![]() |
2f2b44a1bd | ||
![]() |
8386daddcb | ||
![]() |
739a23e506 | ||
![]() |
5a59155a05 | ||
![]() |
1ad917e2f6 | ||
![]() |
859844eae3 | ||
![]() |
857b9848d2 | ||
![]() |
5f98fcf00b | ||
![]() |
5a492e8196 | ||
![]() |
80cb52c944 | ||
![]() |
4436c09c9d | ||
![]() |
23cf7a2e0d | ||
![]() |
4a62e1c0ca | ||
![]() |
173afd8564 | ||
![]() |
f6b9ebb838 | ||
![]() |
f1b109005c | ||
![]() |
0bd58cd727 | ||
![]() |
de1292f8ac | ||
![]() |
a6d5c1fe05 | ||
![]() |
fc5bd11dac | ||
![]() |
e767840874 | ||
![]() |
fd08ca3823 | ||
![]() |
3bf60755cb | ||
![]() |
aac7d1c2ae | ||
![]() |
55caed2011 | ||
![]() |
53058af284 | ||
![]() |
ad1a11164c | ||
![]() |
5f6a4fe643 | ||
![]() |
c85ea238ca | ||
![]() |
5c0b2d04f4 | ||
![]() |
76e64053c3 | ||
![]() |
ddfa59a52b | ||
![]() |
e3fb974fc7 | ||
![]() |
9120fbd501 | ||
![]() |
52181848da | ||
![]() |
10cbe04fc5 | ||
![]() |
8367b00e8c | ||
![]() |
4a4f289adc | ||
![]() |
467f1d52e4 |
82
.github/actions/setup-gdk-desktop/action.yml
vendored
82
.github/actions/setup-gdk-desktop/action.yml
vendored
@@ -1,82 +0,0 @@
|
||||
name: 'Setup GDK (Game Development Kit) for Windows Desktop'
|
||||
description: 'Download GDK and install into MSBuild'
|
||||
inputs:
|
||||
# Keep edition and ref in sync!
|
||||
edition:
|
||||
description: 'GDK edition'
|
||||
default: '240601' # YYMMUU (Year Month Update)
|
||||
ref:
|
||||
description: 'Git reference'
|
||||
default: 'June_2024_Update_1'
|
||||
folder:
|
||||
description: 'Folder where to create Directory.Build.props'
|
||||
required: true
|
||||
default: '${{ github.workspace }}'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-python@main
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: 'Calculate variables'
|
||||
id: calc
|
||||
shell: pwsh
|
||||
run: |
|
||||
$vs_folder=@(vswhere -latest -property installationPath)
|
||||
echo "vs-folder=${vs_folder}" >> $Env:GITHUB_OUTPUT
|
||||
|
||||
echo "gdk-path=${{ runner.temp }}\GDK-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
|
||||
|
||||
echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
|
||||
- name: 'Restore cached GDK'
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: '${{ steps.calc.outputs.gdk-path }}'
|
||||
key: ${{ steps.calc.outputs.cache-key }}
|
||||
- name: 'Download GDK'
|
||||
if: ${{ !steps.cache-restore.outputs.cache-hit }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
python build-scripts/setup-gdk-desktop.py `
|
||||
--download `
|
||||
--temp-folder "${{ runner.temp }}" `
|
||||
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
|
||||
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
|
||||
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
|
||||
--no-user-props
|
||||
- name: 'Extract GDK'
|
||||
if: ${{ !steps.cache-restore.outputs.cache-hit }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
python build-scripts/setup-gdk-desktop.py `
|
||||
--extract `
|
||||
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
|
||||
--temp-folder "${{ runner.temp }}" `
|
||||
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
|
||||
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
|
||||
--no-user-props
|
||||
- name: 'Cache GDK'
|
||||
if: ${{ !steps.cache-restore.outputs.cache-hit }}
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: '${{ steps.calc.outputs.gdk-path }}'
|
||||
key: ${{ steps.calc.outputs.cache-key }}
|
||||
- name: 'Copy MSBuild files into GDK'
|
||||
shell: pwsh
|
||||
run: |
|
||||
python build-scripts/setup-gdk-desktop.py `
|
||||
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
|
||||
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
|
||||
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
|
||||
--copy-msbuild `
|
||||
--no-user-props
|
||||
- name: 'Write user props'
|
||||
shell: pwsh
|
||||
run: |
|
||||
python build-scripts/setup-gdk-desktop.py `
|
||||
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
|
||||
--temp-folder "${{ runner.temp }}" `
|
||||
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
|
||||
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
|
||||
"--props-folder=${{ inputs.folder }}"
|
93
.github/actions/setup-vita-gles/action.yml
vendored
93
.github/actions/setup-vita-gles/action.yml
vendored
@@ -1,93 +0,0 @@
|
||||
name: 'Setup GLES for PlayStation Vita'
|
||||
description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk'
|
||||
inputs:
|
||||
pib-version:
|
||||
description: 'PIB version'
|
||||
default: '1.1.4'
|
||||
pvr-version:
|
||||
description: 'PVR_PSP2 version'
|
||||
default: '3.9'
|
||||
type:
|
||||
description: '"pib" or "pvr"'
|
||||
default: ''
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: 'Calculate variables'
|
||||
id: calc
|
||||
shell: sh
|
||||
run: |
|
||||
if test "x${VITASDK}" = "x"; then
|
||||
echo "VITASDK must be defined"
|
||||
exit 1;
|
||||
fi
|
||||
case "x${{ inputs.type }}" in
|
||||
"xpvr")
|
||||
echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT}
|
||||
;;
|
||||
"xpib")
|
||||
echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT}
|
||||
;;
|
||||
*)
|
||||
echo "Invalid type. Must be 'pib' or 'pvr'."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
- uses: actions/cache/restore@v4
|
||||
id: restore-cache
|
||||
with:
|
||||
path: /vita/dependencies
|
||||
key: '${{ steps.calc.outputs.cache-key }}'
|
||||
- name: 'Download PVR_PSP2 (GLES)'
|
||||
if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }}
|
||||
shell: sh
|
||||
run: |
|
||||
pvr_psp2_version=${{ inputs.pvr-version }}
|
||||
|
||||
mkdir -p /vita/dependencies/include
|
||||
mkdir -p /vita/dependencies/lib
|
||||
|
||||
# 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/* /vita/dependencies/include
|
||||
rm /tmp/v$pvr_psp2_version.zip
|
||||
|
||||
# include guard of PVR_PSP2's khrplatform.h does not match the usual one
|
||||
sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h
|
||||
|
||||
# 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 {} /vita/dependencies/lib \;
|
||||
rm /tmp/vitasdk_stubs.zip
|
||||
rm -rf /tmp/pvr_psp2_stubs
|
||||
|
||||
- name: 'Download gl4es4vita (OpenGL)'
|
||||
if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }}
|
||||
shell: sh
|
||||
run: |
|
||||
gl4es4vita_version=${{ inputs.pib-version }}
|
||||
|
||||
mkdir -p /vita/dependencies/include
|
||||
mkdir -p /vita/dependencies/lib
|
||||
|
||||
# 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/vita/dependencies/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/vita/dependencies/lib
|
||||
|
||||
- uses: actions/cache/save@v4
|
||||
if: ${{ !steps.restore-cache.outputs.cache-hit }}
|
||||
with:
|
||||
path: /vita/dependencies
|
||||
key: '${{ steps.calc.outputs.cache-key }}'
|
||||
|
||||
- name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir
|
||||
shell: sh
|
||||
run: |
|
||||
cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi
|
81
.github/workflows/android.yml
vendored
Normal file
81
.github/workflows/android.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Build (Android)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
android:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: Android.mk }
|
||||
- { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup_ndk
|
||||
with:
|
||||
ndk-version: r21e
|
||||
- name: Build (Android.mk)
|
||||
if: ${{ matrix.platform.name == 'Android.mk' }}
|
||||
run: |
|
||||
./build-scripts/androidbuildlibs.sh
|
||||
- name: Setup (CMake)
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install ninja-build pkg-config
|
||||
- name: Configure (CMake)
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
cmake -B build \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
|
||||
-DSDL_WERROR=ON \
|
||||
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
|
||||
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
|
||||
-DSDL_STATIC_PIC=ON \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-GNinja
|
||||
- name: Build (CMake)
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
cmake --build build --config Release --parallel --verbose
|
||||
- name: Install (CMake)
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
cmake --install build --config Release
|
||||
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
|
||||
( cd prefix; find ) | LC_ALL=C sort -u
|
||||
- name: Verify CMake configuration files
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
|
||||
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
|
||||
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
||||
cmake --build cmake_config_build --verbose
|
||||
- name: Verify sdl2-config
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
|
||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
|
||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||
cmake/test/test_pkgconfig.sh
|
||||
- name: Verify Android.mk
|
||||
if: ${{ matrix.platform.name == 'CMake' }}
|
||||
run: |
|
||||
export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules
|
||||
ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1
|
48
.github/workflows/build.yml
vendored
48
.github/workflows/build.yml
vendored
@@ -1,48 +0,0 @@
|
||||
name: 'Build (All)'
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
controller:
|
||||
name: 'Create test plan'
|
||||
runs-on: 'ubuntu-latest'
|
||||
outputs:
|
||||
platforms-level1: ${{ steps.plan.outputs.platforms-level1 }}
|
||||
platforms-others: ${{ steps.plan.outputs.platforms-others }}
|
||||
steps:
|
||||
- uses: actions/setup-python@main
|
||||
with:
|
||||
python-version: 3.x
|
||||
- uses: actions/checkout@main
|
||||
with:
|
||||
sparse-checkout: '.github/workflows/create-test-plan.py'
|
||||
- name: 'Create plan'
|
||||
id: plan
|
||||
run: |
|
||||
# Adding [sdl-ci-filter GLOB] to the commit message will limit the jobs
|
||||
# e.g. [sdl-ci-filter msvc-*]
|
||||
EOF=$(openssl rand -hex 32)
|
||||
cat >/tmp/commit_message.txt <<$EOF
|
||||
${{ github.event.head_commit.message }}
|
||||
$EOF
|
||||
|
||||
python .github/workflows/create-test-plan.py \
|
||||
--github-variable-prefix platforms \
|
||||
--github-ci \
|
||||
--verbose \
|
||||
${{ (github.repository_owner != 'libsdl-org' && '--no-artifact') || '' }} \
|
||||
--commit-message-file /tmp/commit_message.txt
|
||||
level1:
|
||||
needs: [controller]
|
||||
uses: './.github/workflows/generic.yml'
|
||||
with:
|
||||
platforms: ${{ needs.controller.outputs.platforms-level1 }}
|
||||
level2:
|
||||
needs: [controller, level1]
|
||||
uses: './.github/workflows/generic.yml'
|
||||
with:
|
||||
platforms: ${{ needs.controller.outputs.platforms-others }}
|
51
.github/workflows/cpactions.yml
vendored
Normal file
51
.github/workflows/cpactions.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Build (C/P Actions)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
freebsd:
|
||||
runs-on: ubuntu-latest
|
||||
name: FreeBSD
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
uses: cross-platform-actions/action@v0.24.0
|
||||
with:
|
||||
operating_system: freebsd
|
||||
version: '13.3'
|
||||
shell: bash
|
||||
run: |
|
||||
sudo pkg update
|
||||
sudo pkg install -y \
|
||||
gmake \
|
||||
pkgconf \
|
||||
libXcursor \
|
||||
libXext \
|
||||
libXinerama \
|
||||
libXi \
|
||||
libXfixes \
|
||||
libXrandr \
|
||||
libXScrnSaver \
|
||||
libXxf86vm \
|
||||
wayland \
|
||||
wayland-protocols \
|
||||
libxkbcommon \
|
||||
mesa-libs \
|
||||
libglvnd \
|
||||
evdev-proto \
|
||||
libinotify \
|
||||
alsa-lib \
|
||||
jackit \
|
||||
pipewire \
|
||||
pulseaudio \
|
||||
sndio \
|
||||
dbus \
|
||||
zh-fcitx \
|
||||
ibus \
|
||||
libudev-devd
|
||||
mkdir build_autotools
|
||||
export CPPFLAGS="-I/usr/local/include"
|
||||
export LDFLAGS="-L/usr/local/lib"
|
||||
(cd build_autotools && ../configure --disable-static)
|
||||
gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1
|
806
.github/workflows/create-test-plan.py
vendored
806
.github/workflows/create-test-plan.py
vendored
@@ -1,806 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import dataclasses
|
||||
import fnmatch
|
||||
from enum import Enum
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from typing import Optional
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AppleArch(Enum):
|
||||
ARM64 = "arm64"
|
||||
X86_64 = "x86_64"
|
||||
|
||||
|
||||
class MsvcArch(Enum):
|
||||
X86 = "x86"
|
||||
X64 = "x64"
|
||||
Arm32 = "arm"
|
||||
Arm64 = "arm64"
|
||||
|
||||
|
||||
class JobOs(Enum):
|
||||
WindowsLatest = "windows-latest"
|
||||
UbuntuLatest = "ubuntu-latest"
|
||||
MacosLatest = "macos-latest"
|
||||
Ubuntu22_04 = "ubuntu-22.04"
|
||||
Ubuntu24_04 = "ubuntu-24.04"
|
||||
Macos13 = "macos-13"
|
||||
|
||||
|
||||
class SdlPlatform(Enum):
|
||||
Android = "android"
|
||||
Emscripten = "emscripten"
|
||||
Haiku = "haiku"
|
||||
Msys2 = "msys2"
|
||||
Linux = "linux"
|
||||
MacOS = "macos"
|
||||
Ios = "ios"
|
||||
Tvos = "tvos"
|
||||
Msvc = "msvc"
|
||||
N3ds = "n3ds"
|
||||
Ps2 = "ps2"
|
||||
Psp = "psp"
|
||||
Vita = "vita"
|
||||
Riscos = "riscos"
|
||||
FreeBSD = "freebsd"
|
||||
NetBSD = "netbsd"
|
||||
OpenBSD = "openbsd"
|
||||
Watcom = "watcom"
|
||||
|
||||
|
||||
class Msys2Platform(Enum):
|
||||
Mingw32 = "mingw32"
|
||||
Mingw64 = "mingw64"
|
||||
Clang64 = "clang64"
|
||||
Ucrt64 = "ucrt64"
|
||||
|
||||
|
||||
class IntelCompiler(Enum):
|
||||
Icx = "icx"
|
||||
|
||||
|
||||
class VitaGLES(Enum):
|
||||
Pib = "pib"
|
||||
Pvr = "pvr"
|
||||
|
||||
class WatcomPlatform(Enum):
|
||||
Windows = "windows"
|
||||
OS2 = "OS/2"
|
||||
|
||||
|
||||
@dataclasses.dataclass(slots=True)
|
||||
class JobSpec:
|
||||
name: str
|
||||
os: JobOs
|
||||
platform: SdlPlatform
|
||||
artifact: Optional[str]
|
||||
container: Optional[str] = None
|
||||
autotools: bool = False
|
||||
no_cmake: bool = False
|
||||
xcode: bool = False
|
||||
android_mk: bool = False
|
||||
lean: bool = False
|
||||
android_arch: Optional[str] = None
|
||||
android_abi: Optional[str] = None
|
||||
android_platform: Optional[int] = None
|
||||
msys2_platform: Optional[Msys2Platform] = None
|
||||
intel: Optional[IntelCompiler] = None
|
||||
apple_archs: Optional[set[AppleArch]] = None
|
||||
msvc_project: Optional[str] = None
|
||||
msvc_arch: Optional[MsvcArch] = None
|
||||
msvc_static_crt: bool = False
|
||||
clang_cl: bool = False
|
||||
gdk: bool = False
|
||||
uwp: bool = False
|
||||
vita_gles: Optional[VitaGLES] = None
|
||||
watcom_platform: Optional[WatcomPlatform] = None
|
||||
|
||||
|
||||
JOB_SPECS = {
|
||||
"msys2-mingw32": JobSpec(name="Windows (msys2, mingw32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32", msys2_platform=Msys2Platform.Mingw32, ),
|
||||
"msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ),
|
||||
"msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ),
|
||||
"msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ),
|
||||
"msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ),
|
||||
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
|
||||
"msvc-static-x86": JobSpec(name="Windows (MSVC, static VCRT, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_static_crt=True, ),
|
||||
"msvc-static-x64": JobSpec(name="Windows (MSVC, static VCRT, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_static_crt=True, ),
|
||||
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
|
||||
"msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ),
|
||||
"msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ),
|
||||
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
|
||||
"msvc-uwp-x64": JobSpec(name="UWP (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-UWP", msvc_arch=MsvcArch.X64, msvc_project="VisualC-WinRT/SDL-UWP.sln", uwp=True, ),
|
||||
"msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ),
|
||||
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", autotools=True),
|
||||
"steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ),
|
||||
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
|
||||
"macos-gnu-arm64-x64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-x64-gnu",autotools=True, apple_archs={AppleArch.X86_64, AppleArch.ARM64, }, ),
|
||||
"ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ),
|
||||
"tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ),
|
||||
"android-cmake": JobSpec(name="Android (CMake)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, ),
|
||||
"android-mk": JobSpec(name="Android (Android.mk)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_mk=True, ),
|
||||
"emscripten": JobSpec(name="Emscripten", os=JobOs.UbuntuLatest, platform=SdlPlatform.Emscripten, artifact="SDL-emscripten", ),
|
||||
"haiku": JobSpec(name="Haiku", os=JobOs.UbuntuLatest, platform=SdlPlatform.Haiku, artifact="SDL-haiku-x64", container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ),
|
||||
"n3ds": JobSpec(name="Nintendo 3DS", os=JobOs.UbuntuLatest, platform=SdlPlatform.N3ds, artifact="SDL-n3ds", container="devkitpro/devkitarm:latest", ),
|
||||
"ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ),
|
||||
"psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ),
|
||||
"vita-pib": JobSpec(name="Sony PlayStation Vita (GLES w/ pib)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pib", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pib, ),
|
||||
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
|
||||
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
|
||||
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", autotools=True, ),
|
||||
"openbsd": JobSpec(name="OpenBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.OpenBSD, artifact="SDL-openbsd-x64", autotools=True, ),
|
||||
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", autotools=True, ),
|
||||
"watcom-win32": JobSpec(name="Watcom (Windows)", os=JobOs.WindowsLatest, platform=SdlPlatform.Watcom, artifact="SDL-watcom-win32", no_cmake=True, watcom_platform=WatcomPlatform.Windows ),
|
||||
"watcom-os2": JobSpec(name="Watcom (OS/2)", os=JobOs.WindowsLatest, platform=SdlPlatform.Watcom, artifact="SDL-watcom-win32", no_cmake=True, watcom_platform=WatcomPlatform.OS2 ),
|
||||
# "watcom-win32"
|
||||
# "watcom-os2"
|
||||
}
|
||||
|
||||
|
||||
class StaticLibType(Enum):
|
||||
MSVC = "SDL2-static.lib"
|
||||
A = "libSDL2.a"
|
||||
|
||||
|
||||
class SharedLibType(Enum):
|
||||
WIN32 = "SDL2.dll"
|
||||
SO_0 = "libSDL2-2.0.so.0"
|
||||
SO = "libSDL2.so"
|
||||
DYLIB = "libSDL2-2.0.0.dylib"
|
||||
FRAMEWORK = "SDL2.framework/Versions/A/SDL2"
|
||||
|
||||
|
||||
@dataclasses.dataclass(slots=True)
|
||||
class JobDetails:
|
||||
name: str
|
||||
key: str
|
||||
os: str
|
||||
platform: str
|
||||
artifact: str
|
||||
no_autotools: bool
|
||||
no_cmake: bool
|
||||
build_autotools_tests: bool = True
|
||||
build_tests: bool = True
|
||||
container: str = ""
|
||||
cmake_build_type: str = "RelWithDebInfo"
|
||||
shell: str = "sh"
|
||||
sudo: str = "sudo"
|
||||
cmake_config_emulator: str = ""
|
||||
apk_packages: list[str] = dataclasses.field(default_factory=list)
|
||||
apt_packages: list[str] = dataclasses.field(default_factory=list)
|
||||
brew_packages: list[str] = dataclasses.field(default_factory=list)
|
||||
cmake_toolchain_file: str = ""
|
||||
cmake_arguments: list[str] = dataclasses.field(default_factory=list)
|
||||
cmake_generator: str = "Ninja"
|
||||
cmake_build_arguments: list[str] = dataclasses.field(default_factory=list)
|
||||
cppflags: list[str] = dataclasses.field(default_factory=list)
|
||||
cc: str = ""
|
||||
cxx: str = ""
|
||||
cflags: list[str] = dataclasses.field(default_factory=list)
|
||||
cxxflags: list[str] = dataclasses.field(default_factory=list)
|
||||
ldflags: list[str] = dataclasses.field(default_factory=list)
|
||||
pollute_directories: list[str] = dataclasses.field(default_factory=list)
|
||||
use_cmake: bool = True
|
||||
shared: bool = True
|
||||
static: bool = True
|
||||
shared_lib: Optional[SharedLibType] = None
|
||||
static_lib: Optional[StaticLibType] = None
|
||||
run_tests: bool = True
|
||||
test_pkg_config: bool = True
|
||||
cc_from_cmake: bool = False
|
||||
source_cmd: str = ""
|
||||
pretest_cmd: str = ""
|
||||
android_apks: list[str] = dataclasses.field(default_factory=list)
|
||||
android_ndk: bool = False
|
||||
android_mk: bool = False
|
||||
minidump: bool = False
|
||||
intel: bool = False
|
||||
msys2_msystem: str = ""
|
||||
msys2_env: str = ""
|
||||
msys2_no_perl: bool = False
|
||||
werror: bool = True
|
||||
msvc_vcvars_arch: str = ""
|
||||
msvc_vcvars_sdk: str = ""
|
||||
msvc_project: str = ""
|
||||
msvc_project_flags: list[str] = dataclasses.field(default_factory=list)
|
||||
setup_ninja: bool = False
|
||||
setup_libusb_arch: str = ""
|
||||
xcode_sdk: str = ""
|
||||
xcode_target: str = ""
|
||||
setup_gdk_folder: str = ""
|
||||
cpactions: bool = False
|
||||
cpactions_os: str = ""
|
||||
cpactions_version: str = ""
|
||||
cpactions_arch: str = ""
|
||||
cpactions_setup_cmd: str = ""
|
||||
cpactions_install_cmd: str = ""
|
||||
setup_vita_gles_type: str = ""
|
||||
check_sources: bool = False
|
||||
watcom_makefile: str = ""
|
||||
binutils_strings: str = "strings"
|
||||
|
||||
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
|
||||
data = {
|
||||
"name": self.name,
|
||||
"key": self.key,
|
||||
"os": self.os,
|
||||
"container": self.container if self.container else "",
|
||||
"platform": self.platform,
|
||||
"artifact": self.artifact,
|
||||
"enable-artifacts": enable_artifacts,
|
||||
"shell": self.shell,
|
||||
"msys2-msystem": self.msys2_msystem,
|
||||
"msys2-env": self.msys2_env,
|
||||
"msys2-no-perl": self.msys2_no_perl,
|
||||
"android-ndk": self.android_ndk,
|
||||
"intel": self.intel,
|
||||
"apk-packages": my_shlex_join(self.apk_packages),
|
||||
"apt-packages": my_shlex_join(self.apt_packages),
|
||||
"test-pkg-config": self.test_pkg_config,
|
||||
"brew-packages": my_shlex_join(self.brew_packages),
|
||||
"pollute-directories": my_shlex_join(self.pollute_directories),
|
||||
"no-autotools": self.no_autotools,
|
||||
"no-cmake": self.no_cmake,
|
||||
"build-autotools-tests": self.build_autotools_tests,
|
||||
"build-tests": self.build_tests,
|
||||
"source-cmd": self.source_cmd,
|
||||
"pretest-cmd": self.pretest_cmd,
|
||||
"cmake-config-emulator": self.cmake_config_emulator,
|
||||
"cc": self.cc,
|
||||
"cxx": self.cxx,
|
||||
"cflags": my_shlex_join(self.cppflags + self.cflags),
|
||||
"cxxflags": my_shlex_join(self.cppflags + self.cxxflags),
|
||||
"ldflags": my_shlex_join(self.ldflags),
|
||||
"cmake-generator": self.cmake_generator,
|
||||
"cmake-toolchain-file": self.cmake_toolchain_file,
|
||||
"cmake-arguments": my_shlex_join(self.cmake_arguments),
|
||||
"cmake-build-arguments": my_shlex_join(self.cmake_build_arguments),
|
||||
"shared": self.shared,
|
||||
"static": self.static,
|
||||
"shared-lib": self.shared_lib.value if self.shared_lib else None,
|
||||
"static-lib": self.static_lib.value if self.static_lib else None,
|
||||
"cmake-build-type": self.cmake_build_type,
|
||||
"run-tests": self.run_tests,
|
||||
"android-apks": my_shlex_join(self.android_apks),
|
||||
"android-mk": self.android_mk,
|
||||
"werror": self.werror,
|
||||
"sudo": self.sudo,
|
||||
"msvc-vcvars-arch": self.msvc_vcvars_arch,
|
||||
"msvc-vcvars-sdk": self.msvc_vcvars_sdk,
|
||||
"msvc-project": self.msvc_project,
|
||||
"msvc-project-flags": my_shlex_join(self.msvc_project_flags),
|
||||
"setup-ninja": self.setup_ninja,
|
||||
"setup-libusb-arch": self.setup_libusb_arch,
|
||||
"cc-from-cmake": self.cc_from_cmake,
|
||||
"xcode-sdk": self.xcode_sdk,
|
||||
"xcode-target": self.xcode_target,
|
||||
"cpactions": self.cpactions,
|
||||
"cpactions-os": self.cpactions_os,
|
||||
"cpactions-version": self.cpactions_version,
|
||||
"cpactions-arch": self.cpactions_arch,
|
||||
"cpactions-setup-cmd": self.cpactions_setup_cmd,
|
||||
"cpactions-install-cmd": self.cpactions_install_cmd,
|
||||
"setup-vita-gles-type": self.setup_vita_gles_type,
|
||||
"setup-gdk-folder": self.setup_gdk_folder,
|
||||
"check-sources": self.check_sources,
|
||||
"watcom-makefile": self.watcom_makefile,
|
||||
"binutils-strings": self.binutils_strings,
|
||||
}
|
||||
return {k: v for k, v in data.items() if v != ""}
|
||||
|
||||
|
||||
def my_shlex_join(s):
|
||||
def escape(s):
|
||||
if s[:1] == "'" and s[-1:] == "'":
|
||||
return s
|
||||
if set(s).intersection(set("; \t")):
|
||||
s = s.replace("\\", "\\\\").replace("\"", "\\\"")
|
||||
return f'"{s}"'
|
||||
return s
|
||||
|
||||
return " ".join(escape(e) for e in s)
|
||||
|
||||
|
||||
def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDetails:
|
||||
job = JobDetails(
|
||||
name=spec.name,
|
||||
key=key,
|
||||
os=spec.os.value,
|
||||
artifact=spec.artifact or "",
|
||||
container=spec.container or "",
|
||||
platform=spec.platform.value,
|
||||
sudo="sudo",
|
||||
no_autotools=not spec.autotools,
|
||||
no_cmake=spec.no_cmake,
|
||||
)
|
||||
if job.os.startswith("ubuntu"):
|
||||
job.apt_packages.extend([
|
||||
"ninja-build",
|
||||
"pkg-config",
|
||||
])
|
||||
if spec.msvc_static_crt:
|
||||
job.cmake_arguments.append("-DSDL_FORCE_STATIC_VCRT=ON")
|
||||
pretest_cmd = []
|
||||
if trackmem_symbol_names:
|
||||
pretest_cmd.append("export SDL_TRACKMEM_SYMBOL_NAMES=1")
|
||||
else:
|
||||
pretest_cmd.append("export SDL_TRACKMEM_SYMBOL_NAMES=0")
|
||||
win32 = spec.platform in (SdlPlatform.Msys2, SdlPlatform.Msvc)
|
||||
fpic = None
|
||||
build_parallel = True
|
||||
if spec.lean:
|
||||
job.cppflags.append("-DSDL_LEAN_AND_MEAN=1")
|
||||
if win32:
|
||||
job.cmake_arguments.append("-DSDLTEST_PROCDUMP=ON")
|
||||
job.minidump = True
|
||||
if spec.intel is not None:
|
||||
match spec.intel:
|
||||
case IntelCompiler.Icx:
|
||||
job.cc = "icx"
|
||||
job.cxx = "icpx"
|
||||
case _:
|
||||
raise ValueError(f"Invalid intel={spec.intel}")
|
||||
job.source_cmd = f"source /opt/intel/oneapi/setvars.sh;"
|
||||
job.intel = True
|
||||
job.shell = "bash"
|
||||
job.cmake_arguments.extend((
|
||||
f"-DCMAKE_C_COMPILER={job.cc}",
|
||||
f"-DCMAKE_CXX_COMPILER={job.cxx}",
|
||||
"-DCMAKE_SYSTEM_NAME=Linux",
|
||||
))
|
||||
match spec.platform:
|
||||
case SdlPlatform.Msvc:
|
||||
job.setup_ninja = not spec.gdk
|
||||
job.msvc_project = spec.msvc_project if spec.msvc_project else ""
|
||||
job.msvc_project_flags.append("-p:TreatWarningsAsError=true")
|
||||
job.test_pkg_config = False
|
||||
job.shared_lib = SharedLibType.WIN32
|
||||
job.static_lib = StaticLibType.MSVC
|
||||
job.cmake_arguments.extend((
|
||||
"-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase",
|
||||
"-DCMAKE_EXE_LINKER_FLAGS=-DEBUG",
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS=-DEBUG",
|
||||
))
|
||||
if spec.uwp:
|
||||
job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>DLL'")
|
||||
else:
|
||||
job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>'")
|
||||
|
||||
if spec.clang_cl:
|
||||
job.cmake_arguments.extend((
|
||||
"-DCMAKE_C_COMPILER=clang-cl",
|
||||
"-DCMAKE_CXX_COMPILER=clang-cl",
|
||||
))
|
||||
match spec.msvc_arch:
|
||||
case MsvcArch.X86:
|
||||
job.cflags.append("/clang:-m32")
|
||||
job.ldflags.append("/MACHINE:X86")
|
||||
case MsvcArch.X64:
|
||||
job.cflags.append("/clang:-m64")
|
||||
job.ldflags.append("/MACHINE:X64")
|
||||
case _:
|
||||
raise ValueError(f"Unsupported clang-cl architecture (arch={spec.msvc_arch})")
|
||||
if spec.msvc_project:
|
||||
match spec.msvc_arch:
|
||||
case MsvcArch.X86:
|
||||
msvc_platform = "Win32"
|
||||
case MsvcArch.X64:
|
||||
msvc_platform = "x64"
|
||||
case _:
|
||||
raise ValueError(f"Unsupported vcxproj architecture (arch={spec.msvc_arch})")
|
||||
if spec.gdk:
|
||||
msvc_platform = f"Gaming.Desktop.{msvc_platform}"
|
||||
job.msvc_project_flags.append(f"-p:Platform={msvc_platform}")
|
||||
match spec.msvc_arch:
|
||||
case MsvcArch.X86:
|
||||
job.msvc_vcvars_arch = "x64_x86"
|
||||
case MsvcArch.X64:
|
||||
job.msvc_vcvars_arch = "x64"
|
||||
case MsvcArch.Arm32:
|
||||
job.msvc_vcvars_arch = "x64_arm"
|
||||
job.msvc_vcvars_sdk = "10.0.22621.0" # 10.0.26100.0 dropped ARM32 um and ucrt libraries
|
||||
job.run_tests = False
|
||||
case MsvcArch.Arm64:
|
||||
job.msvc_vcvars_arch = "x64_arm64"
|
||||
job.run_tests = False
|
||||
if spec.uwp:
|
||||
job.build_tests = False
|
||||
job.cmake_arguments.extend((
|
||||
"-DCMAKE_SYSTEM_NAME=WindowsStore",
|
||||
"-DCMAKE_SYSTEM_VERSION=10.0",
|
||||
))
|
||||
job.msvc_project_flags.append("-p:WindowsTargetPlatformVersion=10.0.17763.0")
|
||||
elif spec.gdk:
|
||||
job.setup_gdk_folder = "VisualC-GDK"
|
||||
else:
|
||||
match spec.msvc_arch:
|
||||
case MsvcArch.X86:
|
||||
job.setup_libusb_arch = "x86"
|
||||
case MsvcArch.X64:
|
||||
job.setup_libusb_arch = "x64"
|
||||
case SdlPlatform.Linux:
|
||||
if spec.name.startswith("Ubuntu"):
|
||||
assert spec.os.value.startswith("ubuntu-")
|
||||
job.apt_packages.extend((
|
||||
"gnome-desktop-testing",
|
||||
"libasound2-dev",
|
||||
"libpulse-dev",
|
||||
"libaudio-dev",
|
||||
"libjack-dev",
|
||||
"libsndio-dev",
|
||||
"libusb-1.0-0-dev",
|
||||
"libx11-dev",
|
||||
"libxext-dev",
|
||||
"libxrandr-dev",
|
||||
"libxcursor-dev",
|
||||
"libxfixes-dev",
|
||||
"libxi-dev",
|
||||
"libxss-dev",
|
||||
"libwayland-dev",
|
||||
"libxkbcommon-dev",
|
||||
"libdrm-dev",
|
||||
"libgbm-dev",
|
||||
"libgl1-mesa-dev",
|
||||
"libgles2-mesa-dev",
|
||||
"libegl1-mesa-dev",
|
||||
"libdbus-1-dev",
|
||||
"libibus-1.0-dev",
|
||||
"libudev-dev",
|
||||
"fcitx-libs-dev",
|
||||
))
|
||||
ubuntu_year, ubuntu_month = [int(v) for v in spec.os.value.removeprefix("ubuntu-").split(".", 1)]
|
||||
if ubuntu_year >= 22:
|
||||
job.apt_packages.extend(("libpipewire-0.3-dev", "libdecor-0-dev"))
|
||||
job.apt_packages.extend((
|
||||
"libunwind-dev", # For SDL_test memory tracking
|
||||
))
|
||||
if trackmem_symbol_names:
|
||||
# older libunwind is slow
|
||||
job.cmake_arguments.append("-DSDLTEST_TIMEOUT_MULTIPLIER=2")
|
||||
job.shared_lib = SharedLibType.SO_0
|
||||
job.static_lib = StaticLibType.A
|
||||
fpic = True
|
||||
case SdlPlatform.Ios | SdlPlatform.Tvos:
|
||||
job.brew_packages.extend([
|
||||
"ninja",
|
||||
])
|
||||
job.run_tests = False
|
||||
job.test_pkg_config = False
|
||||
job.shared_lib = SharedLibType.DYLIB
|
||||
job.static_lib = StaticLibType.A
|
||||
match spec.platform:
|
||||
case SdlPlatform.Ios:
|
||||
if spec.xcode:
|
||||
job.xcode_sdk = "iphoneos"
|
||||
job.xcode_target = "Static Library-iOS"
|
||||
job.cmake_arguments.extend([
|
||||
"-DCMAKE_SYSTEM_NAME=iOS",
|
||||
"-DCMAKE_OSX_ARCHITECTURES=\"arm64\"",
|
||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0",
|
||||
])
|
||||
case SdlPlatform.Tvos:
|
||||
if spec.xcode:
|
||||
job.xcode_sdk = "appletvos"
|
||||
job.xcode_target = "Static Library-tvOS"
|
||||
job.cmake_arguments.extend([
|
||||
"-DCMAKE_SYSTEM_NAME=tvOS",
|
||||
"-DCMAKE_OSX_ARCHITECTURES=\"arm64\"",
|
||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0",
|
||||
])
|
||||
case SdlPlatform.MacOS:
|
||||
osx_arch = ";".join(e.value for e in spec.apple_archs) if spec.apple_archs else "arm64"
|
||||
job.cmake_arguments.extend((
|
||||
f"'-DCMAKE_OSX_ARCHITECTURES={osx_arch}'",
|
||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11",
|
||||
))
|
||||
job.build_autotools_tests = False
|
||||
job.shared_lib = SharedLibType.DYLIB
|
||||
job.static_lib = StaticLibType.A
|
||||
job.apt_packages = []
|
||||
job.brew_packages.extend((
|
||||
"autoconf",
|
||||
"ninja",
|
||||
))
|
||||
if spec.xcode:
|
||||
job.xcode_sdk = "macosx"
|
||||
case SdlPlatform.Android:
|
||||
job.android_mk = spec.android_mk
|
||||
job.run_tests = False
|
||||
job.shared_lib = SharedLibType.SO
|
||||
job.static_lib = StaticLibType.A
|
||||
if spec.android_mk or not spec.no_cmake:
|
||||
job.android_ndk = True
|
||||
if spec.android_mk:
|
||||
job.apt_packages = []
|
||||
if not spec.no_cmake:
|
||||
job.cmake_arguments.extend((
|
||||
f"-DANDROID_PLATFORM={spec.android_platform}",
|
||||
f"-DANDROID_ABI={spec.android_abi}",
|
||||
))
|
||||
job.cmake_toolchain_file = "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
|
||||
job.cc = f"${{ANDROID_NDK_HOME}}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target={spec.android_arch}-none-linux-androideabi{spec.android_platform}"
|
||||
|
||||
job.android_apks = [
|
||||
"testaudiorecording-apk",
|
||||
"testautomation-apk",
|
||||
"testcontroller-apk",
|
||||
"testmultiaudio-apk",
|
||||
"testsprite-apk",
|
||||
]
|
||||
case SdlPlatform.Emscripten:
|
||||
job.run_tests = False
|
||||
job.shared = False
|
||||
job.cmake_config_emulator = "emcmake"
|
||||
job.cmake_build_type = "Debug"
|
||||
job.test_pkg_config = False
|
||||
job.cmake_arguments.extend((
|
||||
"-DSDLTEST_BROWSER=chrome",
|
||||
"-DSDLTEST_TIMEOUT_MULTIPLIER=4",
|
||||
"-DSDLTEST_CHROME_BINARY=${CHROME_BINARY}",
|
||||
))
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Ps2:
|
||||
build_parallel = False
|
||||
job.shared = False
|
||||
job.sudo = ""
|
||||
job.apt_packages = []
|
||||
job.apk_packages = ["cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", "git", ]
|
||||
job.cmake_toolchain_file = "${PS2DEV}/ps2sdk/ps2dev.cmake"
|
||||
job.run_tests = False
|
||||
job.shared = False
|
||||
job.cc = "mips64r5900el-ps2-elf-gcc"
|
||||
job.ldflags = ["-L${PS2DEV}/ps2sdk/ee/lib", "-L${PS2DEV}/gsKit/lib", "-L${PS2DEV}/ps2sdk/ports/lib", ]
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Psp:
|
||||
build_parallel = False
|
||||
job.sudo = ""
|
||||
job.apt_packages = []
|
||||
job.apk_packages = ["cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", ]
|
||||
job.cmake_toolchain_file = "${PSPDEV}/psp/share/pspdev.cmake"
|
||||
job.run_tests = False
|
||||
job.shared = False
|
||||
job.cc = "psp-gcc"
|
||||
job.ldflags = ["-L${PSPDEV}/lib", "-L${PSPDEV}/psp/lib", "-L${PSPDEV}/psp/sdk/lib", ]
|
||||
job.pollute_directories = ["${PSPDEV}/include", "${PSPDEV}/psp/include", "${PSPDEV}/psp/sdk/include", ]
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Vita:
|
||||
job.sudo = ""
|
||||
job.apt_packages = []
|
||||
job.apk_packages = ["cmake", "ninja", "pkgconf", "bash", "tar"]
|
||||
job.cmake_toolchain_file = "${VITASDK}/share/vita.toolchain.cmake"
|
||||
assert spec.vita_gles is not None
|
||||
job.setup_vita_gles_type = {
|
||||
VitaGLES.Pib: "pib",
|
||||
VitaGLES.Pvr: "pvr",
|
||||
}[spec.vita_gles]
|
||||
job.cmake_arguments.extend((
|
||||
f"-DVIDEO_VITA_PIB={ 'true' if spec.vita_gles == VitaGLES.Pib else 'false' }",
|
||||
f"-DVIDEO_VITA_PVR={ 'true' if spec.vita_gles == VitaGLES.Pvr else 'false' }",
|
||||
"-DSDL_ARMNEON=ON",
|
||||
"-DSDL_ARMSIMD=ON",
|
||||
))
|
||||
# Fix vita.toolchain.cmake (https://github.com/vitasdk/vita-toolchain/pull/253)
|
||||
job.source_cmd = r"""sed -i -E "s#set\\( PKG_CONFIG_EXECUTABLE \"\\$\\{VITASDK}/bin/arm-vita-eabi-pkg-config\" \\)#set\\( PKG_CONFIG_EXECUTABLE \"${VITASDK}/bin/arm-vita-eabi-pkg-config\" CACHE PATH \"Path of pkg-config executable\" \\)#" ${VITASDK}/share/vita.toolchain.cmake"""
|
||||
job.run_tests = False
|
||||
job.shared = False
|
||||
job.cc = "arm-vita-eabi-gcc"
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Haiku:
|
||||
fpic = False
|
||||
job.build_autotools_tests = False
|
||||
job.run_tests = False
|
||||
job.cc = "x86_64-unknown-haiku-gcc"
|
||||
job.cxx = "x86_64-unknown-haiku-g++"
|
||||
job.sudo = ""
|
||||
job.cmake_arguments.extend((
|
||||
f"-DCMAKE_C_COMPILER={job.cc}",
|
||||
f"-DCMAKE_CXX_COMPILER={job.cxx}",
|
||||
"-DSDL_UNIX_CONSOLE_BUILD=ON",
|
||||
))
|
||||
job.shared_lib = SharedLibType.SO_0
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.N3ds:
|
||||
job.cmake_generator = "Unix Makefiles"
|
||||
job.cmake_build_arguments.append("-j$(nproc)")
|
||||
job.shared = False
|
||||
job.apt_packages = []
|
||||
job.run_tests = False
|
||||
job.cc_from_cmake = True
|
||||
job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake"
|
||||
job.binutils_strings = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-strings"
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Msys2:
|
||||
job.shell = "msys2 {0}"
|
||||
assert spec.msys2_platform
|
||||
job.msys2_msystem = spec.msys2_platform.value
|
||||
job.msys2_env = {
|
||||
"mingw32": "mingw-w64-i686",
|
||||
"mingw64": "mingw-w64-x86_64",
|
||||
"clang32": "mingw-w64-clang-i686",
|
||||
"clang64": "mingw-w64-clang-x86_64",
|
||||
"ucrt64": "mingw-w64-ucrt-x86_64",
|
||||
}[spec.msys2_platform.value]
|
||||
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, )
|
||||
job.shared_lib = SharedLibType.WIN32
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Riscos:
|
||||
# FIXME: Enable SDL_WERROR
|
||||
job.werror = False
|
||||
job.build_autotools_tests = False
|
||||
job.apt_packages = ["cmake", "ninja-build"]
|
||||
job.test_pkg_config = False
|
||||
job.shared = False
|
||||
job.run_tests = False
|
||||
job.sudo = ""
|
||||
job.cmake_arguments.extend((
|
||||
"-DRISCOS:BOOL=ON",
|
||||
"-DCMAKE_DISABLE_PRECOMPILE_HEADERS:BOOL=ON",
|
||||
"-DSDL_GCC_ATOMICS:BOOL=OFF",
|
||||
))
|
||||
job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake"
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD | SdlPlatform.OpenBSD:
|
||||
job.build_autotools_tests = False
|
||||
job.cpactions = True
|
||||
job.no_cmake = True
|
||||
job.run_tests = False
|
||||
job.apt_packages = []
|
||||
job.shared_lib = SharedLibType.SO_0
|
||||
job.static_lib = StaticLibType.A
|
||||
match spec.platform:
|
||||
case SdlPlatform.FreeBSD:
|
||||
job.cpactions_os = "freebsd"
|
||||
job.cpactions_version = "14.2"
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "sudo pkg update"
|
||||
job.cpactions_install_cmd = "sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd"
|
||||
job.cmake_arguments.extend((
|
||||
"-DSDL_CHECK_REQUIRED_INCLUDES=/usr/local/include",
|
||||
"-DSDL_CHECK_REQUIRED_LINK_OPTIONS=-L/usr/local/lib",
|
||||
))
|
||||
case SdlPlatform.NetBSD:
|
||||
job.cpactions_os = "netbsd"
|
||||
job.cpactions_version = "10.1"
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update"
|
||||
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
|
||||
case SdlPlatform.OpenBSD:
|
||||
job.cpactions_os = "openbsd"
|
||||
job.cpactions_version = "7.4"
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "sudo pkg_add -u"
|
||||
job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols xwayland libxkbcommon libinotify pulseaudio dbus ibus"
|
||||
case SdlPlatform.Watcom:
|
||||
match spec.watcom_platform:
|
||||
case WatcomPlatform.OS2:
|
||||
job.watcom_makefile = "Makefile.os2"
|
||||
job.run_tests = False
|
||||
case WatcomPlatform.Windows:
|
||||
job.watcom_makefile = "Makefile.w32"
|
||||
job.run_tests = True
|
||||
case _:
|
||||
raise ValueError(f"Unsupported watcom_platform=${spec.watcom_platform}")
|
||||
case _:
|
||||
raise ValueError(f"Unsupported platform={spec.platform}")
|
||||
|
||||
if "ubuntu" in spec.name.lower():
|
||||
job.check_sources = True
|
||||
|
||||
if not build_parallel:
|
||||
job.cmake_build_arguments.append("-j1")
|
||||
if job.cflags:
|
||||
job.cmake_arguments.append(f"-DCMAKE_C_FLAGS={my_shlex_join(job.cflags)}")
|
||||
if job.cxxflags:
|
||||
job.cmake_arguments.append(f"-DCMAKE_CXX_FLAGS={my_shlex_join(job.cxxflags)}")
|
||||
if job.ldflags:
|
||||
job.cmake_arguments.append(f"-DCMAKE_SHARED_LINKER_FLAGS={my_shlex_join(job.ldflags)}")
|
||||
job.cmake_arguments.append(f"-DCMAKE_EXE_LINKER_FLAGS={my_shlex_join(job.ldflags)}")
|
||||
job.pretest_cmd = "\n".join(pretest_cmd)
|
||||
def tf(b):
|
||||
return "ON" if b else "OFF"
|
||||
|
||||
if fpic is not None:
|
||||
job.cmake_arguments.append(f"-DCMAKE_POSITION_INDEPENDENT_CODE={tf(fpic)}")
|
||||
|
||||
if job.no_cmake:
|
||||
job.cmake_arguments = []
|
||||
|
||||
return job
|
||||
|
||||
|
||||
def spec_to_platform(spec: JobSpec, key: str, enable_artifacts: bool, trackmem_symbol_names: bool) -> dict[str, str|bool]:
|
||||
logger.info("spec=%r", spec)
|
||||
job = spec_to_job(spec, key=key, trackmem_symbol_names=trackmem_symbol_names)
|
||||
logger.info("job=%r", job)
|
||||
platform = job.to_workflow(enable_artifacts=enable_artifacts)
|
||||
logger.info("platform=%r", platform)
|
||||
return platform
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(allow_abbrev=False)
|
||||
parser.add_argument("--github-variable-prefix", default="platforms")
|
||||
parser.add_argument("--github-ci", action="store_true")
|
||||
parser.add_argument("--verbose", action="store_true")
|
||||
parser.add_argument("--commit-message-file")
|
||||
parser.add_argument("--no-artifact", dest="enable_artifacts", action="store_false")
|
||||
parser.add_argument("--trackmem-symbol-names", dest="trackmem_symbol_names", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=logging.INFO if args.verbose else logging.WARNING)
|
||||
|
||||
remaining_keys = set(JOB_SPECS.keys())
|
||||
|
||||
all_level_keys = (
|
||||
# Level 1
|
||||
(
|
||||
"haiku",
|
||||
),
|
||||
)
|
||||
|
||||
filters = []
|
||||
if args.commit_message_file:
|
||||
with open(args.commit_message_file, "r") as f:
|
||||
commit_message = f.read()
|
||||
for m in re.finditer(r"\[sdl-ci-filter (.*)]", commit_message, flags=re.M):
|
||||
filters.append(m.group(1).strip(" \t\n\r\t'\""))
|
||||
|
||||
if re.search(r"\[sdl-ci-artifacts?]", commit_message, flags=re.M):
|
||||
args.enable_artifacts = True
|
||||
|
||||
if re.search(r"\[sdl-ci-(full-)?trackmem(-symbol-names)?]", commit_message, flags=re.M):
|
||||
args.trackmem_symbol_names = True
|
||||
|
||||
if not filters:
|
||||
filters.append("*")
|
||||
|
||||
logger.info("filters: %r", filters)
|
||||
|
||||
all_level_platforms = {}
|
||||
|
||||
all_platforms = {key: spec_to_platform(spec, key=key, enable_artifacts=args.enable_artifacts, trackmem_symbol_names=args.trackmem_symbol_names) for key, spec in JOB_SPECS.items()}
|
||||
|
||||
for level_i, level_keys in enumerate(all_level_keys, 1):
|
||||
level_key = f"level{level_i}"
|
||||
logger.info("Level %d: keys=%r", level_i, level_keys)
|
||||
assert all(k in remaining_keys for k in level_keys)
|
||||
level_platforms = tuple(all_platforms[key] for key in level_keys)
|
||||
remaining_keys.difference_update(level_keys)
|
||||
all_level_platforms[level_key] = level_platforms
|
||||
logger.info("=" * 80)
|
||||
|
||||
logger.info("Keys before filter: %r", remaining_keys)
|
||||
|
||||
filtered_remaining_keys = set()
|
||||
for filter in filters:
|
||||
filtered_remaining_keys.update(fnmatch.filter(remaining_keys, filter))
|
||||
|
||||
logger.info("Keys after filter: %r", filtered_remaining_keys)
|
||||
|
||||
remaining_keys = filtered_remaining_keys
|
||||
|
||||
logger.info("Remaining: %r", remaining_keys)
|
||||
all_level_platforms["others"] = tuple(all_platforms[key] for key in remaining_keys)
|
||||
|
||||
if args.github_ci:
|
||||
for level, platforms in all_level_platforms.items():
|
||||
platforms_json = json.dumps(platforms)
|
||||
txt = f"{args.github_variable_prefix}-{level}={platforms_json}"
|
||||
logger.info("%s", txt)
|
||||
if "GITHUB_OUTPUT" in os.environ:
|
||||
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
|
||||
f.write(txt)
|
||||
f.write("\n")
|
||||
else:
|
||||
logger.warning("GITHUB_OUTPUT not defined")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
45
.github/workflows/emscripten.yml
vendored
Normal file
45
.github/workflows/emscripten.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Build (Emscripten)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
emscripten:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: 3.1.35
|
||||
- name: Install ninja
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get install -y ninja-build
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
emcmake cmake -S . -B build \
|
||||
-DSDL_WERROR=ON \
|
||||
-DSDL_TESTS=ON \
|
||||
-DSDL_INSTALL_TESTS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix \
|
||||
-GNinja
|
||||
- name: Build
|
||||
run: cmake --build build/ --verbose
|
||||
- name: Run build-time tests
|
||||
run: |
|
||||
set -eu
|
||||
export SDL_TESTS_QUICK=1
|
||||
# FIXME: enable Emscripten build time tests
|
||||
# ctest -VV --test-dir build/
|
||||
- name: Install
|
||||
run: |
|
||||
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
|
||||
cmake --install build/
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
emcmake cmake -S cmake/test -B cmake_config_build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DTEST_SHARED=FALSE \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
||||
cmake --build cmake_config_build --verbose
|
352
.github/workflows/generic.yml
vendored
352
.github/workflows/generic.yml
vendored
@@ -1,352 +0,0 @@
|
||||
name: 'Build'
|
||||
run-name: 'Configure, Build and Test SDL'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
platforms:
|
||||
description: 'JSON-encoded test properties'
|
||||
type: string
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
container: ${{ matrix.platform.container }}
|
||||
defaults:
|
||||
run:
|
||||
shell: ${{ matrix.platform.shell }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: ${{ fromJSON(inputs.platforms) }}
|
||||
steps:
|
||||
- name: 'Set up MSYS2'
|
||||
if: ${{ matrix.platform.platform == 'msys2' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.platform.msys2-msystem }}
|
||||
install: >-
|
||||
${{ matrix.platform.msys2-env }}-cc
|
||||
${{ matrix.platform.msys2-env }}-cmake
|
||||
${{ matrix.platform.msys2-env }}-ninja
|
||||
${{ (!matrix.platform.msys2-no-perl && format('{0}-perl', matrix.platform.msys2-env)) || '' }}
|
||||
${{ matrix.platform.msys2-env }}-pkg-config
|
||||
${{ matrix.platform.msys2-env }}-clang-tools-extra
|
||||
- name: 'About this job'
|
||||
run: |
|
||||
echo "key=${{ matrix.platform.key }}"
|
||||
echo "name=${{ matrix.platform.name }}"
|
||||
echo "os=${{ matrix.platform.os }}"
|
||||
echo ""
|
||||
echo "Add [sdl-ci-filter ${{ matrix.platform.key }}] to your commit message to reduce the number of jobs."
|
||||
- uses: actions/checkout@v4
|
||||
- name: 'Set up ninja'
|
||||
if: ${{ matrix.platform.setup-ninja }}
|
||||
uses: ./.github/actions/setup-ninja
|
||||
- uses: mymindstorm/setup-emsdk@v14
|
||||
if: ${{ matrix.platform.platform == 'emscripten' }}
|
||||
with:
|
||||
version: 3.1.35
|
||||
- uses: nttld/setup-ndk@v1
|
||||
if: ${{ matrix.platform.android-ndk }}
|
||||
id: setup-ndk
|
||||
with:
|
||||
local-cache: true
|
||||
ndk-version: r21e
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
if: ${{ matrix.platform.platform == 'msvc' }}
|
||||
with:
|
||||
arch: ${{ matrix.platform.msvc-vcvars-arch }}
|
||||
sdk: ${{ matrix.platform.msvc-vcvars-sdk }}
|
||||
- name: 'Set up Windows GDK Desktop'
|
||||
uses: ./.github/actions/setup-gdk-desktop
|
||||
if: ${{ matrix.platform.setup-gdk-folder != '' }}
|
||||
with:
|
||||
folder: '${{ matrix.platform.setup-gdk-folder }}'
|
||||
- name: 'Setup Intel oneAPI toolchain'
|
||||
id: intel
|
||||
if: ${{ matrix.platform.intel }}
|
||||
run: |
|
||||
# Download the key to system keyring
|
||||
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
|
||||
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
|
||||
|
||||
# Add signed entry to apt sources and configure the APT client to use Intel repository:
|
||||
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
|
||||
|
||||
# Update package list
|
||||
sudo apt-get update -y
|
||||
|
||||
# Install oneAPI
|
||||
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
|
||||
- name: 'Install apk packages'
|
||||
if: ${{ matrix.platform.apk-packages != '' }}
|
||||
run: |
|
||||
${{ matrix.platform.sudo }} apk update
|
||||
${{ matrix.platform.sudo }} apk add ${{ matrix.platform.apk-packages }}
|
||||
- name: 'Install apt packages'
|
||||
if: ${{ matrix.platform.apt-packages != '' }}
|
||||
run: |
|
||||
${{ matrix.platform.sudo }} apt-get update
|
||||
${{ matrix.platform.sudo }} apt-get install -y ${{ matrix.platform.apt-packages }}
|
||||
- name: 'Install brew packages'
|
||||
if: ${{ matrix.platform.brew-packages != '' }}
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
brew update
|
||||
brew install ${{ matrix.platform.brew-packages }}
|
||||
- name: 'Set up GLES for VITA' # Must be after apk
|
||||
if: ${{ matrix.platform.setup-vita-gles-type != '' }}
|
||||
uses: ./.github/actions/setup-vita-gles
|
||||
with:
|
||||
type: ${{ matrix.platform.setup-vita-gles-type }}
|
||||
|
||||
- name: 'Configure (Autotools)'
|
||||
if: ${{ !matrix.platform.no-autotools }}
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
rm -rf build-autotools
|
||||
mkdir build-autotools
|
||||
./autogen.sh
|
||||
(
|
||||
cd build-autotools
|
||||
../configure \
|
||||
--enable-vendor-info="Github Workflow" \
|
||||
--enable-werror \
|
||||
--prefix=${{ github.workspace }}/autotools_prefix \
|
||||
)
|
||||
if test "x${{ (matrix.platform.build-autotools-tests && 'yes') || 'no' }}" = "xyes" ; then
|
||||
curdir="$(pwd)"
|
||||
multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
|
||||
(
|
||||
mkdir -p build-autotools/test
|
||||
cd build-autotools/test
|
||||
../../test/configure \
|
||||
--enable-werror \
|
||||
--x-includes=/usr/include \
|
||||
--x-libraries="/usr/lib/${multiarch}" \
|
||||
--prefix=${{ github.workspace }}/autotools_prefix \
|
||||
SDL_CFLAGS="-I${curdir}/include" \
|
||||
SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
|
||||
ac_cv_lib_SDL2_ttf_TTF_Init=no \
|
||||
${NULL+}
|
||||
)
|
||||
fi
|
||||
- name: 'Build (Autotools)'
|
||||
if: ${{ !matrix.platform.no-autotools }}
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
make -j"${parallel}" -C build-autotools V=1
|
||||
if test "x${{ (matrix.platform.build-autotools-tests && 'yes') || 'no' }}" = "xyes" ; then
|
||||
make -j"${parallel}" -C build-autotools/test V=1
|
||||
fi
|
||||
- name: 'Run build-time tests (Autotools)'
|
||||
if: ${{ !matrix.platform.no-autotools && matrix.platform.build-autotools-tests && matrix.platform.run-tests }}
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
curdir="$(pwd)"
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
export SDL_TESTS_QUICK=1
|
||||
make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs"
|
||||
if test "${{ runner.os }}" = "Linux"; then
|
||||
# This should show us the SDL_REVISION
|
||||
strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL-
|
||||
fi
|
||||
- name: 'Install (Autotools)'
|
||||
if: ${{ !matrix.platform.no-autotools }}
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
curdir="$(pwd)"
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
make -j"${parallel}" -C build-autotools install V=1
|
||||
if test "x${{ (matrix.platform.build-autotools-tests && 'yes') || 'no' }}" = "xyes" ; then
|
||||
make -j"${parallel}" -C build-autotools/test install V=1
|
||||
fi
|
||||
( cd autotools_prefix; find . ) | LC_ALL=C sort -u
|
||||
echo "prefix=$(pwd)/autotools_prefix" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 'Configure (CMake)'
|
||||
if: ${{ !matrix.platform.no-cmake }}
|
||||
#shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -G "${{ matrix.platform.cmake-generator }}" \
|
||||
-Wdeprecated -Wdev -Werror \
|
||||
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
||||
-DSDL_WERROR=${{ matrix.platform.werror }} \
|
||||
-DSDL_TESTS=${{ matrix.platform.build-tests }} \
|
||||
-DSDLTEST_TRACKMEM=OFF \
|
||||
-DSDL_INSTALL_TESTS=${{ matrix.platform.build-tests }} \
|
||||
-DSDL_DISABLE_INSTALL_DOCS=OFF \
|
||||
-DSDL_DISABLE_INSTALL_DOCS=OFF \
|
||||
${{ matrix.platform.cmake-arguments }} \
|
||||
-DSDL_SHARED=${{ matrix.platform.shared }} \
|
||||
-DSDL_STATIC=${{ matrix.platform.static }} \
|
||||
-DSDL_TEST=ON \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DSDL_CMAKE_DEBUG_POSTFIX="" \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }}
|
||||
- name: 'Build (CMake)'
|
||||
id: cmake-build
|
||||
if: ${{ !matrix.platform.no-cmake }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
cmake --build build --config ${{ matrix.platform.cmake-build-type }} --verbose -- ${{ matrix.platform.cmake-build-arguments }}
|
||||
- name: 'Verify SDL_REVISION'
|
||||
if: ${{ !matrix.platform.no-cmake }}
|
||||
run: |
|
||||
echo "This should show us the SDL_REVISION"
|
||||
echo "Shared library:"
|
||||
${{ (matrix.platform.shared-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
|
||||
echo "Static library:"
|
||||
${{ (matrix.platform.static-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
|
||||
- name: 'Run build-time tests (CMake)'
|
||||
id: cmake-tests
|
||||
if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
${{ matrix.platform.pretest-cmd }}
|
||||
set -eu
|
||||
export SDL_TESTS_QUICK=1
|
||||
ctest -VV --test-dir build/ -j2
|
||||
- name: 'Install (CMake)'
|
||||
id: cmake-install
|
||||
if: ${{ steps.build.outcome == 'success' }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
cmake --install build --config ${{ matrix.platform.cmake-build-type }}
|
||||
echo "prefix=$(pwd)/prefix" >> $GITHUB_OUTPUT
|
||||
( cd prefix; find . ) | LC_ALL=C sort -u
|
||||
- name: 'Verify CMake configuration files (CMake)'
|
||||
if: ${{ steps.cmake-install.outcome == 'success' }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
${{ matrix.platform.cmake-config-emulator }} cmake -S cmake/test -B cmake_test_build -GNinja \
|
||||
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
||||
-DTEST_SHARED=${{ matrix.platform.shared }} \
|
||||
-DTEST_STATIC=${{ matrix.platform.static }} \
|
||||
${{ matrix.platform.cmake-arguments }} \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} \
|
||||
-DCMAKE_PREFIX_PATH="${{ steps.cmake-install.outputs.prefix }}"
|
||||
cmake --build cmake_test_build --verbose --config ${{ matrix.platform.cmake-build-type }} -- ${{ matrix.platform.cmake-build-arguments }}
|
||||
- name: 'Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain'
|
||||
if: ${{ steps.cmake-install.outcome == 'success' && matrix.platform.cc-from-cmake }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
cmake -S .github/cmake -B /tmp/cmake_extract \
|
||||
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} \
|
||||
-DVAR_PATH=/tmp/env.txt
|
||||
cat /tmp/env.txt >> $GITHUB_ENV
|
||||
- name: 'Verify sdl2.pc (CMake)'
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
if: ${{ steps.cmake-install.outcome == 'success' && matrix.platform.test-pkg-config }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
${{ matrix.platform.cc && format('export CC="{0}"', matrix.platform.cc) || '' }}
|
||||
${{ matrix.platform.cflags && format('export CFLAGS="{0}"', matrix.platform.cflags) || '' }}
|
||||
${{ matrix.platform.ldflags && format('export LDFLAGS="{0}"', matrix.platform.ldflags) || '' }}
|
||||
export PKG_CONFIG_PATH=${{ steps.cmake-install.outputs.prefix }}/lib/pkgconfig
|
||||
cmake/test/test_pkgconfig.sh
|
||||
- name: 'Build (cross-platform-actions, BSD)'
|
||||
id: cpactions
|
||||
if: ${{ matrix.platform.cpactions }}
|
||||
uses: cross-platform-actions/action@v0.27.0
|
||||
with:
|
||||
operating_system: '${{ matrix.platform.cpactions-os }}'
|
||||
architecture: '${{ matrix.platform.cpactions-arch }}'
|
||||
version: '${{ matrix.platform.cpactions-version }}'
|
||||
run: |
|
||||
${{ matrix.platform.cpactions-setup-cmd }}
|
||||
${{ matrix.platform.cpactions-install-cmd }}
|
||||
cmake -S . -B build -GNinja \
|
||||
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
||||
-Wdeprecated -Wdev -Werror \
|
||||
-DSDL_WERROR=${{ matrix.platform.werror }} \
|
||||
-DSDL_DISABLE_INSTALL_DOCS=OFF \
|
||||
${{ matrix.platform.cmake-arguments }} \
|
||||
-DSDL_SHARED=${{ matrix.platform.shared }} \
|
||||
-DSDL_STATIC=${{ matrix.platform.static }} \
|
||||
-DSDL_TEST=ON \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }}
|
||||
cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --verbose
|
||||
|
||||
cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --target clean
|
||||
rm -rf build/CMakeFiles
|
||||
rm -rf build/docs
|
||||
- name: 'Set up Watcom'
|
||||
uses: open-watcom/setup-watcom@v0
|
||||
if: ${{ matrix.platform.watcom-makefile != '' }}
|
||||
- name: 'Build (Watcom)'
|
||||
if: ${{ matrix.platform.watcom-makefile != '' }}
|
||||
run: |
|
||||
wmake -f ${{ matrix.platform.watcom-makefile }} ENABLE_WERROR=1
|
||||
- name: 'Build tests (Watcom)'
|
||||
if: ${{ matrix.platform.watcom-makefile != '' }}
|
||||
run: |
|
||||
cd test
|
||||
wmake -f ${{ matrix.platform.watcom-makefile }} ENABLE_WERROR=1
|
||||
- name: 'Run tests (Watcom)'
|
||||
if: ${{ matrix.platform.watcom-makefile != '' && matrix.platform.run-tests }}
|
||||
run: |
|
||||
cd test
|
||||
wmake -f ${{ matrix.platform.watcom-makefile }} check-quick
|
||||
- name: 'Distclean (Watcom)'
|
||||
if: ${{ matrix.platform.watcom-makefile != '' }}
|
||||
run: |
|
||||
wmake -f ${{ matrix.platform.watcom-makefile }} distclean
|
||||
cd test
|
||||
wmake -f ${{ matrix.platform.watcom-makefile }} distclean
|
||||
- name: 'Add msbuild to PATH'
|
||||
id: setup-msbuild
|
||||
if: ${{ matrix.platform.msvc-project != '' }}
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Build msbuild
|
||||
if: ${{ matrix.platform.msvc-project != '' }}
|
||||
run: |
|
||||
"$(cygpath -u '${{ steps.setup-msbuild.outputs.msbuildPath }}\msbuild.exe')" ${{ matrix.platform.msvc-project }} -m -p:BuildInParallel=true -p:Configuration=Release ${{ matrix.platform.msvc-project-flags }}
|
||||
- name: 'Build (Android.mk)'
|
||||
if: ${{ matrix.platform.android-mk }}
|
||||
run: |
|
||||
./build-scripts/androidbuildlibs.sh
|
||||
- name: 'Build (xcode)'
|
||||
if: ${{ matrix.platform.xcode-sdk != '' }}
|
||||
run: |
|
||||
xcodebuild -project Xcode/SDL/SDL.xcodeproj -target "${{ matrix.platform.xcode-target }}" -configuration Release -sdk ${{ matrix.platform.xcode-sdk }} clean build
|
||||
- name: 'Setup Python'
|
||||
uses: 'actions/setup-python@main'
|
||||
if: ${{ matrix.platform.check-sources }}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: 'Check Sources'
|
||||
if: ${{ matrix.platform.check-sources }}
|
||||
run: |
|
||||
set -e
|
||||
build-scripts/test-versioning.sh
|
||||
- name: 'Upload binary package'
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ always() && steps.cmake-tests.outcome == 'failure' }}
|
||||
with:
|
||||
if-no-files-found: ignore
|
||||
name: '${{ matrix.platform.artifact }}-minidumps'
|
||||
path: |
|
||||
build/**/*.dmp
|
||||
build/**/*.exe
|
||||
build/**/*.dll
|
||||
build/**/*.pdb
|
20
.github/workflows/ios.yml
vendored
Normal file
20
.github/workflows/ios.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Build (iOS/tvOS)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: iOS, target: Static Library-iOS, sdk: iphoneos }
|
||||
- { name: tvOS, target: Static Library-tvOS, sdk: appletvos }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target '${{ matrix.platform.target }}' -configuration Release -sdk ${{ matrix.platform.sdk }} clean build
|
241
.github/workflows/main.yml
vendored
Normal file
241
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
name: Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: ${{ matrix.platform.shell }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
|
||||
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
|
||||
- { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 }
|
||||
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 }
|
||||
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
|
||||
- { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
|
||||
- { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
|
||||
- { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
|
||||
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
|
||||
- { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
|
||||
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '}
|
||||
|
||||
- { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh }
|
||||
- { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
|
||||
- { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
|
||||
- { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
|
||||
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
if: matrix.platform.shell == 'msys2 {0}'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.platform.msystem }}
|
||||
install: >-
|
||||
${{ matrix.platform.msys-env }}-cc
|
||||
${{ matrix.platform.msys-env }}-cmake
|
||||
${{ matrix.platform.msys-env }}-ninja
|
||||
${{ matrix.platform.msys-env }}-pkg-config
|
||||
|
||||
- name: Setup Linux dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install build-essential git make autoconf automake libtool \
|
||||
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
|
||||
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
|
||||
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
|
||||
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
||||
|
||||
- name: Setup extra Ubuntu 22.04 dependencies
|
||||
if: matrix.platform.os == 'ubuntu-22.04'
|
||||
run: |
|
||||
sudo apt-get install libpipewire-0.3-dev libdecor-0-dev
|
||||
|
||||
- name: Setup Macos dependencies
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
brew install \
|
||||
autoconf \
|
||||
ninja \
|
||||
pkg-config
|
||||
|
||||
- name: Setup Intel oneAPI
|
||||
if: matrix.platform.intel
|
||||
run: |
|
||||
# Download the key to system keyring
|
||||
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
|
||||
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
|
||||
|
||||
# Add signed entry to apt sources and configure the APT client to use Intel repository:
|
||||
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
|
||||
|
||||
# Update package list
|
||||
sudo apt-get update -y
|
||||
|
||||
# Install oneAPI
|
||||
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check that versioning is consistent
|
||||
# We only need to run this once: arbitrarily use the Linux/CMake build
|
||||
if: "runner.os == 'Linux' && ! matrix.platform.autotools"
|
||||
run: ./build-scripts/test-versioning.sh
|
||||
- name: Configure (CMake)
|
||||
if: "! matrix.platform.autotools"
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DSDL_TESTS=ON \
|
||||
-DSDL_WERROR=ON \
|
||||
-DSDL_INSTALL_TESTS=ON \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
${{ matrix.platform.cmake }}
|
||||
- name: Build (CMake)
|
||||
if: "! matrix.platform.autotools"
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
cmake --build build/ --config Release --verbose --parallel
|
||||
- name: Run build-time tests (CMake)
|
||||
if: "! matrix.platform.autotools"
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
export SDL_TESTS_QUICK=1
|
||||
ctest -VV --test-dir build/ -j2
|
||||
if test "${{ runner.os }}" = "Linux"; then
|
||||
# This should show us the SDL_REVISION
|
||||
strings build/libSDL2-2.0.so.0 | grep SDL-
|
||||
fi
|
||||
- name: Install (CMake)
|
||||
if: "! matrix.platform.autotools"
|
||||
run: |
|
||||
set -eu
|
||||
cmake --install build/ --config Release
|
||||
echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
|
||||
( cd cmake_prefix; find ) | LC_ALL=C sort -u
|
||||
- name: Configure (Autotools)
|
||||
if: matrix.platform.autotools
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
rm -fr build-autotools
|
||||
mkdir build-autotools
|
||||
./autogen.sh
|
||||
(
|
||||
cd build-autotools
|
||||
${{ github.workspace }}/configure \
|
||||
--enable-vendor-info="Github Workflow" \
|
||||
--enable-werror \
|
||||
--prefix=${{ github.workspace }}/autotools_prefix \
|
||||
)
|
||||
if test "${{ runner.os }}" != "macOS" ; then
|
||||
curdir="$(pwd)"
|
||||
multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
|
||||
(
|
||||
mkdir -p build-autotools/test
|
||||
cd build-autotools/test
|
||||
${{ github.workspace }}/test/configure \
|
||||
--enable-werror \
|
||||
--x-includes=/usr/include \
|
||||
--x-libraries="/usr/lib/${multiarch}" \
|
||||
--prefix=${{ github.workspace }}/autotools_prefix \
|
||||
SDL_CFLAGS="-I${curdir}/include" \
|
||||
SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
|
||||
ac_cv_lib_SDL2_ttf_TTF_Init=no \
|
||||
${NULL+}
|
||||
)
|
||||
fi
|
||||
- name: Build (Autotools)
|
||||
if: matrix.platform.autotools
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
make -j"${parallel}" -C build-autotools V=1
|
||||
if test "${{ runner.os }}" != "macOS" ; then
|
||||
make -j"${parallel}" -C build-autotools/test V=1
|
||||
fi
|
||||
- name: Run build-time tests (Autotools)
|
||||
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
curdir="$(pwd)"
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
export SDL_TESTS_QUICK=1
|
||||
make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs"
|
||||
if test "${{ runner.os }}" = "Linux"; then
|
||||
# This should show us the SDL_REVISION
|
||||
strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL-
|
||||
fi
|
||||
- name: Install (Autotools)
|
||||
if: matrix.platform.autotools
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
curdir="$(pwd)"
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
make -j"${parallel}" -C build-autotools install V=1
|
||||
if test "${{ runner.os }}" != "macOS" ; then
|
||||
make -j"${parallel}" -C build-autotools/test install V=1
|
||||
fi
|
||||
( cd autotools_prefix; find . ) | LC_ALL=C sort -u
|
||||
echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
||||
cmake --build cmake_config_build --verbose
|
||||
- name: Verify sdl2-config
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||
cmake/test/test_pkgconfig.sh
|
||||
- name: Distcheck (Autotools)
|
||||
if: matrix.platform.autotools
|
||||
run: |
|
||||
set -eu
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
make -j"${parallel}" -C build-autotools dist V=1
|
||||
# Similar to Automake `make distcheck`: check that the tarball
|
||||
# release is sufficient to do a new build
|
||||
mkdir distcheck
|
||||
tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz
|
||||
( cd distcheck/SDL2-* && ./configure )
|
||||
make -j"${parallel}" -C distcheck/SDL2-*
|
||||
- name: Run installed-tests (Autotools)
|
||||
if: "runner.os == 'Linux' && matrix.platform.autotools"
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
set -eu
|
||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||
sudo make -j"${parallel}" -C build-autotools install
|
||||
sudo make -j"${parallel}" -C build-autotools/test install
|
||||
export SDL_TESTS_QUICK=1
|
||||
# We need to set LD_LIBRARY_PATH because it isn't in the default
|
||||
# linker search path. We don't need to set XDG_DATA_DIRS for
|
||||
# ginsttest-runner, because /usr/local/share *is* in the default
|
||||
# search path for that.
|
||||
env --chdir=/ \
|
||||
LD_LIBRARY_PATH=/usr/local/lib \
|
||||
SDL_AUDIODRIVER=dummy \
|
||||
SDL_VIDEODRIVER=dummy \
|
||||
ginsttest-runner --tap SDL2
|
80
.github/workflows/msvc.yml
vendored
Normal file
80
.github/workflows/msvc.yml
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
name: Build (MSVC)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' }
|
||||
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' }
|
||||
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON }
|
||||
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON }
|
||||
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
|
||||
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
|
||||
- { name: Windows (ARM), flags: -A ARM }
|
||||
- { name: Windows (ARM64), flags: -A ARM64 }
|
||||
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true,
|
||||
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Create CMake project using SDL as a subproject
|
||||
shell: python
|
||||
run: |
|
||||
import os
|
||||
import textwrap
|
||||
srcdir = r"${{ github.workspace }}".replace("\\", "/")
|
||||
builddir = f"{ srcdir }/build"
|
||||
os.makedirs(builddir)
|
||||
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
||||
f.write(textwrap.dedent(f"""\
|
||||
# Always build .PDB symbol file
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction")
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries")
|
||||
cmake_minimum_required(VERSION 3.0...3.25)
|
||||
project(sdl_user)
|
||||
enable_testing()
|
||||
add_subdirectory("{ srcdir }" SDL)
|
||||
"""))
|
||||
- name: Configure (CMake)
|
||||
run: cmake -S build -B build `
|
||||
-DSDL_WERROR=${{ !matrix.platform.nowerror }} `
|
||||
-DSDL_TESTS=ON `
|
||||
-DSDL_INSTALL_TESTS=ON `
|
||||
-DSDL_VENDOR_INFO="Github Workflow" `
|
||||
-DSDL2_DISABLE_INSTALL=OFF `
|
||||
${{ matrix.platform.flags }} `
|
||||
-DCMAKE_INSTALL_PREFIX=prefix
|
||||
- name: Build (CMake)
|
||||
run: cmake --build build/ --config Release --parallel
|
||||
- name: Run build-time tests
|
||||
if: "! contains(matrix.platform.name, 'ARM')"
|
||||
run: |
|
||||
$env:SDL_TESTS_QUICK=1
|
||||
ctest -VV --test-dir build/ -C Release -j2
|
||||
- name: Install (CMake)
|
||||
run: |
|
||||
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
|
||||
cmake --install build/
|
||||
- name: Verify CMake configuration files
|
||||
if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build `
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
|
||||
${{ matrix.platform.flags }}
|
||||
cmake --build cmake_config_build --config Release
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
if: ${{ matrix.platform.project != '' }}
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Build msbuild
|
||||
if: ${{ matrix.platform.project != '' }}
|
||||
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
|
55
.github/workflows/n3ds.yml
vendored
Normal file
55
.github/workflows/n3ds.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Build (Nintendo 3DS)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
n3ds:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: devkitpro/devkitarm:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install build requirements
|
||||
run: |
|
||||
apt update
|
||||
apt install ninja-build
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
|
||||
-DSDL_WERROR=ON \
|
||||
-DSDL_TESTS=ON \
|
||||
-DSDL_INSTALL_TESTS=ON \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix
|
||||
- name: Build
|
||||
run: cmake --build build --verbose
|
||||
- name: Install CMake
|
||||
run: |
|
||||
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
|
||||
cmake --install build/
|
||||
( cd prefix; find ) | LC_ALL=C sort -u
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
|
||||
-DTEST_SHARED=FALSE \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build cmake_config_build --verbose
|
||||
- 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
|
73
.github/workflows/ps2.yaml
vendored
Normal file
73
.github/workflows/ps2.yaml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: Build (Sony Playstation 2)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
ps2:
|
||||
runs-on: ubuntu-latest
|
||||
container: ps2dev/ps2dev:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup dependencies
|
||||
run: |
|
||||
apk update
|
||||
apk add cmake gmp mpc1 mpfr4 ninja pkgconf make git
|
||||
|
||||
# To be removed once ps2_drivers is part of PS2DEV
|
||||
- name: Install ps2_drivers lib
|
||||
run: |
|
||||
git clone https://github.com/fjtrujy/ps2_drivers.git
|
||||
cd ps2_drivers
|
||||
make -j $(getconf _NPROCESSORS_ONLN) clean
|
||||
make -j $(getconf _NPROCESSORS_ONLN)
|
||||
make -j $(getconf _NPROCESSORS_ONLN) install
|
||||
|
||||
- name: Configure (CMake)
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \
|
||||
-DSDL_WERROR=ON \
|
||||
-DSDL_TESTS=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- name: Build
|
||||
run: cmake --build build --config Release --verbose --parallel
|
||||
- name: Install (CMake)
|
||||
run: |
|
||||
set -eu
|
||||
cmake --install build/ --config Release
|
||||
echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
|
||||
( cd cmake_prefix; find ) | LC_ALL=C sort -u
|
||||
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \
|
||||
-DTEST_SHARED=FALSE \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build cmake_config_build --verbose
|
||||
- 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
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
run: |
|
||||
export CC=mips64r5900el-ps2-elf-gcc
|
||||
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
|
||||
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
|
||||
- name: Upload artifacts
|
||||
if: ${{ success() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tests-${{ steps.slug.outputs.sha8 }}
|
||||
path: |
|
||||
build/test
|
50
.github/workflows/psp.yaml
vendored
Normal file
50
.github/workflows/psp.yaml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Build (Sony Playstation Portable)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
psp:
|
||||
runs-on: ubuntu-latest
|
||||
container: pspdev/pspdev:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup dependencies
|
||||
run: |
|
||||
apk update
|
||||
apk add cmake gmp mpc1 mpfr4 make pkgconf
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake -S . -B build \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
|
||||
-DSDL_WERROR=ON \
|
||||
-DSDL_TESTS=ON \
|
||||
-DSDL_INSTALL_TESTS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix
|
||||
- name: Build
|
||||
run: cmake --build build --config Release
|
||||
- name: Install
|
||||
run: |
|
||||
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
|
||||
cmake --install build --config Release
|
||||
( cd prefix; find ) | LC_ALL=C sort -u
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||
-DTEST_SHARED=FALSE \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build cmake_config_build --verbose
|
||||
- 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
|
||||
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
|
||||
cmake/test/test_pkgconfig.sh
|
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
@@ -37,8 +37,9 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
python build-scripts/build-release.py \
|
||||
--actions source \
|
||||
--create source \
|
||||
--commit ${{ inputs.commit }} \
|
||||
--project SDL2 \
|
||||
--root "${{ github.workspace }}/SDL" \
|
||||
--github \
|
||||
--debug
|
||||
@@ -92,7 +93,7 @@ jobs:
|
||||
- name: 'Set up Python'
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.10'
|
||||
- name: 'Fetch build-release.py'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -113,8 +114,9 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
python build-scripts/build-release.py \
|
||||
--actions dmg \
|
||||
--create framework \
|
||||
--commit ${{ inputs.commit }} \
|
||||
--project SDL2 \
|
||||
--root "${{ steps.tar.outputs.path }}" \
|
||||
--github \
|
||||
--debug
|
||||
@@ -181,7 +183,7 @@ jobs:
|
||||
|
||||
msvc:
|
||||
needs: [src]
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2019
|
||||
outputs:
|
||||
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
|
||||
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
|
||||
@@ -190,7 +192,7 @@ jobs:
|
||||
- name: 'Set up Python'
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.10'
|
||||
- name: 'Fetch build-release.py'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -211,8 +213,9 @@ jobs:
|
||||
id: releaser
|
||||
run: |
|
||||
python build-scripts/build-release.py `
|
||||
--actions msvc `
|
||||
--create win32 `
|
||||
--commit ${{ inputs.commit }} `
|
||||
--project SDL2 `
|
||||
--root "${{ steps.zip.outputs.path }}" `
|
||||
--github `
|
||||
--debug
|
||||
@@ -307,7 +310,7 @@ jobs:
|
||||
- name: 'Set up Python'
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.10'
|
||||
- name: 'Fetch build-release.py'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -331,8 +334,9 @@ jobs:
|
||||
id: releaser
|
||||
run: |
|
||||
python build-scripts/build-release.py \
|
||||
--actions mingw \
|
||||
--create mingw \
|
||||
--commit ${{ inputs.commit }} \
|
||||
--project SDL2 \
|
||||
--root "${{ steps.tar.outputs.path }}" \
|
||||
--github \
|
||||
--debug
|
||||
@@ -366,13 +370,12 @@ jobs:
|
||||
mkdir -p /tmp/tardir
|
||||
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
|
||||
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
|
||||
- name: 'Untar and install ${{ needs.mingw.outputs.mingw-devel-tar-gz }}'
|
||||
- name: 'Untar ${{ needs.mingw.outputs.mingw-devel-tar-gz }}'
|
||||
id: bin
|
||||
run: |
|
||||
mkdir -p /tmp/mingw-tardir
|
||||
tar -C /tmp/mingw-tardir -v -x -f "${{ github.workspace }}/${{ needs.mingw.outputs.mingw-devel-tar-gz }}"
|
||||
make -C /tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }} cross CROSS_PATH=/tmp/deps-mingw
|
||||
echo "path=/tmp/deps-mingw" >>$GITHUB_OUTPUT
|
||||
echo "path=/tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
|
||||
- name: 'CMake (configure + build) i686'
|
||||
run: |
|
||||
set -e
|
||||
|
68
.github/workflows/riscos.yml
vendored
Normal file
68
.github/workflows/riscos.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
name: Build (RISC OS)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ubuntu-latest
|
||||
container: riscosdotinfo/riscos-gccsdk-4.7:latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: autotools, test_args: '-DTEST_SHARED=FALSE' } # FIXME: autotools should build and install shared libraries
|
||||
- { name: CMake }
|
||||
|
||||
steps:
|
||||
- name: Setup dependencies
|
||||
run: apt-get update && apt-get install -y cmake ninja-build
|
||||
- uses: actions/checkout@v4
|
||||
- name: Configure (autotools)
|
||||
if: ${{ contains(matrix.platform.name, 'autotools') }}
|
||||
run: |
|
||||
mkdir build_autotools
|
||||
cd build_autotools
|
||||
../configure \
|
||||
--host=arm-unknown-riscos \
|
||||
--disable-gcc-atomics \
|
||||
--prefix=${{ github.workspace }}/prefix_autotools
|
||||
- name: Build (autotools)
|
||||
if: ${{ contains(matrix.platform.name, 'autotools') }}
|
||||
run: make -C build_autotools -j`nproc` V=1
|
||||
- name: Install (autotools)
|
||||
if: ${{ contains(matrix.platform.name, 'autotools') }}
|
||||
run: |
|
||||
echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV
|
||||
make -C build_autotools install
|
||||
( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u
|
||||
- name: Configure (CMake)
|
||||
if: ${{ contains(matrix.platform.name, 'CMake') }}
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
|
||||
-DRISCOS=ON \
|
||||
-DSDL_GCC_ATOMICS=OFF \
|
||||
-DSDL_TESTS=ON \
|
||||
-DSDL_INSTALL_TESTS=ON \
|
||||
-DSDL_VENDOR_INFO="Github Workflow" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix_cmake
|
||||
- name: Build (CMake)
|
||||
if: ${{ contains(matrix.platform.name, 'CMake') }}
|
||||
run: cmake --build build --verbose
|
||||
- name: Install (CMake)
|
||||
if: ${{ contains(matrix.platform.name, 'CMake') }}
|
||||
run: |
|
||||
echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV
|
||||
cmake --install build/
|
||||
( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
${{ matrix.platform.test_args }}
|
||||
cmake --build cmake_config_build --verbose
|
95
.github/workflows/vita.yaml
vendored
Normal file
95
.github/workflows/vita.yaml
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
name: Build (Sony Playstation Vita)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: sh
|
||||
|
||||
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@v4
|
||||
- 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 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=prefix
|
||||
- name: Build
|
||||
run: cmake --build build --verbose
|
||||
- name: Install CMake
|
||||
run: |
|
||||
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
|
||||
cmake --install build/
|
||||
( cd prefix; find ) | LC_ALL=C sort -u
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
|
||||
-DTEST_SHARED=FALSE \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build cmake_config_build --verbose
|
||||
- name: Verify sdl2-config
|
||||
run: |
|
||||
export CC=arm-vita-eabi-gcc
|
||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||
cmake/test/test_sdlconfig.sh
|
||||
- name: Verify sdl2.pc
|
||||
run: |
|
||||
export CC=arm-vita-eabi-gcc
|
||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||
cmake/test/test_pkgconfig.sh
|
35
.github/workflows/watcom.yml
vendored
Normal file
35
.github/workflows/watcom.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Build (OpenWatcom)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
os2:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
- { name: Windows, makefile: Makefile.w32 }
|
||||
- { name: OS/2, makefile: Makefile.os2 }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: open-watcom/setup-watcom@v0
|
||||
- name: Build SDL2
|
||||
run: |
|
||||
wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd test && wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1
|
||||
cd ..
|
||||
- name: Run tests
|
||||
if: "matrix.platform.makefile == 'Makefile.w32'"
|
||||
run: |
|
||||
cd test && wmake -f ${{ matrix.platform.makefile }} check-quick
|
||||
cd ..
|
||||
- name: distclean
|
||||
run: |
|
||||
wmake -f ${{ matrix.platform.makefile }} distclean
|
||||
cd test && wmake -f ${{ matrix.platform.makefile }} distclean
|
||||
cd ..
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -15,7 +15,7 @@ build
|
||||
gen
|
||||
Build
|
||||
buildbot
|
||||
/REVISION.txt
|
||||
/VERSION.txt
|
||||
dist
|
||||
|
||||
*.so
|
||||
|
@@ -1,9 +1,9 @@
|
||||
projectfullname = Simple Directmedia Layer
|
||||
projectshortname = SDL
|
||||
projectfullname = SDL2
|
||||
projectshortname = SDL2
|
||||
incsubdir = include
|
||||
wikisubdir = SDL2
|
||||
readmesubdir = docs
|
||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_|[US]int\d+)
|
||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
||||
mainincludefname = SDL.h
|
||||
versionfname = include/SDL_version.h
|
||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
||||
@@ -14,19 +14,4 @@ projecturl = https://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 SDL2, the previous stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current stable version.)
|
||||
wikiheaderfiletext = Defined in [%fname%](https://github.com/libsdl-org/SDL/blob/SDL2/include/%fname%)
|
||||
manpageheaderfiletext = Defined in %fname%
|
||||
|
||||
# All SDL_config_*.h headers are uncategorized, in case something slips in from them.
|
||||
# All SDL_test_* headers become uncategorized, everything else just converts like SDL_audio.h -> Audio
|
||||
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
|
||||
headercategoryeval = s/\ASDL_config_.*?\.h\Z//; s/\ASDL_test_.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
||||
|
||||
# !!! FIXME: maybe later, but there are probably documentation gaps to fix first.
|
||||
quickrefenabled = 0
|
||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gesture,GameController,Joystick,Haptic,Audio,Timer,Render,LoadSO,Thread,Mutex,Atomic,Filesystem,RWOPS,Pixels,Surface,Blendmode,Rect,Clipboard,Messagebox,Vulkan,Metal,Platform,Power,Sensor,Bits,Endian,Assert,CPUInfo,Locale,System,Misc,GUID,Main,Stdinc
|
||||
quickreftitle = SDL2 API Quick Reference
|
||||
quickrefurl = https://libsdl.org/
|
||||
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL2/QuickReference
|
||||
quickrefmacroregex = \A(SDL_Atomic...Ref|SDL_assert.*?|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast|SDL_Load...)\Z
|
||||
wikipreamble = (This is the legacy documentation for stable SDL2, the current stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current development version.)
|
||||
|
@@ -35,7 +35,6 @@ LOCAL_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
|
||||
|
175
CMakeLists.txt
175
CMakeLists.txt
@@ -5,8 +5,8 @@ endif()
|
||||
# MSVC runtime library flags are selected by an abstraction.
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
|
||||
|
||||
cmake_minimum_required(VERSION 3.0.0...3.10)
|
||||
project(SDL2 C)
|
||||
cmake_minimum_required(VERSION 3.0.0...3.5)
|
||||
project(SDL2 C CXX)
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
set(SDL2_SUBPROJECT OFF)
|
||||
@@ -15,15 +15,13 @@ else()
|
||||
endif()
|
||||
|
||||
if (HAIKU)
|
||||
enable_language(CXX)
|
||||
set(LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
set(EXTRA_LIBS)
|
||||
set(EXTRA_LDFLAGS)
|
||||
|
||||
set(CMAKE_LIBS)
|
||||
set(PKGCONFIG_LDFLAGS)
|
||||
set(CMAKE_DEPENDS)
|
||||
set(PKGCONFIG_DEPENDS)
|
||||
|
||||
# This is a virtual "library" that just exists to collect up compiler and
|
||||
@@ -35,8 +33,8 @@ set(PKGCONFIG_DEPENDS)
|
||||
add_library(sdl-build-options INTERFACE)
|
||||
|
||||
if(WINDOWS_STORE)
|
||||
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1" "WINAPI_FAMILY=WINAPI_FAMILY_APP")
|
||||
target_compile_options(sdl-build-options INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-ZW>" "$<$<COMPILE_LANGUAGE:CXX>:-EHsc>")
|
||||
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
|
||||
target_compile_options(sdl-build-options INTERFACE "-ZW")
|
||||
endif()
|
||||
|
||||
# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
|
||||
@@ -88,8 +86,8 @@ endif()
|
||||
|
||||
# See docs/release_checklist.md
|
||||
set(SDL_MAJOR_VERSION 2)
|
||||
set(SDL_MINOR_VERSION 33)
|
||||
set(SDL_MICRO_VERSION 0)
|
||||
set(SDL_MINOR_VERSION 30)
|
||||
set(SDL_MICRO_VERSION 8)
|
||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||
|
||||
# Set defaults preventing destination file conflicts
|
||||
@@ -142,7 +140,6 @@ 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(arm64ec SDL_CPU_ARM64EC)
|
||||
check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64)
|
||||
|
||||
# Check for 64 or 32 bit
|
||||
@@ -198,7 +195,7 @@ endif()
|
||||
# so we'll just use libusb when it's available. libusb does not support iOS,
|
||||
# so we default to yes on iOS.
|
||||
# TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
|
||||
if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID)
|
||||
if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR ANDROID)
|
||||
set(HIDAPI_SKIP_LIBUSB TRUE)
|
||||
else()
|
||||
set(HIDAPI_SKIP_LIBUSB FALSE)
|
||||
@@ -241,10 +238,10 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
||||
endif()
|
||||
|
||||
# Default option knobs
|
||||
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS OR SDL_CPU_ARM64EC)
|
||||
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()
|
||||
if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(WINDOWS OR DARWIN OR MACOSX OR IOS OR TVOS)
|
||||
set(SDL_SYSTEM_ICONV_DEFAULT OFF)
|
||||
else()
|
||||
set(SDL_SYSTEM_ICONV_DEFAULT ON)
|
||||
@@ -363,11 +360,6 @@ if(VITA OR PSP OR PS2 OR N3DS)
|
||||
set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
set(SDL_X11_XRANDR_DEFAULT ON)
|
||||
if(SOLARIS)
|
||||
set(SDL_X11_XRANDR_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
# When defined, respect CMake's BUILD_SHARED_LIBS setting:
|
||||
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
|
||||
if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT)
|
||||
@@ -417,7 +409,7 @@ dep_option(SDL_SSE "Use SSE assembly routines" ON "SDL_ASSEMBLY;
|
||||
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" OFF "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)
|
||||
@@ -464,19 +456,17 @@ set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
|
||||
set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${SDL_CLOCK_GETTIME_ENABLED_BY_DEFAULT})
|
||||
set_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS})
|
||||
dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF)
|
||||
dep_option(SDL_X11_XCURSOR "Enable Xcursor support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XDBE "Enable Xdbe support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XINPUT "Enable XInput support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XFIXES "Enable Xfixes support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XRANDR "Enable Xrandr support" "${SDL_X11_XRANDR_DEFAULT}" SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSCRNSAVER "Enable Xscrnsaver support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSHAPE "Enable XShape support" ON SDL_X11 OFF)
|
||||
set(SDL_X11_OPTIONS Xcursor Xdbe XInput Xfixes Xrandr Xscrnsaver XShape)
|
||||
foreach(_SUB ${SDL_X11_OPTIONS})
|
||||
string(TOUPPER "SDL_X11_${_SUB}" _OPT)
|
||||
dep_option(${_OPT} "Enable ${_SUB} support" ON "SDL_X11" OFF)
|
||||
endforeach()
|
||||
set_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
|
||||
dep_option(SDL_WAYLAND_SHARED "Dynamically load Wayland support" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR "Use client-side window decorations on Wayland" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR_SHARED "Dynamically load libdecor support" ON "SDL_WAYLAND_LIBDECOR;SDL_WAYLAND_SHARED" OFF)
|
||||
dep_option(SDL_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "SDL_WAYLAND" OFF)
|
||||
set_option(SDL_RPI "Use Raspberry Pi 0-3 video driver" ${UNIX_SYS})
|
||||
set_option(SDL_RPI "Use Raspberry Pi video driver" ${UNIX_SYS})
|
||||
set_option(SDL_COCOA "Use Cocoa video driver" ${APPLE})
|
||||
set_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS})
|
||||
set_option(SDL_XINPUT "Use Xinput for Windows" ${WINDOWS})
|
||||
@@ -755,11 +745,6 @@ if(MSVC)
|
||||
if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")
|
||||
list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT")
|
||||
endif()
|
||||
|
||||
# for VS >= 17.14 targeting ARM64: inline the Interlocked funcs
|
||||
if(MSVC_VERSION GREATER 1943 AND SDL_CPU_ARM64 AND NOT SDL_LIBC)
|
||||
list(APPEND EXTRA_CFLAGS /forceInterlockedFunctions-)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
@@ -1099,7 +1084,6 @@ if(SDL_LIBC)
|
||||
endforeach()
|
||||
|
||||
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
||||
check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT)
|
||||
check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
|
||||
check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP)
|
||||
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
|
||||
@@ -1471,14 +1455,10 @@ elseif(EMSCRIPTEN)
|
||||
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
if(SDL_AUDIO)
|
||||
if(SYSV5 OR SOLARIS OR HPUX)
|
||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
||||
check_include_file(sys/audioio.h HAVE_SYS_AUDIOIO_H)
|
||||
if(HAVE_SYS_AUDIOIO_H)
|
||||
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
||||
file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
|
||||
list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
elseif(NETBSD)
|
||||
set(SDL_AUDIO_DRIVER_NETBSD 1)
|
||||
file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c)
|
||||
@@ -1793,7 +1773,6 @@ elseif(WINDOWS)
|
||||
list(APPEND SOURCE_FILES ${CORE_SOURCES})
|
||||
|
||||
if(WINDOWS_STORE)
|
||||
enable_language(CXX)
|
||||
file(GLOB WINRT_SOURCE_FILES ${SDL2_SOURCE_DIR}/src/core/winrt/*.c ${SDL2_SOURCE_DIR}/src/core/winrt/*.cpp)
|
||||
list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES})
|
||||
endif()
|
||||
@@ -1839,10 +1818,8 @@ elseif(WINDOWS)
|
||||
set(HAVE_DIRECTX TRUE)
|
||||
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
|
||||
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
|
||||
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}" SDL2_TMP_DXSDK_LIB_DIR)
|
||||
target_link_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_LIB_DIR}")
|
||||
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\Include" SDL2_TMP_DXSDK_INCLUDE_DIR)
|
||||
target_include_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_INCLUDE_DIR}")
|
||||
target_link_directories(sdl-build-options INTERFACE "$$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}")
|
||||
target_include_directories(sdl-build-options INTERFACE "$ENV{DXSDK_DIR}\\Include")
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||
@@ -2077,7 +2054,6 @@ elseif(WINDOWS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
enable_language(RC)
|
||||
file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
|
||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
|
||||
if(MINGW OR CYGWIN)
|
||||
@@ -2095,7 +2071,7 @@ elseif(APPLE)
|
||||
# !!! FIXME: we need Carbon for some very old API calls in
|
||||
# !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
|
||||
# !!! FIXME: how to dump those.
|
||||
if(MACOS)
|
||||
if(DARWIN OR MACOSX)
|
||||
set(SDL_FRAMEWORK_COCOA 1)
|
||||
set(SDL_FRAMEWORK_CARBON 1)
|
||||
endif()
|
||||
@@ -2109,12 +2085,12 @@ elseif(APPLE)
|
||||
set(HAVE_SDL_FILE TRUE)
|
||||
endif()
|
||||
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c)
|
||||
endif()
|
||||
|
||||
if(SDL_MISC)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m)
|
||||
else()
|
||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m)
|
||||
@@ -2139,10 +2115,10 @@ elseif(APPLE)
|
||||
|
||||
if(SDL_JOYSTICK)
|
||||
file(GLOB MFI_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
|
||||
set(SDL_JOYSTICK_MFI 1)
|
||||
if(IOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS)
|
||||
set(SDL_FRAMEWORK_COREMOTION 1)
|
||||
endif()
|
||||
set(SDL_FRAMEWORK_GAMECONTROLLER 1)
|
||||
@@ -2183,7 +2159,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_HAPTIC)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if (IOS OR TVOS)
|
||||
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
|
||||
set(SDL_HAPTIC_DUMMY 1)
|
||||
else()
|
||||
@@ -2197,7 +2173,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_POWER)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if (IOS OR TVOS)
|
||||
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
|
||||
set(SDL_POWER_UIKIT 1)
|
||||
else()
|
||||
@@ -2230,7 +2206,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_SENSOR)
|
||||
if(IOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS)
|
||||
set(SDL_SENSOR_COREMOTION 1)
|
||||
set(HAVE_SDL_SENSORS TRUE)
|
||||
file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/coremotion/*.m)
|
||||
@@ -2240,7 +2216,7 @@ elseif(APPLE)
|
||||
|
||||
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
|
||||
if(SDL_VIDEO)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if (IOS OR TVOS)
|
||||
set(SDL_VIDEO_DRIVER_UIKIT 1)
|
||||
set(SDL_FRAMEWORK_COREGRAPHICS 1)
|
||||
set(SDL_FRAMEWORK_QUARTZCORE 1)
|
||||
@@ -2261,7 +2237,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_OPENGLES)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
set(SDL_FRAMEWORK_OPENGLES 1)
|
||||
set(SDL_VIDEO_OPENGL_ES 1)
|
||||
set(SDL_VIDEO_RENDER_OGL_ES 1)
|
||||
@@ -2304,96 +2280,73 @@ elseif(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Minimum version for $<LINK_LIBRARY:feature,library-list>
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
# Actually load the frameworks at the end so we don't duplicate include.
|
||||
if(SDL_FRAMEWORK_COREVIDEO)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreVideo>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COCOA)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Cocoa")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Cocoa>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Cocoa")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_IOKIT)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,IOKit")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,IOKit>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,IOKit")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_FF)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,ForceFeedback>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_CARBON)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Carbon")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Carbon>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Carbon")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREAUDIO)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreAudio>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_AUDIOTOOLBOX)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,AudioToolbox>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_AVFOUNDATION)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,AVFoundation>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREBLUETOOTH)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreBluetooth>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREGRAPHICS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreGraphics>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREMOTION)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Coremotion>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_FOUNDATION)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Foundation")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Foundation>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Foundation")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_GAMECONTROLLER)
|
||||
find_library(GAMECONTROLLER GameController)
|
||||
if(GAMECONTROLLER)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,GameController>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_METAL)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Metal")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Metal>")
|
||||
if(IOS OR TVOS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Metal")
|
||||
else()
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,Metal>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_OPENGLES)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,OpenGLES>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_QUARTZCORE)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,QuartzCore>")
|
||||
if(IOS OR TVOS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||
else()
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,QuartzCore>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_UIKIT)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,UIKit")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,UIKit>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,UIKit")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREHAPTICS)
|
||||
find_library(COREHAPTICS CoreHaptics)
|
||||
if(COREHAPTICS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,CoreHaptics>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -2712,11 +2665,6 @@ elseif(PSP)
|
||||
list(APPEND SOURCE_FILES ${PSP_THREAD_SOURCES})
|
||||
set(HAVE_SDL_THREADS TRUE)
|
||||
endif()
|
||||
if(SDL_LOCALE)
|
||||
file(GLOB PSP_LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/psp/*.c)
|
||||
list(APPEND SOURCE_FILES ${PSP_LOCALE_SOURCES})
|
||||
set(HAVE_SDL_LOCALE TRUE)
|
||||
endif()
|
||||
if(SDL_TIMERS)
|
||||
set(SDL_TIMER_PSP 1)
|
||||
file(GLOB PSP_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/psp/*.c)
|
||||
@@ -2749,6 +2697,7 @@ elseif(PSP)
|
||||
endif()
|
||||
|
||||
elseif(PS2)
|
||||
list(APPEND EXTRA_CFLAGS "-DPS2" "-D__PS2__" "-I$ENV{PS2SDK}/ports/include" "-I$ENV{PS2DEV}/gsKit/include")
|
||||
|
||||
file(GLOB PS2_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/ps2/*.c)
|
||||
set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${PS2_MAIN_SOURCES})
|
||||
@@ -3104,8 +3053,8 @@ endif()
|
||||
|
||||
# Compat helpers for the configuration files
|
||||
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/REVISION.txt")
|
||||
file(READ "${PROJECT_SOURCE_DIR}/REVISION.txt" SDL_SOURCE_VERSION)
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION.txt")
|
||||
file(READ "${PROJECT_SOURCE_DIR}/VERSION.txt" SDL_SOURCE_VERSION)
|
||||
string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION)
|
||||
endif()
|
||||
|
||||
@@ -3199,7 +3148,7 @@ endif()
|
||||
|
||||
# Clean up the different lists
|
||||
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
||||
set(SDL_STATIC_LIBS ${EXTRA_LDFLAGS} ${_EXTRA_LIBS} ${PKGCONFIG_LDFLAGS})
|
||||
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
|
||||
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
|
||||
listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
|
||||
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
||||
@@ -3233,12 +3182,10 @@ macro(check_add_debug_flag FLAG SUFFIX)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER)
|
||||
check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX})
|
||||
if (HAS_CXX_${SUFFIX})
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(asan_check_add_debug_flag ASAN_FLAG)
|
||||
@@ -3256,20 +3203,18 @@ macro(asan_check_add_debug_flag2 ASAN_FLAG)
|
||||
|
||||
set (STORED_REQLIBS ${CMAKE_REQUIRED_LIBRARIES})
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${FLAG};asan")
|
||||
|
||||
check_c_compiler_flag (${FLAG} HAS_C_FLAG_${ASAN_FLAG})
|
||||
check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS})
|
||||
|
||||
if (HAS_C_FLAG_${ASAN_FLAG})
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER)
|
||||
check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG})
|
||||
if (HAS_CXX_${ASAN_FLAG})
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS})
|
||||
if(HAS_C_${ASAN_FLAG} OR HAS_CXX_${ASAN_FLAG})
|
||||
set(HAVE_ASAN ON)
|
||||
endif()
|
||||
@@ -3493,7 +3438,7 @@ if(SDL_SHARED)
|
||||
set_property(TARGET SDL2 APPEND_STRING PROPERTY 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} ${CMAKE_LIBS})
|
||||
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/SDL2>"
|
||||
@@ -3529,7 +3474,7 @@ 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} ${CMAKE_LIBS})
|
||||
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/SDL2>"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@@ -14,8 +14,8 @@
|
||||
|
||||
LIBNAME = SDL2
|
||||
MAJOR_VERSION = 2
|
||||
MINOR_VERSION = 33
|
||||
MICRO_VERSION = 0
|
||||
MINOR_VERSION = 30
|
||||
MICRO_VERSION = 8
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
DESCRIPTION = Simple DirectMedia Layer 2
|
||||
|
||||
|
@@ -5,8 +5,8 @@
|
||||
|
||||
LIBNAME = SDL2
|
||||
MAJOR_VERSION = 2
|
||||
MINOR_VERSION = 33
|
||||
MICRO_VERSION = 0
|
||||
MINOR_VERSION = 30
|
||||
MICRO_VERSION = 8
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
|
||||
LIBHOME = .
|
||||
|
@@ -174,7 +174,7 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\</Command>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox Series)</Message>
|
||||
@@ -208,7 +208,7 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ one</Command>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox One)</Message>
|
||||
@@ -272,7 +272,7 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\</Command>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox Series)</Message>
|
||||
@@ -307,7 +307,7 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ one</Command>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox One)</Message>
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@@ -139,7 +139,7 @@
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@@ -223,7 +223,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@@ -352,7 +352,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
||||
|
@@ -139,7 +139,7 @@
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@@ -223,7 +223,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@@ -352,7 +352,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
|
||||
|
@@ -371,7 +371,6 @@
|
||||
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.0.0</WindowsTargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
@@ -392,7 +391,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# SDL2 CMake configuration file:
|
||||
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC
|
||||
|
||||
cmake_minimum_required(VERSION 3.0...3.28)
|
||||
cmake_minimum_required(VERSION 3.0...3.5)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(SDL2 PROPERTIES
|
||||
@@ -94,7 +94,7 @@ if(EXISTS "${_sdl2main_library}")
|
||||
endif()
|
||||
set(SDL2_SDL2main_FOUND TRUE)
|
||||
else()
|
||||
set(SDL2_SDL2main_FOUND FALSE)
|
||||
set(SDL2_SDL2_FOUND FALSE)
|
||||
endif()
|
||||
unset(_sdl2main_library)
|
||||
|
||||
|
@@ -188,12 +188,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -216,12 +216,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -188,12 +188,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -194,12 +194,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -456,10 +456,7 @@ main(int argc, char *argv[])
|
||||
while (!done) {
|
||||
SDL_Event event;
|
||||
double deltaTime = updateDeltaTime();
|
||||
SDL_bool hasEvents = SDL_FALSE;
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
hasEvents = SDL_TRUE;
|
||||
if (event.type == SDL_QUIT) {
|
||||
done = 1;
|
||||
}
|
||||
@@ -469,17 +466,10 @@ main(int argc, char *argv[])
|
||||
spawnEmitterParticle(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
/* Only update and render if we have active particles or just received events */
|
||||
if (num_active_particles > 0 || hasEvents) {
|
||||
stepParticles(deltaTime);
|
||||
drawParticles();
|
||||
SDL_GL_SwapWindow(window);
|
||||
SDL_Delay(16); // Target 60 FPS when active
|
||||
} else {
|
||||
/* Idle state - wait for events with longer delay to save CPU */
|
||||
SDL_Delay(100); // Much longer delay when idle
|
||||
}
|
||||
SDL_Delay(1);
|
||||
}
|
||||
|
||||
/* delete textures */
|
||||
|
@@ -19,10 +19,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.33.0</string>
|
||||
<string>2.30.8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SDLX</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.33.0</string>
|
||||
<string>2.30.8</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@@ -9728,8 +9728,8 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.8.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||
@@ -9770,7 +9770,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
MARKETING_VERSION = 2.33.0;
|
||||
MARKETING_VERSION = 2.30.8;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
};
|
||||
name = Release;
|
||||
@@ -9813,8 +9813,8 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.8.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@@ -9856,7 +9856,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
MARKETING_VERSION = 2.33.0;
|
||||
MARKETING_VERSION = 2.30.8;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -10062,8 +10062,8 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.8.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
@@ -10114,8 +10114,8 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.8.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Title SDL 2.33.0
|
||||
Title SDL 2.30.8
|
||||
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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
acinclude/libtool.m4
vendored
44
acinclude/libtool.m4
vendored
@@ -1023,21 +1023,6 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
|
||||
rm -f conftest.*
|
||||
fi])
|
||||
|
||||
# Feature test to disable chained fixups since it is not
|
||||
# compatible with '-undefined dynamic_lookup'
|
||||
AC_CACHE_CHECK([for -no_fixup_chains linker flag],
|
||||
[lt_cv_support_no_fixup_chains],
|
||||
[ save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([],[])],
|
||||
lt_cv_support_no_fixup_chains=yes,
|
||||
lt_cv_support_no_fixup_chains=no
|
||||
)
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
]
|
||||
)
|
||||
|
||||
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
|
||||
[lt_cv_ld_exported_symbols_list],
|
||||
[lt_cv_ld_exported_symbols_list=no
|
||||
@@ -1062,7 +1047,7 @@ _LT_EOF
|
||||
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
||||
cat > conftest.c << _LT_EOF
|
||||
int main(void) { return 0;}
|
||||
int main() { return 0;}
|
||||
_LT_EOF
|
||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
||||
@@ -1087,12 +1072,7 @@ _LT_EOF
|
||||
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
*)
|
||||
if test yes = "$lt_cv_support_no_fixup_chains"; then
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains'
|
||||
else
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
|
||||
fi
|
||||
;;
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -1882,11 +1862,11 @@ else
|
||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||
correspondingly for the symbols needed. */
|
||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||
int fnord (void) __attribute__((visibility("default")));
|
||||
int fnord () __attribute__((visibility("default")));
|
||||
#endif
|
||||
|
||||
int fnord (void) { return 42; }
|
||||
int main (void)
|
||||
int fnord () { return 42; }
|
||||
int main ()
|
||||
{
|
||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||
int status = $lt_dlunknown;
|
||||
@@ -2567,14 +2547,14 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
#soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
m4_if([$1], [],[
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
||||
;;
|
||||
mingw* | windows* | cegcc*)
|
||||
# MinGW DLLs use traditional 'lib' prefix
|
||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
@@ -3486,7 +3466,7 @@ cygwin*)
|
||||
# func_win32_libid is a shell function defined in ltmain.sh
|
||||
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
mingw* | windows* | pw32*)
|
||||
@@ -3498,10 +3478,10 @@ mingw* | windows* | pw32*)
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
else
|
||||
# Keep this pattern in sync with the one in func_win32_libid.
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
|
||||
lt_cv_file_magic_cmd='$OBJDUMP -f'
|
||||
fi
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
cegcc*)
|
||||
@@ -4072,7 +4052,7 @@ void nm_test_func(void){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(void){nm_test_var='a';nm_test_func();return(0);}
|
||||
int main(){nm_test_var='a';nm_test_func();return(0);}
|
||||
_LT_EOF
|
||||
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
@@ -6238,7 +6218,7 @@ _LT_TAGVAR(objext, $1)=$objext
|
||||
lt_simple_compile_test_code="int some_variable = 0;"
|
||||
|
||||
# Code to be used in simple link tests
|
||||
lt_simple_link_test_code='int main(void){return(0);}'
|
||||
lt_simple_link_test_code='int main(){return(0);}'
|
||||
|
||||
_LT_TAG_COMPILER
|
||||
# Save the default compiler, since it gets overwritten when the other
|
||||
|
81
android-project/app/proguard-rules.pro
vendored
81
android-project/app/proguard-rules.pro
vendored
@@ -15,84 +15,3 @@
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLInputConnection {
|
||||
void nativeCommitText(java.lang.String, int);
|
||||
void nativeGenerateScancodeForUnichar(char);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses class org.libsdl.app.SDLActivity {
|
||||
# for some reason these aren't compatible with allowoptimization modifier
|
||||
boolean supportsRelativeMouse();
|
||||
void setWindowStyle(boolean);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLActivity {
|
||||
java.lang.String nativeGetHint(java.lang.String); # Java-side doesn't use this, so it gets minified, but C-side still tries to register it
|
||||
boolean onNativeSoftReturnKey();
|
||||
void onNativeKeyboardFocusLost();
|
||||
boolean isScreenKeyboardShown();
|
||||
android.util.DisplayMetrics getDisplayDPI();
|
||||
java.lang.String clipboardGetText();
|
||||
boolean clipboardHasText();
|
||||
void clipboardSetText(java.lang.String);
|
||||
int createCustomCursor(int[], int, int, int, int);
|
||||
void destroyCustomCursor(int);
|
||||
android.content.Context getContext();
|
||||
boolean getManifestEnvironmentVariables();
|
||||
android.view.Surface getNativeSurface();
|
||||
void initTouch();
|
||||
boolean isAndroidTV();
|
||||
boolean isChromebook();
|
||||
boolean isDeXMode();
|
||||
boolean isTablet();
|
||||
void manualBackButton();
|
||||
int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]);
|
||||
void minimizeWindow();
|
||||
int openURL(java.lang.String);
|
||||
void requestPermission(java.lang.String, int);
|
||||
int showToast(java.lang.String, int, int, int, int);
|
||||
boolean sendMessage(int, int);
|
||||
boolean setActivityTitle(java.lang.String);
|
||||
boolean setCustomCursor(int);
|
||||
void setOrientation(int, int, boolean, java.lang.String);
|
||||
boolean setRelativeMouseEnabled(boolean);
|
||||
boolean setSystemCursor(int);
|
||||
boolean shouldMinimizeOnFocusLoss();
|
||||
boolean showTextInput(int, int, int, int);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager {
|
||||
boolean initialize(boolean, boolean);
|
||||
boolean openDevice(int);
|
||||
int sendOutputReport(int, byte[]);
|
||||
int sendFeatureReport(int, byte[]);
|
||||
boolean getFeatureReport(int, byte[]);
|
||||
void closeDevice(int);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLAudioManager {
|
||||
int[] getAudioOutputDevices();
|
||||
int[] getAudioInputDevices();
|
||||
int[] audioOpen(int, int, int, int, int);
|
||||
void audioWriteFloatBuffer(float[]);
|
||||
void audioWriteShortBuffer(short[]);
|
||||
void audioWriteByteBuffer(byte[]);
|
||||
void audioClose();
|
||||
int[] captureOpen(int, int, int, int, int);
|
||||
int captureReadFloatBuffer(float[], boolean);
|
||||
int captureReadShortBuffer(short[], boolean);
|
||||
int captureReadByteBuffer(byte[], boolean);
|
||||
void captureClose();
|
||||
void audioSetThreadPriority(boolean, int);
|
||||
native int nativeSetupJNI();
|
||||
native void removeAudioDevice(boolean, int);
|
||||
native void addAudioDevice(boolean, int);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager {
|
||||
void pollInputDevices();
|
||||
void pollHapticDevices();
|
||||
void hapticRun(int, float, int);
|
||||
void hapticStop(int);
|
||||
}
|
||||
|
@@ -60,8 +60,8 @@ 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 = 33;
|
||||
private static final int SDL_MICRO_VERSION = 0;
|
||||
private static final int SDL_MINOR_VERSION = 30;
|
||||
private static final int SDL_MICRO_VERSION = 8;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
@@ -790,9 +790,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
SDLActivity.mFullscreenModeActive = false;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
|
||||
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "error handling message, getContext() returned no Activity");
|
||||
|
@@ -80,8 +80,7 @@ do
|
||||
cd $folder
|
||||
done
|
||||
|
||||
# Uppercase the first char in the activity class name because it's Java
|
||||
ACTIVITY="$(echo $folder | awk '{$1=toupper(substr($1,0,1))substr($1,2)}1')Activity"
|
||||
ACTIVITY="${folder}Activity"
|
||||
sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml
|
||||
|
||||
# Fill in a default Activity
|
||||
|
File diff suppressed because it is too large
Load Diff
26
build-scripts/config.guess
vendored
26
build-scripts/config.guess
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright 1992-2025 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2025-07-10'
|
||||
timestamp='2024-01-01'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -60,7 +60,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright 1992-2025 Free Software Foundation, Inc.
|
||||
Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -123,7 +123,7 @@ set_cc_for_build() {
|
||||
dummy=$tmp/dummy
|
||||
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
|
||||
,,) echo "int x;" > "$dummy.c"
|
||||
for driver in cc gcc c17 c99 c89 ; do
|
||||
for driver in cc gcc c89 c99 ; do
|
||||
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD=$driver
|
||||
break
|
||||
@@ -634,8 +634,7 @@ EOF
|
||||
sed 's/^ //' << EOF > "$dummy.c"
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
@@ -719,8 +718,7 @@ EOF
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
@@ -1597,11 +1595,8 @@ EOF
|
||||
*:Unleashed:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
||||
;;
|
||||
x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
|
||||
;;
|
||||
*:[Ii]ronclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
|
||||
*:Ironclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1626,7 +1621,6 @@ cat > "$dummy.c" <<EOF
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
@@ -1811,8 +1805,8 @@ fi
|
||||
exit 1
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "timestamp='"
|
||||
# time-stamp-format: "%Y-%02m-%02d"
|
||||
# time-stamp-format: "%:y-%02m-%02d"
|
||||
# time-stamp-end: "'"
|
||||
# End:
|
||||
|
751
build-scripts/config.sub
vendored
751
build-scripts/config.sub
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
import subprocess
|
||||
@@ -10,18 +9,17 @@ import subprocess
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def determine_remote() -> str:
|
||||
text = (ROOT / "build-scripts/release-info.json").read_text()
|
||||
release_info = json.loads(text)
|
||||
if "remote" in release_info:
|
||||
return release_info["remote"]
|
||||
project_with_version = release_info["name"]
|
||||
def determine_project() -> str:
|
||||
text = (ROOT / "CMakeLists.txt").read_text()
|
||||
match = next(re.finditer(r"project\((?P<project>[a-zA-Z0-9_]+)\s+", text, flags=re.M))
|
||||
project_with_version = match["project"]
|
||||
project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
|
||||
return f"libsdl-org/{project}"
|
||||
return project
|
||||
|
||||
|
||||
def main():
|
||||
default_remote = determine_remote()
|
||||
project = determine_project()
|
||||
default_remote = f"libsdl-org/{project}"
|
||||
|
||||
current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2024 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"
|
||||
|
@@ -2415,10 +2415,10 @@ libtool_validate_options ()
|
||||
# preserve --debug
|
||||
test : = "$debug_cmd" || func_append preserve_args " --debug"
|
||||
|
||||
case $host_os in
|
||||
case $host in
|
||||
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
|
||||
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
|
||||
cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*)
|
||||
*cygwin* | *mingw* | *windows* | *pw32* | *cegcc* | *solaris2* | *os2*)
|
||||
# don't eliminate duplications in $postdeps and $predeps
|
||||
opt_duplicate_compiler_generated_deps=:
|
||||
;;
|
||||
@@ -4935,7 +4935,7 @@ func_win32_libid ()
|
||||
*ar\ archive*) # could be an import, or static
|
||||
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
|
||||
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
|
||||
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then
|
||||
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
|
||||
case $nm_interface in
|
||||
"MS dumpbin")
|
||||
if func_cygming_ms_implib_p "$1" ||
|
||||
@@ -5534,7 +5534,7 @@ EOF
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined _WIN32 && !defined __GNUC__
|
||||
#ifdef _MSC_VER
|
||||
# include <direct.h>
|
||||
# include <process.h>
|
||||
# include <io.h>
|
||||
@@ -6501,7 +6501,7 @@ func_mode_link ()
|
||||
# we shouldn't force the makefile maintainer to figure out
|
||||
# what system we are compiling for in order to pass an extra
|
||||
# flag for every libtool invocation.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols
|
||||
allow_undefined=no
|
||||
|
||||
# FIXME: Unfortunately, there are problems with the above when trying
|
||||
@@ -6509,7 +6509,7 @@ func_mode_link ()
|
||||
# even a static library is built. For now, we need to specify
|
||||
# -no-undefined on the libtool link line when we can be certain
|
||||
# that all symbols are satisfied, otherwise we get a static library.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols
|
||||
# allow_undefined=yes
|
||||
;;
|
||||
*)
|
||||
@@ -7096,7 +7096,7 @@ func_mode_link ()
|
||||
continue
|
||||
;;
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|
||||
|-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
func_append compiler_flags " $arg"
|
||||
func_append compile_command " $arg"
|
||||
func_append finalize_command " $arg"
|
||||
@@ -7310,10 +7310,7 @@ func_mode_link ()
|
||||
# -fno-sanitize* Clang/GCC memory and address sanitizer
|
||||
# -shared-libsan Link with shared sanitizer runtimes (Clang)
|
||||
# -static-libsan Link with static sanitizer runtimes (Clang)
|
||||
# -no-canonical-prefixes Do not expand any symbolic links
|
||||
# -fuse-ld=* Linker select flags for GCC
|
||||
# -static-* direct GCC to link specific libraries statically
|
||||
# -fcilkplus Cilk Plus language extension features for C/C++
|
||||
# -rtlib=* select c runtime lib with clang
|
||||
# --unwindlib=* select unwinder library with clang
|
||||
# -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
|
||||
@@ -7321,12 +7318,12 @@ func_mode_link ()
|
||||
# -Werror, -Werror=* Report (specified) warnings as errors
|
||||
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
|
||||
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
|
||||
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \
|
||||
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*| \
|
||||
-stdlib=*|-rtlib=*|--unwindlib=*| \
|
||||
-specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
|
||||
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
|
||||
-fdiagnostics-color*|-frecord-gcc-switches| \
|
||||
-fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
|
||||
-fuse-ld=*|-Wa,*|-Werror|-Werror=*)
|
||||
func_quote_for_eval "$arg"
|
||||
arg=$func_quote_for_eval_result
|
||||
func_append compile_command " $arg"
|
||||
@@ -7656,7 +7653,7 @@ func_mode_link ()
|
||||
found=false
|
||||
case $deplib in
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
||||
|-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
if test prog,link = "$linkmode,$pass"; then
|
||||
compile_deplibs="$deplib $compile_deplibs"
|
||||
finalize_deplibs="$deplib $finalize_deplibs"
|
||||
@@ -8182,8 +8179,8 @@ func_mode_link ()
|
||||
fi
|
||||
if test -n "$library_names" &&
|
||||
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
|
||||
case $host_os in
|
||||
cygwin* | mingw* | windows* | cegcc* | os2*)
|
||||
case $host in
|
||||
*cygwin* | *mingw* | *windows* | *cegcc* | *os2*)
|
||||
# No point in relinking DLLs because paths are not encoded
|
||||
func_append notinst_deplibs " $lib"
|
||||
need_relink=no
|
||||
@@ -8252,8 +8249,8 @@ func_mode_link ()
|
||||
soname=$dlname
|
||||
elif test -n "$soname_spec"; then
|
||||
# bleh windows
|
||||
case $host_os in
|
||||
cygwin* | mingw* | windows* | cegcc*) # | os2* # SDL customization: removed OS/2 versioning support.
|
||||
case $host in
|
||||
*cygwin* | mingw* | *windows* | *cegcc*) # | *os2* # SDL customization: removed OS/2 versioning support.
|
||||
func_arith $current - $age
|
||||
major=$func_arith_result
|
||||
versuffix=-$major
|
||||
@@ -8395,7 +8392,7 @@ func_mode_link ()
|
||||
test no = "$hardcode_direct_absolute"; then
|
||||
add=$libdir/$linklib
|
||||
elif test yes = "$hardcode_minus_L"; then
|
||||
add_dir=-L$lt_sysroot$libdir
|
||||
add_dir=-L$libdir
|
||||
add=-l$name
|
||||
elif test yes = "$hardcode_shlibpath_var"; then
|
||||
case :$finalize_shlibpath: in
|
||||
@@ -8412,7 +8409,7 @@ func_mode_link ()
|
||||
fi
|
||||
else
|
||||
# We cannot seem to hardcode it, guess we'll fake it.
|
||||
add_dir=-L$lt_sysroot$libdir
|
||||
add_dir=-L$libdir
|
||||
# Try looking first in the location we're being installed to.
|
||||
if test -n "$inst_prefix_dir"; then
|
||||
case $libdir in
|
||||
@@ -8683,7 +8680,7 @@ func_mode_link ()
|
||||
test CXX = "$tagname" && {
|
||||
case $host_os in
|
||||
linux*)
|
||||
case `$CC -V 2>&1 | $SED 5q` in
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ C*) # Sun C++ 5.9
|
||||
func_suncc_cstd_abi
|
||||
|
||||
@@ -8856,13 +8853,13 @@ func_mode_link ()
|
||||
#
|
||||
case $version_type in
|
||||
# correct linux to gnu/linux during the next big refactor
|
||||
darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none)
|
||||
darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
|
||||
func_arith $number_major + $number_minor
|
||||
current=$func_arith_result
|
||||
age=$number_minor
|
||||
revision=$number_revision
|
||||
;;
|
||||
freebsd-aout|sco|sunos)
|
||||
freebsd-aout|qnx|sco|sunos)
|
||||
current=$number_major
|
||||
revision=$number_minor
|
||||
age=0
|
||||
@@ -9009,9 +9006,8 @@ func_mode_link ()
|
||||
;;
|
||||
|
||||
qnx)
|
||||
func_arith $current - $age
|
||||
major=.$func_arith_result
|
||||
versuffix=$major.$age.$revision
|
||||
major=.$current
|
||||
versuffix=.$current
|
||||
;;
|
||||
|
||||
sco)
|
||||
|
@@ -1,108 +0,0 @@
|
||||
{
|
||||
"name": "SDL2",
|
||||
"remote": "libsdl-org/SDL",
|
||||
"version": {
|
||||
"file": "include/SDL_version.h",
|
||||
"re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$",
|
||||
"re_minor": "^#define SDL_MINOR_VERSION\\s+([0-9]+)$",
|
||||
"re_micro": "^#define SDL_PATCHLEVEL\\s+([0-9]+)$"
|
||||
},
|
||||
"source": {
|
||||
"checks": [
|
||||
"src/SDL.c",
|
||||
"include/SDL.h",
|
||||
"test/testsprite2.c",
|
||||
"android-project/app/src/main/java/org/libsdl/app/SDLActivity.java"
|
||||
]
|
||||
},
|
||||
"dmg": {
|
||||
"project": "Xcode/SDL/SDL.xcodeproj",
|
||||
"path": "Xcode/SDL/build/SDL2.dmg",
|
||||
"target": "Standard DMG"
|
||||
},
|
||||
"mingw": {
|
||||
"autotools": {
|
||||
"archs": ["x86", "x64"],
|
||||
"args": [
|
||||
],
|
||||
"files": {
|
||||
"@<@TRIPLET@>@/include/SDL2": [
|
||||
"include/SDL_config*.h"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"": [
|
||||
"mingw/pkg-support/INSTALL.txt",
|
||||
"mingw/pkg-support/Makefile",
|
||||
"BUGS.txt",
|
||||
"CREDITS.txt",
|
||||
"README-SDL.txt",
|
||||
"WhatsNew.txt",
|
||||
"LICENSE.txt",
|
||||
"README.md"
|
||||
],
|
||||
"cmake": [
|
||||
"mingw/pkg-support/cmake/sdl2-config.cmake",
|
||||
"mingw/pkg-support/cmake/sdl2-config-version.cmake"
|
||||
],
|
||||
"docs": [
|
||||
"docs/*"
|
||||
],
|
||||
"test": [
|
||||
"test/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"msvc": {
|
||||
"msbuild": {
|
||||
"archs": [
|
||||
"x86",
|
||||
"x64"
|
||||
],
|
||||
"projects": [
|
||||
"VisualC/SDL/SDL.vcxproj",
|
||||
"VisualC/SDLmain/SDLmain.vcxproj",
|
||||
"VisualC/SDLtest/SDLtest.vcxproj"
|
||||
],
|
||||
"files-lib": {
|
||||
"": [
|
||||
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll"
|
||||
]
|
||||
},
|
||||
"files-devel": {
|
||||
"lib/@<@ARCH@>@": [
|
||||
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll",
|
||||
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.lib",
|
||||
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.pdb",
|
||||
"VisualC/SDLmain/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2main.lib",
|
||||
"VisualC/SDLtest/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2test.lib"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files-lib": {
|
||||
"": [
|
||||
"README-SDL.txt"
|
||||
]
|
||||
},
|
||||
"files-devel": {
|
||||
"": [
|
||||
"README-SDL.txt",
|
||||
"BUGS.txt",
|
||||
"LICENSE.txt",
|
||||
"README.md",
|
||||
"WhatsNew.txt"
|
||||
],
|
||||
"cmake": [
|
||||
"VisualC/pkg-support/cmake/sdl2-config.cmake",
|
||||
"VisualC/pkg-support/cmake/sdl2-config-version.cmake"
|
||||
],
|
||||
"docs": [
|
||||
"docs/*"
|
||||
],
|
||||
"include": [
|
||||
"include/*.h"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,303 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import functools
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import textwrap
|
||||
import urllib.request
|
||||
import zipfile
|
||||
|
||||
# Update both variables when updating the GDK
|
||||
GIT_REF = "June_2024_Update_1"
|
||||
GDK_EDITION = "240601" # YYMMUU
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class GdDesktopConfigurator:
|
||||
def __init__(self, gdk_path, arch, vs_folder, vs_version=None, vs_toolset=None, temp_folder=None, git_ref=None, gdk_edition=None):
|
||||
self.git_ref = git_ref or GIT_REF
|
||||
self.gdk_edition = gdk_edition or GDK_EDITION
|
||||
self.gdk_path = gdk_path
|
||||
self.temp_folder = temp_folder or Path(tempfile.gettempdir())
|
||||
self.dl_archive_path = Path(self.temp_folder) / f"{ self.git_ref }.zip"
|
||||
self.gdk_extract_path = Path(self.temp_folder) / f"GDK-{ self.git_ref }"
|
||||
self.arch = arch
|
||||
self.vs_folder = vs_folder
|
||||
self._vs_version = vs_version
|
||||
self._vs_toolset = vs_toolset
|
||||
|
||||
def download_archive(self) -> None:
|
||||
gdk_url = f"https://github.com/microsoft/GDK/archive/refs/tags/{ GIT_REF }.zip"
|
||||
logger.info("Downloading %s to %s", gdk_url, self.dl_archive_path)
|
||||
urllib.request.urlretrieve(gdk_url, self.dl_archive_path)
|
||||
assert self.dl_archive_path.is_file()
|
||||
|
||||
def extract_zip_archive(self) -> None:
|
||||
extract_path = self.gdk_extract_path.parent
|
||||
assert self.dl_archive_path.is_file()
|
||||
logger.info("Extracting %s to %s", self.dl_archive_path, extract_path)
|
||||
with zipfile.ZipFile(self.dl_archive_path) as zf:
|
||||
zf.extractall(extract_path)
|
||||
assert self.gdk_extract_path.is_dir(), f"{self.gdk_extract_path} must exist"
|
||||
|
||||
def extract_development_kit(self) -> None:
|
||||
extract_dks_cmd = self.gdk_extract_path / "SetupScripts/ExtractXboxOneDKs.cmd"
|
||||
assert extract_dks_cmd.is_file()
|
||||
logger.info("Extracting GDK Development Kit: running %s", extract_dks_cmd)
|
||||
cmd = ["cmd.exe", "/C", str(extract_dks_cmd), str(self.gdk_extract_path), str(self.gdk_path)]
|
||||
logger.debug("Running %r", cmd)
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
def detect_vs_version(self) -> str:
|
||||
vs_regex = re.compile("VS([0-9]{4})")
|
||||
supported_vs_versions = []
|
||||
for p in self.gaming_grdk_build_path.iterdir():
|
||||
if not p.is_dir():
|
||||
continue
|
||||
if m := vs_regex.match(p.name):
|
||||
supported_vs_versions.append(m.group(1))
|
||||
logger.info(f"Supported Visual Studio versions: {supported_vs_versions}")
|
||||
vs_versions = set(self.vs_folder.parts).intersection(set(supported_vs_versions))
|
||||
if not vs_versions:
|
||||
raise RuntimeError("Visual Studio version is incompatible")
|
||||
if len(vs_versions) > 1:
|
||||
raise RuntimeError(f"Too many compatible VS versions found ({vs_versions})")
|
||||
vs_version = vs_versions.pop()
|
||||
logger.info(f"Used Visual Studio version: {vs_version}")
|
||||
return vs_version
|
||||
|
||||
def detect_vs_toolset(self) -> str:
|
||||
toolset_paths = []
|
||||
for ts_path in self.gdk_toolset_parent_path.iterdir():
|
||||
if not ts_path.is_dir():
|
||||
continue
|
||||
ms_props = ts_path / "Microsoft.Cpp.props"
|
||||
if not ms_props.is_file():
|
||||
continue
|
||||
toolset_paths.append(ts_path.name)
|
||||
logger.info("Detected Visual Studio toolsets: %s", toolset_paths)
|
||||
assert toolset_paths, "Have we detected at least one toolset?"
|
||||
|
||||
def toolset_number(toolset: str) -> int:
|
||||
if m:= re.match("[^0-9]*([0-9]+).*", toolset):
|
||||
return int(m.group(1))
|
||||
return -9
|
||||
|
||||
return max(toolset_paths, key=toolset_number)
|
||||
|
||||
@property
|
||||
def vs_version(self) -> str:
|
||||
if self._vs_version is None:
|
||||
self._vs_version = self.detect_vs_version()
|
||||
return self._vs_version
|
||||
|
||||
@property
|
||||
def vs_toolset(self) -> str:
|
||||
if self._vs_toolset is None:
|
||||
self._vs_toolset = self.detect_vs_toolset()
|
||||
return self._vs_toolset
|
||||
|
||||
@staticmethod
|
||||
def copy_files_and_merge_into(srcdir: Path, dstdir: Path) -> None:
|
||||
logger.info(f"Copy {srcdir} to {dstdir}")
|
||||
for root, _, files in os.walk(srcdir):
|
||||
dest_root = dstdir / Path(root).relative_to(srcdir)
|
||||
if not dest_root.is_dir():
|
||||
dest_root.mkdir()
|
||||
for file in files:
|
||||
srcfile = Path(root) / file
|
||||
dstfile = dest_root / file
|
||||
shutil.copy(srcfile, dstfile)
|
||||
|
||||
def copy_msbuild(self) -> None:
|
||||
vc_toolset_parent_path = self.vs_folder / "MSBuild/Microsoft/VC"
|
||||
if 1:
|
||||
logger.info(f"Detected compatible Visual Studio version: {self.vs_version}")
|
||||
srcdir = vc_toolset_parent_path
|
||||
dstdir = self.gdk_toolset_parent_path
|
||||
assert srcdir.is_dir(), "Source directory must exist"
|
||||
assert dstdir.is_dir(), "Destination directory must exist"
|
||||
|
||||
self.copy_files_and_merge_into(srcdir=srcdir, dstdir=dstdir)
|
||||
|
||||
@property
|
||||
def game_dk_path(self) -> Path:
|
||||
return self.gdk_path / "Microsoft GDK"
|
||||
|
||||
@property
|
||||
def game_dk_latest_path(self) -> Path:
|
||||
return self.game_dk_path / self.gdk_edition
|
||||
|
||||
@property
|
||||
def windows_sdk_path(self) -> Path:
|
||||
return self.gdk_path / "Windows Kits/10"
|
||||
|
||||
@property
|
||||
def gaming_grdk_build_path(self) -> Path:
|
||||
return self.game_dk_latest_path / "GRDK"
|
||||
|
||||
@property
|
||||
def gdk_toolset_parent_path(self) -> Path:
|
||||
return self.gaming_grdk_build_path / f"VS{self.vs_version}/flatDeployment/MSBuild/Microsoft/VC"
|
||||
|
||||
@property
|
||||
def env(self) -> dict[str, str]:
|
||||
game_dk = self.game_dk_path
|
||||
game_dk_latest = self.game_dk_latest_path
|
||||
windows_sdk_dir = self.windows_sdk_path
|
||||
gaming_grdk_build = self.gaming_grdk_build_path
|
||||
|
||||
return {
|
||||
"GRDKEDITION": f"{self.gdk_edition}",
|
||||
"GameDK": f"{game_dk}\\",
|
||||
"GameDKLatest": f"{ game_dk_latest }\\",
|
||||
"WindowsSdkDir": f"{ windows_sdk_dir }\\",
|
||||
"GamingGRDKBuild": f"{ gaming_grdk_build }\\",
|
||||
"VSInstallDir": f"{ self.vs_folder }\\",
|
||||
}
|
||||
|
||||
def create_user_props(self, path: Path) -> None:
|
||||
vc_targets_path = self.gaming_grdk_build_path / f"VS{ self.vs_version }/flatDeployment/MSBuild/Microsoft/VC/{ self.vs_toolset }"
|
||||
vc_targets_path16 = self.gaming_grdk_build_path / f"VS2019/flatDeployment/MSBuild/Microsoft/VC/{ self.vs_toolset }"
|
||||
vc_targets_path17 = self.gaming_grdk_build_path / f"VS2022/flatDeployment/MSBuild/Microsoft/VC/{ self.vs_toolset }"
|
||||
additional_include_directories = ";".join(str(p) for p in self.gdk_include_paths)
|
||||
additional_library_directories = ";".join(str(p) for p in self.gdk_library_paths)
|
||||
durango_xdk_install_path = self.gdk_path / "Microsoft GDK"
|
||||
with path.open("w") as f:
|
||||
f.write(textwrap.dedent(f"""\
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VCTargetsPath>{ vc_targets_path }\\</VCTargetsPath>
|
||||
<VCTargetsPath16>{ vc_targets_path16 }\\</VCTargetsPath16>
|
||||
<VCTargetsPath17>{ vc_targets_path17 }\\</VCTargetsPath17>
|
||||
<BWOI_GDK_Path>{ self.gaming_grdk_build_path }\\</BWOI_GDK_Path>
|
||||
<Platform Condition="'$(Platform)' == ''">Gaming.Desktop.x64</Platform>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
|
||||
<XdkEditionTarget>{ self.gdk_edition }</XdkEditionTarget>
|
||||
<DurangoXdkInstallPath>{ durango_xdk_install_path }</DurangoXdkInstallPath>
|
||||
|
||||
<DefaultXdkEditionRootVS2019>$(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2019\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\</DefaultXdkEditionRootVS2019>
|
||||
<XdkEditionRootVS2019>$(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2019\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\</XdkEditionRootVS2019>
|
||||
<DefaultXdkEditionRootVS2022>$(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2022\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\</DefaultXdkEditionRootVS2022>
|
||||
<XdkEditionRootVS2022>$(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2022\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\</XdkEditionRootVS2022>
|
||||
|
||||
<Deterministic>true</Deterministic>
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<ClearDevCommandPromptEnvVars>true</ClearDevCommandPromptEnvVars>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Platform)' == 'Gaming.Desktop.x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>{ additional_include_directories };%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>{ additional_library_directories };%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
"""))
|
||||
|
||||
@property
|
||||
def gdk_include_paths(self) -> list[Path]:
|
||||
return [
|
||||
self.gaming_grdk_build_path / "gamekit/include",
|
||||
]
|
||||
|
||||
@property
|
||||
def gdk_library_paths(self) -> list[Path]:
|
||||
return [
|
||||
self.gaming_grdk_build_path / f"gamekit/lib/{self.arch}",
|
||||
]
|
||||
|
||||
@property
|
||||
def gdk_binary_path(self) -> list[Path]:
|
||||
return [
|
||||
self.gaming_grdk_build_path / "bin",
|
||||
self.game_dk_path / "bin",
|
||||
]
|
||||
|
||||
@property
|
||||
def build_env(self) -> dict[str, str]:
|
||||
gdk_include = ";".join(str(p) for p in self.gdk_include_paths)
|
||||
gdk_lib = ";".join(str(p) for p in self.gdk_library_paths)
|
||||
gdk_path = ";".join(str(p) for p in self.gdk_binary_path)
|
||||
return {
|
||||
"GDK_INCLUDE": gdk_include,
|
||||
"GDK_LIB": gdk_lib,
|
||||
"GDK_PATH": gdk_path,
|
||||
}
|
||||
|
||||
def print_env(self) -> None:
|
||||
for k, v in self.env.items():
|
||||
print(f"set \"{k}={v}\"")
|
||||
print()
|
||||
for k, v in self.build_env.items():
|
||||
print(f"set \"{k}={v}\"")
|
||||
print()
|
||||
print(f"set \"PATH=%GDK_PATH%;%PATH%\"")
|
||||
print(f"set \"LIB=%GDK_LIB%;%LIB%\"")
|
||||
print(f"set \"INCLUDE=%GDK_INCLUDE%;%INCLUDE%\"")
|
||||
|
||||
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
parser = argparse.ArgumentParser(allow_abbrev=False)
|
||||
parser.add_argument("--arch", choices=["amd64"], default="amd64", help="Architecture")
|
||||
parser.add_argument("--download", action="store_true", help="Download GDK")
|
||||
parser.add_argument("--extract", action="store_true", help="Extract downloaded GDK")
|
||||
parser.add_argument("--copy-msbuild", action="store_true", help="Copy MSBuild files")
|
||||
parser.add_argument("--temp-folder", help="Temporary folder where to download and extract GDK")
|
||||
parser.add_argument("--gdk-path", required=True, type=Path, help="Folder where to store the GDK")
|
||||
parser.add_argument("--ref-edition", type=str, help="Git ref and GDK edition separated by comma")
|
||||
parser.add_argument("--vs-folder", required=True, type=Path, help="Installation folder of Visual Studio")
|
||||
parser.add_argument("--vs-version", required=False, type=int, help="Visual Studio version")
|
||||
parser.add_argument("--vs-toolset", required=False, help="Visual Studio toolset (e.g. v150)")
|
||||
parser.add_argument("--props-folder", required=False, type=Path, default=Path(), help="Visual Studio toolset (e.g. v150)")
|
||||
parser.add_argument("--no-user-props", required=False, dest="user_props", action="store_false", help="Don't ")
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
git_ref = None
|
||||
gdk_edition = None
|
||||
if args.ref_edition is not None:
|
||||
git_ref, gdk_edition = args.ref_edition.split(",", 1)
|
||||
try:
|
||||
int(gdk_edition)
|
||||
except ValueError:
|
||||
parser.error("Edition should be an integer (YYMMUU) (Y=year M=month U=update)")
|
||||
|
||||
configurator = GdDesktopConfigurator(
|
||||
arch=args.arch,
|
||||
git_ref=git_ref,
|
||||
gdk_edition=gdk_edition,
|
||||
vs_folder=args.vs_folder,
|
||||
vs_version=args.vs_version,
|
||||
vs_toolset=args.vs_toolset,
|
||||
gdk_path=args.gdk_path,
|
||||
temp_folder=args.temp_folder,
|
||||
)
|
||||
|
||||
if args.download:
|
||||
configurator.download_archive()
|
||||
|
||||
if args.extract:
|
||||
configurator.extract_zip_archive()
|
||||
|
||||
configurator.extract_development_kit()
|
||||
|
||||
if args.copy_msbuild:
|
||||
configurator.copy_msbuild()
|
||||
|
||||
if args.user_props:
|
||||
configurator.print_env()
|
||||
configurator.create_user_props(args.props_folder / "Directory.Build.props")
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
@@ -5,8 +5,8 @@
|
||||
SDL_ROOT=$(dirname $0)/..
|
||||
cd $SDL_ROOT
|
||||
|
||||
if [ -e ./REVISION.txt ]; then
|
||||
cat ./REVISION.txt
|
||||
if [ -e ./VERSION.txt ]; then
|
||||
cat ./VERSION.txt
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@@ -29,7 +29,7 @@ done
|
||||
rev=`sh showrev.sh 2>/dev/null`
|
||||
if [ "$rev" != "" ]; then
|
||||
if [ -n "$dist" ]; then
|
||||
echo "$rev" > "$outdir/REVISION.txt"
|
||||
echo "$rev" > "$outdir/VERSION.txt"
|
||||
fi
|
||||
echo "/* Generated by updaterev.sh, do not edit */" >"$header.new"
|
||||
if [ -n "$vendor" ]; then
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -27,13 +27,11 @@ function(check_cpu_architecture ARCH VARIABLE)
|
||||
if(ARCH STREQUAL "x86")
|
||||
_internal_check_cpu_architecture("defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)" x86 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "x64")
|
||||
_internal_check_cpu_architecture("(defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)" x64 ${VARIABLE})
|
||||
_internal_check_cpu_architecture("defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)" x64 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "arm32")
|
||||
_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 "arm64ec")
|
||||
_internal_check_cpu_architecture("defined(_M_ARM64EC)" arm64ec ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "loongarch64")
|
||||
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
|
||||
else()
|
||||
|
@@ -119,7 +119,7 @@ macro(CheckALSA)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_ALSA_SHARED)
|
||||
list(APPEND CMAKE_LIBS ALSA::ALSA)
|
||||
list(APPEND CMAKE_DEPENDS ALSA::ALSA)
|
||||
list(APPEND PKGCONFIG_DEPENDS alsa)
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
@@ -947,7 +947,7 @@ macro(CheckPTHREAD)
|
||||
elseif(BSDI)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
||||
set(PTHREAD_LDFLAGS "")
|
||||
elseif(MACOS)
|
||||
elseif(DARWIN)
|
||||
set(PTHREAD_CFLAGS "-D_THREAD_SAFE")
|
||||
# causes Carbon.p complaints?
|
||||
# set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
||||
@@ -963,11 +963,7 @@ macro(CheckPTHREAD)
|
||||
set(PTHREAD_LDFLAGS "-lpthread")
|
||||
elseif(SOLARIS)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
||||
else()
|
||||
set(PTHREAD_LDFLAGS "-pthread")
|
||||
endif()
|
||||
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
||||
elseif(SYSV5)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
||||
set(PTHREAD_LDFLAGS "")
|
||||
@@ -1253,7 +1249,6 @@ macro(CheckHIDAPI)
|
||||
|
||||
if(HAVE_HIDAPI)
|
||||
if(ANDROID)
|
||||
enable_language(CXX)
|
||||
list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp)
|
||||
endif()
|
||||
if(IOS OR TVOS)
|
||||
@@ -1281,18 +1276,13 @@ endmacro()
|
||||
# - n/a
|
||||
macro(CheckRPI)
|
||||
if(SDL_RPI)
|
||||
pkg_check_modules(VIDEO_RPI bcm_host)
|
||||
pkg_check_modules(VIDEO_RPI bcm_host brcmegl)
|
||||
if (NOT VIDEO_RPI_FOUND)
|
||||
set(VIDEO_RPI_INCLUDE_DIRS "/opt/vc/include" "/opt/vc/include/interface/vcos/pthreads" "/opt/vc/include/interface/vmcs_host/linux/" )
|
||||
set(VIDEO_RPI_LIBRARY_DIRS "/opt/vc/lib" )
|
||||
set(VIDEO_RPI_LIBRARIES bcm_host )
|
||||
set(VIDEO_RPI_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
|
||||
endif()
|
||||
|
||||
pkg_check_modules(VIDEO_RPI_EGL brcmegl)
|
||||
if (NOT VIDEO_RPI_EGL_FOUND)
|
||||
set(VIDEO_RPI_EGL_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
|
||||
endif()
|
||||
|
||||
listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I")
|
||||
listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
|
||||
|
||||
@@ -1301,7 +1291,9 @@ macro(CheckRPI)
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBRARIES}")
|
||||
check_c_source_compiles("
|
||||
#include <bcm_host.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
int main(int argc, char **argv) {
|
||||
EGL_DISPMANX_WINDOW_T window;
|
||||
bcm_host_init();
|
||||
}" HAVE_RPI)
|
||||
set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
|
||||
@@ -1315,7 +1307,7 @@ macro(CheckRPI)
|
||||
list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
|
||||
# !!! FIXME: shouldn't be using CMAKE_C_FLAGS, right?
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
|
||||
list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS} ${VIDEO_RPI_EGL_LDFLAGS})
|
||||
list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -32,8 +32,10 @@ macro(SDL_DetectCMakePlatform)
|
||||
set(SDL_CMAKE_PLATFORM QNX)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
|
||||
set(SDL_CMAKE_PLATFORM MACOS)
|
||||
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.*")
|
||||
@@ -41,10 +43,6 @@ macro(SDL_DetectCMakePlatform)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.14)
|
||||
set(SDL_CMAKE_PLATFORM IOS)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*watchOS.*")
|
||||
set(SDL_CMAKE_PLATFORM WATCHOS)
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "visionOS")
|
||||
set(SDL_CMAKE_PLATFORM VISIONOS)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
||||
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
||||
|
@@ -3,8 +3,6 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(sdl_test LANGUAGES C)
|
||||
|
||||
include(CheckLanguage)
|
||||
include(FeatureSummary)
|
||||
include(GenerateExportHeader)
|
||||
|
||||
if(ANDROID)
|
||||
@@ -21,6 +19,8 @@ cmake_policy(SET CMP0074 NEW)
|
||||
# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL2 outside of sysroot
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
option(TEST_SHARED "Test linking to shared SDL2 library" ON)
|
||||
add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library")
|
||||
|
||||
@@ -33,19 +33,6 @@ add_feature_info("TEST_TEST" TEST_STATIC "Test linking to SDL test library")
|
||||
option(TEST_FULL "Run complete SDL test suite" OFF)
|
||||
add_feature_info("TEST_FULL" TEST_FULL "Build full SDL testsuite")
|
||||
|
||||
# FIXME: how to target ios/tvos with Swift?
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/20104
|
||||
if(APPLE AND CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
|
||||
# multiple values for CMAKE_OSX_ARCHITECTURES not supported with Swift
|
||||
list(LENGTH CMAKE_OSX_ARCHITECTURES count_osx_archs)
|
||||
if(count_osx_archs LESS_EQUAL 1)
|
||||
check_language(Swift)
|
||||
if(CMAKE_Swift_COMPILER)
|
||||
enable_language(Swift)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TEST_SHARED)
|
||||
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2)
|
||||
if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE))
|
||||
@@ -99,12 +86,6 @@ if(TEST_SHARED)
|
||||
add_executable(sdltest-shared sdltest.c)
|
||||
target_link_libraries(sdltest-shared PRIVATE SDL2::SDL2main SDL2::SDL2test SDL2::SDL2)
|
||||
endif()
|
||||
|
||||
if(CMAKE_Swift_COMPILER)
|
||||
add_executable(swift-shared main.swift)
|
||||
target_include_directories(swift-shared PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift")
|
||||
target_link_libraries(swift-shared PRIVATE SDL2::SDL2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TEST_STATIC)
|
||||
@@ -142,11 +123,6 @@ if(TEST_STATIC)
|
||||
target_include_directories(cli-static-vars PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(TEST_TEST)
|
||||
add_executable(sdltest-static sdltest.c)
|
||||
target_link_libraries(sdltest-static PRIVATE SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static)
|
||||
endif()
|
||||
|
||||
if(CMAKE_Swift_COMPILER)
|
||||
add_executable(swift-static main.swift)
|
||||
target_include_directories(swift-static PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift")
|
||||
|
@@ -1,12 +0,0 @@
|
||||
/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */
|
||||
|
||||
import SDL2
|
||||
|
||||
guard SDL_Init(Uint32(SDL_INIT_VIDEO)) == 0 else {
|
||||
fatalError("SDL_Init error: \(String(cString: SDL_GetError()))")
|
||||
}
|
||||
|
||||
var sdlVersion = SDL_version()
|
||||
SDL_GetVersion(&sdlVersion)
|
||||
|
||||
print("SDL version: \(sdlVersion.major).\(sdlVersion.minor).\(sdlVersion.patch)")
|
@@ -1,4 +0,0 @@
|
||||
module SDL2 [extern_c] {
|
||||
header "shim.h"
|
||||
export *
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */
|
||||
|
||||
#include "SDL.h"
|
247
configure
vendored
247
configure
vendored
@@ -703,8 +703,6 @@ X_LIBS
|
||||
X_PRE_LIBS
|
||||
X_CFLAGS
|
||||
XMKMF
|
||||
RPI_EGL_LIBS
|
||||
RPI_EGL_CFLAGS
|
||||
RPI_LIBS
|
||||
RPI_CFLAGS
|
||||
DECOR_LIBS
|
||||
@@ -993,8 +991,6 @@ DECOR_CFLAGS
|
||||
DECOR_LIBS
|
||||
RPI_CFLAGS
|
||||
RPI_LIBS
|
||||
RPI_EGL_CFLAGS
|
||||
RPI_EGL_LIBS
|
||||
XMKMF
|
||||
DIRECTFB_CFLAGS
|
||||
DIRECTFB_LIBS
|
||||
@@ -1672,7 +1668,7 @@ Optional Features:
|
||||
--enable-ssemath Allow GCC to use SSE floating point math
|
||||
[default=maybe]
|
||||
--enable-mmx use MMX assembly routines [default=yes]
|
||||
--enable-3dnow use 3DNow! assembly routines [default=no]
|
||||
--enable-3dnow use 3DNow! assembly routines [default=yes]
|
||||
--enable-sse use SSE assembly routines [default=yes]
|
||||
--enable-sse2 use SSE2 assembly routines [default=maybe]
|
||||
--enable-sse3 use SSE3 assembly routines [default=maybe]
|
||||
@@ -1722,7 +1718,7 @@ Optional Features:
|
||||
[default=yes]
|
||||
--enable-libdecor-shared
|
||||
dynamically load libdecor [default=yes]
|
||||
--enable-video-rpi use Raspberry Pi 0-3 video driver [default=yes]
|
||||
--enable-video-rpi use Raspberry Pi 2/3 video driver [default=yes]
|
||||
--enable-video-x11 use X11 video driver [default=maybe]
|
||||
--enable-x11-shared dynamically load X11 support [default=maybe]
|
||||
--enable-video-x11-xcursor
|
||||
@@ -1852,10 +1848,6 @@ Some influential environment variables:
|
||||
DECOR_LIBS linker flags for DECOR, overriding pkg-config
|
||||
RPI_CFLAGS C compiler flags for RPI, overriding pkg-config
|
||||
RPI_LIBS linker flags for RPI, overriding pkg-config
|
||||
RPI_EGL_CFLAGS
|
||||
C compiler flags for RPI_EGL, overriding pkg-config
|
||||
RPI_EGL_LIBS
|
||||
linker flags for RPI_EGL, overriding pkg-config
|
||||
XMKMF Path to xmkmf, Makefile generator for X Window System
|
||||
DIRECTFB_CFLAGS
|
||||
C compiler flags for DIRECTFB, overriding pkg-config
|
||||
@@ -3515,8 +3507,8 @@ orig_CFLAGS="$CFLAGS"
|
||||
|
||||
# See docs/release_checklist.md
|
||||
SDL_MAJOR_VERSION=2
|
||||
SDL_MINOR_VERSION=33
|
||||
SDL_MICRO_VERSION=0
|
||||
SDL_MINOR_VERSION=30
|
||||
SDL_MICRO_VERSION=8
|
||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||
|
||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||
@@ -5815,7 +5807,7 @@ cygwin*)
|
||||
# func_win32_libid is a shell function defined in ltmain.sh
|
||||
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
mingw* | windows* | pw32*)
|
||||
@@ -5827,10 +5819,10 @@ mingw* | windows* | pw32*)
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
else
|
||||
# Keep this pattern in sync with the one in func_win32_libid.
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
|
||||
lt_cv_file_magic_cmd='$OBJDUMP -f'
|
||||
fi
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
cegcc*)
|
||||
@@ -6836,7 +6828,7 @@ void nm_test_func(void){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(void){nm_test_var='a';nm_test_func();return(0);}
|
||||
int main(){nm_test_var='a';nm_test_func();return(0);}
|
||||
_LT_EOF
|
||||
|
||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||
@@ -8098,43 +8090,6 @@ fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
|
||||
printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
|
||||
|
||||
# Feature test to disable chained fixups since it is not
|
||||
# compatible with '-undefined dynamic_lookup'
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5
|
||||
printf %s "checking for -no_fixup_chains linker flag... " >&6; }
|
||||
if test ${lt_cv_support_no_fixup_chains+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"
|
||||
then :
|
||||
lt_cv_support_no_fixup_chains=yes
|
||||
else $as_nop
|
||||
lt_cv_support_no_fixup_chains=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
|
||||
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5
|
||||
printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; }
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
|
||||
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
|
||||
if test ${lt_cv_ld_exported_symbols_list+y}
|
||||
@@ -8187,7 +8142,7 @@ _LT_EOF
|
||||
echo "$RANLIB libconftest.a" >&5
|
||||
$RANLIB libconftest.a 2>&5
|
||||
cat > conftest.c << _LT_EOF
|
||||
int main(void) { return 0;}
|
||||
int main() { return 0;}
|
||||
_LT_EOF
|
||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
|
||||
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
||||
@@ -8215,12 +8170,7 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; }
|
||||
10.[012],*|,*powerpc*-darwin[5-8]*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
*)
|
||||
if test yes = "$lt_cv_support_no_fixup_chains"; then
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains'
|
||||
else
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
|
||||
fi
|
||||
;;
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -9120,7 +9070,7 @@ objext=$objext
|
||||
lt_simple_compile_test_code="int some_variable = 0;"
|
||||
|
||||
# Code to be used in simple link tests
|
||||
lt_simple_link_test_code='int main(void){return(0);}'
|
||||
lt_simple_link_test_code='int main(){return(0);}'
|
||||
|
||||
|
||||
|
||||
@@ -11600,14 +11550,14 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
#soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
|
||||
;;
|
||||
mingw* | windows* | cegcc*)
|
||||
# MinGW DLLs use traditional 'lib' prefix
|
||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
@@ -12671,11 +12621,11 @@ else
|
||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||
correspondingly for the symbols needed. */
|
||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||
int fnord (void) __attribute__((visibility("default")));
|
||||
int fnord () __attribute__((visibility("default")));
|
||||
#endif
|
||||
|
||||
int fnord (void) { return 42; }
|
||||
int main (void)
|
||||
int fnord () { return 42; }
|
||||
int main ()
|
||||
{
|
||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||
int status = $lt_dlunknown;
|
||||
@@ -12778,11 +12728,11 @@ else
|
||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||
correspondingly for the symbols needed. */
|
||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||
int fnord (void) __attribute__((visibility("default")));
|
||||
int fnord () __attribute__((visibility("default")));
|
||||
#endif
|
||||
|
||||
int fnord (void) { return 42; }
|
||||
int main (void)
|
||||
int fnord () { return 42; }
|
||||
int main ()
|
||||
{
|
||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||
int status = $lt_dlunknown;
|
||||
@@ -16984,13 +16934,13 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
#soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
|
||||
;;
|
||||
mingw* | windows* | cegcc*)
|
||||
# MinGW DLLs use traditional 'lib' prefix
|
||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
@@ -19755,12 +19705,6 @@ if test "x$ac_cv_func_sigaction" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
ac_fn_c_check_func "$LINENO" "sigtimedwait" "ac_cv_func_sigtimedwait"
|
||||
if test "x$ac_cv_func_sigtimedwait" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
ac_fn_c_check_func "$LINENO" "setjmp" "ac_cv_func_setjmp"
|
||||
if test "x$ac_cv_func_setjmp" = xyes
|
||||
@@ -20703,7 +20647,7 @@ if test ${enable_3dnow+y}
|
||||
then :
|
||||
enableval=$enable_3dnow;
|
||||
else $as_nop
|
||||
enable_3dnow=no
|
||||
enable_3dnow=yes
|
||||
fi
|
||||
|
||||
if test x$enable_3dnow = xyes; then
|
||||
@@ -21092,7 +21036,7 @@ printf "%s\n" "#define HAVE_ALTIVEC_H 1" >>confdefs.h
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --enable-lsx was given.
|
||||
# Check whether --enable-lsx was given.
|
||||
if test ${enable_lsx+y}
|
||||
then :
|
||||
enableval=$enable_lsx;
|
||||
@@ -21100,7 +21044,7 @@ else $as_nop
|
||||
enable_lsx=yes
|
||||
fi
|
||||
|
||||
if test x$enable_lsx = xyes; then
|
||||
if test x$enable_lsx = xyes; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
have_gcc_lsx=no
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mlsx option" >&5
|
||||
@@ -21136,11 +21080,11 @@ printf "%s\n" "$have_gcc_lsx" >&6; }
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
||||
SUMMARY_math="${SUMMARY_math} lsx"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lsxintrin.h" >&5
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lsxintrin.h" >&5
|
||||
printf %s "checking for lsxintrin.h... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <lsxintrin.h>
|
||||
int
|
||||
@@ -21158,13 +21102,13 @@ else $as_nop
|
||||
have_lsxintrin_h_hdr=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_lsxintrin_h_hdr" >&5
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_lsxintrin_h_hdr" >&5
|
||||
printf "%s\n" "$have_lsxintrin_h_hdr" >&6; }
|
||||
if test x$have_lsxintrin_h_hdr = xyes; then
|
||||
if test x$have_lsxintrin_h_hdr = xyes; then
|
||||
|
||||
printf "%s\n" "#define HAVE_LSXINTRIN_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
CheckOSS()
|
||||
{
|
||||
@@ -22428,6 +22372,7 @@ printf %s "checking for NAS audio support... " >&6; }
|
||||
have_nas=yes
|
||||
NAS_CFLAGS="-I/usr/X11R6/include/"
|
||||
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
||||
|
||||
fi
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5
|
||||
@@ -23675,19 +23620,19 @@ fi
|
||||
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
|
||||
|
||||
pkg_failed=no
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host" >&5
|
||||
printf %s "checking for bcm_host... " >&6; }
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host brcmegl" >&5
|
||||
printf %s "checking for bcm_host brcmegl... " >&6; }
|
||||
|
||||
if test -n "$RPI_CFLAGS"; then
|
||||
pkg_cv_RPI_CFLAGS="$RPI_CFLAGS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_CFLAGS=`$PKG_CONFIG --cflags "bcm_host" 2>/dev/null`
|
||||
pkg_cv_RPI_CFLAGS=`$PKG_CONFIG --cflags "bcm_host brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
@@ -23699,12 +23644,12 @@ if test -n "$RPI_LIBS"; then
|
||||
pkg_cv_RPI_LIBS="$RPI_LIBS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_LIBS=`$PKG_CONFIG --libs "bcm_host" 2>/dev/null`
|
||||
pkg_cv_RPI_LIBS=`$PKG_CONFIG --libs "bcm_host brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
@@ -23725,9 +23670,9 @@ else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host" 2>&1`
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host brcmegl" 2>&1`
|
||||
else
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host" 2>&1`
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host brcmegl" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$RPI_PKG_ERRORS" >&5
|
||||
@@ -23745,92 +23690,13 @@ printf "%s\n" "yes" >&6; }
|
||||
video_rpi=yes
|
||||
fi
|
||||
|
||||
pkg_failed=no
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for brcmegl" >&5
|
||||
printf %s "checking for brcmegl... " >&6; }
|
||||
|
||||
if test -n "$RPI_EGL_CFLAGS"; then
|
||||
pkg_cv_RPI_EGL_CFLAGS="$RPI_EGL_CFLAGS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_EGL_CFLAGS=`$PKG_CONFIG --cflags "brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
if test -n "$RPI_EGL_LIBS"; then
|
||||
pkg_cv_RPI_EGL_LIBS="$RPI_EGL_LIBS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_EGL_LIBS=`$PKG_CONFIG --libs "brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
RPI_EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "brcmegl" 2>&1`
|
||||
else
|
||||
RPI_EGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "brcmegl" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$RPI_EGL_PKG_ERRORS" >&5
|
||||
|
||||
video_rpi_egl=no
|
||||
elif test $pkg_failed = untried; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
video_rpi_egl=no
|
||||
else
|
||||
RPI_EGL_CFLAGS=$pkg_cv_RPI_EGL_CFLAGS
|
||||
RPI_EGL_LIBS=$pkg_cv_RPI_EGL_LIBS
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
printf "%s\n" "yes" >&6; }
|
||||
video_rpi_egl=yes
|
||||
fi
|
||||
|
||||
if test x$video_rpi = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/usr/pkg/lib -lbcm_host"
|
||||
RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
|
||||
else
|
||||
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$video_rpi_egl = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_EGL_LIBS="-Wl,-R/usr/pkg/lib"
|
||||
else
|
||||
RPI_EGL_LIBS="-Wl,-rpath,/opt/vc/lib"
|
||||
RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -23838,20 +23704,22 @@ fi
|
||||
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
||||
|
||||
# Add the Raspberry Pi compiler flags and libraries
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 0-3" >&5
|
||||
printf %s "checking for Raspberry Pi 0-3... " >&6; }
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 2/3" >&5
|
||||
printf %s "checking for Raspberry Pi 2/3... " >&6; }
|
||||
have_video_rpi=no
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <bcm_host.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
EGL_DISPMANX_WINDOW_T window;
|
||||
bcm_host_init();
|
||||
|
||||
;
|
||||
@@ -23874,7 +23742,7 @@ printf "%s\n" "$have_video_rpi" >&6; }
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
||||
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
|
||||
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
|
||||
|
||||
printf "%s\n" "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
|
||||
@@ -26458,9 +26326,6 @@ else $as_nop
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
;;
|
||||
*-*-solaris*)
|
||||
enable_video_vulkan=no
|
||||
;;
|
||||
*-*-darwin*)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -x objective-c"
|
||||
@@ -28399,8 +28264,7 @@ fi
|
||||
|
||||
if test x$hidapi_support = xyes; then
|
||||
if test x$have_libusb_h = xyes; then
|
||||
|
||||
printf "%s\n" "#define HAVE_LIBUSB 1" >>confdefs.h
|
||||
printf "%s\n" "#define HAVE_LIBUSB 1" >>confdefs.h
|
||||
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
|
||||
if test x$require_hidapi_libusb = xyes; then
|
||||
@@ -28747,23 +28611,12 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
|
||||
if test x$enable_audio = xyes; then
|
||||
case $ARCH in
|
||||
sysv5|solaris|hpux)
|
||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
||||
ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_audioio_h" = xyes
|
||||
then :
|
||||
have_sys_audioio_h=yes
|
||||
else $as_nop
|
||||
have_sys_audioio_h=no
|
||||
fi
|
||||
|
||||
if test x$have_sys_audioio_h = xyes; then
|
||||
|
||||
printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||
have_audio=yes
|
||||
fi
|
||||
;;
|
||||
netbsd) # Don't use this on OpenBSD, it's busted.
|
||||
|
||||
|
62
configure.ac
62
configure.ac
@@ -12,8 +12,8 @@ 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=33
|
||||
SDL_MICRO_VERSION=0
|
||||
SDL_MINOR_VERSION=30
|
||||
SDL_MICRO_VERSION=8
|
||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||
|
||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||
@@ -359,7 +359,7 @@ dnl Checks for library functions.
|
||||
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
|
||||
],[]),
|
||||
)
|
||||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction sigtimedwait setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit)
|
||||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit)
|
||||
|
||||
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
|
||||
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
|
||||
@@ -698,8 +698,8 @@ dnl Check for various instruction support
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(3dnow,
|
||||
[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=no]])],
|
||||
, enable_3dnow=no)
|
||||
[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=yes]])],
|
||||
, enable_3dnow=yes)
|
||||
if test x$enable_3dnow = xyes; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
have_gcc_3dnow=no
|
||||
@@ -906,10 +906,10 @@ dnl Check for various instruction support
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(lsx,
|
||||
AC_ARG_ENABLE(lsx,
|
||||
[AS_HELP_STRING([--enable-lsx], [use LSX assembly routines [default=yes]])],
|
||||
, enable_lsx=yes)
|
||||
if test x$enable_lsx = xyes; then
|
||||
if test x$enable_lsx = xyes; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
have_gcc_lsx=no
|
||||
AC_MSG_CHECKING(for GCC -mlsx option)
|
||||
@@ -928,15 +928,15 @@ if test x$enable_lsx = xyes; then
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
||||
SUMMARY_math="${SUMMARY_math} lsx"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for lsxintrin.h)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lsxintrin.h>]])],
|
||||
AC_MSG_CHECKING(for lsxintrin.h)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lsxintrin.h>]])],
|
||||
[have_lsxintrin_h_hdr=yes],[have_lsxintrin_h_hdr=no])
|
||||
AC_MSG_RESULT($have_lsxintrin_h_hdr)
|
||||
if test x$have_lsxintrin_h_hdr = xyes; then
|
||||
AC_MSG_RESULT($have_lsxintrin_h_hdr)
|
||||
if test x$have_lsxintrin_h_hdr = xyes; then
|
||||
AC_DEFINE(HAVE_LSXINTRIN_H, 1, [ ])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl See if the OSS audio interface is supported
|
||||
CheckOSS()
|
||||
@@ -1247,6 +1247,7 @@ CheckNAS()
|
||||
have_nas=yes
|
||||
NAS_CFLAGS="-I/usr/X11R6/include/"
|
||||
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
||||
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($have_nas)
|
||||
@@ -1847,27 +1848,18 @@ CheckNativeClient()
|
||||
CheckRPI()
|
||||
{
|
||||
AC_ARG_ENABLE(video-rpi,
|
||||
[AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi 0-3 video driver [default=yes]])],
|
||||
[AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi 2/3 video driver [default=yes]])],
|
||||
, enable_video_rpi=yes)
|
||||
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
|
||||
PKG_CHECK_MODULES([RPI], [bcm_host], video_rpi=yes, video_rpi=no)
|
||||
PKG_CHECK_MODULES([RPI_EGL], [brcmegl], video_rpi_egl=yes, video_rpi_egl=no)
|
||||
PKG_CHECK_MODULES([RPI], [bcm_host brcmegl], video_rpi=yes, video_rpi=no)
|
||||
|
||||
if test x$video_rpi = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/usr/pkg/lib -lbcm_host"
|
||||
RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
|
||||
else
|
||||
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$video_rpi_egl = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_EGL_LIBS="-Wl,-R/usr/pkg/lib"
|
||||
else
|
||||
RPI_EGL_LIBS="-Wl,-rpath,/opt/vc/lib"
|
||||
RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1875,13 +1867,15 @@ CheckRPI()
|
||||
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
||||
|
||||
# Add the Raspberry Pi compiler flags and libraries
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
|
||||
|
||||
AC_MSG_CHECKING(for Raspberry Pi 0-3)
|
||||
AC_MSG_CHECKING(for Raspberry Pi 2/3)
|
||||
have_video_rpi=no
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <bcm_host.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
]], [[
|
||||
EGL_DISPMANX_WINDOW_T window;
|
||||
bcm_host_init();
|
||||
]])], [have_video_rpi=yes],[])
|
||||
AC_MSG_RESULT($have_video_rpi)
|
||||
@@ -1893,7 +1887,7 @@ CheckRPI()
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
||||
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
|
||||
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
|
||||
AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
|
||||
SUMMARY_video="${SUMMARY_video} rpi"
|
||||
@@ -2742,10 +2736,6 @@ CheckVulkan()
|
||||
#endif
|
||||
]],[])], [],[enable_video_vulkan=no])
|
||||
;;
|
||||
*-*-solaris*)
|
||||
dnl Strictly speaking, what's missing here is libxcb. Even without Vulkan support at the OS level, it should still compile if we had that.
|
||||
enable_video_vulkan=no
|
||||
;;
|
||||
*-*-darwin*)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
dnl Work around that we don't have Objective-C support in autoconf
|
||||
@@ -3635,7 +3625,7 @@ CheckHIDAPI()
|
||||
|
||||
if test x$hidapi_support = xyes; then
|
||||
if test x$have_libusb_h = xyes; then
|
||||
AC_DEFINE(HAVE_LIBUSB, 1, [ ])
|
||||
AC_DEFINE(HAVE_LIBUSB)
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
|
||||
if test x$require_hidapi_libusb = xyes; then
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
|
||||
@@ -3868,14 +3858,10 @@ case "$host" in
|
||||
if test x$enable_audio = xyes; then
|
||||
case $ARCH in
|
||||
sysv5|solaris|hpux)
|
||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
||||
AC_CHECK_HEADER(sys/audioio.h, have_sys_audioio_h=yes, have_sys_audioio_h=no)
|
||||
if test x$have_sys_audioio_h = xyes; then
|
||||
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
|
||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||
have_audio=yes
|
||||
fi
|
||||
;;
|
||||
netbsd) # Don't use this on OpenBSD, it's busted.
|
||||
AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
|
||||
|
@@ -257,7 +257,7 @@ Game Center
|
||||
|
||||
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
|
||||
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
|
||||
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
|
||||
|
||||
|
@@ -29,7 +29,7 @@ cmake --install build
|
||||
|
||||
|
||||
## Compiling a HelloWorld
|
||||
[PSP Hello World](https://pspdev.github.io/basic_programs.html#hello-world)
|
||||
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
|
||||
|
||||
## To Do
|
||||
- PSP Screen Keyboard
|
||||
|
@@ -14,6 +14,7 @@ Works out of box.
|
||||
Windows:
|
||||
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
|
||||
|
||||
===========================================================================
|
||||
Events
|
||||
===========================================================================
|
||||
SDL_FINGERDOWN:
|
||||
@@ -38,6 +39,7 @@ Fields:
|
||||
Same as SDL_FINGERDOWN.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Functions
|
||||
===========================================================================
|
||||
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||
@@ -74,6 +76,7 @@ A SDL_Finger has the following fields:
|
||||
The pressure of the touch.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Notes
|
||||
===========================================================================
|
||||
For a complete example see test/testgesture.c
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -25,6 +25,7 @@
|
||||
* Main include header for the SDL library
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_h_
|
||||
#define SDL_h_
|
||||
|
||||
@@ -69,8 +70,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* WIKI CATEGORY: Init */
|
||||
|
||||
/* As of version 0.5, SDL is loaded dynamically into the application */
|
||||
|
||||
/**
|
||||
@@ -131,7 +130,7 @@ extern "C" {
|
||||
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
|
||||
* this call will increase the ref-count and return.
|
||||
*
|
||||
* \param flags subsystem initialization flags.
|
||||
* \param flags subsystem initialization flags
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -61,8 +61,6 @@ assert can have unique static variables associated with it.
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
||||
#elif defined(__APPLE__) && defined(__arm__)
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
||||
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
|
||||
#elif defined(__386__) && defined(__WATCOMC__)
|
||||
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
||||
@@ -153,7 +151,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||
#define SDL_enabled_assert(condition) \
|
||||
do { \
|
||||
while ( !(condition) ) { \
|
||||
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, NULL, 0, NULL, NULL }; \
|
||||
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
|
||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||
continue; /* go again. */ \
|
||||
@@ -193,8 +191,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||
* A callback that fires when an SDL assertion fails.
|
||||
*
|
||||
* \param data a pointer to the SDL_AssertData structure corresponding to the
|
||||
* current assertion.
|
||||
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
|
||||
* current assertion
|
||||
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
|
||||
* \returns an SDL_AssertState value indicating how to handle the failure.
|
||||
*/
|
||||
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||
@@ -214,8 +212,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
||||
*
|
||||
* \param handler the SDL_AssertionHandler function to call when an assertion
|
||||
* fails or NULL for the default handler.
|
||||
* \param userdata a pointer that is passed to `handler`.
|
||||
* fails or NULL for the default handler
|
||||
* \param userdata a pointer that is passed to `handler`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -256,7 +254,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
|
||||
* data, it is safe to pass a NULL pointer to this function to ignore it.
|
||||
*
|
||||
* \param puserdata pointer which is filled with the "userdata" pointer that
|
||||
* was passed to SDL_SetAssertionHandler().
|
||||
* was passed to SDL_SetAssertionHandler()
|
||||
* \returns the SDL_AssertionHandler that is called when an assert triggers.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,29 +20,38 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryAtomic
|
||||
* \file SDL_atomic.h
|
||||
*
|
||||
* Atomic operations.
|
||||
*
|
||||
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
|
||||
* should not be using any functions in this file. You should be protecting
|
||||
* your data structures with full mutexes instead.
|
||||
* IMPORTANT:
|
||||
* If you are not an expert in concurrent lockless programming, you should
|
||||
* only be using the atomic lock and reference counting functions in this
|
||||
* file. In all other cases you should be protecting your data structures
|
||||
* with full mutexes.
|
||||
*
|
||||
* ***Seriously, here be dragons!***
|
||||
* The list of "safe" functions to use are:
|
||||
* SDL_AtomicLock()
|
||||
* SDL_AtomicUnlock()
|
||||
* SDL_AtomicIncRef()
|
||||
* SDL_AtomicDecRef()
|
||||
*
|
||||
* You can find out a little more about lockless programming and the subtle
|
||||
* issues that can arise here:
|
||||
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
|
||||
* Seriously, here be dragons!
|
||||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
*
|
||||
* You can find out a little more about lockless programming and the
|
||||
* subtle issues that can arise here:
|
||||
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
|
||||
*
|
||||
* There's also lots of good information here:
|
||||
* http://www.1024cores.net/home/lock-free-algorithms
|
||||
* http://preshing.com/
|
||||
*
|
||||
* - https://www.1024cores.net/home/lock-free-algorithms
|
||||
* - https://preshing.com/
|
||||
*
|
||||
* These operations may or may not actually be implemented using processor
|
||||
* specific atomic operations. When possible they are implemented as true
|
||||
* processor specific atomic operations. When that is not possible the are
|
||||
* implemented using locks that *do* use the available atomic operations.
|
||||
* These operations may or may not actually be implemented using
|
||||
* processor specific atomic operations. When possible they are
|
||||
* implemented as true processor specific atomic operations. When that
|
||||
* is not possible the are implemented using locks that *do* use the
|
||||
* available atomic operations.
|
||||
*
|
||||
* All of the atomic operations that modify memory are full memory barriers.
|
||||
*/
|
||||
@@ -85,7 +94,7 @@ typedef int SDL_SpinLock;
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \param lock a pointer to a lock variable
|
||||
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
|
||||
* held.
|
||||
*
|
||||
@@ -102,7 +111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \param lock a pointer to a lock variable
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -119,7 +128,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \param lock a pointer to a lock variable
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -248,13 +257,10 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
||||
|
||||
|
||||
/**
|
||||
* A type representing an atomic integer value.
|
||||
*
|
||||
* It is a struct so people don't accidentally use numeric operations on it.
|
||||
* \brief A type representing an atomic integer value. It is a struct
|
||||
* so people don't accidentally use numeric operations on it.
|
||||
*/
|
||||
typedef struct SDL_atomic_t {
|
||||
int value;
|
||||
} SDL_atomic_t;
|
||||
typedef struct { int value; } SDL_atomic_t;
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a new value if it is currently an old value.
|
||||
@@ -262,9 +268,9 @@ typedef struct SDL_atomic_t {
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
||||
* \param oldval the old value.
|
||||
* \param newval the new value.
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param oldval the old value
|
||||
* \param newval the new value
|
||||
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -283,8 +289,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
||||
* \param v the desired value.
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param v the desired value
|
||||
* \returns the previous value of the atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -299,7 +305,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable.
|
||||
* \param a a pointer to an SDL_atomic_t variable
|
||||
* \returns the current value of an atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -316,8 +322,8 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
||||
* \param v the desired value to add.
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param v the desired value to add
|
||||
* \returns the previous value of the atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -350,9 +356,9 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer.
|
||||
* \param oldval the old pointer value.
|
||||
* \param newval the new pointer value.
|
||||
* \param a a pointer to a pointer
|
||||
* \param oldval the old pointer value
|
||||
* \param newval the new pointer value
|
||||
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -369,8 +375,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer.
|
||||
* \param v the desired pointer value.
|
||||
* \param a a pointer to a pointer
|
||||
* \param v the desired pointer value
|
||||
* \returns the previous value of the pointer.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -386,7 +392,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer.
|
||||
* \param a a pointer to a pointer
|
||||
* \returns the current value of a pointer.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -22,7 +22,7 @@
|
||||
/* !!! FIXME: several functions in here need Doxygen comments. */
|
||||
|
||||
/**
|
||||
* # CategoryAudio
|
||||
* \file SDL_audio.h
|
||||
*
|
||||
* Access to the raw audio mixing buffer for the SDL library.
|
||||
*/
|
||||
@@ -44,22 +44,22 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Audio format flags.
|
||||
* \brief Audio format flags.
|
||||
*
|
||||
* These are what the 16 bits in SDL_AudioFormat currently mean...
|
||||
* (Unspecified bits are always zero).
|
||||
*
|
||||
* ```
|
||||
* ++-----------------------sample is signed if set
|
||||
* ||
|
||||
* || ++-----------sample is bigendian if set
|
||||
* || ||
|
||||
* || || ++---sample is float if set
|
||||
* || || ||
|
||||
* || || || +---sample bit size---+
|
||||
* || || || | |
|
||||
* 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
||||
* ```
|
||||
* \verbatim
|
||||
++-----------------------sample is signed if set
|
||||
||
|
||||
|| ++-----------sample is bigendian if set
|
||||
|| ||
|
||||
|| || ++---sample is float if set
|
||||
|| || ||
|
||||
|| || || +---sample bit size---+
|
||||
|| || || | |
|
||||
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
||||
\endverbatim
|
||||
*
|
||||
* There are macros in SDL 2.0 and later to query these bits.
|
||||
*/
|
||||
@@ -151,10 +151,16 @@ typedef Uint16 SDL_AudioFormat;
|
||||
/**
|
||||
* This function is called when the audio device needs more data.
|
||||
*
|
||||
* \param userdata An application-specific parameter saved in the
|
||||
* SDL_AudioSpec structure.
|
||||
* \param userdata An application-specific parameter saved in
|
||||
* the SDL_AudioSpec structure
|
||||
* \param stream A pointer to the audio data buffer.
|
||||
* \param len Length of **stream** in bytes.
|
||||
* \param len The length of that buffer in bytes.
|
||||
*
|
||||
* Once the callback returns, the buffer will no longer be valid.
|
||||
* Stereo samples are stored in a LRLRLR ordering.
|
||||
*
|
||||
* You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
|
||||
* you like. Just open your audio device with a NULL callback.
|
||||
*/
|
||||
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||
int len);
|
||||
@@ -163,8 +169,6 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
||||
*
|
||||
* For multi-channel audio, the default SDL channel mapping is:
|
||||
*
|
||||
* ```
|
||||
* 2: FL FR (stereo)
|
||||
* 3: FL FR LFE (2.1 surround)
|
||||
* 4: FL FR BL BR (quad)
|
||||
@@ -172,7 +176,6 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
||||
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
||||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
||||
* ```
|
||||
*/
|
||||
typedef struct SDL_AudioSpec
|
||||
{
|
||||
@@ -193,11 +196,11 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
|
||||
SDL_AudioFormat format);
|
||||
|
||||
/**
|
||||
* Upper limit of filters in SDL_AudioCVT
|
||||
* \brief Upper limit of filters in SDL_AudioCVT
|
||||
*
|
||||
* The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
|
||||
* currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, one
|
||||
* of which is the terminating NULL pointer.
|
||||
* currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
|
||||
* one of which is the terminating NULL pointer.
|
||||
*/
|
||||
#define SDL_AUDIOCVT_MAX_FILTERS 9
|
||||
|
||||
@@ -284,7 +287,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
* meant to be proper names.
|
||||
*
|
||||
* \param index the index of the audio driver; the value ranges from 0 to
|
||||
* SDL_GetNumAudioDrivers() - 1.
|
||||
* SDL_GetNumAudioDrivers() - 1
|
||||
* \returns the name of the audio driver at the requested index, or NULL if an
|
||||
* invalid index was specified.
|
||||
*
|
||||
@@ -311,7 +314,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
* specific need to designate the audio driver you want to use. You should
|
||||
* normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*
|
||||
* \param driver_name the name of the desired audio driver.
|
||||
* \param driver_name the name of the desired audio driver
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -407,11 +410,11 @@ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
|
||||
/**
|
||||
* SDL Audio Device IDs.
|
||||
*
|
||||
* A successful call to SDL_OpenAudio() is always device id 1, and legacy SDL
|
||||
* audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
|
||||
* always returns devices >= 2 on success. The legacy calls are good both for
|
||||
* backwards compatibility and when you don't care about multiple, specific,
|
||||
* or capture devices.
|
||||
* A successful call to SDL_OpenAudio() is always device id 1, and legacy
|
||||
* SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
|
||||
* always returns devices >= 2 on success. The legacy calls are good both
|
||||
* for backwards compatibility and when you don't care about multiple,
|
||||
* specific, or capture devices.
|
||||
*/
|
||||
typedef Uint32 SDL_AudioDeviceID;
|
||||
|
||||
@@ -449,7 +452,7 @@ typedef Uint32 SDL_AudioDeviceID;
|
||||
* ```
|
||||
*
|
||||
* \param iscapture zero to request playback devices, non-zero to request
|
||||
* recording devices.
|
||||
* recording devices
|
||||
* \returns the number of available devices exposed by the current driver or
|
||||
* -1 if an explicit list of devices can't be determined. A return
|
||||
* value of -1 does not necessarily mean an error condition.
|
||||
@@ -475,7 +478,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
|
||||
* invalid next time any of several other SDL functions are called.
|
||||
*
|
||||
* \param index the index of the audio device; valid values range from 0 to
|
||||
* SDL_GetNumAudioDevices() - 1.
|
||||
* SDL_GetNumAudioDevices() - 1
|
||||
* \param iscapture non-zero to query the list of recording devices, zero to
|
||||
* query the list of output devices.
|
||||
* \returns the name of the audio device at the requested index, or NULL on
|
||||
@@ -501,11 +504,11 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
||||
* count.
|
||||
*
|
||||
* \param index the index of the audio device; valid values range from 0 to
|
||||
* SDL_GetNumAudioDevices() - 1.
|
||||
* SDL_GetNumAudioDevices() - 1
|
||||
* \param iscapture non-zero to query the list of recording devices, zero to
|
||||
* query the list of output devices.
|
||||
* \param spec The SDL_AudioSpec to be initialized by this function.
|
||||
* \returns 0 on success, nonzero on error.
|
||||
* \returns 0 on success, nonzero on error
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
*
|
||||
@@ -539,7 +542,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
|
||||
* \param spec The SDL_AudioSpec to be initialized by this function.
|
||||
* \param iscapture non-zero to query the default recording device, zero to
|
||||
* query the default output device.
|
||||
* \returns 0 on success, nonzero on error.
|
||||
* \returns 0 on success, nonzero on error
|
||||
*
|
||||
* \since This function is available since SDL 2.24.0.
|
||||
*
|
||||
@@ -591,7 +594,7 @@ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
|
||||
* frames_ (with stereo output, two samples--left and right--would make a
|
||||
* single sample frame). This number should be a power of two, and may be
|
||||
* adjusted by the audio driver to a value more suitable for the hardware.
|
||||
* Good values seem to range between 512 and 4096 inclusive, depending on
|
||||
* Good values seem to range between 512 and 8096 inclusive, depending on
|
||||
* the application and CPU speed. Smaller values reduce latency, but can
|
||||
* lead to underflow if the application is doing heavy processing and cannot
|
||||
* fill the audio buffer in time. Note that the number of sample frames is
|
||||
@@ -642,13 +645,13 @@ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
|
||||
* driver-specific name as appropriate. NULL requests the most
|
||||
* reasonable default device.
|
||||
* \param iscapture non-zero to specify a device should be opened for
|
||||
* recording, not playback.
|
||||
* recording, not playback
|
||||
* \param desired an SDL_AudioSpec structure representing the desired output
|
||||
* format; see SDL_OpenAudio() for more information.
|
||||
* format; see SDL_OpenAudio() for more information
|
||||
* \param obtained an SDL_AudioSpec structure filled in with the actual output
|
||||
* format; see SDL_OpenAudio() for more information.
|
||||
* \param allowed_changes 0, or one or more flags OR'd together.
|
||||
* \returns a valid device ID > 0 on success or 0 on failure; call
|
||||
* format; see SDL_OpenAudio() for more information
|
||||
* \param allowed_changes 0, or one or more flags OR'd together
|
||||
* \returns a valid device ID that is > 0 on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* For compatibility with SDL 1.2, this will never return 1, since
|
||||
@@ -709,7 +712,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
|
||||
* Use this function to get the current audio state of an audio device.
|
||||
*
|
||||
* \param dev the ID of an audio device previously opened with
|
||||
* SDL_OpenAudioDevice().
|
||||
* SDL_OpenAudioDevice()
|
||||
* \returns the SDL_AudioStatus of the specified audio device.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -742,7 +745,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDevice
|
||||
*
|
||||
* ...and is only useful if you used the legacy SDL_OpenAudio() function.
|
||||
*
|
||||
* \param pause_on non-zero to pause, 0 to unpause.
|
||||
* \param pause_on non-zero to pause, 0 to unpause
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -772,8 +775,8 @@ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
|
||||
* callback, you shouldn't pause the audio device, as it will lead to dropouts
|
||||
* in the audio playback. Instead, you should use SDL_LockAudioDevice().
|
||||
*
|
||||
* \param dev a device opened by SDL_OpenAudioDevice().
|
||||
* \param pause_on non-zero to pause, 0 to unpause.
|
||||
* \param dev a device opened by SDL_OpenAudioDevice()
|
||||
* \param pause_on non-zero to pause, 0 to unpause
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -838,14 +841,14 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
|
||||
* SDL_LoadWAV("sample.wav", &spec, &buf, &len);
|
||||
* ```
|
||||
*
|
||||
* \param src The data source for the WAVE data.
|
||||
* \param freesrc If non-zero, SDL will _always_ free the data source.
|
||||
* \param src The data source for the WAVE data
|
||||
* \param freesrc If non-zero, SDL will _always_ free the data source
|
||||
* \param spec An SDL_AudioSpec that will be filled in with the wave file's
|
||||
* format details.
|
||||
* format details
|
||||
* \param audio_buf A pointer filled with the audio data, allocated by the
|
||||
* function.
|
||||
* \param audio_len A pointer filled with the length of the audio data buffer
|
||||
* in bytes.
|
||||
* in bytes
|
||||
* \returns This function, if successfully called, returns `spec`, which will
|
||||
* be filled with the audio data format of the wave source data.
|
||||
* `audio_buf` will be filled with a pointer to an allocated buffer
|
||||
@@ -872,7 +875,6 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
|
||||
|
||||
/**
|
||||
* Loads a WAV from a file.
|
||||
*
|
||||
* Compatibility convenience function.
|
||||
*/
|
||||
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
|
||||
@@ -886,7 +888,7 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
|
||||
* this function with a NULL pointer.
|
||||
*
|
||||
* \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or
|
||||
* SDL_LoadWAV_RW().
|
||||
* SDL_LoadWAV_RW()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -910,16 +912,15 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
|
||||
* and then can call SDL_ConvertAudio() to complete the conversion.
|
||||
*
|
||||
* \param cvt an SDL_AudioCVT structure filled in with audio conversion
|
||||
* information.
|
||||
* information
|
||||
* \param src_format the source format of the audio data; for more info see
|
||||
* SDL_AudioFormat.
|
||||
* \param src_channels the number of channels in the source.
|
||||
* \param src_rate the frequency (sample-frames-per-second) of the source.
|
||||
* SDL_AudioFormat
|
||||
* \param src_channels the number of channels in the source
|
||||
* \param src_rate the frequency (sample-frames-per-second) of the source
|
||||
* \param dst_format the destination format of the audio data; for more info
|
||||
* see SDL_AudioFormat.
|
||||
* \param dst_channels the number of channels in the destination.
|
||||
* \param dst_rate the frequency (sample-frames-per-second) of the
|
||||
* destination.
|
||||
* see SDL_AudioFormat
|
||||
* \param dst_channels the number of channels in the destination
|
||||
* \param dst_rate the frequency (sample-frames-per-second) of the destination
|
||||
* \returns 1 if the audio filter is prepared, 0 if no conversion is needed,
|
||||
* or a negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
@@ -990,12 +991,12 @@ typedef struct _SDL_AudioStream SDL_AudioStream;
|
||||
/**
|
||||
* Create a new audio stream.
|
||||
*
|
||||
* \param src_format The format of the source audio.
|
||||
* \param src_channels The number of channels of the source audio.
|
||||
* \param src_rate The sampling rate of the source audio.
|
||||
* \param dst_format The format of the desired audio output.
|
||||
* \param dst_channels The number of channels of the desired audio output.
|
||||
* \param dst_rate The sampling rate of the desired audio output.
|
||||
* \param src_format The format of the source audio
|
||||
* \param src_channels The number of channels of the source audio
|
||||
* \param src_rate The sampling rate of the source audio
|
||||
* \param dst_format The format of the desired audio output
|
||||
* \param dst_channels The number of channels of the desired audio output
|
||||
* \param dst_rate The sampling rate of the desired audio output
|
||||
* \returns 0 on success, or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
@@ -1017,9 +1018,9 @@ extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioForm
|
||||
/**
|
||||
* Add data to be converted/resampled to the stream.
|
||||
*
|
||||
* \param stream The stream the audio data is being added to.
|
||||
* \param buf A pointer to the audio data to add.
|
||||
* \param len The number of bytes to write to the stream.
|
||||
* \param stream The stream the audio data is being added to
|
||||
* \param buf A pointer to the audio data to add
|
||||
* \param len The number of bytes to write to the stream
|
||||
* \returns 0 on success, or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
@@ -1036,10 +1037,10 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const vo
|
||||
/**
|
||||
* Get converted/resampled data from the stream
|
||||
*
|
||||
* \param stream The stream the audio is being requested from.
|
||||
* \param buf A buffer to fill with audio data.
|
||||
* \param len The maximum number of bytes to fill.
|
||||
* \returns the number of bytes read from the stream, or -1 on error.
|
||||
* \param stream The stream the audio is being requested from
|
||||
* \param buf A buffer to fill with audio data
|
||||
* \param len The maximum number of bytes to fill
|
||||
* \returns the number of bytes read from the stream, or -1 on error
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
*
|
||||
@@ -1117,9 +1118,6 @@ extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Maximum volume allowed in calls to SDL_MixAudio and SDL_MixAudioFormat.
|
||||
*/
|
||||
#define SDL_MIX_MAXVOLUME 128
|
||||
|
||||
/**
|
||||
@@ -1134,11 +1132,11 @@ extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
|
||||
* ...where `format` is the obtained format of the audio device from the
|
||||
* legacy SDL_OpenAudio() function.
|
||||
*
|
||||
* \param dst the destination for the mixed audio.
|
||||
* \param src the source audio buffer to be mixed.
|
||||
* \param len the length of the audio buffer in bytes.
|
||||
* \param dst the destination for the mixed audio
|
||||
* \param src the source audio buffer to be mixed
|
||||
* \param len the length of the audio buffer in bytes
|
||||
* \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume.
|
||||
* for full audio volume
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1167,13 +1165,13 @@ extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
|
||||
* SDL_MixAudioFormat() is really only needed when you're mixing a single
|
||||
* audio stream with a volume adjustment.
|
||||
*
|
||||
* \param dst the destination for the mixed audio.
|
||||
* \param src the source audio buffer to be mixed.
|
||||
* \param dst the destination for the mixed audio
|
||||
* \param src the source audio buffer to be mixed
|
||||
* \param format the SDL_AudioFormat structure representing the desired audio
|
||||
* format.
|
||||
* \param len the length of the audio buffer in bytes.
|
||||
* format
|
||||
* \param len the length of the audio buffer in bytes
|
||||
* \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume.
|
||||
* for full audio volume
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
@@ -1217,9 +1215,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||
* from planar audio formats into a non-planar one (see SDL_AudioFormat)
|
||||
* before queuing audio.
|
||||
*
|
||||
* \param dev the device ID to which we will queue audio.
|
||||
* \param data the data to queue to the device for later playback.
|
||||
* \param len the number of bytes (not samples!) to which `data` points.
|
||||
* \param dev the device ID to which we will queue audio
|
||||
* \param data the data to queue to the device for later playback
|
||||
* \param len the number of bytes (not samples!) to which `data` points
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -1265,9 +1263,9 @@ extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *da
|
||||
* You should not call SDL_LockAudio() on the device before dequeueing; SDL
|
||||
* handles locking internally for this function.
|
||||
*
|
||||
* \param dev the device ID from which we will dequeue audio.
|
||||
* \param data a pointer into where audio data should be copied.
|
||||
* \param len the number of bytes (not samples!) to which (data) points.
|
||||
* \param dev the device ID from which we will dequeue audio
|
||||
* \param data a pointer into where audio data should be copied
|
||||
* \param len the number of bytes (not samples!) to which (data) points
|
||||
* \returns the number of bytes dequeued, which could be less than requested;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -1301,7 +1299,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *dat
|
||||
* You should not call SDL_LockAudio() on the device before querying; SDL
|
||||
* handles locking internally for this function.
|
||||
*
|
||||
* \param dev the device ID of which we will query queued audio size.
|
||||
* \param dev the device ID of which we will query queued audio size
|
||||
* \returns the number of bytes (not samples!) of queued audio.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
@@ -1336,7 +1334,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
||||
*
|
||||
* This function always succeeds and thus returns void.
|
||||
*
|
||||
* \param dev the device ID of which to clear the audio queue.
|
||||
* \param dev the device ID of which to clear the audio queue
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*
|
||||
@@ -1408,7 +1406,7 @@ extern DECLSPEC void SDLCALL SDL_LockAudio(void);
|
||||
* at once, not only will you block the audio callback, you'll block the other
|
||||
* thread.
|
||||
*
|
||||
* \param dev the ID of the device to be locked.
|
||||
* \param dev the ID of the device to be locked
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1441,7 +1439,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
|
||||
*
|
||||
* This function should be paired with a previous SDL_LockAudioDevice() call.
|
||||
*
|
||||
* \param dev the ID of the device to be unlocked.
|
||||
* \param dev the ID of the device to be unlocked
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1483,7 +1481,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
|
||||
* The device ID is invalid as soon as the device is closed, and is eligible
|
||||
* for reuse in a new SDL_OpenAudioDevice() call immediately.
|
||||
*
|
||||
* \param dev an audio device previously opened with SDL_OpenAudioDevice().
|
||||
* \param dev an audio device previously opened with SDL_OpenAudioDevice()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryBits
|
||||
* \file SDL_bits.h
|
||||
*
|
||||
* Functions for fiddling with bits and bitmasks.
|
||||
*/
|
||||
@@ -56,12 +56,6 @@ extern __inline int _SDL_bsr_watcom(Uint32);
|
||||
modify exact [eax] nomemory;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Use this function to get the index of the most significant (set) bit in a
|
||||
*
|
||||
* \param x the number to find the MSB of.
|
||||
* \returns the index of the most significant bit of x, or -1 if x is 0.
|
||||
*/
|
||||
SDL_FORCE_INLINE int
|
||||
SDL_MostSignificantBitIndex32(Uint32 x)
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryBlendmode
|
||||
* \file SDL_blendmode.h
|
||||
*
|
||||
* Header file declaring the SDL_BlendMode enumeration
|
||||
*/
|
||||
@@ -35,9 +35,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The blend mode used in SDL_RenderCopy() and drawing operations.
|
||||
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
|
||||
*/
|
||||
typedef enum SDL_BlendMode
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
|
||||
dstRGBA = srcRGBA */
|
||||
@@ -60,10 +60,9 @@ typedef enum SDL_BlendMode
|
||||
} SDL_BlendMode;
|
||||
|
||||
/**
|
||||
* The blend operation used when combining source and destination pixel
|
||||
* components
|
||||
* \brief The blend operation used when combining source and destination pixel components
|
||||
*/
|
||||
typedef enum SDL_BlendOperation
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||
@@ -73,9 +72,9 @@ typedef enum SDL_BlendOperation
|
||||
} SDL_BlendOperation;
|
||||
|
||||
/**
|
||||
* The normalized factor used to multiply pixel components
|
||||
* \brief The normalized factor used to multiply pixel components
|
||||
*/
|
||||
typedef enum SDL_BlendFactor
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */
|
||||
SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */
|
||||
@@ -159,18 +158,18 @@ typedef enum SDL_BlendFactor
|
||||
* case.
|
||||
*
|
||||
* \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
|
||||
* blue components of the source pixels.
|
||||
* blue components of the source pixels
|
||||
* \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
|
||||
* blue components of the destination pixels.
|
||||
* blue components of the destination pixels
|
||||
* \param colorOperation the SDL_BlendOperation used to combine the red,
|
||||
* green, and blue components of the source and
|
||||
* destination pixels.
|
||||
* destination pixels
|
||||
* \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
|
||||
* the source pixels.
|
||||
* the source pixels
|
||||
* \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
|
||||
* the destination pixels.
|
||||
* the destination pixels
|
||||
* \param alphaOperation the SDL_BlendOperation used to combine the alpha
|
||||
* component of the source and destination pixels.
|
||||
* component of the source and destination pixels
|
||||
* \returns an SDL_BlendMode that represents the chosen factors and
|
||||
* operations.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryClipboard
|
||||
* \file SDL_clipboard.h
|
||||
*
|
||||
* Include file for SDL clipboard handling
|
||||
*/
|
||||
@@ -41,7 +41,7 @@ extern "C" {
|
||||
/**
|
||||
* Put UTF-8 text into the clipboard.
|
||||
*
|
||||
* \param text the text to store in the clipboard.
|
||||
* \param text the text to store in the clipboard
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -85,7 +85,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
/**
|
||||
* Put UTF-8 text into the primary selection.
|
||||
*
|
||||
* \param text the text to store in the primary selection.
|
||||
* \param text the text to store in the primary selection
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* WIKI CATEGORY: - */
|
||||
/**
|
||||
* \file SDL_config.h
|
||||
*/
|
||||
|
||||
/* Add any platform that doesn't build using the configure system. */
|
||||
#if defined(__WIN32__)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -193,7 +193,6 @@
|
||||
#cmakedefine HAVE_MEMFD_CREATE 1
|
||||
#cmakedefine HAVE_POSIX_FALLOCATE 1
|
||||
#cmakedefine HAVE_SIGACTION 1
|
||||
#cmakedefine HAVE_SIGTIMEDWAIT 1
|
||||
#cmakedefine HAVE_SA_SIGACTION 1
|
||||
#cmakedefine HAVE_SETJMP 1
|
||||
#cmakedefine HAVE_NANOSLEEP 1
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -195,7 +195,6 @@
|
||||
#undef HAVE_FSEEKO
|
||||
#undef HAVE_FSEEKO64
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SIGTIMEDWAIT
|
||||
#undef HAVE_SA_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
@@ -217,7 +216,6 @@
|
||||
#undef HAVE__EXIT
|
||||
|
||||
#else
|
||||
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -19,16 +19,10 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: CPUInfo */
|
||||
|
||||
/**
|
||||
* # CategoryCPUInfo
|
||||
* \file SDL_cpuinfo.h
|
||||
*
|
||||
* CPU feature detection for SDL.
|
||||
*
|
||||
* These functions are largely concerned with reporting if the system has
|
||||
* access to various SIMD instruction sets, but also has other important info
|
||||
* to share, such as number of logical CPU cores.
|
||||
*/
|
||||
|
||||
#ifndef SDL_cpuinfo_h_
|
||||
@@ -59,11 +53,9 @@ _m_prefetch(void *__P)
|
||||
#ifndef __MMX__
|
||||
#define __MMX__
|
||||
#endif
|
||||
/*
|
||||
#ifndef __3dNOW__
|
||||
#define __3dNOW__
|
||||
#endif
|
||||
*/
|
||||
#endif
|
||||
#ifndef __SSE__
|
||||
#define __SSE__
|
||||
@@ -115,8 +107,7 @@ _m_prefetch(void *__P)
|
||||
#include <lasxintrin.h>
|
||||
#define __LASX__
|
||||
#endif
|
||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) && \
|
||||
(defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86))
|
||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
||||
#include <immintrin.h>
|
||||
#else
|
||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -19,10 +19,11 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_egl.h
|
||||
*
|
||||
* This is a simple file to encapsulate the EGL API headers.
|
||||
*/
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
|
||||
#if defined(__vita__) || defined(__psp2__)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryEndian
|
||||
* \file SDL_endian.h
|
||||
*
|
||||
* Functions for reading and writing endian-specific values
|
||||
*/
|
||||
@@ -59,15 +59,6 @@ _m_prefetch(void *__P)
|
||||
#ifdef __linux__
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#elif defined(__sun) && defined(__SVR4) /* Solaris */
|
||||
#include <sys/byteorder.h>
|
||||
#if defined(_LITTLE_ENDIAN)
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#elif defined(_BIG_ENDIAN)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#error Unsupported endianness
|
||||
#endif
|
||||
#elif defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
@@ -88,7 +79,7 @@ _m_prefetch(void *__P)
|
||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
||||
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
|
||||
defined(__sparc__) || defined(__sparc)
|
||||
defined(__sparc__)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
@@ -189,16 +180,6 @@ extern __inline Uint16 SDL_Swap16(Uint16);
|
||||
parm [ax] \
|
||||
modify [ax];
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a 16-bit value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapBE16
|
||||
* \sa SDL_SwapLE16
|
||||
*/
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
@@ -250,16 +231,6 @@ extern __inline Uint32 SDL_Swap32(Uint32);
|
||||
parm [eax] \
|
||||
modify [eax];
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a 32-bit value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapBE32
|
||||
* \sa SDL_SwapLE32
|
||||
*/
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
@@ -305,16 +276,6 @@ extern __inline Uint64 SDL_Swap64(Uint64);
|
||||
parm [eax edx] \
|
||||
modify [eax edx];
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a 64-bit value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapBE64
|
||||
* \sa SDL_SwapLE64
|
||||
*/
|
||||
SDL_FORCE_INLINE Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
@@ -332,15 +293,6 @@ SDL_Swap64(Uint64 x)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a floating point value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapFloatBE
|
||||
* \sa SDL_SwapFloatLE
|
||||
*/
|
||||
SDL_FORCE_INLINE float
|
||||
SDL_SwapFloat(float x)
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryError
|
||||
* \file SDL_error.h
|
||||
*
|
||||
* Simple error message routines for SDL.
|
||||
*/
|
||||
@@ -53,9 +53,9 @@ extern "C" {
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* \param fmt a printf()-style message format string.
|
||||
* \param fmt a printf()-style message format string
|
||||
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
||||
* any.
|
||||
* any
|
||||
* \returns always -1.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -109,8 +109,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
||||
* otherwise operates exactly the same as SDL_GetError().
|
||||
*
|
||||
* \param errstr A buffer to fill with the last error message that was set for
|
||||
* the current thread.
|
||||
* \param maxlen The size of the buffer pointed to by the errstr parameter.
|
||||
* the current thread
|
||||
* \param maxlen The size of the buffer pointed to by the errstr parameter
|
||||
* \returns the pointer passed in as the `errstr` parameter.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryEvents
|
||||
* \file SDL_events.h
|
||||
*
|
||||
* Include file for SDL event handling.
|
||||
*/
|
||||
@@ -52,7 +52,7 @@ extern "C" {
|
||||
/**
|
||||
* The types of events that can be delivered.
|
||||
*/
|
||||
typedef enum SDL_EventType
|
||||
typedef enum
|
||||
{
|
||||
SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
|
||||
|
||||
@@ -167,7 +167,7 @@ typedef enum SDL_EventType
|
||||
/* Internal events */
|
||||
SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
|
||||
|
||||
/** Events SDL_USEREVENT through SDL_LASTEVENT are for your use,
|
||||
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
|
||||
* and should be allocated with SDL_RegisterEvents()
|
||||
*/
|
||||
SDL_USEREVENT = 0x8000,
|
||||
@@ -179,7 +179,7 @@ typedef enum SDL_EventType
|
||||
} SDL_EventType;
|
||||
|
||||
/**
|
||||
* Fields shared by every event
|
||||
* \brief Fields shared by every event
|
||||
*/
|
||||
typedef struct SDL_CommonEvent
|
||||
{
|
||||
@@ -188,14 +188,14 @@ typedef struct SDL_CommonEvent
|
||||
} SDL_CommonEvent;
|
||||
|
||||
/**
|
||||
* Display state change event data (event.display.*)
|
||||
* \brief Display state change event data (event.display.*)
|
||||
*/
|
||||
typedef struct SDL_DisplayEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_DISPLAYEVENT */
|
||||
Uint32 type; /**< ::SDL_DISPLAYEVENT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 display; /**< The associated display index */
|
||||
Uint8 event; /**< SDL_DisplayEventID */
|
||||
Uint8 event; /**< ::SDL_DisplayEventID */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@@ -203,14 +203,14 @@ typedef struct SDL_DisplayEvent
|
||||
} SDL_DisplayEvent;
|
||||
|
||||
/**
|
||||
* Window state change event data (event.window.*)
|
||||
* \brief Window state change event data (event.window.*)
|
||||
*/
|
||||
typedef struct SDL_WindowEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_WINDOWEVENT */
|
||||
Uint32 type; /**< ::SDL_WINDOWEVENT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The associated window */
|
||||
Uint8 event; /**< SDL_WindowEventID */
|
||||
Uint8 event; /**< ::SDL_WindowEventID */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@@ -219,14 +219,14 @@ typedef struct SDL_WindowEvent
|
||||
} SDL_WindowEvent;
|
||||
|
||||
/**
|
||||
* Keyboard button event structure (event.key.*)
|
||||
* \brief Keyboard button event structure (event.key.*)
|
||||
*/
|
||||
typedef struct SDL_KeyboardEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_KEYDOWN or SDL_KEYUP */
|
||||
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 repeat; /**< Non-zero if this is a key repeat */
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@@ -234,13 +234,12 @@ typedef struct SDL_KeyboardEvent
|
||||
} SDL_KeyboardEvent;
|
||||
|
||||
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
|
||||
|
||||
/**
|
||||
* Keyboard text editing event structure (event.edit.*)
|
||||
* \brief Keyboard text editing event structure (event.edit.*)
|
||||
*/
|
||||
typedef struct SDL_TextEditingEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_TEXTEDITING */
|
||||
Uint32 type; /**< ::SDL_TEXTEDITING */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
|
||||
@@ -249,12 +248,12 @@ typedef struct SDL_TextEditingEvent
|
||||
} SDL_TextEditingEvent;
|
||||
|
||||
/**
|
||||
* Extended keyboard text editing event structure (event.editExt.*) when text
|
||||
* would be truncated if stored in the text buffer SDL_TextEditingEvent
|
||||
* \brief Extended keyboard text editing event structure (event.editExt.*) when text would be
|
||||
* truncated if stored in the text buffer SDL_TextEditingEvent
|
||||
*/
|
||||
typedef struct SDL_TextEditingExtEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_TEXTEDITING_EXT */
|
||||
Uint32 type; /**< ::SDL_TEXTEDITING_EXT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */
|
||||
@@ -262,43 +261,24 @@ typedef struct SDL_TextEditingExtEvent
|
||||
Sint32 length; /**< The length of selected editing text */
|
||||
} SDL_TextEditingExtEvent;
|
||||
|
||||
/**
|
||||
* The maximum bytes of text that can be supplied in an SDL_TextInputEvent.
|
||||
*/
|
||||
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
|
||||
|
||||
/**
|
||||
* Keyboard text input event structure (event.text.*)
|
||||
*
|
||||
* `text` is limited to SDL_TEXTINPUTEVENT_TEXT_SIZE bytes. If the incoming
|
||||
* string is larger than this, SDL will split it and send it in pieces, across
|
||||
* multiple events. The string is in UTF-8 format, and if split, SDL
|
||||
* guarantees that it will not split in the middle of a UTF-8 sequence, so any
|
||||
* event will only contain complete codepoints. However, if there are several
|
||||
* codepoints that go together into a single glyph (like an emoji "thumbs up"
|
||||
* followed by a skin color), they may be split between events.
|
||||
*
|
||||
* This event will never be delivered unless text input is enabled by calling
|
||||
* SDL_StartTextInput(). Text input is enabled by default on desktop
|
||||
* platforms, and disabled by default on mobile platforms!
|
||||
*
|
||||
* \sa SDL_StartTextInput
|
||||
* \sa SDL_StopTextInput
|
||||
* \brief Keyboard text input event structure (event.text.*)
|
||||
*/
|
||||
typedef struct SDL_TextInputEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_TEXTINPUT */
|
||||
Uint32 type; /**< ::SDL_TEXTINPUT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text; UTF-8 encoded. */
|
||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
|
||||
} SDL_TextInputEvent;
|
||||
|
||||
/**
|
||||
* Mouse motion event structure (event.motion.*)
|
||||
* \brief Mouse motion event structure (event.motion.*)
|
||||
*/
|
||||
typedef struct SDL_MouseMotionEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MOUSEMOTION */
|
||||
Uint32 type; /**< ::SDL_MOUSEMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||
@@ -310,16 +290,16 @@ typedef struct SDL_MouseMotionEvent
|
||||
} SDL_MouseMotionEvent;
|
||||
|
||||
/**
|
||||
* Mouse button event structure (event.button.*)
|
||||
* \brief Mouse button event structure (event.button.*)
|
||||
*/
|
||||
typedef struct SDL_MouseButtonEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
|
||||
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||
Uint8 button; /**< The mouse button index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
|
||||
Uint8 padding1;
|
||||
Sint32 x; /**< X coordinate, relative to window */
|
||||
@@ -327,11 +307,11 @@ typedef struct SDL_MouseButtonEvent
|
||||
} SDL_MouseButtonEvent;
|
||||
|
||||
/**
|
||||
* Mouse wheel event structure (event.wheel.*)
|
||||
* \brief Mouse wheel event structure (event.wheel.*)
|
||||
*/
|
||||
typedef struct SDL_MouseWheelEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MOUSEWHEEL */
|
||||
Uint32 type; /**< ::SDL_MOUSEWHEEL */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||
@@ -345,11 +325,11 @@ typedef struct SDL_MouseWheelEvent
|
||||
} SDL_MouseWheelEvent;
|
||||
|
||||
/**
|
||||
* Joystick axis motion event structure (event.jaxis.*)
|
||||
* \brief Joystick axis motion event structure (event.jaxis.*)
|
||||
*/
|
||||
typedef struct SDL_JoyAxisEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYAXISMOTION */
|
||||
Uint32 type; /**< ::SDL_JOYAXISMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 axis; /**< The joystick axis index */
|
||||
@@ -361,11 +341,11 @@ typedef struct SDL_JoyAxisEvent
|
||||
} SDL_JoyAxisEvent;
|
||||
|
||||
/**
|
||||
* Joystick trackball motion event structure (event.jball.*)
|
||||
* \brief Joystick trackball motion event structure (event.jball.*)
|
||||
*/
|
||||
typedef struct SDL_JoyBallEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYBALLMOTION */
|
||||
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 ball; /**< The joystick trackball index */
|
||||
@@ -377,18 +357,18 @@ typedef struct SDL_JoyBallEvent
|
||||
} SDL_JoyBallEvent;
|
||||
|
||||
/**
|
||||
* Joystick hat position change event structure (event.jhat.*)
|
||||
* \brief Joystick hat position change event structure (event.jhat.*)
|
||||
*/
|
||||
typedef struct SDL_JoyHatEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYHATMOTION */
|
||||
Uint32 type; /**< ::SDL_JOYHATMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 hat; /**< The joystick hat index */
|
||||
Uint8 value; /**< The hat position value.
|
||||
* \sa SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
|
||||
* \sa SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
|
||||
* \sa SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
|
||||
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
|
||||
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
|
||||
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
|
||||
*
|
||||
* Note that zero means the POV is centered.
|
||||
*/
|
||||
@@ -397,51 +377,46 @@ typedef struct SDL_JoyHatEvent
|
||||
} SDL_JoyHatEvent;
|
||||
|
||||
/**
|
||||
* Joystick button event structure (event.jbutton.*)
|
||||
* \brief Joystick button event structure (event.jbutton.*)
|
||||
*/
|
||||
typedef struct SDL_JoyButtonEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
|
||||
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The joystick button index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_JoyButtonEvent;
|
||||
|
||||
/**
|
||||
* Joystick device event structure (event.jdevice.*)
|
||||
*
|
||||
* SDL will send JOYSTICK_ADDED events for devices that are already plugged in
|
||||
* during SDL_Init.
|
||||
*
|
||||
* \sa SDL_ControllerDeviceEvent
|
||||
* \brief Joystick device event structure (event.jdevice.*)
|
||||
*/
|
||||
typedef struct SDL_JoyDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYDEVICEADDED or SDL_JOYDEVICEREMOVED */
|
||||
Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
||||
} SDL_JoyDeviceEvent;
|
||||
|
||||
/**
|
||||
* Joysick battery level change event structure (event.jbattery.*)
|
||||
* \brief Joysick battery level change event structure (event.jbattery.*)
|
||||
*/
|
||||
typedef struct SDL_JoyBatteryEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYBATTERYUPDATED */
|
||||
Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
SDL_JoystickPowerLevel level; /**< The joystick battery level */
|
||||
} SDL_JoyBatteryEvent;
|
||||
|
||||
/**
|
||||
* Game controller axis motion event structure (event.caxis.*)
|
||||
* \brief Game controller axis motion event structure (event.caxis.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerAxisEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERAXISMOTION */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
|
||||
@@ -454,42 +429,36 @@ typedef struct SDL_ControllerAxisEvent
|
||||
|
||||
|
||||
/**
|
||||
* Game controller button event structure (event.cbutton.*)
|
||||
* \brief Game controller button event structure (event.cbutton.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerButtonEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERBUTTONDOWN or SDL_CONTROLLERBUTTONUP */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The controller button (SDL_GameControllerButton) */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_ControllerButtonEvent;
|
||||
|
||||
|
||||
/**
|
||||
* Controller device event structure (event.cdevice.*)
|
||||
*
|
||||
* Joysticks that are supported game controllers receive both an
|
||||
* SDL_JoyDeviceEvent and an SDL_ControllerDeviceEvent.
|
||||
*
|
||||
* SDL will send CONTROLLERDEVICEADDED events for joysticks that are already
|
||||
* plugged in during SDL_Init() and are recognized as game controllers.
|
||||
* \brief Controller device event structure (event.cdevice.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, or SDL_CONTROLLERSTEAMHANDLEUPDATED */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
|
||||
} SDL_ControllerDeviceEvent;
|
||||
|
||||
/**
|
||||
* Game controller touchpad event structure (event.ctouchpad.*)
|
||||
* \brief Game controller touchpad event structure (event.ctouchpad.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerTouchpadEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERTOUCHPADDOWN or SDL_CONTROLLERTOUCHPADMOTION or SDL_CONTROLLERTOUCHPADUP */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Sint32 touchpad; /**< The index of the touchpad */
|
||||
@@ -500,24 +469,24 @@ typedef struct SDL_ControllerTouchpadEvent
|
||||
} SDL_ControllerTouchpadEvent;
|
||||
|
||||
/**
|
||||
* Game controller sensor event structure (event.csensor.*)
|
||||
* \brief Game controller sensor event structure (event.csensor.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerSensorEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERSENSORUPDATE */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Sint32 sensor; /**< The type of the sensor, one of the values of SDL_SensorType */
|
||||
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
||||
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
||||
Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
|
||||
} SDL_ControllerSensorEvent;
|
||||
|
||||
/**
|
||||
* Audio device event structure (event.adevice.*)
|
||||
* \brief Audio device event structure (event.adevice.*)
|
||||
*/
|
||||
typedef struct SDL_AudioDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_AUDIODEVICEADDED, or SDL_AUDIODEVICEREMOVED */
|
||||
Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
||||
@@ -528,11 +497,11 @@ typedef struct SDL_AudioDeviceEvent
|
||||
|
||||
|
||||
/**
|
||||
* Touch finger event structure (event.tfinger.*)
|
||||
* \brief Touch finger event structure (event.tfinger.*)
|
||||
*/
|
||||
typedef struct SDL_TouchFingerEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_FINGERMOTION or SDL_FINGERDOWN or SDL_FINGERUP */
|
||||
Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_TouchID touchId; /**< The touch device id */
|
||||
SDL_FingerID fingerId;
|
||||
@@ -546,11 +515,11 @@ typedef struct SDL_TouchFingerEvent
|
||||
|
||||
|
||||
/**
|
||||
* Multiple Finger Gesture Event (event.mgesture.*)
|
||||
* \brief Multiple Finger Gesture Event (event.mgesture.*)
|
||||
*/
|
||||
typedef struct SDL_MultiGestureEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MULTIGESTURE */
|
||||
Uint32 type; /**< ::SDL_MULTIGESTURE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_TouchID touchId; /**< The touch device id */
|
||||
float dTheta;
|
||||
@@ -563,11 +532,11 @@ typedef struct SDL_MultiGestureEvent
|
||||
|
||||
|
||||
/**
|
||||
* Dollar Gesture Event (event.dgesture.*)
|
||||
* \brief Dollar Gesture Event (event.dgesture.*)
|
||||
*/
|
||||
typedef struct SDL_DollarGestureEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_DOLLARGESTURE or SDL_DOLLARRECORD */
|
||||
Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_TouchID touchId; /**< The touch device id */
|
||||
SDL_GestureID gestureId;
|
||||
@@ -579,15 +548,13 @@ typedef struct SDL_DollarGestureEvent
|
||||
|
||||
|
||||
/**
|
||||
* An event used to request a file open by the system (event.drop.*)
|
||||
*
|
||||
* \brief An event used to request a file open by the system (event.drop.*)
|
||||
* This event is enabled by default, you can disable it with SDL_EventState().
|
||||
*
|
||||
* If this event is enabled, you must free the filename in the event.
|
||||
* \note If this event is enabled, you must free the filename in the event.
|
||||
*/
|
||||
typedef struct SDL_DropEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_DROPBEGIN or SDL_DROPFILE or SDL_DROPTEXT or SDL_DROPCOMPLETE */
|
||||
Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
|
||||
Uint32 windowID; /**< The window that was dropped on, if any */
|
||||
@@ -595,11 +562,11 @@ typedef struct SDL_DropEvent
|
||||
|
||||
|
||||
/**
|
||||
* Sensor event structure (event.sensor.*)
|
||||
* \brief Sensor event structure (event.sensor.*)
|
||||
*/
|
||||
typedef struct SDL_SensorEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_SENSORUPDATE */
|
||||
Uint32 type; /**< ::SDL_SENSORUPDATE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Sint32 which; /**< The instance ID of the sensor */
|
||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
|
||||
@@ -607,20 +574,20 @@ typedef struct SDL_SensorEvent
|
||||
} SDL_SensorEvent;
|
||||
|
||||
/**
|
||||
* The "quit requested" event
|
||||
* \brief The "quit requested" event
|
||||
*/
|
||||
typedef struct SDL_QuitEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_QUIT */
|
||||
Uint32 type; /**< ::SDL_QUIT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
} SDL_QuitEvent;
|
||||
|
||||
/**
|
||||
* A user-defined event type (event.user.*)
|
||||
* \brief A user-defined event type (event.user.*)
|
||||
*/
|
||||
typedef struct SDL_UserEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_USEREVENT through SDL_LASTEVENT-1 */
|
||||
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The associated window if any */
|
||||
Sint32 code; /**< User defined event code */
|
||||
@@ -633,24 +600,20 @@ struct SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
||||
|
||||
/**
|
||||
* A video driver dependent system event (event.syswm.*)
|
||||
*
|
||||
* \brief A video driver dependent system event (event.syswm.*)
|
||||
* This event is disabled by default, you can enable it with SDL_EventState()
|
||||
*
|
||||
* If you want to use this event, you should include SDL_syswm.h.
|
||||
* \note If you want to use this event, you should include SDL_syswm.h.
|
||||
*/
|
||||
typedef struct SDL_SysWMEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_SYSWMEVENT */
|
||||
Uint32 type; /**< ::SDL_SYSWMEVENT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
||||
} SDL_SysWMEvent;
|
||||
|
||||
/**
|
||||
* General event structure
|
||||
*
|
||||
* The SDL_Event structure is the core of all event handling in SDL. SDL_Event
|
||||
* is a union of all event structures used in SDL.
|
||||
* \brief General event structure
|
||||
*/
|
||||
typedef union SDL_Event
|
||||
{
|
||||
@@ -733,7 +696,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NUL
|
||||
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
|
||||
/* @{ */
|
||||
typedef enum SDL_eventaction
|
||||
typedef enum
|
||||
{
|
||||
SDL_ADDEVENT,
|
||||
SDL_PEEKEVENT,
|
||||
@@ -760,15 +723,15 @@ typedef enum SDL_eventaction
|
||||
*
|
||||
* This function is thread-safe.
|
||||
*
|
||||
* \param events destination buffer for the retrieved events.
|
||||
* \param events destination buffer for the retrieved events
|
||||
* \param numevents if action is SDL_ADDEVENT, the number of events to add
|
||||
* back to the event queue; if action is SDL_PEEKEVENT or
|
||||
* SDL_GETEVENT, the maximum number of events to retrieve.
|
||||
* \param action action to take; see [[#action|Remarks]] for details.
|
||||
* SDL_GETEVENT, the maximum number of events to retrieve
|
||||
* \param action action to take; see [[#action|Remarks]] for details
|
||||
* \param minType minimum value of the event type to be considered;
|
||||
* SDL_FIRSTEVENT is a safe choice.
|
||||
* SDL_FIRSTEVENT is a safe choice
|
||||
* \param maxType maximum value of the event type to be considered;
|
||||
* SDL_LASTEVENT is a safe choice.
|
||||
* SDL_LASTEVENT is a safe choice
|
||||
* \returns the number of events actually stored or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -789,7 +752,7 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
||||
* If you need to check for a range of event types, use SDL_HasEvents()
|
||||
* instead.
|
||||
*
|
||||
* \param type the type of event to be queried; see SDL_EventType for details.
|
||||
* \param type the type of event to be queried; see SDL_EventType for details
|
||||
* \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
|
||||
* events matching `type` are not present.
|
||||
*
|
||||
@@ -806,9 +769,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
* If you need to check for a single event type, use SDL_HasEvent() instead.
|
||||
*
|
||||
* \param minType the low end of event type to be queried, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
* \param maxType the high end of event type to be queried, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
* \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
|
||||
* present, or SDL_FALSE if not.
|
||||
*
|
||||
@@ -832,7 +795,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
||||
* on the main thread immediately before the flush call.
|
||||
*
|
||||
* \param type the type of event to be cleared; see SDL_EventType for details.
|
||||
* \param type the type of event to be cleared; see SDL_EventType for details
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -855,9 +818,9 @@ extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
||||
* on the main thread immediately before the flush call.
|
||||
*
|
||||
* \param minType the low end of event type to be cleared, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
* \param maxType the high end of event type to be cleared, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -898,7 +861,7 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
||||
* ```
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled with the next event from
|
||||
* the queue, or NULL.
|
||||
* the queue, or NULL
|
||||
* \returns 1 if there is a pending event or 0 if there are none available.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -922,7 +885,7 @@ extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
|
||||
* this function in the thread that initialized the video subsystem.
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled in with the next event
|
||||
* from the queue, or NULL.
|
||||
* from the queue, or NULL
|
||||
* \returns 1 on success or 0 if there was an error while waiting for events;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -945,9 +908,9 @@ extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
|
||||
* this function in the thread that initialized the video subsystem.
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled in with the next event
|
||||
* from the queue, or NULL.
|
||||
* from the queue, or NULL
|
||||
* \param timeout the maximum number of milliseconds to wait for the next
|
||||
* available event.
|
||||
* available event
|
||||
* \returns 1 on success or 0 if there was an error while waiting for events;
|
||||
* call SDL_GetError() for more information. This also returns 0 if
|
||||
* the timeout elapsed without an event arriving.
|
||||
@@ -982,7 +945,7 @@ extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
|
||||
* get an event type that does not conflict with other code that also wants
|
||||
* its own custom event types.
|
||||
*
|
||||
* \param event the SDL_Event to be added to the queue.
|
||||
* \param event the SDL_Event to be added to the queue
|
||||
* \returns 1 on success, 0 if the event was filtered, or a negative error
|
||||
* code on failure; call SDL_GetError() for more information. A
|
||||
* common reason for error is the event queue being full.
|
||||
@@ -998,11 +961,11 @@ extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
|
||||
/**
|
||||
* A function pointer used for callbacks that watch the event queue.
|
||||
*
|
||||
* \param userdata what was passed as `userdata` to SDL_SetEventFilter() or
|
||||
* SDL_AddEventWatch, etc.
|
||||
* \param event the event that triggered the callback.
|
||||
* \returns 1 to permit event to be added to the queue, and 0 to disallow it.
|
||||
* When used with SDL_AddEventWatch, the return value is ignored.
|
||||
* \param userdata what was passed as `userdata` to SDL_SetEventFilter()
|
||||
* or SDL_AddEventWatch, etc
|
||||
* \param event the event that triggered the callback
|
||||
* \returns 1 to permit event to be added to the queue, and 0 to disallow
|
||||
* it. When used with SDL_AddEventWatch, the return value is ignored.
|
||||
*
|
||||
* \sa SDL_SetEventFilter
|
||||
* \sa SDL_AddEventWatch
|
||||
@@ -1025,7 +988,7 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
||||
* interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
|
||||
* application at the next event poll.
|
||||
*
|
||||
* There is one caveat when dealing with the SDL_QuitEvent event type. The
|
||||
* There is one caveat when dealing with the ::SDL_QuitEvent event type. The
|
||||
* event filter is only called when the window manager desires to close the
|
||||
* application window. If the event filter returns 1, then the window will be
|
||||
* closed, otherwise the window will remain open if possible.
|
||||
@@ -1040,8 +1003,8 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
||||
* the event filter, but events pushed onto the queue with SDL_PeepEvents() do
|
||||
* not.
|
||||
*
|
||||
* \param filter An SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \param filter An SDL_EventFilter function to call when an event happens
|
||||
* \param userdata a pointer that is passed to `filter`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1060,9 +1023,9 @@ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
|
||||
* This function can be used to "chain" filters, by saving the existing filter
|
||||
* before replacing it with a function that will call that saved filter.
|
||||
*
|
||||
* \param filter the current callback function will be stored here.
|
||||
* \param filter the current callback function will be stored here
|
||||
* \param userdata the pointer that is passed to the current event filter will
|
||||
* be stored here.
|
||||
* be stored here
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -1091,7 +1054,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
|
||||
* through SDL_PeepEvents().
|
||||
*
|
||||
* \param filter an SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \param userdata a pointer that is passed to `filter`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1107,8 +1070,8 @@ extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
|
||||
* This function takes the same input as SDL_AddEventWatch() to identify and
|
||||
* delete the corresponding callback.
|
||||
*
|
||||
* \param filter the function originally passed to SDL_AddEventWatch().
|
||||
* \param userdata the pointer originally passed to SDL_AddEventWatch().
|
||||
* \param filter the function originally passed to SDL_AddEventWatch()
|
||||
* \param userdata the pointer originally passed to SDL_AddEventWatch()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1125,8 +1088,8 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
|
||||
* this function does not change the filter permanently, it only uses the
|
||||
* supplied filter until this function returns.
|
||||
*
|
||||
* \param filter the SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \param filter the SDL_EventFilter function to call when an event happens
|
||||
* \param userdata a pointer that is passed to `filter`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1152,8 +1115,8 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
||||
* from the event queue and will not be filtered
|
||||
* - `SDL_ENABLE`: the event will be processed normally
|
||||
*
|
||||
* \param type the type of event; see SDL_EventType for details.
|
||||
* \param state how to process the event.
|
||||
* \param type the type of event; see SDL_EventType for details
|
||||
* \param state how to process the event
|
||||
* \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state
|
||||
* of the event before this function makes any changes to it.
|
||||
*
|
||||
@@ -1175,7 +1138,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
|
||||
* Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
|
||||
* 0xFFFFFFFF), but is clearer to write.
|
||||
*
|
||||
* \param numevents the number of events to be allocated.
|
||||
* \param numevents the number of events to be allocated
|
||||
* \returns the beginning event number, or (Uint32)-1 if there are not enough
|
||||
* user-defined events left.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryFilesystem
|
||||
* \file SDL_filesystem.h
|
||||
*
|
||||
* Include file for filesystem SDL API functions
|
||||
* \brief Include file for filesystem SDL API functions
|
||||
*/
|
||||
|
||||
#ifndef SDL_filesystem_h_
|
||||
@@ -126,8 +126,8 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
||||
* The pointer returned is owned by the caller. Please call SDL_free() on the
|
||||
* pointer when done with it.
|
||||
*
|
||||
* \param org the name of your organization.
|
||||
* \param app the name of your application.
|
||||
* \param org the name of your organization
|
||||
* \param app the name of your application
|
||||
* \returns a UTF-8 string of the user directory in platform-dependent
|
||||
* notation. NULL if there's a problem (creating directory failed,
|
||||
* etc.).
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user