mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 11:28:15 +00:00
Compare commits
208 Commits
SDL2
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 }}"
|
|
62
.github/actions/setup-ninja/action.yml
vendored
62
.github/actions/setup-ninja/action.yml
vendored
@@ -1,62 +0,0 @@
|
|||||||
name: 'Setup ninja'
|
|
||||||
description: 'Download ninja and add it to the PATH environment variable'
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Ninja version'
|
|
||||||
default: '1.12.1'
|
|
||||||
runs:
|
|
||||||
using: 'composite'
|
|
||||||
steps:
|
|
||||||
- name: 'Calculate variables'
|
|
||||||
id: calc
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
case "${{ runner.os }}-${{ runner.arch }}" in
|
|
||||||
"Linux-X86" | "Linux-X64")
|
|
||||||
archive="ninja-linux.zip"
|
|
||||||
;;
|
|
||||||
"Linux-ARM64")
|
|
||||||
archive="ninja-linux-aarch64.zip"
|
|
||||||
;;
|
|
||||||
"macOS-X86" | "macOS-X64" | "macOS-ARM64")
|
|
||||||
archive="ninja-mac.zip"
|
|
||||||
;;
|
|
||||||
"Windows-X86" | "Windows-X64")
|
|
||||||
archive="ninja-win.zip"
|
|
||||||
;;
|
|
||||||
"Windows-ARM64")
|
|
||||||
archive="ninja-winarm64.zip"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
|
|
||||||
exit 1;
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "archive=${archive}" >> ${GITHUB_OUTPUT}
|
|
||||||
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
|
|
||||||
- name: 'Restore cached ${{ steps.calc.outputs.archive }}'
|
|
||||||
id: cache-restore
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
|
|
||||||
key: ${{ steps.calc.outputs.cache-key }}
|
|
||||||
- name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})'
|
|
||||||
if: ${{ !steps.cache-restore.outputs.cache-hit }}
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
|
|
||||||
- name: 'Cache ${{ steps.calc.outputs.archive }}'
|
|
||||||
if: ${{ !steps.cache-restore.outputs.cache-hit }}
|
|
||||||
uses: actions/cache/save@v4
|
|
||||||
with:
|
|
||||||
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
|
|
||||||
key: ${{ steps.calc.outputs.cache-key }}
|
|
||||||
- name: 'Extract libusb'
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
|
|
||||||
- name: 'Set output variables'
|
|
||||||
id: final
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
echo "${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" >> $env:GITHUB_PATH
|
|
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
|
403
.github/workflows/release.yml
vendored
403
.github/workflows/release.yml
vendored
@@ -1,403 +0,0 @@
|
|||||||
name: 'release'
|
|
||||||
run-name: 'Create SDL release artifacts for ${{ inputs.commit }}'
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
commit:
|
|
||||||
description: 'Commit of SDL'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
src:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
project: ${{ steps.releaser.outputs.project }}
|
|
||||||
version: ${{ steps.releaser.outputs.version }}
|
|
||||||
src-tar-gz: ${{ steps.releaser.outputs.src-tar-gz }}
|
|
||||||
src-tar-xz: ${{ steps.releaser.outputs.src-tar-xz }}
|
|
||||||
src-zip: ${{ steps.releaser.outputs.src-zip }}
|
|
||||||
steps:
|
|
||||||
- name: 'Set up Python'
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
- name: 'Fetch build-release.py'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
sparse-checkout: 'build-scripts/build-release.py'
|
|
||||||
- name: 'Set up SDL sources'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
path: 'SDL'
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: 'Build Source archive'
|
|
||||||
id: releaser
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
python build-scripts/build-release.py \
|
|
||||||
--actions source \
|
|
||||||
--commit ${{ inputs.commit }} \
|
|
||||||
--root "${{ github.workspace }}/SDL" \
|
|
||||||
--github \
|
|
||||||
--debug
|
|
||||||
- name: 'Store source archives'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace}}/dist'
|
|
||||||
|
|
||||||
linux-verify:
|
|
||||||
needs: [src]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Unzip ${{ needs.src.outputs.src-zip }}'
|
|
||||||
id: zip
|
|
||||||
run: |
|
|
||||||
mkdir /tmp/zipdir
|
|
||||||
cd /tmp/zipdir
|
|
||||||
unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
|
|
||||||
echo "path=/tmp/zipdir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
|
|
||||||
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
|
|
||||||
id: tar
|
|
||||||
run: |
|
|
||||||
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: 'Compare contents of ${{ needs.src.outputs.src-zip }} and ${{ needs.src.outputs.src-tar-gz }}'
|
|
||||||
run: |
|
|
||||||
diff /tmp/zipdir /tmp/tardir
|
|
||||||
- name: 'Test versioning'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
${{ steps.tar.outputs.path }}/build-scripts/test-versioning.sh
|
|
||||||
- name: 'CMake (configure + build + tests + examples)'
|
|
||||||
run: |
|
|
||||||
cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
|
|
||||||
cmake --build /tmp/build --verbose
|
|
||||||
ctest --test-dir /tmp/build --no-tests=error --output-on-failure
|
|
||||||
|
|
||||||
dmg:
|
|
||||||
needs: [src]
|
|
||||||
runs-on: macos-latest
|
|
||||||
outputs:
|
|
||||||
dmg: ${{ steps.releaser.outputs.dmg }}
|
|
||||||
steps:
|
|
||||||
- name: 'Set up Python'
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
- name: 'Fetch build-release.py'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
sparse-checkout: 'build-scripts/build-release.py'
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
|
|
||||||
id: tar
|
|
||||||
run: |
|
|
||||||
mkdir -p "${{ github.workspace }}/tardir"
|
|
||||||
tar -C "${{ github.workspace }}/tardir" -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
|
|
||||||
echo "path=${{ github.workspace }}/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
|
|
||||||
- name: 'Build SDL2.dmg'
|
|
||||||
id: releaser
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
python build-scripts/build-release.py \
|
|
||||||
--actions dmg \
|
|
||||||
--commit ${{ inputs.commit }} \
|
|
||||||
--root "${{ steps.tar.outputs.path }}" \
|
|
||||||
--github \
|
|
||||||
--debug
|
|
||||||
- name: 'Store DMG image file'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: dmg
|
|
||||||
path: '${{ github.workspace }}/dist'
|
|
||||||
|
|
||||||
dmg-verify:
|
|
||||||
needs: [dmg, src]
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Download ${{ needs.dmg.outputs.dmg }}'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: dmg
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
|
|
||||||
id: src
|
|
||||||
run: |
|
|
||||||
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: 'Mount ${{ needs.dmg.outputs.dmg }}'
|
|
||||||
id: mount
|
|
||||||
run: |
|
|
||||||
hdiutil attach '${{ github.workspace }}/${{ needs.dmg.outputs.dmg }}'
|
|
||||||
mount_point="/Volumes/${{ needs.src.outputs.project }}"
|
|
||||||
if [ ! -d "$mount_point/${{ needs.src.outputs.project }}.framework" ]; then
|
|
||||||
echo "Cannot find ${{ needs.src.outputs.project }}.framework!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "mount_point=$mount_point">>$GITHUB_OUTPUT
|
|
||||||
- name: 'CMake (configure + build) Darwin'
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
|
||||||
-DTEST_FULL=FALSE \
|
|
||||||
-DTEST_STATIC=FALSE \
|
|
||||||
-DTEST_TEST=FALSE \
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
|
|
||||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
|
||||||
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
|
|
||||||
-Werror=dev \
|
|
||||||
-B build_darwin
|
|
||||||
cmake --build build_darwin --config Release --verbose
|
|
||||||
|
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
|
||||||
-DTEST_FULL=FALSE \
|
|
||||||
-DTEST_STATIC=FALSE \
|
|
||||||
-DTEST_TEST=FALSE \
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
|
|
||||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
|
||||||
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
|
|
||||||
-Werror=dev \
|
|
||||||
-B build_darwin_2
|
|
||||||
cmake --build build_darwin --config Release --verbose
|
|
||||||
|
|
||||||
msvc:
|
|
||||||
needs: [src]
|
|
||||||
runs-on: windows-2025
|
|
||||||
outputs:
|
|
||||||
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
|
|
||||||
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
|
|
||||||
VC-devel: ${{ steps.releaser.outputs.VC-devel }}
|
|
||||||
steps:
|
|
||||||
- name: 'Set up Python'
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
- name: 'Fetch build-release.py'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
sparse-checkout: 'build-scripts/build-release.py'
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Unzip ${{ needs.src.outputs.src-zip }}'
|
|
||||||
id: zip
|
|
||||||
run: |
|
|
||||||
New-Item C:\temp -ItemType Directory -ErrorAction SilentlyContinue
|
|
||||||
cd C:\temp
|
|
||||||
unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
|
|
||||||
echo "path=C:\temp\${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$Env:GITHUB_OUTPUT
|
|
||||||
- name: 'Build MSVC binary archives'
|
|
||||||
id: releaser
|
|
||||||
run: |
|
|
||||||
python build-scripts/build-release.py `
|
|
||||||
--actions msvc `
|
|
||||||
--commit ${{ inputs.commit }} `
|
|
||||||
--root "${{ steps.zip.outputs.path }}" `
|
|
||||||
--github `
|
|
||||||
--debug
|
|
||||||
- name: 'Store MSVC archives'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: win32
|
|
||||||
path: '${{ github.workspace }}/dist'
|
|
||||||
|
|
||||||
msvc-verify:
|
|
||||||
needs: [msvc, src]
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- name: 'Fetch .github/actions/setup-ninja/action.yml'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
sparse-checkout: '.github/actions/setup-ninja/action.yml'
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Download MSVC binaries'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: win32
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Unzip ${{ needs.src.outputs.src-zip }}'
|
|
||||||
id: src
|
|
||||||
run: |
|
|
||||||
mkdir '${{ github.workspace }}/sources'
|
|
||||||
cd '${{ github.workspace }}/sources'
|
|
||||||
unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
|
|
||||||
echo "path=${{ github.workspace }}/sources/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
|
|
||||||
- name: 'Unzip ${{ needs.msvc.outputs.VC-devel }}'
|
|
||||||
id: bin
|
|
||||||
run: |
|
|
||||||
mkdir '${{ github.workspace }}/vc'
|
|
||||||
cd '${{ github.workspace }}/vc'
|
|
||||||
unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}"
|
|
||||||
echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
|
|
||||||
- name: Set up ninja
|
|
||||||
uses: ./.github/actions/setup-ninja
|
|
||||||
- name: 'Configure vcvars x86'
|
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
|
||||||
with:
|
|
||||||
arch: x64_x86
|
|
||||||
- name: 'CMake (configure + build + tests) x86'
|
|
||||||
run: |
|
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
|
|
||||||
-B build_x86 `
|
|
||||||
-GNinja `
|
|
||||||
-DCMAKE_BUILD_TYPE=Debug `
|
|
||||||
-Werror=dev `
|
|
||||||
-DTEST_FULL=FALSE `
|
|
||||||
-DTEST_STATIC=FALSE `
|
|
||||||
-DTEST_SHARED=TRUE `
|
|
||||||
-DTEST_TEST=TRUE `
|
|
||||||
-DCMAKE_SUPPRESS_REGENERATION=TRUE `
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
|
|
||||||
Start-Sleep -Seconds 2
|
|
||||||
cmake --build build_x86 --config Release --verbose
|
|
||||||
#ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure
|
|
||||||
- name: 'Configure vcvars x64'
|
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
|
||||||
with:
|
|
||||||
arch: x64
|
|
||||||
- name: 'CMake (configure + build + tests) x64'
|
|
||||||
run: |
|
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
|
|
||||||
-B build_x64 `
|
|
||||||
-GNinja `
|
|
||||||
-DCMAKE_BUILD_TYPE=Debug `
|
|
||||||
-Werror=dev `
|
|
||||||
-DTEST_FULL=FALSE `
|
|
||||||
-DTEST_STATIC=FALSE `
|
|
||||||
-DTEST_SHARED=TRUE `
|
|
||||||
-DTEST_TEST=TRUE `
|
|
||||||
-DCMAKE_SUPPRESS_REGENERATION=TRUE `
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
|
|
||||||
Start-Sleep -Seconds 2
|
|
||||||
cmake --build build_x64 --config Release --verbose
|
|
||||||
#ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure
|
|
||||||
|
|
||||||
mingw:
|
|
||||||
needs: [src]
|
|
||||||
runs-on: ubuntu-24.04 # FIXME: current ubuntu-latest ships an outdated mingw, replace with ubuntu-latest once 24.04 becomes the new default
|
|
||||||
outputs:
|
|
||||||
mingw-devel-tar-gz: ${{ steps.releaser.outputs.mingw-devel-tar-gz }}
|
|
||||||
mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
|
|
||||||
steps:
|
|
||||||
- name: 'Set up Python'
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
- name: 'Fetch build-release.py'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
sparse-checkout: 'build-scripts/build-release.py'
|
|
||||||
- name: 'Install Mingw toolchain'
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
|
|
||||||
id: tar
|
|
||||||
run: |
|
|
||||||
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: 'Build MinGW binary archives'
|
|
||||||
id: releaser
|
|
||||||
run: |
|
|
||||||
python build-scripts/build-release.py \
|
|
||||||
--actions mingw \
|
|
||||||
--commit ${{ inputs.commit }} \
|
|
||||||
--root "${{ steps.tar.outputs.path }}" \
|
|
||||||
--github \
|
|
||||||
--debug
|
|
||||||
- name: 'Store MinGW archives'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: mingw
|
|
||||||
path: '${{ github.workspace }}/dist'
|
|
||||||
|
|
||||||
mingw-verify:
|
|
||||||
needs: [mingw, src]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: 'Install Mingw toolchain'
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
|
|
||||||
- name: 'Download source archives'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sources
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Download MinGW binaries'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: mingw
|
|
||||||
path: '${{ github.workspace }}'
|
|
||||||
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
|
|
||||||
id: src
|
|
||||||
run: |
|
|
||||||
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 }}'
|
|
||||||
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
|
|
||||||
- name: 'CMake (configure + build) i686'
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
|
||||||
-DCMAKE_BUILD_TYPE="Release" \
|
|
||||||
-DTEST_FULL=FALSE \
|
|
||||||
-DTEST_STATIC=TRUE \
|
|
||||||
-DTEST_TEST=TRUE \
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \
|
|
||||||
-DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \
|
|
||||||
-Werror=dev \
|
|
||||||
-B build_x86
|
|
||||||
cmake --build build_x86 --config Release --verbose
|
|
||||||
- name: 'CMake (configure + build) x86_64'
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
|
||||||
-DCMAKE_BUILD_TYPE="Release" \
|
|
||||||
-DTEST_FULL=FALSE \
|
|
||||||
-DTEST_STATIC=TRUE \
|
|
||||||
-DTEST_TEST=TRUE \
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \
|
|
||||||
-DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \
|
|
||||||
-Werror=dev \
|
|
||||||
-B build_x64
|
|
||||||
cmake --build build_x64 --config Release --verbose
|
|
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 ..
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -15,8 +15,7 @@ build
|
|||||||
gen
|
gen
|
||||||
Build
|
Build
|
||||||
buildbot
|
buildbot
|
||||||
/REVISION.txt
|
/VERSION.txt
|
||||||
dist
|
|
||||||
|
|
||||||
*.so
|
*.so
|
||||||
*.so.*
|
*.so.*
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
projectfullname = Simple Directmedia Layer
|
projectfullname = SDL2
|
||||||
projectshortname = SDL
|
projectshortname = SDL2
|
||||||
incsubdir = include
|
incsubdir = include
|
||||||
wikisubdir = SDL2
|
wikisubdir = SDL2
|
||||||
readmesubdir = docs
|
readmesubdir = docs
|
||||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_|[US]int\d+)
|
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
||||||
mainincludefname = SDL.h
|
mainincludefname = SDL.h
|
||||||
versionfname = include/SDL_version.h
|
versionfname = include/SDL_version.h
|
||||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
||||||
@@ -14,19 +14,4 @@ projecturl = https://libsdl.org/
|
|||||||
wikiurl = https://wiki.libsdl.org/SDL2
|
wikiurl = https://wiki.libsdl.org/SDL2
|
||||||
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
||||||
warn_about_missing = 0
|
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.)
|
wikipreamble = (This is the legacy documentation for stable SDL2, the current stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current development 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
|
|
||||||
|
@@ -35,7 +35,6 @@ LOCAL_SRC_FILES := \
|
|||||||
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
|
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
|
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.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/hidapi/*.c) \
|
||||||
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
|
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
|
||||||
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
|
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
|
||||||
|
198
CMakeLists.txt
198
CMakeLists.txt
@@ -5,8 +5,8 @@ endif()
|
|||||||
# MSVC runtime library flags are selected by an abstraction.
|
# MSVC runtime library flags are selected by an abstraction.
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
|
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0.0...3.10)
|
cmake_minimum_required(VERSION 3.0.0...3.5)
|
||||||
project(SDL2 C)
|
project(SDL2 C CXX)
|
||||||
|
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||||
set(SDL2_SUBPROJECT OFF)
|
set(SDL2_SUBPROJECT OFF)
|
||||||
@@ -15,15 +15,13 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (HAIKU)
|
if (HAIKU)
|
||||||
enable_language(CXX)
|
|
||||||
set(LINKER_LANGUAGE CXX)
|
set(LINKER_LANGUAGE CXX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(EXTRA_LIBS)
|
set(EXTRA_LIBS)
|
||||||
set(EXTRA_LDFLAGS)
|
set(EXTRA_LDFLAGS)
|
||||||
|
|
||||||
set(CMAKE_LIBS)
|
set(CMAKE_DEPENDS)
|
||||||
set(PKGCONFIG_LDFLAGS)
|
|
||||||
set(PKGCONFIG_DEPENDS)
|
set(PKGCONFIG_DEPENDS)
|
||||||
|
|
||||||
# This is a virtual "library" that just exists to collect up compiler and
|
# 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)
|
add_library(sdl-build-options INTERFACE)
|
||||||
|
|
||||||
if(WINDOWS_STORE)
|
if(WINDOWS_STORE)
|
||||||
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1" "WINAPI_FAMILY=WINAPI_FAMILY_APP")
|
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
|
||||||
target_compile_options(sdl-build-options INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-ZW>" "$<$<COMPILE_LANGUAGE:CXX>:-EHsc>")
|
target_compile_options(sdl-build-options INTERFACE "-ZW")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
|
# 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
|
# See docs/release_checklist.md
|
||||||
set(SDL_MAJOR_VERSION 2)
|
set(SDL_MAJOR_VERSION 2)
|
||||||
set(SDL_MINOR_VERSION 33)
|
set(SDL_MINOR_VERSION 30)
|
||||||
set(SDL_MICRO_VERSION 0)
|
set(SDL_MICRO_VERSION 6)
|
||||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||||
|
|
||||||
# Set defaults preventing destination file conflicts
|
# 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(x64 SDL_CPU_X64)
|
||||||
check_cpu_architecture(arm32 SDL_CPU_ARM32)
|
check_cpu_architecture(arm32 SDL_CPU_ARM32)
|
||||||
check_cpu_architecture(arm64 SDL_CPU_ARM64)
|
check_cpu_architecture(arm64 SDL_CPU_ARM64)
|
||||||
check_cpu_architecture(arm64ec SDL_CPU_ARM64EC)
|
|
||||||
check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64)
|
check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64)
|
||||||
|
|
||||||
# Check for 64 or 32 bit
|
# 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'll just use libusb when it's available. libusb does not support iOS,
|
||||||
# so we default to yes on iOS.
|
# so we default to yes on iOS.
|
||||||
# TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
|
# 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)
|
set(HIDAPI_SKIP_LIBUSB TRUE)
|
||||||
else()
|
else()
|
||||||
set(HIDAPI_SKIP_LIBUSB FALSE)
|
set(HIDAPI_SKIP_LIBUSB FALSE)
|
||||||
@@ -241,10 +238,10 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Default option knobs
|
# 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)
|
set(OPT_DEF_LIBC ON)
|
||||||
endif()
|
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)
|
set(SDL_SYSTEM_ICONV_DEFAULT OFF)
|
||||||
else()
|
else()
|
||||||
set(SDL_SYSTEM_ICONV_DEFAULT ON)
|
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)
|
set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF)
|
||||||
endif()
|
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:
|
# When defined, respect CMake's BUILD_SHARED_LIBS setting:
|
||||||
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
|
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
|
||||||
if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT)
|
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_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_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_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_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_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
|
||||||
dep_option(SDL_ARMNEON "Use NEON assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
|
dep_option(SDL_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_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${SDL_CLOCK_GETTIME_ENABLED_BY_DEFAULT})
|
||||||
set_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS})
|
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_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF)
|
||||||
dep_option(SDL_X11_XCURSOR "Enable Xcursor support" ON SDL_X11 OFF)
|
set(SDL_X11_OPTIONS Xcursor Xdbe XInput Xfixes Xrandr Xscrnsaver XShape)
|
||||||
dep_option(SDL_X11_XDBE "Enable Xdbe support" ON SDL_X11 OFF)
|
foreach(_SUB ${SDL_X11_OPTIONS})
|
||||||
dep_option(SDL_X11_XINPUT "Enable XInput support" ON SDL_X11 OFF)
|
string(TOUPPER "SDL_X11_${_SUB}" _OPT)
|
||||||
dep_option(SDL_X11_XFIXES "Enable Xfixes support" ON SDL_X11 OFF)
|
dep_option(${_OPT} "Enable ${_SUB} support" ON "SDL_X11" OFF)
|
||||||
dep_option(SDL_X11_XRANDR "Enable Xrandr support" "${SDL_X11_XRANDR_DEFAULT}" SDL_X11 OFF)
|
endforeach()
|
||||||
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_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
|
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_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 "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_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)
|
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_COCOA "Use Cocoa video driver" ${APPLE})
|
||||||
set_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS})
|
set_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS})
|
||||||
set_option(SDL_XINPUT "Use Xinput for Windows" ${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")
|
if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")
|
||||||
list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT")
|
list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT")
|
||||||
endif()
|
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()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||||
@@ -1099,7 +1084,6 @@ if(SDL_LIBC)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
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(setjmp "setjmp.h" HAVE_SETJMP)
|
||||||
check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP)
|
check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP)
|
||||||
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
|
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)
|
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||||
if(SDL_AUDIO)
|
if(SDL_AUDIO)
|
||||||
if(SYSV5 OR SOLARIS OR HPUX)
|
if(SYSV5 OR SOLARIS OR HPUX)
|
||||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
||||||
check_include_file(sys/audioio.h HAVE_SYS_AUDIOIO_H)
|
file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
|
||||||
if(HAVE_SYS_AUDIOIO_H)
|
list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
|
||||||
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
set(HAVE_SDL_AUDIO TRUE)
|
||||||
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)
|
elseif(NETBSD)
|
||||||
set(SDL_AUDIO_DRIVER_NETBSD 1)
|
set(SDL_AUDIO_DRIVER_NETBSD 1)
|
||||||
file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c)
|
file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c)
|
||||||
@@ -1793,7 +1773,6 @@ elseif(WINDOWS)
|
|||||||
list(APPEND SOURCE_FILES ${CORE_SOURCES})
|
list(APPEND SOURCE_FILES ${CORE_SOURCES})
|
||||||
|
|
||||||
if(WINDOWS_STORE)
|
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)
|
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})
|
list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES})
|
||||||
endif()
|
endif()
|
||||||
@@ -1839,10 +1818,8 @@ elseif(WINDOWS)
|
|||||||
set(HAVE_DIRECTX TRUE)
|
set(HAVE_DIRECTX TRUE)
|
||||||
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
|
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
|
||||||
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
|
# 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 "$$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}")
|
||||||
target_link_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_LIB_DIR}")
|
target_include_directories(sdl-build-options INTERFACE "$ENV{DXSDK_DIR}\\Include")
|
||||||
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}")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
@@ -2077,7 +2054,6 @@ elseif(WINDOWS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
enable_language(RC)
|
|
||||||
file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
|
file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
|
||||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
|
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
|
||||||
if(MINGW OR CYGWIN)
|
if(MINGW OR CYGWIN)
|
||||||
@@ -2095,7 +2071,7 @@ elseif(APPLE)
|
|||||||
# !!! FIXME: we need Carbon for some very old API calls in
|
# !!! FIXME: we need Carbon for some very old API calls in
|
||||||
# !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
|
# !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
|
||||||
# !!! FIXME: how to dump those.
|
# !!! FIXME: how to dump those.
|
||||||
if(MACOS)
|
if(DARWIN OR MACOSX)
|
||||||
set(SDL_FRAMEWORK_COCOA 1)
|
set(SDL_FRAMEWORK_COCOA 1)
|
||||||
set(SDL_FRAMEWORK_CARBON 1)
|
set(SDL_FRAMEWORK_CARBON 1)
|
||||||
endif()
|
endif()
|
||||||
@@ -2109,12 +2085,12 @@ elseif(APPLE)
|
|||||||
set(HAVE_SDL_FILE TRUE)
|
set(HAVE_SDL_FILE TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
if(IOS OR TVOS)
|
||||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c)
|
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_MISC)
|
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)
|
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m)
|
||||||
else()
|
else()
|
||||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m)
|
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m)
|
||||||
@@ -2139,10 +2115,10 @@ elseif(APPLE)
|
|||||||
|
|
||||||
if(SDL_JOYSTICK)
|
if(SDL_JOYSTICK)
|
||||||
file(GLOB MFI_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m)
|
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)
|
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
|
||||||
set(SDL_JOYSTICK_MFI 1)
|
set(SDL_JOYSTICK_MFI 1)
|
||||||
if(IOS OR VISIONOS OR WATCHOS)
|
if(IOS)
|
||||||
set(SDL_FRAMEWORK_COREMOTION 1)
|
set(SDL_FRAMEWORK_COREMOTION 1)
|
||||||
endif()
|
endif()
|
||||||
set(SDL_FRAMEWORK_GAMECONTROLLER 1)
|
set(SDL_FRAMEWORK_GAMECONTROLLER 1)
|
||||||
@@ -2183,7 +2159,7 @@ elseif(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_HAPTIC)
|
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)
|
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
|
||||||
set(SDL_HAPTIC_DUMMY 1)
|
set(SDL_HAPTIC_DUMMY 1)
|
||||||
else()
|
else()
|
||||||
@@ -2197,7 +2173,7 @@ elseif(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_POWER)
|
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)
|
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
|
||||||
set(SDL_POWER_UIKIT 1)
|
set(SDL_POWER_UIKIT 1)
|
||||||
else()
|
else()
|
||||||
@@ -2230,7 +2206,7 @@ elseif(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_SENSOR)
|
if(SDL_SENSOR)
|
||||||
if(IOS OR VISIONOS OR WATCHOS)
|
if(IOS)
|
||||||
set(SDL_SENSOR_COREMOTION 1)
|
set(SDL_SENSOR_COREMOTION 1)
|
||||||
set(HAVE_SDL_SENSORS TRUE)
|
set(HAVE_SDL_SENSORS TRUE)
|
||||||
file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/coremotion/*.m)
|
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/ ?
|
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
|
||||||
if(SDL_VIDEO)
|
if(SDL_VIDEO)
|
||||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
if (IOS OR TVOS)
|
||||||
set(SDL_VIDEO_DRIVER_UIKIT 1)
|
set(SDL_VIDEO_DRIVER_UIKIT 1)
|
||||||
set(SDL_FRAMEWORK_COREGRAPHICS 1)
|
set(SDL_FRAMEWORK_COREGRAPHICS 1)
|
||||||
set(SDL_FRAMEWORK_QUARTZCORE 1)
|
set(SDL_FRAMEWORK_QUARTZCORE 1)
|
||||||
@@ -2261,7 +2237,7 @@ elseif(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_OPENGLES)
|
if(SDL_OPENGLES)
|
||||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
if(IOS OR TVOS)
|
||||||
set(SDL_FRAMEWORK_OPENGLES 1)
|
set(SDL_FRAMEWORK_OPENGLES 1)
|
||||||
set(SDL_VIDEO_OPENGL_ES 1)
|
set(SDL_VIDEO_OPENGL_ES 1)
|
||||||
set(SDL_VIDEO_RENDER_OGL_ES 1)
|
set(SDL_VIDEO_RENDER_OGL_ES 1)
|
||||||
@@ -2304,96 +2280,73 @@ elseif(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
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.
|
# Actually load the frameworks at the end so we don't duplicate include.
|
||||||
if(SDL_FRAMEWORK_COREVIDEO)
|
if(SDL_FRAMEWORK_COREVIDEO)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreVideo")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreVideo>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_COCOA)
|
if(SDL_FRAMEWORK_COCOA)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Cocoa")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Cocoa")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Cocoa>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_IOKIT)
|
if(SDL_FRAMEWORK_IOKIT)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,IOKit")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,IOKit")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,IOKit>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_FF)
|
if(SDL_FRAMEWORK_FF)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,ForceFeedback")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,ForceFeedback>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_CARBON)
|
if(SDL_FRAMEWORK_CARBON)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Carbon")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Carbon")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Carbon>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_COREAUDIO)
|
if(SDL_FRAMEWORK_COREAUDIO)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreAudio")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreAudio>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_AUDIOTOOLBOX)
|
if(SDL_FRAMEWORK_AUDIOTOOLBOX)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AudioToolbox")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,AudioToolbox>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_AVFOUNDATION)
|
if(SDL_FRAMEWORK_AVFOUNDATION)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AVFoundation")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,AVFoundation>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_COREBLUETOOTH)
|
if(SDL_FRAMEWORK_COREBLUETOOTH)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreBluetooth>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_COREGRAPHICS)
|
if(SDL_FRAMEWORK_COREGRAPHICS)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreGraphics")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreGraphics>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_COREMOTION)
|
if(SDL_FRAMEWORK_COREMOTION)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreMotion")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Coremotion>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_FOUNDATION)
|
if(SDL_FRAMEWORK_FOUNDATION)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Foundation")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Foundation")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Foundation>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_GAMECONTROLLER)
|
if(SDL_FRAMEWORK_GAMECONTROLLER)
|
||||||
find_library(GAMECONTROLLER GameController)
|
find_library(GAMECONTROLLER GameController)
|
||||||
if(GAMECONTROLLER)
|
if(GAMECONTROLLER)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,GameController")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,GameController>")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_METAL)
|
if(SDL_FRAMEWORK_METAL)
|
||||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
if(IOS OR TVOS)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Metal")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Metal")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Metal>")
|
|
||||||
else()
|
else()
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,Metal")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,Metal>")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_OPENGLES)
|
if(SDL_FRAMEWORK_OPENGLES)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,OpenGLES")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,OpenGLES>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_QUARTZCORE)
|
if(SDL_FRAMEWORK_QUARTZCORE)
|
||||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
if(IOS OR TVOS)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,QuartzCore")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,QuartzCore>")
|
|
||||||
else()
|
else()
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,QuartzCore>")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_UIKIT)
|
if(SDL_FRAMEWORK_UIKIT)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,UIKit")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,UIKit")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,UIKit>")
|
|
||||||
endif()
|
endif()
|
||||||
if(SDL_FRAMEWORK_COREHAPTICS)
|
if(SDL_FRAMEWORK_COREHAPTICS)
|
||||||
find_library(COREHAPTICS CoreHaptics)
|
find_library(COREHAPTICS CoreHaptics)
|
||||||
if(COREHAPTICS)
|
if(COREHAPTICS)
|
||||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,CoreHaptics>")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -2712,11 +2665,6 @@ elseif(PSP)
|
|||||||
list(APPEND SOURCE_FILES ${PSP_THREAD_SOURCES})
|
list(APPEND SOURCE_FILES ${PSP_THREAD_SOURCES})
|
||||||
set(HAVE_SDL_THREADS TRUE)
|
set(HAVE_SDL_THREADS TRUE)
|
||||||
endif()
|
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)
|
if(SDL_TIMERS)
|
||||||
set(SDL_TIMER_PSP 1)
|
set(SDL_TIMER_PSP 1)
|
||||||
file(GLOB PSP_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/psp/*.c)
|
file(GLOB PSP_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/psp/*.c)
|
||||||
@@ -2749,6 +2697,7 @@ elseif(PSP)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
elseif(PS2)
|
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)
|
file(GLOB PS2_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/ps2/*.c)
|
||||||
set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${PS2_MAIN_SOURCES})
|
set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${PS2_MAIN_SOURCES})
|
||||||
@@ -3104,8 +3053,8 @@ endif()
|
|||||||
|
|
||||||
# Compat helpers for the configuration files
|
# Compat helpers for the configuration files
|
||||||
|
|
||||||
if(EXISTS "${PROJECT_SOURCE_DIR}/REVISION.txt")
|
if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION.txt")
|
||||||
file(READ "${PROJECT_SOURCE_DIR}/REVISION.txt" SDL_SOURCE_VERSION)
|
file(READ "${PROJECT_SOURCE_DIR}/VERSION.txt" SDL_SOURCE_VERSION)
|
||||||
string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION)
|
string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -3199,7 +3148,7 @@ endif()
|
|||||||
|
|
||||||
# Clean up the different lists
|
# Clean up the different lists
|
||||||
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
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)
|
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
|
||||||
listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
|
listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
|
||||||
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
||||||
@@ -3233,11 +3182,9 @@ macro(check_add_debug_flag FLAG SUFFIX)
|
|||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER)
|
check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX})
|
||||||
check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX})
|
if (HAS_CXX_${SUFFIX})
|
||||||
if (HAS_CXX_${SUFFIX})
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
@@ -3256,20 +3203,18 @@ macro(asan_check_add_debug_flag2 ASAN_FLAG)
|
|||||||
|
|
||||||
set (STORED_REQLIBS ${CMAKE_REQUIRED_LIBRARIES})
|
set (STORED_REQLIBS ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
set (CMAKE_REQUIRED_LIBRARIES "${FLAG};asan")
|
set (CMAKE_REQUIRED_LIBRARIES "${FLAG};asan")
|
||||||
|
|
||||||
check_c_compiler_flag (${FLAG} HAS_C_FLAG_${ASAN_FLAG})
|
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})
|
if (HAS_C_FLAG_${ASAN_FLAG})
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER)
|
if (HAS_CXX_${ASAN_FLAG})
|
||||||
check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG})
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||||
if (HAS_CXX_${ASAN_FLAG})
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS})
|
|
||||||
if(HAS_C_${ASAN_FLAG} OR HAS_CXX_${ASAN_FLAG})
|
if(HAS_C_${ASAN_FLAG} OR HAS_CXX_${ASAN_FLAG})
|
||||||
set(HAVE_ASAN ON)
|
set(HAVE_ASAN ON)
|
||||||
endif()
|
endif()
|
||||||
@@ -3493,7 +3438,7 @@ if(SDL_SHARED)
|
|||||||
set_property(TARGET SDL2 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS " /NODEFAULTLIB")
|
set_property(TARGET SDL2 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS " /NODEFAULTLIB")
|
||||||
endif()
|
endif()
|
||||||
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
|
# 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
|
target_include_directories(SDL2 PUBLIC
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||||
@@ -3529,7 +3474,7 @@ if(SDL_STATIC)
|
|||||||
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
|
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
|
||||||
# TODO: Win32 platforms keep the same suffix .lib for import and static
|
# TODO: Win32 platforms keep the same suffix .lib for import and static
|
||||||
# libraries - do we need to consider this?
|
# 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
|
target_include_directories(SDL2-static PUBLIC
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||||
@@ -3575,10 +3520,7 @@ if(SDL_TEST)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC AND NOT SDL_LIBC)
|
if(MSVC AND NOT SDL_LIBC)
|
||||||
set(targets )
|
set(targets SDL2)
|
||||||
if(TARGET SDL2)
|
|
||||||
list(APPEND targets SDL2)
|
|
||||||
endif()
|
|
||||||
if(TARGET SDL2-static)
|
if(TARGET SDL2-static)
|
||||||
list(APPEND targets SDL2-static)
|
list(APPEND targets SDL2-static)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -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
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 33
|
MINOR_VERSION = 30
|
||||||
MICRO_VERSION = 0
|
MICRO_VERSION = 6
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
DESCRIPTION = Simple DirectMedia Layer 2
|
DESCRIPTION = Simple DirectMedia Layer 2
|
||||||
|
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 33
|
MINOR_VERSION = 30
|
||||||
MICRO_VERSION = 0
|
MICRO_VERSION = 6
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
|
|
||||||
LIBHOME = .
|
LIBHOME = .
|
||||||
|
@@ -174,7 +174,7 @@
|
|||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\</Command>
|
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Building shader blobs (Xbox Series)</Message>
|
<Message>Building shader blobs (Xbox Series)</Message>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ one</Command>
|
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Building shader blobs (Xbox One)</Message>
|
<Message>Building shader blobs (Xbox One)</Message>
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\</Command>
|
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Building shader blobs (Xbox Series)</Message>
|
<Message>Building shader blobs (Xbox Series)</Message>
|
||||||
@@ -307,7 +307,7 @@
|
|||||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>$(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ one</Command>
|
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Building shader blobs (Xbox One)</Message>
|
<Message>Building shader blobs (Xbox One)</Message>
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||||
<Filter>logos</Filter>
|
<Filter>logos</Filter>
|
||||||
</CopyFileToFolders>
|
</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>
|
<Filter>wingdk</Filter>
|
||||||
</CopyFileToFolders>
|
</CopyFileToFolders>
|
||||||
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
<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
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -139,7 +139,7 @@
|
|||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<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>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>
|
<Command>
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<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>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>
|
<Command>
|
||||||
@@ -352,7 +352,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
|
|||||||
</CopyFileToFolders>
|
</CopyFileToFolders>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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>
|
<FileType>Document</FileType>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||||
<Filter>logos</Filter>
|
<Filter>logos</Filter>
|
||||||
</CopyFileToFolders>
|
</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>
|
<Filter>wingdk</Filter>
|
||||||
</CopyFileToFolders>
|
</CopyFileToFolders>
|
||||||
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
||||||
|
@@ -139,7 +139,7 @@
|
|||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<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>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>
|
<Command>
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<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>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>
|
<Command>
|
||||||
@@ -352,7 +352,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
|
|||||||
</CopyFileToFolders>
|
</CopyFileToFolders>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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>
|
<FileType>Document</FileType>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||||
<Filter>logos</Filter>
|
<Filter>logos</Filter>
|
||||||
</CopyFileToFolders>
|
</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>
|
<Filter>wingdk</Filter>
|
||||||
</CopyFileToFolders>
|
</CopyFileToFolders>
|
||||||
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
|
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
|
||||||
|
@@ -371,7 +371,6 @@
|
|||||||
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
|
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
|
||||||
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
<WindowsTargetPlatformMinVersion>10.0.0.0</WindowsTargetPlatformMinVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
@@ -392,7 +391,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
@@ -604,4 +603,4 @@
|
|||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -44,6 +44,22 @@
|
|||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||||
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# SDL2 CMake configuration file:
|
# SDL2 CMake configuration file:
|
||||||
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC
|
# 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)
|
include(FeatureSummary)
|
||||||
set_package_properties(SDL2 PROPERTIES
|
set_package_properties(SDL2 PROPERTIES
|
||||||
@@ -79,8 +79,6 @@ endif()
|
|||||||
unset(_sdl2_library)
|
unset(_sdl2_library)
|
||||||
unset(_sdl2_dll_library)
|
unset(_sdl2_dll_library)
|
||||||
|
|
||||||
set(SDL2_SDL2-static_FOUND FALSE)
|
|
||||||
|
|
||||||
set(_sdl2main_library "${SDL2_LIBDIR}/SDL2main.lib")
|
set(_sdl2main_library "${SDL2_LIBDIR}/SDL2main.lib")
|
||||||
if(EXISTS "${_sdl2main_library}")
|
if(EXISTS "${_sdl2main_library}")
|
||||||
if(NOT TARGET SDL2::SDL2main)
|
if(NOT TARGET SDL2::SDL2main)
|
||||||
@@ -94,7 +92,7 @@ if(EXISTS "${_sdl2main_library}")
|
|||||||
endif()
|
endif()
|
||||||
set(SDL2_SDL2main_FOUND TRUE)
|
set(SDL2_SDL2main_FOUND TRUE)
|
||||||
else()
|
else()
|
||||||
set(SDL2_SDL2main_FOUND FALSE)
|
set(SDL2_SDL2_FOUND FALSE)
|
||||||
endif()
|
endif()
|
||||||
unset(_sdl2main_library)
|
unset(_sdl2main_library)
|
||||||
|
|
||||||
@@ -112,7 +110,7 @@ if(EXISTS "${_sdl2test_library}")
|
|||||||
endif()
|
endif()
|
||||||
set(SDL2_SDL2test_FOUND TRUE)
|
set(SDL2_SDL2test_FOUND TRUE)
|
||||||
else()
|
else()
|
||||||
set(SDL2_SDL2test_FOUND FALSE)
|
set(SDL2_SDL2_FOUND FALSE)
|
||||||
endif()
|
endif()
|
||||||
unset(_sdl2test_library)
|
unset(_sdl2test_library)
|
||||||
|
|
||||||
|
@@ -188,12 +188,6 @@
|
|||||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</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">
|
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
@@ -216,12 +216,6 @@
|
|||||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</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">
|
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
@@ -188,12 +188,6 @@
|
|||||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</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">
|
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
@@ -194,12 +194,6 @@
|
|||||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</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">
|
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
@@ -456,10 +456,7 @@ main(int argc, char *argv[])
|
|||||||
while (!done) {
|
while (!done) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
double deltaTime = updateDeltaTime();
|
double deltaTime = updateDeltaTime();
|
||||||
SDL_bool hasEvents = SDL_FALSE;
|
|
||||||
|
|
||||||
while (SDL_PollEvent(&event)) {
|
while (SDL_PollEvent(&event)) {
|
||||||
hasEvents = SDL_TRUE;
|
|
||||||
if (event.type == SDL_QUIT) {
|
if (event.type == SDL_QUIT) {
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
@@ -469,17 +466,10 @@ main(int argc, char *argv[])
|
|||||||
spawnEmitterParticle(x, y);
|
spawnEmitterParticle(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stepParticles(deltaTime);
|
||||||
/* Only update and render if we have active particles or just received events */
|
drawParticles();
|
||||||
if (num_active_particles > 0 || hasEvents) {
|
SDL_GL_SwapWindow(window);
|
||||||
stepParticles(deltaTime);
|
SDL_Delay(1);
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete textures */
|
/* delete textures */
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.33.0</string>
|
<string>2.30.6</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.33.0</string>
|
<string>2.30.6</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@@ -9728,8 +9728,8 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
DYLIB_CURRENT_VERSION = 3001.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||||
@@ -9770,7 +9770,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.33.0;
|
MARKETING_VERSION = 2.30.6;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -9813,8 +9813,8 @@
|
|||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
DYLIB_CURRENT_VERSION = 3001.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@@ -9856,7 +9856,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.33.0;
|
MARKETING_VERSION = 2.30.6;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -10062,8 +10062,8 @@
|
|||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
DYLIB_CURRENT_VERSION = 3001.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
@@ -10114,8 +10114,8 @@
|
|||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
DYLIB_CURRENT_VERSION = 3001.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Title SDL 2.33.0
|
Title SDL 2.30.6
|
||||||
Version 1
|
Version 1
|
||||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||||
DefaultLocation /Library/Frameworks
|
DefaultLocation /Library/Frameworks
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Simple DirectMedia Layer
|
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
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
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.*
|
rm -f conftest.*
|
||||||
fi])
|
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],
|
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
|
||||||
[lt_cv_ld_exported_symbols_list],
|
[lt_cv_ld_exported_symbols_list],
|
||||||
[lt_cv_ld_exported_symbols_list=no
|
[lt_cv_ld_exported_symbols_list=no
|
||||||
@@ -1062,7 +1047,7 @@ _LT_EOF
|
|||||||
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||||
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
||||||
cat > conftest.c << _LT_EOF
|
cat > conftest.c << _LT_EOF
|
||||||
int main(void) { return 0;}
|
int main() { return 0;}
|
||||||
_LT_EOF
|
_LT_EOF
|
||||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
|
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
|
$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]]*)
|
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
|
||||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
_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' ;;
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains'
|
|
||||||
else
|
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1882,11 +1862,11 @@ else
|
|||||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||||
correspondingly for the symbols needed. */
|
correspondingly for the symbols needed. */
|
||||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||||
int fnord (void) __attribute__((visibility("default")));
|
int fnord () __attribute__((visibility("default")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int fnord (void) { return 42; }
|
int fnord () { return 42; }
|
||||||
int main (void)
|
int main ()
|
||||||
{
|
{
|
||||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||||
int status = $lt_dlunknown;
|
int status = $lt_dlunknown;
|
||||||
@@ -2567,14 +2547,14 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
|||||||
cygwin*)
|
cygwin*)
|
||||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
# 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/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], [],[
|
m4_if([$1], [],[
|
||||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
||||||
;;
|
;;
|
||||||
mingw* | windows* | cegcc*)
|
mingw* | windows* | cegcc*)
|
||||||
# MinGW DLLs use traditional 'lib' prefix
|
# MinGW DLLs use traditional 'lib' prefix
|
||||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
#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*)
|
||||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||||
@@ -3486,7 +3466,7 @@ cygwin*)
|
|||||||
# func_win32_libid is a shell function defined in ltmain.sh
|
# 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_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
|
||||||
lt_cv_file_magic_cmd='func_win32_libid'
|
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*)
|
mingw* | windows* | pw32*)
|
||||||
@@ -3498,10 +3478,10 @@ mingw* | windows* | pw32*)
|
|||||||
lt_cv_file_magic_cmd='func_win32_libid'
|
lt_cv_file_magic_cmd='func_win32_libid'
|
||||||
else
|
else
|
||||||
# Keep this pattern in sync with the one in func_win32_libid.
|
# 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'
|
lt_cv_file_magic_cmd='$OBJDUMP -f'
|
||||||
fi
|
fi
|
||||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cegcc*)
|
cegcc*)
|
||||||
@@ -4072,7 +4052,7 @@ void nm_test_func(void){}
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
_LT_EOF
|
||||||
|
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
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;"
|
lt_simple_compile_test_code="int some_variable = 0;"
|
||||||
|
|
||||||
# Code to be used in simple link tests
|
# 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
|
_LT_TAG_COMPILER
|
||||||
# Save the default compiler, since it gets overwritten when the other
|
# 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 {
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
# public *;
|
# 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 {
|
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
|
||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 2;
|
private static final int SDL_MAJOR_VERSION = 2;
|
||||||
private static final int SDL_MINOR_VERSION = 33;
|
private static final int SDL_MINOR_VERSION = 30;
|
||||||
private static final int SDL_MICRO_VERSION = 0;
|
private static final int SDL_MICRO_VERSION = 6;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
@@ -89,7 +89,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
| InputDevice.SOURCE_CLASS_POSITION
|
| InputDevice.SOURCE_CLASS_POSITION
|
||||||
| InputDevice.SOURCE_CLASS_TRACKBALL);
|
| InputDevice.SOURCE_CLASS_TRACKBALL);
|
||||||
|
|
||||||
if (s2 != 0) cls += "Some_Unknown";
|
if (s2 != 0) cls += "Some_Unkown";
|
||||||
|
|
||||||
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
|
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
if (s == FLAG_TAINTED) src += " FLAG_TAINTED";
|
if (s == FLAG_TAINTED) src += " FLAG_TAINTED";
|
||||||
s2 &= ~FLAG_TAINTED;
|
s2 &= ~FLAG_TAINTED;
|
||||||
|
|
||||||
if (s2 != 0) src += " Some_Unknown";
|
if (s2 != 0) src += " Some_Unkown";
|
||||||
|
|
||||||
Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src);
|
Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src);
|
||||||
}
|
}
|
||||||
@@ -790,9 +790,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
SDLActivity.mFullscreenModeActive = false;
|
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 {
|
} else {
|
||||||
Log.e(TAG, "error handling message, getContext() returned no Activity");
|
Log.e(TAG, "error handling message, getContext() returned no Activity");
|
||||||
|
@@ -80,8 +80,7 @@ do
|
|||||||
cd $folder
|
cd $folder
|
||||||
done
|
done
|
||||||
|
|
||||||
# Uppercase the first char in the activity class name because it's Java
|
ACTIVITY="${folder}Activity"
|
||||||
ACTIVITY="$(echo $folder | awk '{$1=toupper(substr($1,0,1))substr($1,2)}1')Activity"
|
|
||||||
sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml
|
sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml
|
||||||
|
|
||||||
# Fill in a default Activity
|
# Fill in a default Activity
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
|||||||
set(CMAKE_SYSTEM_NAME Windows)
|
|
||||||
set(CMAKE_SYSTEM_PROCESSOR x86)
|
|
||||||
|
|
||||||
find_program(CMAKE_C_COMPILER NAMES i686-w64-mingw32-gcc)
|
|
||||||
find_program(CMAKE_CXX_COMPILER NAMES i686-w64-mingw32-g++)
|
|
||||||
find_program(CMAKE_RC_COMPILER NAMES i686-w64-mingw32-windres windres)
|
|
||||||
|
|
||||||
if(NOT CMAKE_C_COMPILER)
|
|
||||||
message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_COMPILER)
|
|
||||||
message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_RC_COMPILER)
|
|
||||||
message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.")
|
|
||||||
endif()
|
|
@@ -1,18 +0,0 @@
|
|||||||
set(CMAKE_SYSTEM_NAME Windows)
|
|
||||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
|
||||||
|
|
||||||
find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc)
|
|
||||||
find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++)
|
|
||||||
find_program(CMAKE_RC_COMPILER NAMES x86_64-w64-mingw32-windres windres)
|
|
||||||
|
|
||||||
if(NOT CMAKE_C_COMPILER)
|
|
||||||
message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_COMPILER)
|
|
||||||
message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_RC_COMPILER)
|
|
||||||
message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.")
|
|
||||||
endif()
|
|
26
build-scripts/config.guess
vendored
26
build-scripts/config.guess
vendored
@@ -1,10 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Attempt to guess a canonical system name.
|
# 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
|
# 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
|
# 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
|
# under the terms of the GNU General Public License as published by
|
||||||
@@ -60,7 +60,7 @@ version="\
|
|||||||
GNU config.guess ($timestamp)
|
GNU config.guess ($timestamp)
|
||||||
|
|
||||||
Originally written by Per Bothner.
|
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
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
@@ -123,7 +123,7 @@ set_cc_for_build() {
|
|||||||
dummy=$tmp/dummy
|
dummy=$tmp/dummy
|
||||||
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
|
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
|
||||||
,,) echo "int x;" > "$dummy.c"
|
,,) 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
|
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
|
||||||
CC_FOR_BUILD=$driver
|
CC_FOR_BUILD=$driver
|
||||||
break
|
break
|
||||||
@@ -634,8 +634,7 @@ EOF
|
|||||||
sed 's/^ //' << EOF > "$dummy.c"
|
sed 's/^ //' << EOF > "$dummy.c"
|
||||||
#include <sys/systemcfg.h>
|
#include <sys/systemcfg.h>
|
||||||
|
|
||||||
int
|
main()
|
||||||
main ()
|
|
||||||
{
|
{
|
||||||
if (!__power_pc())
|
if (!__power_pc())
|
||||||
exit(1);
|
exit(1);
|
||||||
@@ -719,8 +718,7 @@ EOF
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int main ()
|
||||||
main ()
|
|
||||||
{
|
{
|
||||||
#if defined(_SC_KERNEL_BITS)
|
#if defined(_SC_KERNEL_BITS)
|
||||||
long bits = sysconf(_SC_KERNEL_BITS);
|
long bits = sysconf(_SC_KERNEL_BITS);
|
||||||
@@ -1597,11 +1595,8 @@ EOF
|
|||||||
*:Unleashed:*:*)
|
*:Unleashed:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
||||||
;;
|
;;
|
||||||
x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
|
*:Ironclad:*:*)
|
||||||
GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
|
GUESS=$UNAME_MACHINE-unknown-ironclad
|
||||||
;;
|
|
||||||
*:[Ii]ronclad:*:*)
|
|
||||||
GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -1626,7 +1621,6 @@ cat > "$dummy.c" <<EOF
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
int
|
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
#if defined (sony)
|
#if defined (sony)
|
||||||
@@ -1811,8 +1805,8 @@ fi
|
|||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
# Local variables:
|
# 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-start: "timestamp='"
|
||||||
# time-stamp-format: "%Y-%02m-%02d"
|
# time-stamp-format: "%:y-%02m-%02d"
|
||||||
# time-stamp-end: "'"
|
# time-stamp-end: "'"
|
||||||
# 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,43 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
from pathlib import Path
|
|
||||||
import json
|
|
||||||
import logging
|
|
||||||
import re
|
|
||||||
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"]
|
|
||||||
project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
|
|
||||||
return f"libsdl-org/{project}"
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
default_remote = determine_remote()
|
|
||||||
|
|
||||||
current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(allow_abbrev=False)
|
|
||||||
parser.add_argument("--ref", required=True, help=f"Name of branch or tag containing release.yml")
|
|
||||||
parser.add_argument("--remote", "-R", default=default_remote, help=f"Remote repo (default={default_remote})")
|
|
||||||
parser.add_argument("--commit", default=current_commit, help=f"Commit (default={current_commit})")
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
|
|
||||||
print(f"Running release.yml workflow:")
|
|
||||||
print(f" commit = {args.commit}")
|
|
||||||
print(f" remote = {args.remote}")
|
|
||||||
|
|
||||||
subprocess.check_call(["gh", "-R", args.remote, "workflow", "run", "release.yml", "--ref", args.ref, "-f", f"commit={args.commit}"], cwd=ROOT)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
raise SystemExit(main())
|
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
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
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -395,7 +395,7 @@ int main(void)
|
|||||||
printf(
|
printf(
|
||||||
"/*\n"
|
"/*\n"
|
||||||
" Simple DirectMedia Layer\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"
|
"\n"
|
||||||
" This software is provided 'as-is', without any express or implied\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"
|
" warranty. In no event will the authors be held liable for any damages\n"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
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
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -113,7 +113,7 @@ int main(void)
|
|||||||
printf(
|
printf(
|
||||||
"/*\n"
|
"/*\n"
|
||||||
" Simple DirectMedia Layer\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"
|
"\n"
|
||||||
" This software is provided 'as-is', without any express or implied\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"
|
" warranty. In no event will the authors be held liable for any damages\n"
|
||||||
|
@@ -2415,10 +2415,10 @@ libtool_validate_options ()
|
|||||||
# preserve --debug
|
# preserve --debug
|
||||||
test : = "$debug_cmd" || func_append preserve_args " --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
|
# 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
|
# 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
|
# don't eliminate duplications in $postdeps and $predeps
|
||||||
opt_duplicate_compiler_generated_deps=:
|
opt_duplicate_compiler_generated_deps=:
|
||||||
;;
|
;;
|
||||||
@@ -4935,7 +4935,7 @@ func_win32_libid ()
|
|||||||
*ar\ archive*) # could be an import, or static
|
*ar\ archive*) # could be an import, or static
|
||||||
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
|
# 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 |
|
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
|
case $nm_interface in
|
||||||
"MS dumpbin")
|
"MS dumpbin")
|
||||||
if func_cygming_ms_implib_p "$1" ||
|
if func_cygming_ms_implib_p "$1" ||
|
||||||
@@ -5534,7 +5534,7 @@ EOF
|
|||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#if defined _WIN32 && !defined __GNUC__
|
#ifdef _MSC_VER
|
||||||
# include <direct.h>
|
# include <direct.h>
|
||||||
# include <process.h>
|
# include <process.h>
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
@@ -6501,7 +6501,7 @@ func_mode_link ()
|
|||||||
# we shouldn't force the makefile maintainer to figure out
|
# we shouldn't force the makefile maintainer to figure out
|
||||||
# what system we are compiling for in order to pass an extra
|
# what system we are compiling for in order to pass an extra
|
||||||
# flag for every libtool invocation.
|
# 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
|
allow_undefined=no
|
||||||
|
|
||||||
# FIXME: Unfortunately, there are problems with the above when trying
|
# 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
|
# even a static library is built. For now, we need to specify
|
||||||
# -no-undefined on the libtool link line when we can be certain
|
# -no-undefined on the libtool link line when we can be certain
|
||||||
# that all symbols are satisfied, otherwise we get a static library.
|
# 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
|
# allow_undefined=yes
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -7096,7 +7096,7 @@ func_mode_link ()
|
|||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|
-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 compiler_flags " $arg"
|
||||||
func_append compile_command " $arg"
|
func_append compile_command " $arg"
|
||||||
func_append finalize_command " $arg"
|
func_append finalize_command " $arg"
|
||||||
@@ -7310,10 +7310,7 @@ func_mode_link ()
|
|||||||
# -fno-sanitize* Clang/GCC memory and address sanitizer
|
# -fno-sanitize* Clang/GCC memory and address sanitizer
|
||||||
# -shared-libsan Link with shared sanitizer runtimes (Clang)
|
# -shared-libsan Link with shared sanitizer runtimes (Clang)
|
||||||
# -static-libsan Link with static 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
|
# -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
|
# -rtlib=* select c runtime lib with clang
|
||||||
# --unwindlib=* select unwinder library with clang
|
# --unwindlib=* select unwinder library with clang
|
||||||
# -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
|
# -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
|
# -Werror, -Werror=* Report (specified) warnings as errors
|
||||||
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
|
-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=*| \
|
-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=*| \
|
-stdlib=*|-rtlib=*|--unwindlib=*| \
|
||||||
-specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
|
-specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
|
||||||
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
|
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
|
||||||
-fdiagnostics-color*|-frecord-gcc-switches| \
|
-fdiagnostics-color*|-frecord-gcc-switches| \
|
||||||
-fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
|
-fuse-ld=*|-Wa,*|-Werror|-Werror=*)
|
||||||
func_quote_for_eval "$arg"
|
func_quote_for_eval "$arg"
|
||||||
arg=$func_quote_for_eval_result
|
arg=$func_quote_for_eval_result
|
||||||
func_append compile_command " $arg"
|
func_append compile_command " $arg"
|
||||||
@@ -7656,7 +7653,7 @@ func_mode_link ()
|
|||||||
found=false
|
found=false
|
||||||
case $deplib in
|
case $deplib in
|
||||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
-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
|
if test prog,link = "$linkmode,$pass"; then
|
||||||
compile_deplibs="$deplib $compile_deplibs"
|
compile_deplibs="$deplib $compile_deplibs"
|
||||||
finalize_deplibs="$deplib $finalize_deplibs"
|
finalize_deplibs="$deplib $finalize_deplibs"
|
||||||
@@ -8182,8 +8179,8 @@ func_mode_link ()
|
|||||||
fi
|
fi
|
||||||
if test -n "$library_names" &&
|
if test -n "$library_names" &&
|
||||||
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
|
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
|
||||||
case $host_os in
|
case $host in
|
||||||
cygwin* | mingw* | windows* | cegcc* | os2*)
|
*cygwin* | *mingw* | *windows* | *cegcc* | *os2*)
|
||||||
# No point in relinking DLLs because paths are not encoded
|
# No point in relinking DLLs because paths are not encoded
|
||||||
func_append notinst_deplibs " $lib"
|
func_append notinst_deplibs " $lib"
|
||||||
need_relink=no
|
need_relink=no
|
||||||
@@ -8252,8 +8249,8 @@ func_mode_link ()
|
|||||||
soname=$dlname
|
soname=$dlname
|
||||||
elif test -n "$soname_spec"; then
|
elif test -n "$soname_spec"; then
|
||||||
# bleh windows
|
# bleh windows
|
||||||
case $host_os in
|
case $host in
|
||||||
cygwin* | mingw* | windows* | cegcc*) # | os2* # SDL customization: removed OS/2 versioning support.
|
*cygwin* | mingw* | *windows* | *cegcc*) # | *os2* # SDL customization: removed OS/2 versioning support.
|
||||||
func_arith $current - $age
|
func_arith $current - $age
|
||||||
major=$func_arith_result
|
major=$func_arith_result
|
||||||
versuffix=-$major
|
versuffix=-$major
|
||||||
@@ -8395,7 +8392,7 @@ func_mode_link ()
|
|||||||
test no = "$hardcode_direct_absolute"; then
|
test no = "$hardcode_direct_absolute"; then
|
||||||
add=$libdir/$linklib
|
add=$libdir/$linklib
|
||||||
elif test yes = "$hardcode_minus_L"; then
|
elif test yes = "$hardcode_minus_L"; then
|
||||||
add_dir=-L$lt_sysroot$libdir
|
add_dir=-L$libdir
|
||||||
add=-l$name
|
add=-l$name
|
||||||
elif test yes = "$hardcode_shlibpath_var"; then
|
elif test yes = "$hardcode_shlibpath_var"; then
|
||||||
case :$finalize_shlibpath: in
|
case :$finalize_shlibpath: in
|
||||||
@@ -8412,7 +8409,7 @@ func_mode_link ()
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# We cannot seem to hardcode it, guess we'll fake it.
|
# 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.
|
# Try looking first in the location we're being installed to.
|
||||||
if test -n "$inst_prefix_dir"; then
|
if test -n "$inst_prefix_dir"; then
|
||||||
case $libdir in
|
case $libdir in
|
||||||
@@ -8683,7 +8680,7 @@ func_mode_link ()
|
|||||||
test CXX = "$tagname" && {
|
test CXX = "$tagname" && {
|
||||||
case $host_os in
|
case $host_os in
|
||||||
linux*)
|
linux*)
|
||||||
case `$CC -V 2>&1 | $SED 5q` in
|
case `$CC -V 2>&1 | sed 5q` in
|
||||||
*Sun\ C*) # Sun C++ 5.9
|
*Sun\ C*) # Sun C++ 5.9
|
||||||
func_suncc_cstd_abi
|
func_suncc_cstd_abi
|
||||||
|
|
||||||
@@ -8856,13 +8853,13 @@ func_mode_link ()
|
|||||||
#
|
#
|
||||||
case $version_type in
|
case $version_type in
|
||||||
# correct linux to gnu/linux during the next big refactor
|
# 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
|
func_arith $number_major + $number_minor
|
||||||
current=$func_arith_result
|
current=$func_arith_result
|
||||||
age=$number_minor
|
age=$number_minor
|
||||||
revision=$number_revision
|
revision=$number_revision
|
||||||
;;
|
;;
|
||||||
freebsd-aout|sco|sunos)
|
freebsd-aout|qnx|sco|sunos)
|
||||||
current=$number_major
|
current=$number_major
|
||||||
revision=$number_minor
|
revision=$number_minor
|
||||||
age=0
|
age=0
|
||||||
@@ -9009,9 +9006,8 @@ func_mode_link ()
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
qnx)
|
qnx)
|
||||||
func_arith $current - $age
|
major=.$current
|
||||||
major=.$func_arith_result
|
versuffix=.$current
|
||||||
versuffix=$major.$age.$revision
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
sco)
|
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)/..
|
SDL_ROOT=$(dirname $0)/..
|
||||||
cd $SDL_ROOT
|
cd $SDL_ROOT
|
||||||
|
|
||||||
if [ -e ./REVISION.txt ]; then
|
if [ -e ./VERSION.txt ]; then
|
||||||
cat ./REVISION.txt
|
cat ./VERSION.txt
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ done
|
|||||||
rev=`sh showrev.sh 2>/dev/null`
|
rev=`sh showrev.sh 2>/dev/null`
|
||||||
if [ "$rev" != "" ]; then
|
if [ "$rev" != "" ]; then
|
||||||
if [ -n "$dist" ]; then
|
if [ -n "$dist" ]; then
|
||||||
echo "$rev" > "$outdir/REVISION.txt"
|
echo "$rev" > "$outdir/VERSION.txt"
|
||||||
fi
|
fi
|
||||||
echo "/* Generated by updaterev.sh, do not edit */" >"$header.new"
|
echo "/* Generated by updaterev.sh, do not edit */" >"$header.new"
|
||||||
if [ -n "$vendor" ]; then
|
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")
|
if(ARCH STREQUAL "x86")
|
||||||
_internal_check_cpu_architecture("defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)" x86 ${VARIABLE})
|
_internal_check_cpu_architecture("defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)" x86 ${VARIABLE})
|
||||||
elseif(ARCH STREQUAL "x64")
|
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")
|
elseif(ARCH STREQUAL "arm32")
|
||||||
_internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE})
|
_internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE})
|
||||||
elseif(ARCH STREQUAL "arm64")
|
elseif(ARCH STREQUAL "arm64")
|
||||||
_internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
|
_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")
|
elseif(ARCH STREQUAL "loongarch64")
|
||||||
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
|
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
|
||||||
else()
|
else()
|
||||||
|
@@ -119,7 +119,7 @@ macro(CheckALSA)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(NOT HAVE_ALSA_SHARED)
|
if(NOT HAVE_ALSA_SHARED)
|
||||||
list(APPEND CMAKE_LIBS ALSA::ALSA)
|
list(APPEND CMAKE_DEPENDS ALSA::ALSA)
|
||||||
list(APPEND PKGCONFIG_DEPENDS alsa)
|
list(APPEND PKGCONFIG_DEPENDS alsa)
|
||||||
endif()
|
endif()
|
||||||
set(HAVE_SDL_AUDIO TRUE)
|
set(HAVE_SDL_AUDIO TRUE)
|
||||||
@@ -947,7 +947,7 @@ macro(CheckPTHREAD)
|
|||||||
elseif(BSDI)
|
elseif(BSDI)
|
||||||
set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
||||||
set(PTHREAD_LDFLAGS "")
|
set(PTHREAD_LDFLAGS "")
|
||||||
elseif(MACOS)
|
elseif(DARWIN)
|
||||||
set(PTHREAD_CFLAGS "-D_THREAD_SAFE")
|
set(PTHREAD_CFLAGS "-D_THREAD_SAFE")
|
||||||
# causes Carbon.p complaints?
|
# causes Carbon.p complaints?
|
||||||
# set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
# set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
||||||
@@ -963,11 +963,7 @@ macro(CheckPTHREAD)
|
|||||||
set(PTHREAD_LDFLAGS "-lpthread")
|
set(PTHREAD_LDFLAGS "-lpthread")
|
||||||
elseif(SOLARIS)
|
elseif(SOLARIS)
|
||||||
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
||||||
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
|
||||||
else()
|
|
||||||
set(PTHREAD_LDFLAGS "-pthread")
|
|
||||||
endif()
|
|
||||||
elseif(SYSV5)
|
elseif(SYSV5)
|
||||||
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
||||||
set(PTHREAD_LDFLAGS "")
|
set(PTHREAD_LDFLAGS "")
|
||||||
@@ -1253,7 +1249,6 @@ macro(CheckHIDAPI)
|
|||||||
|
|
||||||
if(HAVE_HIDAPI)
|
if(HAVE_HIDAPI)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
enable_language(CXX)
|
|
||||||
list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp)
|
list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp)
|
||||||
endif()
|
endif()
|
||||||
if(IOS OR TVOS)
|
if(IOS OR TVOS)
|
||||||
@@ -1281,18 +1276,13 @@ endmacro()
|
|||||||
# - n/a
|
# - n/a
|
||||||
macro(CheckRPI)
|
macro(CheckRPI)
|
||||||
if(SDL_RPI)
|
if(SDL_RPI)
|
||||||
pkg_check_modules(VIDEO_RPI bcm_host)
|
pkg_check_modules(VIDEO_RPI bcm_host brcmegl)
|
||||||
if (NOT VIDEO_RPI_FOUND)
|
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_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_LIBRARY_DIRS "/opt/vc/lib" )
|
||||||
set(VIDEO_RPI_LIBRARIES bcm_host )
|
set(VIDEO_RPI_LIBRARIES bcm_host )
|
||||||
|
set(VIDEO_RPI_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
|
||||||
endif()
|
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_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I")
|
||||||
listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
|
listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
|
||||||
|
|
||||||
@@ -1301,7 +1291,9 @@ macro(CheckRPI)
|
|||||||
set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBRARIES}")
|
set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBRARIES}")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <bcm_host.h>
|
#include <bcm_host.h>
|
||||||
|
#include <EGL/eglplatform.h>
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
EGL_DISPMANX_WINDOW_T window;
|
||||||
bcm_host_init();
|
bcm_host_init();
|
||||||
}" HAVE_RPI)
|
}" HAVE_RPI)
|
||||||
set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
|
set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
|
||||||
@@ -1315,7 +1307,7 @@ macro(CheckRPI)
|
|||||||
list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
|
list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
|
||||||
# !!! FIXME: shouldn't be using CMAKE_C_FLAGS, right?
|
# !!! FIXME: shouldn't be using CMAKE_C_FLAGS, right?
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
|
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()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@@ -32,8 +32,10 @@ macro(SDL_DetectCMakePlatform)
|
|||||||
set(SDL_CMAKE_PLATFORM QNX)
|
set(SDL_CMAKE_PLATFORM QNX)
|
||||||
endif()
|
endif()
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
|
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
||||||
set(SDL_CMAKE_PLATFORM MACOS)
|
set(SDL_CMAKE_PLATFORM DARWIN)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM MACOSX)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
|
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
|
||||||
set(SDL_CMAKE_PLATFORM TVOS)
|
set(SDL_CMAKE_PLATFORM TVOS)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
|
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
|
||||||
@@ -41,10 +43,6 @@ macro(SDL_DetectCMakePlatform)
|
|||||||
if(CMAKE_VERSION VERSION_LESS 3.14)
|
if(CMAKE_VERSION VERSION_LESS 3.14)
|
||||||
set(SDL_CMAKE_PLATFORM IOS)
|
set(SDL_CMAKE_PLATFORM IOS)
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*watchOS.*")
|
|
||||||
set(SDL_CMAKE_PLATFORM WATCHOS)
|
|
||||||
elseif (CMAKE_SYSTEM_NAME MATCHES "visionOS")
|
|
||||||
set(SDL_CMAKE_PLATFORM VISIONOS)
|
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
||||||
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12)
|
||||||
project(sdl_test LANGUAGES C)
|
project(sdl_test LANGUAGES C)
|
||||||
|
|
||||||
include(CheckLanguage)
|
|
||||||
include(FeatureSummary)
|
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
@@ -21,31 +19,14 @@ cmake_policy(SET CMP0074 NEW)
|
|||||||
# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL2 outside of sysroot
|
# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL2 outside of sysroot
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
|
||||||
|
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
option(TEST_SHARED "Test linking to shared SDL2 library" ON)
|
option(TEST_SHARED "Test linking to shared SDL2 library" ON)
|
||||||
add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library")
|
add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library")
|
||||||
|
|
||||||
option(TEST_STATIC "Test linking to static SDL2 library" ON)
|
option(TEST_STATIC "Test linking to static SDL2 library" ON)
|
||||||
add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library")
|
add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library")
|
||||||
|
|
||||||
option(TEST_TEST "Test linking to SDL3_test library" ON)
|
|
||||||
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)
|
if(TEST_SHARED)
|
||||||
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2)
|
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2)
|
||||||
if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE))
|
if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE))
|
||||||
@@ -94,17 +75,6 @@ if(TEST_SHARED)
|
|||||||
generate_export_header(sharedlib-shared-vars EXPORT_MACRO_NAME MYLIBRARY_EXPORT)
|
generate_export_header(sharedlib-shared-vars EXPORT_MACRO_NAME MYLIBRARY_EXPORT)
|
||||||
target_compile_definitions(sharedlib-shared-vars PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-shared-vars_export.h\"")
|
target_compile_definitions(sharedlib-shared-vars PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-shared-vars_export.h\"")
|
||||||
set_target_properties(sharedlib-shared-vars PROPERTIES C_VISIBILITY_PRESET "hidden")
|
set_target_properties(sharedlib-shared-vars PROPERTIES C_VISIBILITY_PRESET "hidden")
|
||||||
|
|
||||||
if(TEST_TEST)
|
|
||||||
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()
|
endif()
|
||||||
|
|
||||||
if(TEST_STATIC)
|
if(TEST_STATIC)
|
||||||
@@ -141,26 +111,6 @@ if(TEST_STATIC)
|
|||||||
target_link_libraries(cli-static-vars PRIVATE ${SDL2_STATIC_LIBRARIES})
|
target_link_libraries(cli-static-vars PRIVATE ${SDL2_STATIC_LIBRARIES})
|
||||||
target_include_directories(cli-static-vars PRIVATE ${SDL2_INCLUDE_DIRS})
|
target_include_directories(cli-static-vars PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
endif()
|
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")
|
|
||||||
target_link_libraries(swift-static PRIVATE SDL2::SDL2-static)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(TEST_FULL)
|
|
||||||
enable_testing()
|
|
||||||
set(SDL_TESTS_TIMEOUT_MULTIPLIER "1" CACHE STRING "Test timeout multiplier")
|
|
||||||
set(SDL_TESTS_LINK_SHARED ${TEST_SHARED})
|
|
||||||
|
|
||||||
add_definitions(-DNO_BUILD_CONFIG)
|
|
||||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../../test" SDL_test)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "SDL2_PREFIX: ${SDL2_PREFIX}")
|
message(STATUS "SDL2_PREFIX: ${SDL2_PREFIX}")
|
||||||
|
@@ -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,9 +0,0 @@
|
|||||||
#include "SDL.h"
|
|
||||||
#include "SDL_test.h"
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
SDLTest_CommonState state;
|
|
||||||
SDLTest_CommonDefaultArgs(&state, argc, argv);
|
|
||||||
return 0;
|
|
||||||
}
|
|
@@ -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"
|
|
281
configure
vendored
281
configure
vendored
@@ -703,8 +703,6 @@ X_LIBS
|
|||||||
X_PRE_LIBS
|
X_PRE_LIBS
|
||||||
X_CFLAGS
|
X_CFLAGS
|
||||||
XMKMF
|
XMKMF
|
||||||
RPI_EGL_LIBS
|
|
||||||
RPI_EGL_CFLAGS
|
|
||||||
RPI_LIBS
|
RPI_LIBS
|
||||||
RPI_CFLAGS
|
RPI_CFLAGS
|
||||||
DECOR_LIBS
|
DECOR_LIBS
|
||||||
@@ -993,8 +991,6 @@ DECOR_CFLAGS
|
|||||||
DECOR_LIBS
|
DECOR_LIBS
|
||||||
RPI_CFLAGS
|
RPI_CFLAGS
|
||||||
RPI_LIBS
|
RPI_LIBS
|
||||||
RPI_EGL_CFLAGS
|
|
||||||
RPI_EGL_LIBS
|
|
||||||
XMKMF
|
XMKMF
|
||||||
DIRECTFB_CFLAGS
|
DIRECTFB_CFLAGS
|
||||||
DIRECTFB_LIBS
|
DIRECTFB_LIBS
|
||||||
@@ -1672,7 +1668,7 @@ Optional Features:
|
|||||||
--enable-ssemath Allow GCC to use SSE floating point math
|
--enable-ssemath Allow GCC to use SSE floating point math
|
||||||
[default=maybe]
|
[default=maybe]
|
||||||
--enable-mmx use MMX assembly routines [default=yes]
|
--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-sse use SSE assembly routines [default=yes]
|
||||||
--enable-sse2 use SSE2 assembly routines [default=maybe]
|
--enable-sse2 use SSE2 assembly routines [default=maybe]
|
||||||
--enable-sse3 use SSE3 assembly routines [default=maybe]
|
--enable-sse3 use SSE3 assembly routines [default=maybe]
|
||||||
@@ -1722,7 +1718,7 @@ Optional Features:
|
|||||||
[default=yes]
|
[default=yes]
|
||||||
--enable-libdecor-shared
|
--enable-libdecor-shared
|
||||||
dynamically load libdecor [default=yes]
|
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-video-x11 use X11 video driver [default=maybe]
|
||||||
--enable-x11-shared dynamically load X11 support [default=maybe]
|
--enable-x11-shared dynamically load X11 support [default=maybe]
|
||||||
--enable-video-x11-xcursor
|
--enable-video-x11-xcursor
|
||||||
@@ -1852,10 +1848,6 @@ Some influential environment variables:
|
|||||||
DECOR_LIBS linker flags for DECOR, overriding pkg-config
|
DECOR_LIBS linker flags for DECOR, overriding pkg-config
|
||||||
RPI_CFLAGS C compiler flags for RPI, overriding pkg-config
|
RPI_CFLAGS C compiler flags for RPI, overriding pkg-config
|
||||||
RPI_LIBS linker 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
|
XMKMF Path to xmkmf, Makefile generator for X Window System
|
||||||
DIRECTFB_CFLAGS
|
DIRECTFB_CFLAGS
|
||||||
C compiler flags for DIRECTFB, overriding pkg-config
|
C compiler flags for DIRECTFB, overriding pkg-config
|
||||||
@@ -3515,8 +3507,8 @@ orig_CFLAGS="$CFLAGS"
|
|||||||
|
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=33
|
SDL_MINOR_VERSION=30
|
||||||
SDL_MICRO_VERSION=0
|
SDL_MICRO_VERSION=6
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $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
|
# 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_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
|
||||||
lt_cv_file_magic_cmd='func_win32_libid'
|
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*)
|
mingw* | windows* | pw32*)
|
||||||
@@ -5827,10 +5819,10 @@ mingw* | windows* | pw32*)
|
|||||||
lt_cv_file_magic_cmd='func_win32_libid'
|
lt_cv_file_magic_cmd='func_win32_libid'
|
||||||
else
|
else
|
||||||
# Keep this pattern in sync with the one in func_win32_libid.
|
# 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'
|
lt_cv_file_magic_cmd='$OBJDUMP -f'
|
||||||
fi
|
fi
|
||||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cegcc*)
|
cegcc*)
|
||||||
@@ -6836,7 +6828,7 @@ void nm_test_func(void){}
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
_LT_EOF
|
||||||
|
|
||||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
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" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
|
||||||
printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
|
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\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
|
||||||
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
|
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
|
||||||
if test ${lt_cv_ld_exported_symbols_list+y}
|
if test ${lt_cv_ld_exported_symbols_list+y}
|
||||||
@@ -8187,7 +8142,7 @@ _LT_EOF
|
|||||||
echo "$RANLIB libconftest.a" >&5
|
echo "$RANLIB libconftest.a" >&5
|
||||||
$RANLIB libconftest.a 2>&5
|
$RANLIB libconftest.a 2>&5
|
||||||
cat > conftest.c << _LT_EOF
|
cat > conftest.c << _LT_EOF
|
||||||
int main(void) { return 0;}
|
int main() { return 0;}
|
||||||
_LT_EOF
|
_LT_EOF
|
||||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
|
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
|
$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]*)
|
10.[012],*|,*powerpc*-darwin[5-8]*)
|
||||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
_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' ;;
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains'
|
|
||||||
else
|
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -9120,7 +9070,7 @@ objext=$objext
|
|||||||
lt_simple_compile_test_code="int some_variable = 0;"
|
lt_simple_compile_test_code="int some_variable = 0;"
|
||||||
|
|
||||||
# Code to be used in simple link tests
|
# 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*)
|
||||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
# 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/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"
|
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
|
||||||
;;
|
;;
|
||||||
mingw* | windows* | cegcc*)
|
mingw* | windows* | cegcc*)
|
||||||
# MinGW DLLs use traditional 'lib' prefix
|
# MinGW DLLs use traditional 'lib' prefix
|
||||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
#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*)
|
||||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||||
@@ -12671,11 +12621,11 @@ else
|
|||||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||||
correspondingly for the symbols needed. */
|
correspondingly for the symbols needed. */
|
||||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||||
int fnord (void) __attribute__((visibility("default")));
|
int fnord () __attribute__((visibility("default")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int fnord (void) { return 42; }
|
int fnord () { return 42; }
|
||||||
int main (void)
|
int main ()
|
||||||
{
|
{
|
||||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||||
int status = $lt_dlunknown;
|
int status = $lt_dlunknown;
|
||||||
@@ -12778,11 +12728,11 @@ else
|
|||||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||||
correspondingly for the symbols needed. */
|
correspondingly for the symbols needed. */
|
||||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||||
int fnord (void) __attribute__((visibility("default")));
|
int fnord () __attribute__((visibility("default")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int fnord (void) { return 42; }
|
int fnord () { return 42; }
|
||||||
int main (void)
|
int main ()
|
||||||
{
|
{
|
||||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||||
int status = $lt_dlunknown;
|
int status = $lt_dlunknown;
|
||||||
@@ -16984,13 +16934,13 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
|||||||
cygwin*)
|
cygwin*)
|
||||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
# 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/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* | windows* | cegcc*)
|
||||||
# MinGW DLLs use traditional 'lib' prefix
|
# MinGW DLLs use traditional 'lib' prefix
|
||||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
#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*)
|
||||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||||
@@ -19755,12 +19705,6 @@ if test "x$ac_cv_func_sigaction" = xyes
|
|||||||
then :
|
then :
|
||||||
printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h
|
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
|
fi
|
||||||
ac_fn_c_check_func "$LINENO" "setjmp" "ac_cv_func_setjmp"
|
ac_fn_c_check_func "$LINENO" "setjmp" "ac_cv_func_setjmp"
|
||||||
if test "x$ac_cv_func_setjmp" = xyes
|
if test "x$ac_cv_func_setjmp" = xyes
|
||||||
@@ -20703,7 +20647,7 @@ if test ${enable_3dnow+y}
|
|||||||
then :
|
then :
|
||||||
enableval=$enable_3dnow;
|
enableval=$enable_3dnow;
|
||||||
else $as_nop
|
else $as_nop
|
||||||
enable_3dnow=no
|
enable_3dnow=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$enable_3dnow = xyes; then
|
if test x$enable_3dnow = xyes; then
|
||||||
@@ -21092,7 +21036,7 @@ printf "%s\n" "#define HAVE_ALTIVEC_H 1" >>confdefs.h
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check whether --enable-lsx was given.
|
# Check whether --enable-lsx was given.
|
||||||
if test ${enable_lsx+y}
|
if test ${enable_lsx+y}
|
||||||
then :
|
then :
|
||||||
enableval=$enable_lsx;
|
enableval=$enable_lsx;
|
||||||
@@ -21100,20 +21044,20 @@ else $as_nop
|
|||||||
enable_lsx=yes
|
enable_lsx=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$enable_lsx = xyes; then
|
if test x$enable_lsx = xyes; then
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
have_gcc_lsx=no
|
have_gcc_lsx=no
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mlsx option" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mlsx option" >&5
|
||||||
printf %s "checking for GCC -mlsx option... " >&6; }
|
printf %s "checking for GCC -mlsx option... " >&6; }
|
||||||
lsx_CFLAGS="-mlsx"
|
lsx_CFLAGS="-mlsx"
|
||||||
CFLAGS="$save_CFLAGS $lsx_CFLAGS"
|
CFLAGS="$save_CFLAGS $lsx_CFLAGS"
|
||||||
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
#ifndef __loongarch_sx
|
#ifndef __loongarch_sx
|
||||||
#error Assembler CPP flag not enabled
|
#error Assembler CPP flag not enabled
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
@@ -21128,19 +21072,19 @@ then :
|
|||||||
have_gcc_lsx=yes
|
have_gcc_lsx=yes
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lsx" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lsx" >&5
|
||||||
printf "%s\n" "$have_gcc_lsx" >&6; }
|
printf "%s\n" "$have_gcc_lsx" >&6; }
|
||||||
CFLAGS="$save_CFLAGS"
|
CFLAGS="$save_CFLAGS"
|
||||||
|
|
||||||
if test x$have_gcc_lsx = xyes; then
|
if test x$have_gcc_lsx = xyes; then
|
||||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
||||||
SUMMARY_math="${SUMMARY_math} lsx"
|
SUMMARY_math="${SUMMARY_math} lsx"
|
||||||
|
fi
|
||||||
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; }
|
printf %s "checking for lsxintrin.h... " >&6; }
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
#include <lsxintrin.h>
|
#include <lsxintrin.h>
|
||||||
int
|
int
|
||||||
@@ -21158,13 +21102,13 @@ else $as_nop
|
|||||||
have_lsxintrin_h_hdr=no
|
have_lsxintrin_h_hdr=no
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
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; }
|
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
|
printf "%s\n" "#define HAVE_LSXINTRIN_H 1" >>confdefs.h
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CheckOSS()
|
CheckOSS()
|
||||||
{
|
{
|
||||||
@@ -22428,6 +22372,7 @@ printf %s "checking for NAS audio support... " >&6; }
|
|||||||
have_nas=yes
|
have_nas=yes
|
||||||
NAS_CFLAGS="-I/usr/X11R6/include/"
|
NAS_CFLAGS="-I/usr/X11R6/include/"
|
||||||
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5
|
{ 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
|
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
|
||||||
|
|
||||||
pkg_failed=no
|
pkg_failed=no
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host brcmegl" >&5
|
||||||
printf %s "checking for bcm_host... " >&6; }
|
printf %s "checking for bcm_host brcmegl... " >&6; }
|
||||||
|
|
||||||
if test -n "$RPI_CFLAGS"; then
|
if test -n "$RPI_CFLAGS"; then
|
||||||
pkg_cv_RPI_CFLAGS="$RPI_CFLAGS"
|
pkg_cv_RPI_CFLAGS="$RPI_CFLAGS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&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") 2>&5
|
($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
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
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -23699,12 +23644,12 @@ if test -n "$RPI_LIBS"; then
|
|||||||
pkg_cv_RPI_LIBS="$RPI_LIBS"
|
pkg_cv_RPI_LIBS="$RPI_LIBS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&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") 2>&5
|
($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
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
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -23725,9 +23670,9 @@ else
|
|||||||
_pkg_short_errors_supported=no
|
_pkg_short_errors_supported=no
|
||||||
fi
|
fi
|
||||||
if test $_pkg_short_errors_supported = yes; then
|
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
|
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
|
fi
|
||||||
# Put the nasty error message in config.log where it belongs
|
# Put the nasty error message in config.log where it belongs
|
||||||
echo "$RPI_PKG_ERRORS" >&5
|
echo "$RPI_PKG_ERRORS" >&5
|
||||||
@@ -23745,92 +23690,13 @@ printf "%s\n" "yes" >&6; }
|
|||||||
video_rpi=yes
|
video_rpi=yes
|
||||||
fi
|
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$video_rpi = xno; then
|
||||||
if test x$ARCH = xnetbsd; 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_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
|
else
|
||||||
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
|
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"
|
RPI_LIBS="-Wl,-rpath,/opt/vc/lib -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"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -23838,20 +23704,22 @@ fi
|
|||||||
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
||||||
|
|
||||||
# Add the Raspberry Pi compiler flags and libraries
|
# 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\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 2/3" >&5
|
||||||
printf %s "checking for Raspberry Pi 0-3... " >&6; }
|
printf %s "checking for Raspberry Pi 2/3... " >&6; }
|
||||||
have_video_rpi=no
|
have_video_rpi=no
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
#include <bcm_host.h>
|
#include <bcm_host.h>
|
||||||
|
#include <EGL/eglplatform.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
EGL_DISPMANX_WINDOW_T window;
|
||||||
bcm_host_init();
|
bcm_host_init();
|
||||||
|
|
||||||
;
|
;
|
||||||
@@ -23874,7 +23742,7 @@ printf "%s\n" "$have_video_rpi" >&6; }
|
|||||||
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
||||||
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
||||||
EXTRA_CFLAGS="$EXTRA_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"
|
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
|
||||||
|
|
||||||
printf "%s\n" "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
|
printf "%s\n" "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
|
||||||
@@ -26458,9 +26326,6 @@ else $as_nop
|
|||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
;;
|
;;
|
||||||
*-*-solaris*)
|
|
||||||
enable_video_vulkan=no
|
|
||||||
;;
|
|
||||||
*-*-darwin*)
|
*-*-darwin*)
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -x objective-c"
|
CFLAGS="$CFLAGS -x objective-c"
|
||||||
@@ -28399,8 +28264,7 @@ fi
|
|||||||
|
|
||||||
if test x$hidapi_support = xyes; then
|
if test x$hidapi_support = xyes; then
|
||||||
if test x$have_libusb_h = 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"
|
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
|
||||||
if test x$require_hidapi_libusb = xyes; then
|
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
|
if test x$enable_audio = xyes; then
|
||||||
case $ARCH in
|
case $ARCH in
|
||||||
sysv5|solaris|hpux)
|
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
|
printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h
|
||||||
|
|
||||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||||
have_audio=yes
|
have_audio=yes
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
netbsd) # Don't use this on OpenBSD, it's busted.
|
netbsd) # Don't use this on OpenBSD, it's busted.
|
||||||
|
|
||||||
|
104
configure.ac
104
configure.ac
@@ -12,8 +12,8 @@ orig_CFLAGS="$CFLAGS"
|
|||||||
dnl Set various version strings - taken gratefully from the GTk sources
|
dnl Set various version strings - taken gratefully from the GTk sources
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=33
|
SDL_MINOR_VERSION=30
|
||||||
SDL_MICRO_VERSION=0
|
SDL_MICRO_VERSION=6
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $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_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_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)
|
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
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(3dnow,
|
AC_ARG_ENABLE(3dnow,
|
||||||
[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=no]])],
|
[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=yes]])],
|
||||||
, enable_3dnow=no)
|
, enable_3dnow=yes)
|
||||||
if test x$enable_3dnow = xyes; then
|
if test x$enable_3dnow = xyes; then
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
have_gcc_3dnow=no
|
have_gcc_3dnow=no
|
||||||
@@ -906,37 +906,37 @@ dnl Check for various instruction support
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(lsx,
|
AC_ARG_ENABLE(lsx,
|
||||||
[AS_HELP_STRING([--enable-lsx], [use LSX assembly routines [default=yes]])],
|
[AS_HELP_STRING([--enable-lsx], [use LSX assembly routines [default=yes]])],
|
||||||
, enable_lsx=yes)
|
, enable_lsx=yes)
|
||||||
if test x$enable_lsx = xyes; then
|
if test x$enable_lsx = xyes; then
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
have_gcc_lsx=no
|
have_gcc_lsx=no
|
||||||
AC_MSG_CHECKING(for GCC -mlsx option)
|
AC_MSG_CHECKING(for GCC -mlsx option)
|
||||||
lsx_CFLAGS="-mlsx"
|
lsx_CFLAGS="-mlsx"
|
||||||
CFLAGS="$save_CFLAGS $lsx_CFLAGS"
|
CFLAGS="$save_CFLAGS $lsx_CFLAGS"
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
#ifndef __loongarch_sx
|
#ifndef __loongarch_sx
|
||||||
#error Assembler CPP flag not enabled
|
#error Assembler CPP flag not enabled
|
||||||
#endif
|
#endif
|
||||||
]], [])], [have_gcc_lsx=yes], [])
|
]], [])], [have_gcc_lsx=yes], [])
|
||||||
AC_MSG_RESULT($have_gcc_lsx)
|
AC_MSG_RESULT($have_gcc_lsx)
|
||||||
CFLAGS="$save_CFLAGS"
|
CFLAGS="$save_CFLAGS"
|
||||||
|
|
||||||
if test x$have_gcc_lsx = xyes; then
|
if test x$have_gcc_lsx = xyes; then
|
||||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
||||||
SUMMARY_math="${SUMMARY_math} lsx"
|
SUMMARY_math="${SUMMARY_math} lsx"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING(for lsxintrin.h)
|
AC_MSG_CHECKING(for lsxintrin.h)
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lsxintrin.h>]])],
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lsxintrin.h>]])],
|
||||||
[have_lsxintrin_h_hdr=yes],[have_lsxintrin_h_hdr=no])
|
[have_lsxintrin_h_hdr=yes],[have_lsxintrin_h_hdr=no])
|
||||||
AC_MSG_RESULT($have_lsxintrin_h_hdr)
|
AC_MSG_RESULT($have_lsxintrin_h_hdr)
|
||||||
if test x$have_lsxintrin_h_hdr = xyes; then
|
if test x$have_lsxintrin_h_hdr = xyes; then
|
||||||
AC_DEFINE(HAVE_LSXINTRIN_H, 1, [ ])
|
AC_DEFINE(HAVE_LSXINTRIN_H, 1, [ ])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl See if the OSS audio interface is supported
|
dnl See if the OSS audio interface is supported
|
||||||
CheckOSS()
|
CheckOSS()
|
||||||
@@ -1247,6 +1247,7 @@ CheckNAS()
|
|||||||
have_nas=yes
|
have_nas=yes
|
||||||
NAS_CFLAGS="-I/usr/X11R6/include/"
|
NAS_CFLAGS="-I/usr/X11R6/include/"
|
||||||
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_RESULT($have_nas)
|
AC_MSG_RESULT($have_nas)
|
||||||
@@ -1847,27 +1848,18 @@ CheckNativeClient()
|
|||||||
CheckRPI()
|
CheckRPI()
|
||||||
{
|
{
|
||||||
AC_ARG_ENABLE(video-rpi,
|
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)
|
, enable_video_rpi=yes)
|
||||||
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
|
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], [bcm_host brcmegl], video_rpi=yes, video_rpi=no)
|
||||||
PKG_CHECK_MODULES([RPI_EGL], [brcmegl], video_rpi_egl=yes, video_rpi_egl=no)
|
|
||||||
|
|
||||||
if test x$video_rpi = xno; then
|
if test x$video_rpi = xno; then
|
||||||
if test x$ARCH = xnetbsd; 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_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
|
else
|
||||||
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
|
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"
|
RPI_LIBS="-Wl,-rpath,/opt/vc/lib -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"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1875,13 +1867,15 @@ CheckRPI()
|
|||||||
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
||||||
|
|
||||||
# Add the Raspberry Pi compiler flags and libraries
|
# 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
|
have_video_rpi=no
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
#include <bcm_host.h>
|
#include <bcm_host.h>
|
||||||
|
#include <EGL/eglplatform.h>
|
||||||
]], [[
|
]], [[
|
||||||
|
EGL_DISPMANX_WINDOW_T window;
|
||||||
bcm_host_init();
|
bcm_host_init();
|
||||||
]])], [have_video_rpi=yes],[])
|
]])], [have_video_rpi=yes],[])
|
||||||
AC_MSG_RESULT($have_video_rpi)
|
AC_MSG_RESULT($have_video_rpi)
|
||||||
@@ -1893,7 +1887,7 @@ CheckRPI()
|
|||||||
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
||||||
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
||||||
EXTRA_CFLAGS="$EXTRA_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"
|
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
|
||||||
AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
|
AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
|
||||||
SUMMARY_video="${SUMMARY_video} rpi"
|
SUMMARY_video="${SUMMARY_video} rpi"
|
||||||
@@ -2742,10 +2736,6 @@ CheckVulkan()
|
|||||||
#endif
|
#endif
|
||||||
]],[])], [],[enable_video_vulkan=no])
|
]],[])], [],[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*)
|
*-*-darwin*)
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
dnl Work around that we don't have Objective-C support in autoconf
|
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$hidapi_support = xyes; then
|
||||||
if test x$have_libusb_h = 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"
|
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
|
||||||
if test x$require_hidapi_libusb = xyes; then
|
if test x$require_hidapi_libusb = xyes; then
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
|
||||||
@@ -3868,14 +3858,10 @@ case "$host" in
|
|||||||
if test x$enable_audio = xyes; then
|
if test x$enable_audio = xyes; then
|
||||||
case $ARCH in
|
case $ARCH in
|
||||||
sysv5|solaris|hpux)
|
sysv5|solaris|hpux)
|
||||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
|
||||||
AC_CHECK_HEADER(sys/audioio.h, have_sys_audioio_h=yes, have_sys_audioio_h=no)
|
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||||
if test x$have_sys_audioio_h = xyes; then
|
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||||
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
|
have_audio=yes
|
||||||
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.
|
netbsd) # Don't use this on OpenBSD, it's busted.
|
||||||
AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
|
AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
|
||||||
|
@@ -1,483 +1,483 @@
|
|||||||
Android
|
Android
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Matt Styles wrote a tutorial on building SDL for Android with Visual Studio:
|
Matt Styles wrote a tutorial on building SDL for Android with Visual Studio:
|
||||||
http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html
|
http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html
|
||||||
|
|
||||||
The rest of this README covers the Android gradle style build process.
|
The rest of this README covers the Android gradle style build process.
|
||||||
|
|
||||||
If you are using the older ant build process, it is no longer officially
|
If you are using the older ant build process, it is no longer officially
|
||||||
supported, but you can use the "android-project-ant" directory as a template.
|
supported, but you can use the "android-project-ant" directory as a template.
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Android SDK (version 34 or later)
|
Android SDK (version 34 or later)
|
||||||
https://developer.android.com/sdk/index.html
|
https://developer.android.com/sdk/index.html
|
||||||
|
|
||||||
Android NDK r15c or later
|
Android NDK r15c or later
|
||||||
https://developer.android.com/tools/sdk/ndk/index.html
|
https://developer.android.com/tools/sdk/ndk/index.html
|
||||||
|
|
||||||
Minimum API level supported by SDL: 19 (Android 4.4)
|
Minimum API level supported by SDL: 19 (Android 4.4)
|
||||||
|
|
||||||
|
|
||||||
How the port works
|
How the port works
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
- Android applications are Java-based, optionally with parts written in C
|
- Android applications are Java-based, optionally with parts written in C
|
||||||
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to
|
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to
|
||||||
the SDL library
|
the SDL library
|
||||||
- This means that your application C code must be placed inside an Android
|
- This means that your application C code must be placed inside an Android
|
||||||
Java project, along with some C support code that communicates with Java
|
Java project, along with some C support code that communicates with Java
|
||||||
- This eventually produces a standard Android .apk package
|
- This eventually produces a standard Android .apk package
|
||||||
|
|
||||||
The Android Java code implements an "Activity" and can be found in:
|
The Android Java code implements an "Activity" and can be found in:
|
||||||
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
|
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
|
||||||
|
|
||||||
The Java code loads your game code, the SDL shared library, and
|
The Java code loads your game code, the SDL shared library, and
|
||||||
dispatches to native functions implemented in the SDL library:
|
dispatches to native functions implemented in the SDL library:
|
||||||
src/core/android/SDL_android.c
|
src/core/android/SDL_android.c
|
||||||
|
|
||||||
|
|
||||||
Building an app
|
Building an app
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
For simple projects you can use the script located at build-scripts/androidbuild.sh
|
For simple projects you can use the script located at build-scripts/androidbuild.sh
|
||||||
|
|
||||||
There's two ways of using it:
|
There's two ways of using it:
|
||||||
|
|
||||||
androidbuild.sh com.yourcompany.yourapp < sources.list
|
androidbuild.sh com.yourcompany.yourapp < sources.list
|
||||||
androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
|
androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
|
||||||
|
|
||||||
sources.list should be a text file with a source file name in each line
|
sources.list should be a text file with a source file name in each line
|
||||||
Filenames should be specified relative to the current directory, for example if
|
Filenames should be specified relative to the current directory, for example if
|
||||||
you are in the build-scripts directory and want to create the testgles.c test, you'll
|
you are in the build-scripts directory and want to create the testgles.c test, you'll
|
||||||
run:
|
run:
|
||||||
|
|
||||||
./androidbuild.sh org.libsdl.testgles ../test/testgles.c
|
./androidbuild.sh org.libsdl.testgles ../test/testgles.c
|
||||||
|
|
||||||
One limitation of this script is that all sources provided will be aggregated into
|
One limitation of this script is that all sources provided will be aggregated into
|
||||||
a single directory, thus all your source files should have a unique name.
|
a single directory, thus all your source files should have a unique name.
|
||||||
|
|
||||||
Once the project is complete the script will tell you where the debug APK is located.
|
Once the project is complete the script will tell you where the debug APK is located.
|
||||||
If you want to create a signed release APK, you can use the project created by this
|
If you want to create a signed release APK, you can use the project created by this
|
||||||
utility to generate it.
|
utility to generate it.
|
||||||
|
|
||||||
Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
|
Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
|
||||||
done in the build directory for the app!
|
done in the build directory for the app!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
For more complex projects, follow these instructions:
|
For more complex projects, follow these instructions:
|
||||||
|
|
||||||
1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT).
|
1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT).
|
||||||
|
|
||||||
(The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.)
|
(The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.)
|
||||||
|
|
||||||
2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory
|
2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory
|
||||||
|
|
||||||
(This is needed as the source of SDL has to be compiled by the Android compiler)
|
(This is needed as the source of SDL has to be compiled by the Android compiler)
|
||||||
|
|
||||||
3. Edit "YOURPROJECT/app/jni/src/Android.mk" to include your source files.
|
3. Edit "YOURPROJECT/app/jni/src/Android.mk" to include your source files.
|
||||||
|
|
||||||
(They should be separated by spaces after the "LOCAL_SRC_FILES := " declaration)
|
(They should be separated by spaces after the "LOCAL_SRC_FILES := " declaration)
|
||||||
|
|
||||||
4a. If you want to use Android Studio, simply open your 'YOURPROJECT' directory and start building.
|
4a. If you want to use Android Studio, simply open your 'YOURPROJECT' directory and start building.
|
||||||
|
|
||||||
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
|
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
|
||||||
|
|
||||||
|
|
||||||
If you already have a project that uses CMake, the instructions change somewhat:
|
If you already have a project that uses CMake, the instructions change somewhat:
|
||||||
|
|
||||||
1. Do points 1 and 2 from the instruction above.
|
1. Do points 1 and 2 from the instruction above.
|
||||||
2. Edit "YOURPROJECT/app/build.gradle" to comment out or remove sections containing ndk-build
|
2. Edit "YOURPROJECT/app/build.gradle" to comment out or remove sections containing ndk-build
|
||||||
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
|
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
|
||||||
3. Edit "YOURPROJECT/app/jni/CMakeLists.txt" to include your project (it defaults to
|
3. Edit "YOURPROJECT/app/jni/CMakeLists.txt" to include your project (it defaults to
|
||||||
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
|
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
|
||||||
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
|
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
|
||||||
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
|
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
|
||||||
add_executable() for the target containing your "main" function.
|
add_executable() for the target containing your "main" function.
|
||||||
|
|
||||||
If you wish to use Android Studio, you can skip the last step.
|
If you wish to use Android Studio, you can skip the last step.
|
||||||
|
|
||||||
4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any
|
4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any
|
||||||
connected Android device
|
connected Android device
|
||||||
|
|
||||||
Here's an explanation of the files in the Android project, so you can customize them:
|
Here's an explanation of the files in the Android project, so you can customize them:
|
||||||
|
|
||||||
android-project/app
|
android-project/app
|
||||||
build.gradle - build info including the application version and SDK
|
build.gradle - build info including the application version and SDK
|
||||||
src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application.
|
src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application.
|
||||||
jni/ - directory holding native code
|
jni/ - directory holding native code
|
||||||
jni/Application.mk - Application JNI settings, including target platform and STL library
|
jni/Application.mk - Application JNI settings, including target platform and STL library
|
||||||
jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories
|
jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories
|
||||||
jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject
|
jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject
|
||||||
jni/SDL/ - (symlink to) directory holding the SDL library files
|
jni/SDL/ - (symlink to) directory holding the SDL library files
|
||||||
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
|
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
|
||||||
jni/src/ - directory holding your C/C++ source
|
jni/src/ - directory holding your C/C++ source
|
||||||
jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references
|
jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references
|
||||||
jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references
|
jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references
|
||||||
src/main/assets/ - directory holding asset files for your application
|
src/main/assets/ - directory holding asset files for your application
|
||||||
src/main/res/ - directory holding resources for your application
|
src/main/res/ - directory holding resources for your application
|
||||||
src/main/res/mipmap-* - directories holding icons for different phone hardware
|
src/main/res/mipmap-* - directories holding icons for different phone hardware
|
||||||
src/main/res/values/strings.xml - strings used in your application, including the application name
|
src/main/res/values/strings.xml - strings used in your application, including the application name
|
||||||
src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application.
|
src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application.
|
||||||
|
|
||||||
|
|
||||||
Customizing your application name
|
Customizing your application name
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
To customize your application name, edit AndroidManifest.xml and replace
|
To customize your application name, edit AndroidManifest.xml and replace
|
||||||
"org.libsdl.app" with an identifier for your product package.
|
"org.libsdl.app" with an identifier for your product package.
|
||||||
|
|
||||||
Then create a Java class extending SDLActivity and place it in a directory
|
Then create a Java class extending SDLActivity and place it in a directory
|
||||||
under src matching your package, e.g.
|
under src matching your package, e.g.
|
||||||
|
|
||||||
src/com/gamemaker/game/MyGame.java
|
src/com/gamemaker/game/MyGame.java
|
||||||
|
|
||||||
Here's an example of a minimal class file:
|
Here's an example of a minimal class file:
|
||||||
|
|
||||||
--- MyGame.java --------------------------
|
--- MyGame.java --------------------------
|
||||||
package com.gamemaker.game;
|
package com.gamemaker.game;
|
||||||
|
|
||||||
import org.libsdl.app.SDLActivity;
|
import org.libsdl.app.SDLActivity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sample wrapper class that just calls SDLActivity
|
* A sample wrapper class that just calls SDLActivity
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MyGame extends SDLActivity { }
|
public class MyGame extends SDLActivity { }
|
||||||
|
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
|
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
|
||||||
class, .e.g. "MyGame"
|
class, .e.g. "MyGame"
|
||||||
|
|
||||||
|
|
||||||
Customizing your application icon
|
Customizing your application icon
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
|
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
|
||||||
the drawable directories under the res directory. There are several directories
|
the drawable directories under the res directory. There are several directories
|
||||||
for different screen sizes.
|
for different screen sizes.
|
||||||
|
|
||||||
|
|
||||||
Loading assets
|
Loading assets
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Any files you put in the "app/src/main/assets" directory of your project
|
Any files you put in the "app/src/main/assets" directory of your project
|
||||||
directory will get bundled into the application package and you can load
|
directory will get bundled into the application package and you can load
|
||||||
them using the standard functions in SDL_rwops.h.
|
them using the standard functions in SDL_rwops.h.
|
||||||
|
|
||||||
There are also a few Android specific functions that allow you to get other
|
There are also a few Android specific functions that allow you to get other
|
||||||
useful paths for saving and loading data:
|
useful paths for saving and loading data:
|
||||||
* SDL_AndroidGetInternalStoragePath()
|
* SDL_AndroidGetInternalStoragePath()
|
||||||
* SDL_AndroidGetExternalStorageState()
|
* SDL_AndroidGetExternalStorageState()
|
||||||
* SDL_AndroidGetExternalStoragePath()
|
* SDL_AndroidGetExternalStoragePath()
|
||||||
|
|
||||||
See SDL_system.h for more details on these functions.
|
See SDL_system.h for more details on these functions.
|
||||||
|
|
||||||
The asset packaging system will, by default, compress certain file extensions.
|
The asset packaging system will, by default, compress certain file extensions.
|
||||||
SDL includes two asset file access mechanisms, the preferred one is the so
|
SDL includes two asset file access mechanisms, the preferred one is the so
|
||||||
called "File Descriptor" method, which is faster and doesn't involve the Dalvik
|
called "File Descriptor" method, which is faster and doesn't involve the Dalvik
|
||||||
GC, but given this method does not work on compressed assets, there is also the
|
GC, but given this method does not work on compressed assets, there is also the
|
||||||
"Input Stream" method, which is automatically used as a fall back by SDL. You
|
"Input Stream" method, which is automatically used as a fall back by SDL. You
|
||||||
may want to keep this fact in mind when building your APK, specially when large
|
may want to keep this fact in mind when building your APK, specially when large
|
||||||
files are involved.
|
files are involved.
|
||||||
For more information on which extensions get compressed by default and how to
|
For more information on which extensions get compressed by default and how to
|
||||||
disable this behaviour, see for example:
|
disable this behaviour, see for example:
|
||||||
|
|
||||||
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
|
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
|
||||||
|
|
||||||
|
|
||||||
Pause / Resume behaviour
|
Pause / Resume behaviour
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default),
|
If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default),
|
||||||
the event loop will block itself when the app is paused (ie, when the user
|
the event loop will block itself when the app is paused (ie, when the user
|
||||||
returns to the main Android dashboard). Blocking is better in terms of battery
|
returns to the main Android dashboard). Blocking is better in terms of battery
|
||||||
use, and it allows your app to spring back to life instantaneously after resume
|
use, and it allows your app to spring back to life instantaneously after resume
|
||||||
(versus polling for a resume message).
|
(versus polling for a resume message).
|
||||||
|
|
||||||
Upon resume, SDL will attempt to restore the GL context automatically.
|
Upon resume, SDL will attempt to restore the GL context automatically.
|
||||||
In modern devices (Android 3.0 and up) this will most likely succeed and your
|
In modern devices (Android 3.0 and up) this will most likely succeed and your
|
||||||
app can continue to operate as it was.
|
app can continue to operate as it was.
|
||||||
|
|
||||||
However, there's a chance (on older hardware, or on systems under heavy load),
|
However, there's a chance (on older hardware, or on systems under heavy load),
|
||||||
where the GL context can not be restored. In that case you have to listen for
|
where the GL context can not be restored. In that case you have to listen for
|
||||||
a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures
|
a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures
|
||||||
manually or quit the app.
|
manually or quit the app.
|
||||||
|
|
||||||
You should not use the SDL renderer API while the app going in background:
|
You should not use the SDL renderer API while the app going in background:
|
||||||
- SDL_APP_WILLENTERBACKGROUND:
|
- SDL_APP_WILLENTERBACKGROUND:
|
||||||
after you read this message, GL context gets backed-up and you should not
|
after you read this message, GL context gets backed-up and you should not
|
||||||
use the SDL renderer API.
|
use the SDL renderer API.
|
||||||
|
|
||||||
When this event is received, you have to set the render target to NULL, if you're using it.
|
When this event is received, you have to set the render target to NULL, if you're using it.
|
||||||
(eg call SDL_SetRenderTarget(renderer, NULL))
|
(eg call SDL_SetRenderTarget(renderer, NULL))
|
||||||
|
|
||||||
- SDL_APP_DIDENTERFOREGROUND:
|
- SDL_APP_DIDENTERFOREGROUND:
|
||||||
GL context is restored, and the SDL renderer API is available (unless you
|
GL context is restored, and the SDL renderer API is available (unless you
|
||||||
receive SDL_RENDER_DEVICE_RESET).
|
receive SDL_RENDER_DEVICE_RESET).
|
||||||
|
|
||||||
Mouse / Touch events
|
Mouse / Touch events
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
In some case, SDL generates synthetic mouse (resp. touch) events for touch
|
In some case, SDL generates synthetic mouse (resp. touch) events for touch
|
||||||
(resp. mouse) devices.
|
(resp. mouse) devices.
|
||||||
To enable/disable this behavior, see SDL_hints.h:
|
To enable/disable this behavior, see SDL_hints.h:
|
||||||
- SDL_HINT_TOUCH_MOUSE_EVENTS
|
- SDL_HINT_TOUCH_MOUSE_EVENTS
|
||||||
- SDL_HINT_MOUSE_TOUCH_EVENTS
|
- SDL_HINT_MOUSE_TOUCH_EVENTS
|
||||||
|
|
||||||
Misc
|
Misc
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
For some device, it appears to works better setting explicitly GL attributes
|
For some device, it appears to works better setting explicitly GL attributes
|
||||||
before creating a window:
|
before creating a window:
|
||||||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
|
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
|
||||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
|
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
|
||||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
|
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
|
||||||
|
|
||||||
Threads and the Java VM
|
Threads and the Java VM
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
For a quick tour on how Linux native threads interoperate with the Java VM, take
|
For a quick tour on how Linux native threads interoperate with the Java VM, take
|
||||||
a look here: https://developer.android.com/guide/practices/jni.html
|
a look here: https://developer.android.com/guide/practices/jni.html
|
||||||
|
|
||||||
If you want to use threads in your SDL app, it's strongly recommended that you
|
If you want to use threads in your SDL app, it's strongly recommended that you
|
||||||
do so by creating them using SDL functions. This way, the required attach/detach
|
do so by creating them using SDL functions. This way, the required attach/detach
|
||||||
handling is managed by SDL automagically. If you have threads created by other
|
handling is managed by SDL automagically. If you have threads created by other
|
||||||
means and they make calls to SDL functions, make sure that you call
|
means and they make calls to SDL functions, make sure that you call
|
||||||
Android_JNI_SetupThread() before doing anything else otherwise SDL will attach
|
Android_JNI_SetupThread() before doing anything else otherwise SDL will attach
|
||||||
your thread automatically anyway (when you make an SDL call), but it'll never
|
your thread automatically anyway (when you make an SDL call), but it'll never
|
||||||
detach it.
|
detach it.
|
||||||
|
|
||||||
|
|
||||||
If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"),
|
If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"),
|
||||||
it won't be able to find your java class and method because of the java class loader
|
it won't be able to find your java class and method because of the java class loader
|
||||||
which is different for native threads, than for java threads (eg your "main()").
|
which is different for native threads, than for java threads (eg your "main()").
|
||||||
|
|
||||||
the work-around is to find class/method, in you "main()" thread, and to use them
|
the work-around is to find class/method, in you "main()" thread, and to use them
|
||||||
in your native thread.
|
in your native thread.
|
||||||
|
|
||||||
see:
|
see:
|
||||||
https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
|
https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
|
||||||
|
|
||||||
Using STL
|
Using STL
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
You can use STL in your project by creating an Application.mk file in the jni
|
You can use STL in your project by creating an Application.mk file in the jni
|
||||||
folder and adding the following line:
|
folder and adding the following line:
|
||||||
|
|
||||||
APP_STL := c++_shared
|
APP_STL := c++_shared
|
||||||
|
|
||||||
For more information go here:
|
For more information go here:
|
||||||
https://developer.android.com/ndk/guides/cpp-support
|
https://developer.android.com/ndk/guides/cpp-support
|
||||||
|
|
||||||
|
|
||||||
Using the emulator
|
Using the emulator
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
There are some good tips and tricks for getting the most out of the
|
There are some good tips and tricks for getting the most out of the
|
||||||
emulator here: https://developer.android.com/tools/devices/emulator.html
|
emulator here: https://developer.android.com/tools/devices/emulator.html
|
||||||
|
|
||||||
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
|
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
|
||||||
|
|
||||||
Notice that this software emulator is incredibly slow and needs a lot of disk space.
|
Notice that this software emulator is incredibly slow and needs a lot of disk space.
|
||||||
Using a real device works better.
|
Using a real device works better.
|
||||||
|
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
You can see if adb can see any devices with the following command:
|
You can see if adb can see any devices with the following command:
|
||||||
|
|
||||||
adb devices
|
adb devices
|
||||||
|
|
||||||
You can see the output of log messages on the default device with:
|
You can see the output of log messages on the default device with:
|
||||||
|
|
||||||
adb logcat
|
adb logcat
|
||||||
|
|
||||||
You can push files to the device with:
|
You can push files to the device with:
|
||||||
|
|
||||||
adb push local_file remote_path_and_file
|
adb push local_file remote_path_and_file
|
||||||
|
|
||||||
You can push files to the SD Card at /sdcard, for example:
|
You can push files to the SD Card at /sdcard, for example:
|
||||||
|
|
||||||
adb push moose.dat /sdcard/moose.dat
|
adb push moose.dat /sdcard/moose.dat
|
||||||
|
|
||||||
You can see the files on the SD card with a shell command:
|
You can see the files on the SD card with a shell command:
|
||||||
|
|
||||||
adb shell ls /sdcard/
|
adb shell ls /sdcard/
|
||||||
|
|
||||||
You can start a command shell on the default device with:
|
You can start a command shell on the default device with:
|
||||||
|
|
||||||
adb shell
|
adb shell
|
||||||
|
|
||||||
You can remove the library files of your project (and not the SDL lib files) with:
|
You can remove the library files of your project (and not the SDL lib files) with:
|
||||||
|
|
||||||
ndk-build clean
|
ndk-build clean
|
||||||
|
|
||||||
You can do a build with the following command:
|
You can do a build with the following command:
|
||||||
|
|
||||||
ndk-build
|
ndk-build
|
||||||
|
|
||||||
You can see the complete command line that ndk-build is using by passing V=1 on the command line:
|
You can see the complete command line that ndk-build is using by passing V=1 on the command line:
|
||||||
|
|
||||||
ndk-build V=1
|
ndk-build V=1
|
||||||
|
|
||||||
If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace:
|
If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace:
|
||||||
https://developer.android.com/ndk/guides/ndk-stack
|
https://developer.android.com/ndk/guides/ndk-stack
|
||||||
|
|
||||||
If you want to go through the process manually, you can use addr2line to convert the
|
If you want to go through the process manually, you can use addr2line to convert the
|
||||||
addresses in the stack trace to lines in your code.
|
addresses in the stack trace to lines in your code.
|
||||||
|
|
||||||
For example, if your crash looks like this:
|
For example, if your crash looks like this:
|
||||||
|
|
||||||
I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
|
I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
|
||||||
I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4
|
I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4
|
||||||
I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c
|
I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c
|
||||||
I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c
|
I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c
|
||||||
I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030
|
I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030
|
||||||
I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so
|
I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so
|
||||||
I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so
|
I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so
|
||||||
I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so
|
I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so
|
||||||
I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so
|
I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so
|
||||||
|
|
||||||
You can see that there's a crash in the C library being called from the main code.
|
You can see that there's a crash in the C library being called from the main code.
|
||||||
I run addr2line with the debug version of my code:
|
I run addr2line with the debug version of my code:
|
||||||
|
|
||||||
arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
|
arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
|
||||||
|
|
||||||
and then paste in the number after "pc" in the call stack, from the line that I care about:
|
and then paste in the number after "pc" in the call stack, from the line that I care about:
|
||||||
000014bc
|
000014bc
|
||||||
|
|
||||||
I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
|
I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
|
||||||
|
|
||||||
You can add logging to your code to help show what's happening:
|
You can add logging to your code to help show what's happening:
|
||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
|
__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
|
||||||
|
|
||||||
If you need to build without optimization turned on, you can create a file called
|
If you need to build without optimization turned on, you can create a file called
|
||||||
"Application.mk" in the jni directory, with the following line in it:
|
"Application.mk" in the jni directory, with the following line in it:
|
||||||
|
|
||||||
APP_OPTIM := debug
|
APP_OPTIM := debug
|
||||||
|
|
||||||
|
|
||||||
Memory debugging
|
Memory debugging
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
The best (and slowest) way to debug memory issues on Android is valgrind.
|
The best (and slowest) way to debug memory issues on Android is valgrind.
|
||||||
Valgrind has support for Android out of the box, just grab code using:
|
Valgrind has support for Android out of the box, just grab code using:
|
||||||
|
|
||||||
svn co svn://svn.valgrind.org/valgrind/trunk valgrind
|
svn co svn://svn.valgrind.org/valgrind/trunk valgrind
|
||||||
|
|
||||||
... and follow the instructions in the file README.android to build it.
|
... and follow the instructions in the file README.android to build it.
|
||||||
|
|
||||||
One thing I needed to do on Mac OS X was change the path to the toolchain,
|
One thing I needed to do on Mac OS X was change the path to the toolchain,
|
||||||
and add ranlib to the environment variables:
|
and add ranlib to the environment variables:
|
||||||
export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
|
export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
|
||||||
|
|
||||||
Once valgrind is built, you can create a wrapper script to launch your
|
Once valgrind is built, you can create a wrapper script to launch your
|
||||||
application with it, changing org.libsdl.app to your package identifier:
|
application with it, changing org.libsdl.app to your package identifier:
|
||||||
|
|
||||||
--- start_valgrind_app -------------------
|
--- start_valgrind_app -------------------
|
||||||
#!/system/bin/sh
|
#!/system/bin/sh
|
||||||
export TMPDIR=/data/data/org.libsdl.app
|
export TMPDIR=/data/data/org.libsdl.app
|
||||||
exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
|
exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
Then push it to the device:
|
Then push it to the device:
|
||||||
|
|
||||||
adb push start_valgrind_app /data/local
|
adb push start_valgrind_app /data/local
|
||||||
|
|
||||||
and make it executable:
|
and make it executable:
|
||||||
|
|
||||||
adb shell chmod 755 /data/local/start_valgrind_app
|
adb shell chmod 755 /data/local/start_valgrind_app
|
||||||
|
|
||||||
and tell Android to use the script to launch your application:
|
and tell Android to use the script to launch your application:
|
||||||
|
|
||||||
adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
|
adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
|
||||||
|
|
||||||
If the setprop command says "could not set property", it's likely that
|
If the setprop command says "could not set property", it's likely that
|
||||||
your package name is too long and you should make it shorter by changing
|
your package name is too long and you should make it shorter by changing
|
||||||
AndroidManifest.xml and the path to your class file in android-project/src
|
AndroidManifest.xml and the path to your class file in android-project/src
|
||||||
|
|
||||||
You can then launch your application normally and waaaaaaaiiittt for it.
|
You can then launch your application normally and waaaaaaaiiittt for it.
|
||||||
You can monitor the startup process with the logcat command above, and
|
You can monitor the startup process with the logcat command above, and
|
||||||
when it's done (or even while it's running) you can grab the valgrind
|
when it's done (or even while it's running) you can grab the valgrind
|
||||||
output file:
|
output file:
|
||||||
|
|
||||||
adb pull /sdcard/valgrind.log
|
adb pull /sdcard/valgrind.log
|
||||||
|
|
||||||
When you're done instrumenting with valgrind, you can disable the wrapper:
|
When you're done instrumenting with valgrind, you can disable the wrapper:
|
||||||
|
|
||||||
adb shell setprop wrap.org.libsdl.app ""
|
adb shell setprop wrap.org.libsdl.app ""
|
||||||
|
|
||||||
|
|
||||||
Graphics debugging
|
Graphics debugging
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
If you are developing on a compatible Tegra-based tablet, NVidia provides
|
If you are developing on a compatible Tegra-based tablet, NVidia provides
|
||||||
Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL
|
Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL
|
||||||
and GLES libraries, you must follow their instructions for installing the
|
and GLES libraries, you must follow their instructions for installing the
|
||||||
interposer library on a rooted device. The non-rooted instructions are not
|
interposer library on a rooted device. The non-rooted instructions are not
|
||||||
compatible with applications that use SDL2 for video.
|
compatible with applications that use SDL2 for video.
|
||||||
|
|
||||||
The Tegra Graphics Debugger is available from NVidia here:
|
The Tegra Graphics Debugger is available from NVidia here:
|
||||||
https://developer.nvidia.com/tegra-graphics-debugger
|
https://developer.nvidia.com/tegra-graphics-debugger
|
||||||
|
|
||||||
|
|
||||||
Why is API level 19 the minimum required?
|
Why is API level 19 the minimum required?
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
The latest NDK toolchain doesn't support targeting earlier than API level 19.
|
The latest NDK toolchain doesn't support targeting earlier than API level 19.
|
||||||
As of this writing, according to https://www.composables.com/tools/distribution-chart
|
As of this writing, according to https://www.composables.com/tools/distribution-chart
|
||||||
about 99.7% of the Android devices accessing Google Play support API level 19 or
|
about 99.7% of the Android devices accessing Google Play support API level 19 or
|
||||||
higher (August 2023).
|
higher (August 2023).
|
||||||
|
|
||||||
|
|
||||||
A note regarding the use of the "dirty rectangles" rendering technique
|
A note regarding the use of the "dirty rectangles" rendering technique
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
If your app uses a variation of the "dirty rectangles" rendering technique,
|
If your app uses a variation of the "dirty rectangles" rendering technique,
|
||||||
where you only update a portion of the screen on each frame, you may notice a
|
where you only update a portion of the screen on each frame, you may notice a
|
||||||
variety of visual glitches on Android, that are not present on other platforms.
|
variety of visual glitches on Android, that are not present on other platforms.
|
||||||
This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
|
This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
|
||||||
contexts, in particular the use of the eglSwapBuffers function. As stated in the
|
contexts, in particular the use of the eglSwapBuffers function. As stated in the
|
||||||
documentation for the function "The contents of ancillary buffers are always
|
documentation for the function "The contents of ancillary buffers are always
|
||||||
undefined after calling eglSwapBuffers".
|
undefined after calling eglSwapBuffers".
|
||||||
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
|
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
|
||||||
is not possible for SDL as it requires EGL 1.4, available only on the API level
|
is not possible for SDL as it requires EGL 1.4, available only on the API level
|
||||||
17+, so the only workaround available on this platform is to redraw the entire
|
17+, so the only workaround available on this platform is to redraw the entire
|
||||||
screen each frame.
|
screen each frame.
|
||||||
|
|
||||||
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
|
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
|
||||||
|
|
||||||
|
|
||||||
Ending your application
|
Ending your application
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Two legitimate ways:
|
Two legitimate ways:
|
||||||
|
|
||||||
- return from your main() function. Java side will automatically terminate the
|
- return from your main() function. Java side will automatically terminate the
|
||||||
Activity by calling Activity.finish().
|
Activity by calling Activity.finish().
|
||||||
|
|
||||||
- Android OS can decide to terminate your application by calling onDestroy()
|
- Android OS can decide to terminate your application by calling onDestroy()
|
||||||
(see Activity life cycle). Your application will receive a SDL_QUIT event you
|
(see Activity life cycle). Your application will receive a SDL_QUIT event you
|
||||||
can handle to save things and quit.
|
can handle to save things and quit.
|
||||||
|
|
||||||
Don't call exit() as it stops the activity badly.
|
Don't call exit() as it stops the activity badly.
|
||||||
|
|
||||||
NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
|
NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
|
||||||
SDLK_AC_BACK, for any purpose.
|
SDLK_AC_BACK, for any purpose.
|
||||||
|
|
||||||
Known issues
|
Known issues
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
- The number of buttons reported for each joystick is hardcoded to be 36, which
|
- The number of buttons reported for each joystick is hardcoded to be 36, which
|
||||||
is the current maximum number of buttons Android can report.
|
is the current maximum number of buttons Android can report.
|
||||||
|
|
||||||
|
@@ -1,163 +1,163 @@
|
|||||||
# CMake
|
# CMake
|
||||||
|
|
||||||
(www.cmake.org)
|
(www.cmake.org)
|
||||||
|
|
||||||
SDL's build system was traditionally based on autotools. Over time, this
|
SDL's build system was traditionally based on autotools. Over time, this
|
||||||
approach has suffered from several issues across the different supported
|
approach has suffered from several issues across the different supported
|
||||||
platforms.
|
platforms.
|
||||||
To solve these problems, a new build system based on CMake was introduced.
|
To solve these problems, a new build system based on CMake was introduced.
|
||||||
It is developed in parallel to the legacy autotools build system, so users
|
It is developed in parallel to the legacy autotools build system, so users
|
||||||
can experiment with it without complication.
|
can experiment with it without complication.
|
||||||
|
|
||||||
The CMake build system is supported on the following platforms:
|
The CMake build system is supported on the following platforms:
|
||||||
|
|
||||||
* FreeBSD
|
* FreeBSD
|
||||||
* Linux
|
* Linux
|
||||||
* Microsoft Visual C
|
* Microsoft Visual C
|
||||||
* MinGW and Msys
|
* MinGW and Msys
|
||||||
* macOS, iOS, and tvOS, with support for XCode
|
* macOS, iOS, and tvOS, with support for XCode
|
||||||
* Android
|
* Android
|
||||||
* Emscripten
|
* Emscripten
|
||||||
* RiscOS
|
* RiscOS
|
||||||
* Playstation Vita
|
* Playstation Vita
|
||||||
|
|
||||||
## Building SDL
|
## Building SDL
|
||||||
|
|
||||||
Assuming the source for SDL is located at `~/sdl`
|
Assuming the source for SDL is located at `~/sdl`
|
||||||
```sh
|
```sh
|
||||||
cd ~
|
cd ~
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ~/sdl
|
cmake ~/sdl
|
||||||
cmake --build .
|
cmake --build .
|
||||||
```
|
```
|
||||||
|
|
||||||
This will build the static and dynamic versions of SDL in the `~/build` directory.
|
This will build the static and dynamic versions of SDL in the `~/build` directory.
|
||||||
Installation can be done using:
|
Installation can be done using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cmake --install . # '--install' requires CMake 3.15, or newer
|
cmake --install . # '--install' requires CMake 3.15, or newer
|
||||||
```
|
```
|
||||||
|
|
||||||
## Including SDL in your project
|
## Including SDL in your project
|
||||||
|
|
||||||
SDL can be included in your project in 2 major ways:
|
SDL can be included in your project in 2 major ways:
|
||||||
- using a system SDL library, provided by your (*nix) distribution or a package manager
|
- using a system SDL library, provided by your (*nix) distribution or a package manager
|
||||||
- using a vendored SDL library: this is SDL copied or symlinked in a subfolder.
|
- using a vendored SDL library: this is SDL copied or symlinked in a subfolder.
|
||||||
|
|
||||||
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
project(mygame)
|
project(mygame)
|
||||||
|
|
||||||
# Create an option to switch between a system sdl library and a vendored sdl library
|
# Create an option to switch between a system sdl library and a vendored sdl library
|
||||||
option(MYGAME_VENDORED "Use vendored libraries" OFF)
|
option(MYGAME_VENDORED "Use vendored libraries" OFF)
|
||||||
|
|
||||||
if(MYGAME_VENDORED)
|
if(MYGAME_VENDORED)
|
||||||
add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL)
|
add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL)
|
||||||
else()
|
else()
|
||||||
# 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found
|
# 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found
|
||||||
find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2)
|
find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2)
|
||||||
|
|
||||||
# 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available
|
# 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available
|
||||||
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main)
|
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create your game executable target as usual
|
# Create your game executable target as usual
|
||||||
add_executable(mygame WIN32 mygame.c)
|
add_executable(mygame WIN32 mygame.c)
|
||||||
|
|
||||||
# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications
|
# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications
|
||||||
if(TARGET SDL2::SDL2main)
|
if(TARGET SDL2::SDL2main)
|
||||||
# It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static)
|
# It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static)
|
||||||
target_link_libraries(mygame PRIVATE SDL2::SDL2main)
|
target_link_libraries(mygame PRIVATE SDL2::SDL2main)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary.
|
# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary.
|
||||||
target_link_libraries(mygame PRIVATE SDL2::SDL2)
|
target_link_libraries(mygame PRIVATE SDL2::SDL2)
|
||||||
```
|
```
|
||||||
|
|
||||||
### A system SDL library
|
### A system SDL library
|
||||||
|
|
||||||
For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
|
For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
|
||||||
|
|
||||||
The following components are available, to be used as an argument of `find_package`.
|
The following components are available, to be used as an argument of `find_package`.
|
||||||
|
|
||||||
| Component name | Description |
|
| Component name | Description |
|
||||||
|----------------|--------------------------------------------------------------------------------------------|
|
|----------------|--------------------------------------------------------------------------------------------|
|
||||||
| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] |
|
| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] |
|
||||||
| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target |
|
| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target |
|
||||||
| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target |
|
| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target |
|
||||||
| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target |
|
| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target |
|
||||||
|
|
||||||
### Using a vendored SDL
|
### Using a vendored SDL
|
||||||
|
|
||||||
This only requires a copy of SDL in a subdirectory.
|
This only requires a copy of SDL in a subdirectory.
|
||||||
|
|
||||||
## CMake configuration options for platforms
|
## CMake configuration options for platforms
|
||||||
|
|
||||||
### iOS/tvOS
|
### iOS/tvOS
|
||||||
|
|
||||||
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
|
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
|
||||||
using Xcode or Make, possibly among other build-systems.
|
using Xcode or Make, possibly among other build-systems.
|
||||||
|
|
||||||
When using a recent version of CMake (3.14+), it should be possible to:
|
When using a recent version of CMake (3.14+), it should be possible to:
|
||||||
|
|
||||||
- build SDL for iOS, both static and dynamic
|
- build SDL for iOS, both static and dynamic
|
||||||
- build SDL test apps (as iOS/tvOS .app bundles)
|
- build SDL test apps (as iOS/tvOS .app bundles)
|
||||||
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
|
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
|
||||||
|
|
||||||
To use, set the following CMake variables when running CMake's configuration stage:
|
To use, set the following CMake variables when running CMake's configuration stage:
|
||||||
|
|
||||||
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
|
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
|
||||||
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
|
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
|
||||||
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
|
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
|
||||||
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
|
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
|
||||||
|
|
||||||
|
|
||||||
#### Examples
|
#### Examples
|
||||||
|
|
||||||
- for iOS-Simulator, using the latest, installed SDK:
|
- for iOS-Simulator, using the latest, installed SDK:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||||
```
|
```
|
||||||
|
|
||||||
- for iOS-Device, using the latest, installed SDK, 64-bit only
|
- for iOS-Device, using the latest, installed SDK, 64-bit only
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64
|
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||||
```
|
```
|
||||||
|
|
||||||
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
|
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"
|
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"
|
||||||
```
|
```
|
||||||
|
|
||||||
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
|
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64
|
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||||
```
|
```
|
||||||
|
|
||||||
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
|
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||||
```
|
```
|
||||||
|
|
||||||
- for tvOS-Simulator, using the latest, installed SDK:
|
- for tvOS-Simulator, using the latest, installed SDK:
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||||
```
|
```
|
||||||
|
|
||||||
- for tvOS-Device, using the latest, installed SDK:
|
- for tvOS-Device, using the latest, installed SDK:
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`
|
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons.
|
[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons.
|
||||||
|
@@ -1,123 +1,123 @@
|
|||||||
DirectFB
|
DirectFB
|
||||||
========
|
========
|
||||||
|
|
||||||
Supports:
|
Supports:
|
||||||
|
|
||||||
- Hardware YUV overlays
|
- Hardware YUV overlays
|
||||||
- OpenGL - software only
|
- OpenGL - software only
|
||||||
- 2D/3D accelerations (depends on directfb driver)
|
- 2D/3D accelerations (depends on directfb driver)
|
||||||
- multiple displays
|
- multiple displays
|
||||||
- windows
|
- windows
|
||||||
|
|
||||||
What you need:
|
What you need:
|
||||||
|
|
||||||
* DirectFB 1.0.1, 1.2.x, 1.3.0
|
* DirectFB 1.0.1, 1.2.x, 1.3.0
|
||||||
* Kernel-Framebuffer support: required: vesafb, radeonfb ....
|
* Kernel-Framebuffer support: required: vesafb, radeonfb ....
|
||||||
* Mesa 7.0.x - optional for OpenGL
|
* Mesa 7.0.x - optional for OpenGL
|
||||||
|
|
||||||
The `/etc/directfbrc` file should contain the following lines to make
|
The `/etc/directfbrc` file should contain the following lines to make
|
||||||
your joystick work and avoid crashes:
|
your joystick work and avoid crashes:
|
||||||
|
|
||||||
```
|
```
|
||||||
disable-module=joystick
|
disable-module=joystick
|
||||||
disable-module=cle266
|
disable-module=cle266
|
||||||
disable-module=cyber5k
|
disable-module=cyber5k
|
||||||
no-linux-input-grab
|
no-linux-input-grab
|
||||||
```
|
```
|
||||||
|
|
||||||
To disable to use x11 backend when DISPLAY variable is found use
|
To disable to use x11 backend when DISPLAY variable is found use
|
||||||
|
|
||||||
```
|
```
|
||||||
export SDL_DIRECTFB_X11_CHECK=0
|
export SDL_DIRECTFB_X11_CHECK=0
|
||||||
```
|
```
|
||||||
|
|
||||||
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
|
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
|
||||||
use
|
use
|
||||||
|
|
||||||
```
|
```
|
||||||
export SDL_DIRECTFB_LINUX_INPUT=0
|
export SDL_DIRECTFB_LINUX_INPUT=0
|
||||||
```
|
```
|
||||||
|
|
||||||
To use hardware accelerated YUV-overlays for YUV-textures, use:
|
To use hardware accelerated YUV-overlays for YUV-textures, use:
|
||||||
|
|
||||||
```
|
```
|
||||||
export SDL_DIRECTFB_YUV_DIRECT=1
|
export SDL_DIRECTFB_YUV_DIRECT=1
|
||||||
```
|
```
|
||||||
|
|
||||||
This is disabled by default. It will only support one
|
This is disabled by default. It will only support one
|
||||||
YUV texture, namely the first. Every other YUV texture will be
|
YUV texture, namely the first. Every other YUV texture will be
|
||||||
rendered in software.
|
rendered in software.
|
||||||
|
|
||||||
In addition, you may use (directfb-1.2.x)
|
In addition, you may use (directfb-1.2.x)
|
||||||
|
|
||||||
```
|
```
|
||||||
export SDL_DIRECTFB_YUV_UNDERLAY=1
|
export SDL_DIRECTFB_YUV_UNDERLAY=1
|
||||||
```
|
```
|
||||||
|
|
||||||
to make the YUV texture an underlay. This will make the cursor to
|
to make the YUV texture an underlay. This will make the cursor to
|
||||||
be shown.
|
be shown.
|
||||||
|
|
||||||
Simple Window Manager
|
Simple Window Manager
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
The driver has support for a very, very basic window manager you may
|
The driver has support for a very, very basic window manager you may
|
||||||
want to use when running with `wm=default`. Use
|
want to use when running with `wm=default`. Use
|
||||||
|
|
||||||
```
|
```
|
||||||
export SDL_DIRECTFB_WM=1
|
export SDL_DIRECTFB_WM=1
|
||||||
```
|
```
|
||||||
|
|
||||||
to enable basic window borders. In order to have the window title rendered,
|
to enable basic window borders. In order to have the window title rendered,
|
||||||
you need to have the following font installed:
|
you need to have the following font installed:
|
||||||
|
|
||||||
```
|
```
|
||||||
/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
||||||
```
|
```
|
||||||
|
|
||||||
OpenGL Support
|
OpenGL Support
|
||||||
==============
|
==============
|
||||||
|
|
||||||
The following instructions will give you *software* OpenGL. However this
|
The following instructions will give you *software* OpenGL. However this
|
||||||
works at least on all directfb supported platforms.
|
works at least on all directfb supported platforms.
|
||||||
|
|
||||||
As of this writing 20100802 you need to pull Mesa from git and do the following:
|
As of this writing 20100802 you need to pull Mesa from git and do the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
||||||
cd mesa
|
cd mesa
|
||||||
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
|
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit `configs/linux-directfb` so that the Directories-section looks like this:
|
Edit `configs/linux-directfb` so that the Directories-section looks like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Directories
|
# Directories
|
||||||
SRC_DIRS = mesa glu
|
SRC_DIRS = mesa glu
|
||||||
GLU_DIRS = sgi
|
GLU_DIRS = sgi
|
||||||
DRIVER_DIRS = directfb
|
DRIVER_DIRS = directfb
|
||||||
PROGRAM_DIRS =
|
PROGRAM_DIRS =
|
||||||
```
|
```
|
||||||
|
|
||||||
Then do the following:
|
Then do the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
make linux-directfb
|
make linux-directfb
|
||||||
make
|
make
|
||||||
|
|
||||||
echo Installing - please enter sudo pw.
|
echo Installing - please enter sudo pw.
|
||||||
|
|
||||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||||
cd src/mesa/drivers/directfb
|
cd src/mesa/drivers/directfb
|
||||||
make
|
make
|
||||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||||
```
|
```
|
||||||
|
|
||||||
To run the SDL - testprograms:
|
To run the SDL - testprograms:
|
||||||
|
|
||||||
```
|
```
|
||||||
export SDL_VIDEODRIVER=directfb
|
export SDL_VIDEODRIVER=directfb
|
||||||
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
|
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
|
||||||
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
|
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
|
||||||
|
|
||||||
./testgl
|
./testgl
|
||||||
```
|
```
|
||||||
|
@@ -1,138 +1,138 @@
|
|||||||
# Dynamic API
|
# Dynamic API
|
||||||
|
|
||||||
Originally posted on Ryan's Google+ account.
|
Originally posted on Ryan's Google+ account.
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
|
||||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
|
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
|
||||||
but developers are shipping their own SDL2 with individual Steam games.
|
but developers are shipping their own SDL2 with individual Steam games.
|
||||||
These games might stop getting updates, but a newer SDL2 might be needed later.
|
These games might stop getting updates, but a newer SDL2 might be needed later.
|
||||||
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
||||||
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
||||||
- Even if we replace the SDL2 in those games with a compatible one, that is to
|
- Even if we replace the SDL2 in those games with a compatible one, that is to
|
||||||
say, edit a developer's Steam depot (yuck!), there are developers that are
|
say, edit a developer's Steam depot (yuck!), there are developers that are
|
||||||
statically linking SDL2 that we can't do this for. We can't even force the
|
statically linking SDL2 that we can't do this for. We can't even force the
|
||||||
dynamic loader to ignore their SDL2 in this case, of course.
|
dynamic loader to ignore their SDL2 in this case, of course.
|
||||||
- If you don't ship an SDL2 with the game in some form, people that disabled the
|
- If you don't ship an SDL2 with the game in some form, people that disabled the
|
||||||
Steam Runtime, or just tried to run the game from the command line instead of
|
Steam Runtime, or just tried to run the game from the command line instead of
|
||||||
Steam might find themselves unable to run the game, due to a missing dependency.
|
Steam might find themselves unable to run the game, due to a missing dependency.
|
||||||
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
||||||
generic Linux boxes that may or may not have SDL2 installed, you have to ship
|
generic Linux boxes that may or may not have SDL2 installed, you have to ship
|
||||||
the library or risk a total failure to launch. So now, you might have to have
|
the library or risk a total failure to launch. So now, you might have to have
|
||||||
a non-Steam build plus a Steam build (that is, one with and one without SDL2
|
a non-Steam build plus a Steam build (that is, one with and one without SDL2
|
||||||
included), which is inconvenient if you could have had one universal build
|
included), which is inconvenient if you could have had one universal build
|
||||||
that works everywhere.
|
that works everywhere.
|
||||||
- We like the zlib license, but the biggest complaint from the open source
|
- We like the zlib license, but the biggest complaint from the open source
|
||||||
community about the license change is the static linking. The LGPL forced this
|
community about the license change is the static linking. The LGPL forced this
|
||||||
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
|
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
|
||||||
concerned about the GNU freedoms found themselves solving the same problems:
|
concerned about the GNU freedoms found themselves solving the same problems:
|
||||||
swapping in a newer SDL to an older game often times can save the day.
|
swapping in a newer SDL to an older game often times can save the day.
|
||||||
Static linking stops this dead.
|
Static linking stops this dead.
|
||||||
|
|
||||||
So here's what we did:
|
So here's what we did:
|
||||||
|
|
||||||
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
|
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
|
||||||
now looks like:
|
now looks like:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
Uint32 SDL_Init(Uint32 flags)
|
Uint32 SDL_Init(Uint32 flags)
|
||||||
{
|
{
|
||||||
return jump_table.SDL_Init(flags);
|
return jump_table.SDL_Init(flags);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Except that is all done with a bunch of macro magic so we don't have to maintain
|
Except that is all done with a bunch of macro magic so we don't have to maintain
|
||||||
every one of these.
|
every one of these.
|
||||||
|
|
||||||
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
|
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
|
||||||
SDL_Init() that you've been calling all this time. But at startup, it looks more
|
SDL_Init() that you've been calling all this time. But at startup, it looks more
|
||||||
like this:
|
like this:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
Uint32 SDL_Init_DEFAULT(Uint32 flags)
|
Uint32 SDL_Init_DEFAULT(Uint32 flags)
|
||||||
{
|
{
|
||||||
SDL_InitDynamicAPI();
|
SDL_InitDynamicAPI();
|
||||||
return jump_table.SDL_Init(flags);
|
return jump_table.SDL_Init(flags);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
|
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
|
||||||
pointers, which means that this `_DEFAULT` function never gets called again.
|
pointers, which means that this `_DEFAULT` function never gets called again.
|
||||||
First call to any SDL function sets the whole thing up.
|
First call to any SDL function sets the whole thing up.
|
||||||
|
|
||||||
So you might be asking, what was the value in that? Isn't this what the operating
|
So you might be asking, what was the value in that? Isn't this what the operating
|
||||||
system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
||||||
level of indirection, we can do things like this:
|
level of indirection, we can do things like this:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
|
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
|
||||||
./MyGameThatIsStaticallyLinkedToSDL2
|
./MyGameThatIsStaticallyLinkedToSDL2
|
||||||
```
|
```
|
||||||
|
|
||||||
And now, this game that is statically linked to SDL, can still be overridden
|
And now, this game that is statically linked to SDL, can still be overridden
|
||||||
with a newer, or better, SDL. The statically linked one will only be used as
|
with a newer, or better, SDL. The statically linked one will only be used as
|
||||||
far as calling into the jump table in this case. But in cases where no override
|
far as calling into the jump table in this case. But in cases where no override
|
||||||
is desired, the statically linked version will provide its own jump table,
|
is desired, the statically linked version will provide its own jump table,
|
||||||
and everyone is happy.
|
and everyone is happy.
|
||||||
|
|
||||||
So now:
|
So now:
|
||||||
- Developers can statically link SDL, and users can still replace it.
|
- Developers can statically link SDL, and users can still replace it.
|
||||||
(We'd still rather you ship a shared library, though!)
|
(We'd still rather you ship a shared library, though!)
|
||||||
- Developers can ship an SDL with their game, Valve can override it for, say,
|
- Developers can ship an SDL with their game, Valve can override it for, say,
|
||||||
new features on SteamOS, or distros can override it for their own needs,
|
new features on SteamOS, or distros can override it for their own needs,
|
||||||
but it'll also just work in the default case.
|
but it'll also just work in the default case.
|
||||||
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
|
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
|
||||||
and it'll do the right thing.
|
and it'll do the right thing.
|
||||||
- End users (and Valve) can update a game's SDL in almost any case,
|
- End users (and Valve) can update a game's SDL in almost any case,
|
||||||
to keep abandoned games running on newer platforms.
|
to keep abandoned games running on newer platforms.
|
||||||
- Everyone develops with SDL exactly as they have been doing all along.
|
- Everyone develops with SDL exactly as they have been doing all along.
|
||||||
Same headers, same ABI. Just get the latest version to enable this magic.
|
Same headers, same ABI. Just get the latest version to enable this magic.
|
||||||
|
|
||||||
|
|
||||||
A little more about SDL_InitDynamicAPI():
|
A little more about SDL_InitDynamicAPI():
|
||||||
|
|
||||||
Internally, InitAPI does some locking to make sure everything waits until a
|
Internally, InitAPI does some locking to make sure everything waits until a
|
||||||
single thread initializes everything (although even SDL_CreateThread() goes
|
single thread initializes everything (although even SDL_CreateThread() goes
|
||||||
through here before spinning a thread, too), and then decides if it should use
|
through here before spinning a thread, too), and then decides if it should use
|
||||||
an external SDL library. If not, it sets up the jump table using the current
|
an external SDL library. If not, it sets up the jump table using the current
|
||||||
SDL's function pointers (which might be statically linked into a program, or in
|
SDL's function pointers (which might be statically linked into a program, or in
|
||||||
a shared library of its own). If so, it loads that library and looks for and
|
a shared library of its own). If so, it loads that library and looks for and
|
||||||
calls a single function:
|
calls a single function:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
Sint32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
|
Sint32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
|
||||||
```
|
```
|
||||||
|
|
||||||
That function takes a version number (more on that in a moment), the address of
|
That function takes a version number (more on that in a moment), the address of
|
||||||
the jump table, and the size, in bytes, of the table.
|
the jump table, and the size, in bytes, of the table.
|
||||||
Now, we've got policy here: this table's layout never changes; new stuff gets
|
Now, we've got policy here: this table's layout never changes; new stuff gets
|
||||||
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
||||||
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
||||||
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
|
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
|
||||||
if it's smaller, we know we can provide the entire API that the caller needs.
|
if it's smaller, we know we can provide the entire API that the caller needs.
|
||||||
|
|
||||||
The version variable is a failsafe switch.
|
The version variable is a failsafe switch.
|
||||||
Right now it's always 1. This number changes when there are major API changes
|
Right now it's always 1. This number changes when there are major API changes
|
||||||
(so we know if the tablesize might be smaller, or entries in it have changed).
|
(so we know if the tablesize might be smaller, or entries in it have changed).
|
||||||
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
|
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
|
||||||
inconceivable to have a small dispatch library that only supplies this one
|
inconceivable to have a small dispatch library that only supplies this one
|
||||||
function and loads different, otherwise-incompatible SDL libraries and has the
|
function and loads different, otherwise-incompatible SDL libraries and has the
|
||||||
right one initialize the jump table based on the version. For something that
|
right one initialize the jump table based on the version. For something that
|
||||||
must generically catch lots of different versions of SDL over time, like the
|
must generically catch lots of different versions of SDL over time, like the
|
||||||
Steam Client, this isn't a bad option.
|
Steam Client, this isn't a bad option.
|
||||||
|
|
||||||
Finally, I'm sure some people are reading this and thinking,
|
Finally, I'm sure some people are reading this and thinking,
|
||||||
"I don't want that overhead in my project!"
|
"I don't want that overhead in my project!"
|
||||||
|
|
||||||
To which I would point out that the extra function call through the jump table
|
To which I would point out that the extra function call through the jump table
|
||||||
probably wouldn't even show up in a profile, but lucky you: this can all be
|
probably wouldn't even show up in a profile, but lucky you: this can all be
|
||||||
disabled. You can build SDL without this if you absolutely must, but we would
|
disabled. You can build SDL without this if you absolutely must, but we would
|
||||||
encourage you not to do that. However, on heavily locked down platforms like
|
encourage you not to do that. However, on heavily locked down platforms like
|
||||||
iOS, or maybe when debugging, it makes sense to disable it. The way this is
|
iOS, or maybe when debugging, it makes sense to disable it. The way this is
|
||||||
designed in SDL, you just have to change one #define, and the entire system
|
designed in SDL, you just have to change one #define, and the entire system
|
||||||
vaporizes out, and SDL functions exactly like it always did. Most of it is
|
vaporizes out, and SDL functions exactly like it always did. Most of it is
|
||||||
macro magic, so the system is contained to one C file and a few headers.
|
macro magic, so the system is contained to one C file and a few headers.
|
||||||
However, this is on by default and you have to edit a header file to turn it
|
However, this is on by default and you have to edit a header file to turn it
|
||||||
off. Our hopes is that if we make it easy to disable, but not too easy,
|
off. Our hopes is that if we make it easy to disable, but not too easy,
|
||||||
everyone will ultimately be able to get what they want, but we've gently
|
everyone will ultimately be able to get what they want, but we've gently
|
||||||
nudged everyone towards what we think is the best solution.
|
nudged everyone towards what we think is the best solution.
|
||||||
|
@@ -1,374 +1,374 @@
|
|||||||
# Emscripten
|
# Emscripten
|
||||||
|
|
||||||
## The state of things
|
## The state of things
|
||||||
|
|
||||||
(As of September 2023, but things move quickly and we don't update this
|
(As of September 2023, but things move quickly and we don't update this
|
||||||
document often.)
|
document often.)
|
||||||
|
|
||||||
In modern times, all the browsers you probably care about (Chrome, Firefox,
|
In modern times, all the browsers you probably care about (Chrome, Firefox,
|
||||||
Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some
|
Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some
|
||||||
reasonable base configurations:
|
reasonable base configurations:
|
||||||
|
|
||||||
- WebAssembly (don't bother with asm.js any more)
|
- WebAssembly (don't bother with asm.js any more)
|
||||||
- WebGL (which will look like OpenGL ES 2 or 3 to your app).
|
- WebGL (which will look like OpenGL ES 2 or 3 to your app).
|
||||||
- Threads (see caveats, though!)
|
- Threads (see caveats, though!)
|
||||||
- Game controllers
|
- Game controllers
|
||||||
- Autoupdating (so you can assume they have a recent version of the browser)
|
- Autoupdating (so you can assume they have a recent version of the browser)
|
||||||
|
|
||||||
All this to say we're at the point where you don't have to make a lot of
|
All this to say we're at the point where you don't have to make a lot of
|
||||||
concessions to get even a fairly complex SDL-based game up and running.
|
concessions to get even a fairly complex SDL-based game up and running.
|
||||||
|
|
||||||
|
|
||||||
## RTFM
|
## RTFM
|
||||||
|
|
||||||
This document is a quick rundown of some high-level details. The
|
This document is a quick rundown of some high-level details. The
|
||||||
documentation at [emscripten.org](https://emscripten.org/) is vast
|
documentation at [emscripten.org](https://emscripten.org/) is vast
|
||||||
and extremely detailed for a wide variety of topics, and you should at
|
and extremely detailed for a wide variety of topics, and you should at
|
||||||
least skim through it at some point.
|
least skim through it at some point.
|
||||||
|
|
||||||
|
|
||||||
## Porting your app to Emscripten
|
## Porting your app to Emscripten
|
||||||
|
|
||||||
Many many things just need some simple adjustments and they'll compile
|
Many many things just need some simple adjustments and they'll compile
|
||||||
like any other C/C++ code, as long as SDL was handling the platform-specific
|
like any other C/C++ code, as long as SDL was handling the platform-specific
|
||||||
work for your program.
|
work for your program.
|
||||||
|
|
||||||
First, you probably need this in at least one of your source files:
|
First, you probably need this in at least one of your source files:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
#endif
|
#endif
|
||||||
```
|
```
|
||||||
|
|
||||||
Second: assembly language code has to go. Replace it with C. You can even use
|
Second: assembly language code has to go. Replace it with C. You can even use
|
||||||
[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)!
|
[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)!
|
||||||
|
|
||||||
Third: Middleware has to go. If you have a third-party library you link
|
Third: Middleware has to go. If you have a third-party library you link
|
||||||
against, you either need an Emscripten port of it, or the source code to it
|
against, you either need an Emscripten port of it, or the source code to it
|
||||||
to compile yourself, or you need to remove it.
|
to compile yourself, or you need to remove it.
|
||||||
|
|
||||||
Fourth: You still start in a function called main(), but you need to get out of
|
Fourth: You still start in a function called main(), but you need to get out of
|
||||||
it and into a function that gets called repeatedly, and returns quickly,
|
it and into a function that gets called repeatedly, and returns quickly,
|
||||||
called a mainloop.
|
called a mainloop.
|
||||||
|
|
||||||
Somewhere in your program, you probably have something that looks like a more
|
Somewhere in your program, you probably have something that looks like a more
|
||||||
complicated version of this:
|
complicated version of this:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
initialize_the_game();
|
initialize_the_game();
|
||||||
while (game_is_still_running) {
|
while (game_is_still_running) {
|
||||||
check_for_new_input();
|
check_for_new_input();
|
||||||
think_about_stuff();
|
think_about_stuff();
|
||||||
draw_the_next_frame();
|
draw_the_next_frame();
|
||||||
}
|
}
|
||||||
deinitialize_the_game();
|
deinitialize_the_game();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This will not work on Emscripten, because the main thread needs to be free
|
This will not work on Emscripten, because the main thread needs to be free
|
||||||
to do stuff and can't sit in this loop forever. So Emscripten lets you set up
|
to do stuff and can't sit in this loop forever. So Emscripten lets you set up
|
||||||
a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop).
|
a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop).
|
||||||
|
|
||||||
```c
|
```c
|
||||||
static void mainloop(void) /* this will run often, possibly at the monitor's refresh rate */
|
static void mainloop(void) /* this will run often, possibly at the monitor's refresh rate */
|
||||||
{
|
{
|
||||||
if (!game_is_still_running) {
|
if (!game_is_still_running) {
|
||||||
deinitialize_the_game();
|
deinitialize_the_game();
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
||||||
#else
|
#else
|
||||||
exit(0);
|
exit(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
check_for_new_input();
|
check_for_new_input();
|
||||||
think_about_stuff();
|
think_about_stuff();
|
||||||
draw_the_next_frame();
|
draw_the_next_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
initialize_the_game();
|
initialize_the_game();
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten_set_main_loop(mainloop, 0, 1);
|
emscripten_set_main_loop(mainloop, 0, 1);
|
||||||
#else
|
#else
|
||||||
while (1) { mainloop(); }
|
while (1) { mainloop(); }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run
|
Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run
|
||||||
`mainloop` over and over until I end the program." The function will
|
`mainloop` over and over until I end the program." The function will
|
||||||
run, and return, freeing the main thread for other tasks, and then
|
run, and return, freeing the main thread for other tasks, and then
|
||||||
run again when it's time. The `1` parameter does some magic to make
|
run again when it's time. The `1` parameter does some magic to make
|
||||||
your main() function end immediately; this is useful because you
|
your main() function end immediately; this is useful because you
|
||||||
don't want any shutdown code that might be sitting below this code
|
don't want any shutdown code that might be sitting below this code
|
||||||
to actually run if main() were to continue on, since we're just
|
to actually run if main() were to continue on, since we're just
|
||||||
getting started.
|
getting started.
|
||||||
|
|
||||||
There's a lot of little details that are beyond the scope of this
|
There's a lot of little details that are beyond the scope of this
|
||||||
document, but that's the biggest intial set of hurdles to porting
|
document, but that's the biggest intial set of hurdles to porting
|
||||||
your app to the web.
|
your app to the web.
|
||||||
|
|
||||||
|
|
||||||
## Do you need threads?
|
## Do you need threads?
|
||||||
|
|
||||||
If you plan to use threads, they work on all major browsers now. HOWEVER,
|
If you plan to use threads, they work on all major browsers now. HOWEVER,
|
||||||
they bring with them a lot of careful considerations. Rendering _must_
|
they bring with them a lot of careful considerations. Rendering _must_
|
||||||
be done on the main thread. This is a general guideline for many
|
be done on the main thread. This is a general guideline for many
|
||||||
platforms, but a hard requirement on the web.
|
platforms, but a hard requirement on the web.
|
||||||
|
|
||||||
Many other things also must happen on the main thread; often times SDL
|
Many other things also must happen on the main thread; often times SDL
|
||||||
and Emscripten make efforts to "proxy" work to the main thread that
|
and Emscripten make efforts to "proxy" work to the main thread that
|
||||||
must be there, but you have to be careful (and read more detailed
|
must be there, but you have to be careful (and read more detailed
|
||||||
documentation than this for the finer points).
|
documentation than this for the finer points).
|
||||||
|
|
||||||
Even when using threads, your main thread needs to set an Emscripten
|
Even when using threads, your main thread needs to set an Emscripten
|
||||||
mainloop that runs quickly and returns, or things will fail to work
|
mainloop that runs quickly and returns, or things will fail to work
|
||||||
correctly.
|
correctly.
|
||||||
|
|
||||||
You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html)
|
You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html)
|
||||||
for all the finer points. Mostly SDL's thread API will work as expected,
|
for all the finer points. Mostly SDL's thread API will work as expected,
|
||||||
but is built on pthreads, so it shares the same little incompatibilities
|
but is built on pthreads, so it shares the same little incompatibilities
|
||||||
that are documented there, such as where you can use a mutex, and when
|
that are documented there, such as where you can use a mutex, and when
|
||||||
a thread will start running, etc.
|
a thread will start running, etc.
|
||||||
|
|
||||||
|
|
||||||
IMPORTANT: You have to decide to either build something that uses
|
IMPORTANT: You have to decide to either build something that uses
|
||||||
threads or something that doesn't; you can't have one build
|
threads or something that doesn't; you can't have one build
|
||||||
that works everywhere. This is an Emscripten (or maybe WebAssembly?
|
that works everywhere. This is an Emscripten (or maybe WebAssembly?
|
||||||
Or just web browsers in general?) limitation. If you aren't using
|
Or just web browsers in general?) limitation. If you aren't using
|
||||||
threads, it's easier to not enable them at all, at build time.
|
threads, it's easier to not enable them at all, at build time.
|
||||||
|
|
||||||
If you use threads, you _have to_ run from a web server that has
|
If you use threads, you _have to_ run from a web server that has
|
||||||
[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/)
|
[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/)
|
||||||
or your program will fail to start at all.
|
or your program will fail to start at all.
|
||||||
|
|
||||||
If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined
|
If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined
|
||||||
for checking with the C preprocessor, so you can build something
|
for checking with the C preprocessor, so you can build something
|
||||||
different depending on what sort of build you're compiling.
|
different depending on what sort of build you're compiling.
|
||||||
|
|
||||||
|
|
||||||
## Audio
|
## Audio
|
||||||
|
|
||||||
Audio works as expected at the API level, but not exactly like other
|
Audio works as expected at the API level, but not exactly like other
|
||||||
platforms.
|
platforms.
|
||||||
|
|
||||||
You'll only see a single default audio device. Audio capture also works;
|
You'll only see a single default audio device. Audio capture also works;
|
||||||
if the browser pops up a prompt to ask for permission to access the
|
if the browser pops up a prompt to ask for permission to access the
|
||||||
microphone, the SDL_OpenAudioDevice call will succeed and start producing
|
microphone, the SDL_OpenAudioDevice call will succeed and start producing
|
||||||
silence at a regular interval. Once the user approves the request, real
|
silence at a regular interval. Once the user approves the request, real
|
||||||
audio data will flow. If the user denies it, the app is not informed and
|
audio data will flow. If the user denies it, the app is not informed and
|
||||||
will just continue to receive silence.
|
will just continue to receive silence.
|
||||||
|
|
||||||
Modern web browsers will not permit web pages to produce sound before the
|
Modern web browsers will not permit web pages to produce sound before the
|
||||||
user has interacted with them (clicked or tapped on them, usually); this is
|
user has interacted with them (clicked or tapped on them, usually); this is
|
||||||
for several reasons, not the least of which being that no one likes when a
|
for several reasons, not the least of which being that no one likes when a
|
||||||
random browser tab suddenly starts making noise and the user has to scramble
|
random browser tab suddenly starts making noise and the user has to scramble
|
||||||
to figure out which and silence it.
|
to figure out which and silence it.
|
||||||
|
|
||||||
SDL will allow you to open the audio device for playback in this
|
SDL will allow you to open the audio device for playback in this
|
||||||
circumstance, and your audio callback will fire, but SDL will throw the audio
|
circumstance, and your audio callback will fire, but SDL will throw the audio
|
||||||
data away until the user interacts with the page. This helps apps that depend
|
data away until the user interacts with the page. This helps apps that depend
|
||||||
on the audio callback to make progress, and also keeps audio playback in sync
|
on the audio callback to make progress, and also keeps audio playback in sync
|
||||||
once the app is finally allowed to make noise.
|
once the app is finally allowed to make noise.
|
||||||
|
|
||||||
There are two reasonable ways to deal with the silence at the app level:
|
There are two reasonable ways to deal with the silence at the app level:
|
||||||
if you are writing some sort of media player thing, where the user expects
|
if you are writing some sort of media player thing, where the user expects
|
||||||
there to be a volume control when you mouseover the canvas, just default
|
there to be a volume control when you mouseover the canvas, just default
|
||||||
that control to a muted state; if the user clicks on the control to unmute
|
that control to a muted state; if the user clicks on the control to unmute
|
||||||
it, on this first click, open the audio device. This allows the media to
|
it, on this first click, open the audio device. This allows the media to
|
||||||
play at start, and the user can reasonably opt-in to listening.
|
play at start, and the user can reasonably opt-in to listening.
|
||||||
|
|
||||||
Many games do not have this sort of UI, and are more rigid about starting
|
Many games do not have this sort of UI, and are more rigid about starting
|
||||||
audio along with everything else at the start of the process. For these, your
|
audio along with everything else at the start of the process. For these, your
|
||||||
best bet is to write a little Javascript that puts up a "Click here to play!"
|
best bet is to write a little Javascript that puts up a "Click here to play!"
|
||||||
UI, and upon the user clicking, remove that UI and then call the Emscripten
|
UI, and upon the user clicking, remove that UI and then call the Emscripten
|
||||||
app's main() function. As far as the application knows, the audio device was
|
app's main() function. As far as the application knows, the audio device was
|
||||||
available to be opened as soon as the program started, and since this magic
|
available to be opened as soon as the program started, and since this magic
|
||||||
happens in a little Javascript, you don't have to change your C/C++ code at
|
happens in a little Javascript, you don't have to change your C/C++ code at
|
||||||
all to make it happen.
|
all to make it happen.
|
||||||
|
|
||||||
Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385
|
Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385
|
||||||
for some Javascript code to steal for this approach.
|
for some Javascript code to steal for this approach.
|
||||||
|
|
||||||
|
|
||||||
## Rendering
|
## Rendering
|
||||||
|
|
||||||
If you use SDL's 2D render API, it will use GLES2 internally, which
|
If you use SDL's 2D render API, it will use GLES2 internally, which
|
||||||
Emscripten will turn into WebGL calls. You can also use OpenGL ES 2
|
Emscripten will turn into WebGL calls. You can also use OpenGL ES 2
|
||||||
directly by creating a GL context and drawing into it.
|
directly by creating a GL context and drawing into it.
|
||||||
|
|
||||||
Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
|
Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
|
||||||
present anything on the screen until your return from your mainloop
|
present anything on the screen until your return from your mainloop
|
||||||
function.
|
function.
|
||||||
|
|
||||||
|
|
||||||
## Building SDL/emscripten
|
## Building SDL/emscripten
|
||||||
|
|
||||||
First: do you _really_ need to build SDL from source?
|
First: do you _really_ need to build SDL from source?
|
||||||
|
|
||||||
If you aren't developing SDL itself, have a desire to mess with its source
|
If you aren't developing SDL itself, have a desire to mess with its source
|
||||||
code, or need something on the bleeding edge, don't build SDL. Just use
|
code, or need something on the bleeding edge, don't build SDL. Just use
|
||||||
Emscripten's packaged version!
|
Emscripten's packaged version!
|
||||||
|
|
||||||
Compile and link your app with `-sUSE_SDL=2` and it'll use a build of
|
Compile and link your app with `-sUSE_SDL=2` and it'll use a build of
|
||||||
SDL packaged with Emscripten. This comes from the same source code and
|
SDL packaged with Emscripten. This comes from the same source code and
|
||||||
fixes the Emscripten project makes to SDL are generally merged into SDL's
|
fixes the Emscripten project makes to SDL are generally merged into SDL's
|
||||||
revision control, so often this is much easier for app developers.
|
revision control, so often this is much easier for app developers.
|
||||||
|
|
||||||
`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL
|
`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL
|
||||||
1.2 instead; if you need SDL 1.2, this might be fine, but we generally
|
1.2 instead; if you need SDL 1.2, this might be fine, but we generally
|
||||||
recommend you don't use SDL 1.2 in modern times.
|
recommend you don't use SDL 1.2 in modern times.
|
||||||
|
|
||||||
|
|
||||||
If you want to build SDL, though...
|
If you want to build SDL, though...
|
||||||
|
|
||||||
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
|
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
|
||||||
are likely to work, as well.
|
are likely to work, as well.
|
||||||
|
|
||||||
|
|
||||||
Build:
|
Build:
|
||||||
|
|
||||||
This works on Linux/Unix and macOS. Please send comments about Windows.
|
This works on Linux/Unix and macOS. Please send comments about Windows.
|
||||||
|
|
||||||
Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html)
|
Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html)
|
||||||
first, and run `source emsdk_env.sh` at the command line so it finds the
|
first, and run `source emsdk_env.sh` at the command line so it finds the
|
||||||
tools.
|
tools.
|
||||||
|
|
||||||
(These configure options might be overkill, but this has worked for me.)
|
(These configure options might be overkill, but this has worked for me.)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd SDL
|
cd SDL
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
emconfigure ../configure --host=wasm32-unknown-emscripten --disable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3"
|
emconfigure ../configure --host=wasm32-unknown-emscripten --disable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3"
|
||||||
emmake make -j4
|
emmake make -j4
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to build with thread support, something like this works:
|
If you want to build with thread support, something like this works:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
emconfigure ../configure --host=wasm32-unknown-emscripten --enable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3 -pthread" LDFLAGS="-pthread"
|
emconfigure ../configure --host=wasm32-unknown-emscripten --enable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3 -pthread" LDFLAGS="-pthread"
|
||||||
```
|
```
|
||||||
|
|
||||||
Or with cmake:
|
Or with cmake:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
emcmake cmake ..
|
emcmake cmake ..
|
||||||
emmake make -j4
|
emmake make -j4
|
||||||
```
|
```
|
||||||
|
|
||||||
To build one of the tests:
|
To build one of the tests:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd test/
|
cd test/
|
||||||
emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
|
emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building your app
|
## Building your app
|
||||||
|
|
||||||
You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but
|
You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but
|
||||||
mostly it uses the same command line arguments as Clang.
|
mostly it uses the same command line arguments as Clang.
|
||||||
|
|
||||||
Link against the SDL/build/.libs/libSDL2.a file you generated by building SDL,
|
Link against the SDL/build/.libs/libSDL2.a file you generated by building SDL,
|
||||||
link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build.
|
link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build.
|
||||||
|
|
||||||
Usually you would produce a binary like this:
|
Usually you would produce a binary like this:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gcc -o mygame mygame.c # or whatever
|
gcc -o mygame mygame.c # or whatever
|
||||||
```
|
```
|
||||||
|
|
||||||
But for Emscripten, you want to output something else:
|
But for Emscripten, you want to output something else:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
emcc -o index.html mygame.c
|
emcc -o index.html mygame.c
|
||||||
```
|
```
|
||||||
|
|
||||||
This will produce several files...support Javascript and WebAssembly (.wasm)
|
This will produce several files...support Javascript and WebAssembly (.wasm)
|
||||||
files. The `-o index.html` will produce a simple HTML page that loads and
|
files. The `-o index.html` will produce a simple HTML page that loads and
|
||||||
runs your app. You will (probably) eventually want to replace or customize
|
runs your app. You will (probably) eventually want to replace or customize
|
||||||
that file and do `-o index.js` instead to just build the code pieces.
|
that file and do `-o index.js` instead to just build the code pieces.
|
||||||
|
|
||||||
If you're working on a program of any serious size, you'll likely need to
|
If you're working on a program of any serious size, you'll likely need to
|
||||||
link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access
|
link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access
|
||||||
to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb`
|
to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb`
|
||||||
or the app will fail to start on iOS browsers, but this might be a bug that
|
or the app will fail to start on iOS browsers, but this might be a bug that
|
||||||
goes away in the future.
|
goes away in the future.
|
||||||
|
|
||||||
|
|
||||||
## Data files
|
## Data files
|
||||||
|
|
||||||
Your game probably has data files. Here's how to access them.
|
Your game probably has data files. Here's how to access them.
|
||||||
|
|
||||||
Filesystem access works like a Unix filesystem; you have a single directory
|
Filesystem access works like a Unix filesystem; you have a single directory
|
||||||
tree, possibly interpolated from several mounted locations, no drive letters,
|
tree, possibly interpolated from several mounted locations, no drive letters,
|
||||||
'/' for a path separator. You can access them with standard file APIs like
|
'/' for a path separator. You can access them with standard file APIs like
|
||||||
open() or fopen() or SDL_RWops. You can read or write from the filesystem.
|
open() or fopen() or SDL_RWops. You can read or write from the filesystem.
|
||||||
|
|
||||||
By default, you probably have a "MEMFS" filesystem (all files are stored in
|
By default, you probably have a "MEMFS" filesystem (all files are stored in
|
||||||
memory, but access to them is immediate and doesn't need to block). There are
|
memory, but access to them is immediate and doesn't need to block). There are
|
||||||
other options, like "IDBFS" (files are stored in a local database, so they
|
other options, like "IDBFS" (files are stored in a local database, so they
|
||||||
don't need to be in RAM all the time and they can persist between runs of the
|
don't need to be in RAM all the time and they can persist between runs of the
|
||||||
program, but access is not synchronous). You can mix and match these file
|
program, but access is not synchronous). You can mix and match these file
|
||||||
systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc,
|
systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc,
|
||||||
but that's beyond the scope of this document. Please refer to Emscripten's
|
but that's beyond the scope of this document. Please refer to Emscripten's
|
||||||
[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html)
|
[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html)
|
||||||
for more info.
|
for more info.
|
||||||
|
|
||||||
The _easiest_ (but not the best) way to get at your data files is to embed
|
The _easiest_ (but not the best) way to get at your data files is to embed
|
||||||
them in the app itself. Emscripten's linker has support for automating this.
|
them in the app itself. Emscripten's linker has support for automating this.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav
|
emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav
|
||||||
```
|
```
|
||||||
|
|
||||||
This will pack ../test/sample.wav in your app, and make it available at
|
This will pack ../test/sample.wav in your app, and make it available at
|
||||||
"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available
|
"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available
|
||||||
before your main() function runs, and since it's in MEMFS, you can just
|
before your main() function runs, and since it's in MEMFS, you can just
|
||||||
read it like you do on other platforms. `--embed-file` can also accept a
|
read it like you do on other platforms. `--embed-file` can also accept a
|
||||||
directory to pack an entire tree, and you can specify the argument multiple
|
directory to pack an entire tree, and you can specify the argument multiple
|
||||||
times to pack unrelated things into the final installation.
|
times to pack unrelated things into the final installation.
|
||||||
|
|
||||||
Note that this is absolutely the best approach if you have a few small
|
Note that this is absolutely the best approach if you have a few small
|
||||||
files to include and shouldn't worry about the issue further. However, if you
|
files to include and shouldn't worry about the issue further. However, if you
|
||||||
have hundreds of megabytes and/or thousands of files, this is not so great,
|
have hundreds of megabytes and/or thousands of files, this is not so great,
|
||||||
since the user will download it all every time they load your page, and it
|
since the user will download it all every time they load your page, and it
|
||||||
all has to live in memory at runtime.
|
all has to live in memory at runtime.
|
||||||
|
|
||||||
[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
|
[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
|
||||||
gives other options and details, and is worth a read.
|
gives other options and details, and is worth a read.
|
||||||
|
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
Debugging web apps is a mixed bag. You should compile and link with
|
Debugging web apps is a mixed bag. You should compile and link with
|
||||||
`-gsource-map`, which embeds a ton of source-level debugging information into
|
`-gsource-map`, which embeds a ton of source-level debugging information into
|
||||||
the build, and make sure _the app source code is available on the web server_,
|
the build, and make sure _the app source code is available on the web server_,
|
||||||
which is often a scary proposition for various reasons.
|
which is often a scary proposition for various reasons.
|
||||||
|
|
||||||
When you debug from the browser's tools and hit a breakpoint, you can step
|
When you debug from the browser's tools and hit a breakpoint, you can step
|
||||||
through the actual C/C++ source code, though, which can be nice.
|
through the actual C/C++ source code, though, which can be nice.
|
||||||
|
|
||||||
If you try debugging in Firefox and it doesn't work well for no apparent
|
If you try debugging in Firefox and it doesn't work well for no apparent
|
||||||
reason, try Chrome, and vice-versa. These tools are still relatively new,
|
reason, try Chrome, and vice-versa. These tools are still relatively new,
|
||||||
and improving all the time.
|
and improving all the time.
|
||||||
|
|
||||||
SDL_Log() (or even plain old printf) will write to the Javascript console,
|
SDL_Log() (or even plain old printf) will write to the Javascript console,
|
||||||
and honestly I find printf-style debugging to be easier than setting up a build
|
and honestly I find printf-style debugging to be easier than setting up a build
|
||||||
for proper debugging, so use whatever tools work best for you.
|
for proper debugging, so use whatever tools work best for you.
|
||||||
|
|
||||||
|
|
||||||
## Questions?
|
## Questions?
|
||||||
|
|
||||||
Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues).
|
Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues).
|
||||||
If something is wrong or unclear, we want to know!
|
If something is wrong or unclear, we want to know!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,176 +1,176 @@
|
|||||||
GDK
|
GDK
|
||||||
=====
|
=====
|
||||||
|
|
||||||
This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
|
This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
|
||||||
|
|
||||||
Windows (GDK) and Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets.
|
Windows (GDK) and Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets.
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested)
|
* Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested)
|
||||||
* Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022))
|
* Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022))
|
||||||
* For Xbox, you will need the corresponding GDKX version (licensed developers only)
|
* For Xbox, you will need the corresponding GDKX version (licensed developers only)
|
||||||
* To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work.
|
* To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work.
|
||||||
|
|
||||||
|
|
||||||
Windows GDK Status
|
Windows GDK Status
|
||||||
------
|
------
|
||||||
|
|
||||||
The Windows GDK port supports the full set of Win32 APIs, renderers, controllers, input devices, etc., as the normal Windows x64 build of SDL.
|
The Windows GDK port supports the full set of Win32 APIs, renderers, controllers, input devices, etc., as the normal Windows x64 build of SDL.
|
||||||
|
|
||||||
* Additionally, the GDK port adds the following:
|
* Additionally, the GDK port adds the following:
|
||||||
* Compile-time platform detection for SDL programs. The `__GDK__` is `#define`d on every GDK platform, and the `__WINGDK__` is `#define`d on Windows GDK, specifically. (This distinction exists because other GDK platforms support a smaller subset of functionality. This allows you to mark code for "any" GDK separate from Windows GDK.)
|
* Compile-time platform detection for SDL programs. The `__GDK__` is `#define`d on every GDK platform, and the `__WINGDK__` is `#define`d on Windows GDK, specifically. (This distinction exists because other GDK platforms support a smaller subset of functionality. This allows you to mark code for "any" GDK separate from Windows GDK.)
|
||||||
* GDK-specific setup:
|
* GDK-specific setup:
|
||||||
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
|
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
|
||||||
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
|
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
|
||||||
|
|
||||||
* An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
|
* An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
|
||||||
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
|
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
|
||||||
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
|
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
|
||||||
|
|
||||||
* Single-player games have some additional features available:
|
* Single-player games have some additional features available:
|
||||||
* Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
|
* Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
|
||||||
* `SDL_GetPrefPath` still works, but only for single-player titles.
|
* `SDL_GetPrefPath` still works, but only for single-player titles.
|
||||||
|
|
||||||
These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!
|
These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!
|
||||||
|
|
||||||
* What doesn't work:
|
* What doesn't work:
|
||||||
* Compilation with anything other than through the included Visual C++ solution file
|
* Compilation with anything other than through the included Visual C++ solution file
|
||||||
|
|
||||||
## VisualC-GDK Solution
|
## VisualC-GDK Solution
|
||||||
|
|
||||||
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
|
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
|
||||||
|
|
||||||
* SDL2 (DLL) - This is the typical SDL2.dll, but for Gaming.Desktop.x64.
|
* SDL2 (DLL) - This is the typical SDL2.dll, but for Gaming.Desktop.x64.
|
||||||
* SDL2main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs.
|
* SDL2main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs.
|
||||||
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
|
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
|
||||||
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
|
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
|
||||||
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
|
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
|
||||||
* tests/testsprite2 - Standard SDL test program demonstrating sprite drawing functionality.
|
* tests/testsprite2 - Standard SDL test program demonstrating sprite drawing functionality.
|
||||||
|
|
||||||
If you set one of the test programs as a startup project, you can run it directly from Visual Studio.
|
If you set one of the test programs as a startup project, you can run it directly from Visual Studio.
|
||||||
|
|
||||||
Windows GDK Setup, Detailed Steps
|
Windows GDK Setup, Detailed Steps
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
These steps assume you already have a game using SDL that runs on Windows x64 along with a corresponding Visual Studio solution file for the x64 version. If you don't have this, it's easiest to use one of the test program vcxproj files in the `VisualC-GDK` directory as a starting point, though you will still need to do most of the steps below.
|
These steps assume you already have a game using SDL that runs on Windows x64 along with a corresponding Visual Studio solution file for the x64 version. If you don't have this, it's easiest to use one of the test program vcxproj files in the `VisualC-GDK` directory as a starting point, though you will still need to do most of the steps below.
|
||||||
|
|
||||||
### 1. Add a Gaming.Desktop.x64 Configuration ###
|
### 1. Add a Gaming.Desktop.x64 Configuration ###
|
||||||
|
|
||||||
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
|
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
|
||||||
|
|
||||||
### 2. Build SDL2 and SDL2main for GDK ###
|
### 2. Build SDL2 and SDL2main for GDK ###
|
||||||
|
|
||||||
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL2.lib`, and `SDL2main.lib` output files for your game project.
|
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL2.lib`, and `SDL2main.lib` output files for your game project.
|
||||||
|
|
||||||
*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built.
|
*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built.
|
||||||
|
|
||||||
### 3. Configuring Project Settings ###
|
### 3. Configuring Project Settings ###
|
||||||
|
|
||||||
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
|
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
|
||||||
|
|
||||||
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
|
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
|
||||||
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL2.lib and SDL2main.lib are
|
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL2.lib and SDL2main.lib are
|
||||||
* Under Linker > Input > Additional Dependencies, you need the following:
|
* Under Linker > Input > Additional Dependencies, you need the following:
|
||||||
* `SDL2.lib`
|
* `SDL2.lib`
|
||||||
* `SDL2main.lib` (unless not using)
|
* `SDL2main.lib` (unless not using)
|
||||||
* `xgameruntime.lib`
|
* `xgameruntime.lib`
|
||||||
* `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib`
|
* `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib`
|
||||||
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
|
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
|
||||||
|
|
||||||
### 4. Setting up SDL_main ###
|
### 4. Setting up SDL_main ###
|
||||||
|
|
||||||
Rather than using your own implementation of `WinMain`, it's recommended that you instead `#include "SDL_main.h"` and declare a standard main function. If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
|
Rather than using your own implementation of `WinMain`, it's recommended that you instead `#include "SDL_main.h"` and declare a standard main function. If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
|
||||||
|
|
||||||
### 5. Required DLLs ###
|
### 5. Required DLLs ###
|
||||||
|
|
||||||
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
|
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
|
||||||
|
|
||||||
* Your SDL2.dll
|
* Your SDL2.dll
|
||||||
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll"
|
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll"
|
||||||
* XCurl.dll
|
* XCurl.dll
|
||||||
|
|
||||||
You can either copy these in a post-build step, or you can add the dlls into the project and set its Configuration Properties > General > Item type to "Copy file," which will also copy them into the output directory.
|
You can either copy these in a post-build step, or you can add the dlls into the project and set its Configuration Properties > General > Item type to "Copy file," which will also copy them into the output directory.
|
||||||
|
|
||||||
### 6. Setting up MicrosoftGame.config ###
|
### 6. Setting up MicrosoftGame.config ###
|
||||||
|
|
||||||
You can copy `VisualC-GDK/tests/testgdk/MicrosoftGame.config` and use that as a starting point in your project. Minimally, you will want to change the Executable Name attribute, the DefaultDisplayName, and the Description.
|
You can copy `VisualC-GDK/tests/testgdk/MicrosoftGame.config` and use that as a starting point in your project. Minimally, you will want to change the Executable Name attribute, the DefaultDisplayName, and the Description.
|
||||||
|
|
||||||
This file must be copied into the same directory as the game's .exe file. As with the DLLs, you can either use a post-build step or the "Copy file" item type.
|
This file must be copied into the same directory as the game's .exe file. As with the DLLs, you can either use a post-build step or the "Copy file" item type.
|
||||||
|
|
||||||
For basic testing, you do not need to change anything else in `MicrosoftGame.config`. However, if you want to test any Xbox Live services (such as logging in users) _or_ publish a package, you will need to setup a Game app on Partner Center.
|
For basic testing, you do not need to change anything else in `MicrosoftGame.config`. However, if you want to test any Xbox Live services (such as logging in users) _or_ publish a package, you will need to setup a Game app on Partner Center.
|
||||||
|
|
||||||
Then, you need to set the following values to the values from Partner Center:
|
Then, you need to set the following values to the values from Partner Center:
|
||||||
|
|
||||||
* Identity tag - Name and Publisher attributes
|
* Identity tag - Name and Publisher attributes
|
||||||
* TitleId
|
* TitleId
|
||||||
* MSAAppId
|
* MSAAppId
|
||||||
|
|
||||||
### 7. Adding Required Logos
|
### 7. Adding Required Logos
|
||||||
|
|
||||||
Several logo PNG files are required to be able to launch the game, even from the debugger. You can use the sample logos provided in `VisualC-GDK/logos`. As with the other files, they must be copied into the same directory as the game's .exe file.
|
Several logo PNG files are required to be able to launch the game, even from the debugger. You can use the sample logos provided in `VisualC-GDK/logos`. As with the other files, they must be copied into the same directory as the game's .exe file.
|
||||||
|
|
||||||
|
|
||||||
### 8. Copying any Data Files ###
|
### 8. Copying any Data Files ###
|
||||||
|
|
||||||
When debugging GDK games, there is no way to specify a working directory. Therefore, any required game data must also be copied into the output directory, likely in a post-build step.
|
When debugging GDK games, there is no way to specify a working directory. Therefore, any required game data must also be copied into the output directory, likely in a post-build step.
|
||||||
|
|
||||||
|
|
||||||
### 9. Build and Run from Visual Studio ###
|
### 9. Build and Run from Visual Studio ###
|
||||||
|
|
||||||
At this point, you should be able to build and run your game from the Visual Studio Debugger. If you get any linker errors, make sure you double-check that you referenced all the required libs.
|
At this point, you should be able to build and run your game from the Visual Studio Debugger. If you get any linker errors, make sure you double-check that you referenced all the required libs.
|
||||||
|
|
||||||
If you are testing Xbox Live functionality, it's likely you will need to change to the Sandbox for your title. To do this:
|
If you are testing Xbox Live functionality, it's likely you will need to change to the Sandbox for your title. To do this:
|
||||||
|
|
||||||
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
||||||
2. Switch the sandbox name with:
|
2. Switch the sandbox name with:
|
||||||
`XblPCSandbox SANDBOX.#`
|
`XblPCSandbox SANDBOX.#`
|
||||||
3. (To switch back to the retail sandbox):
|
3. (To switch back to the retail sandbox):
|
||||||
`XblPCSandbox RETAIL`
|
`XblPCSandbox RETAIL`
|
||||||
|
|
||||||
### 10. Packaging and Installing Locally
|
### 10. Packaging and Installing Locally
|
||||||
|
|
||||||
You can use one of the test program's `PackageLayout.xml` as a starting point. Minimally, you will need to change the exe to the correct name and also reference any required game data. As with the other data files, it's easiest if you have this copy to the output directory, although it's not a requirement as you can specify relative paths to files.
|
You can use one of the test program's `PackageLayout.xml` as a starting point. Minimally, you will need to change the exe to the correct name and also reference any required game data. As with the other data files, it's easiest if you have this copy to the output directory, although it's not a requirement as you can specify relative paths to files.
|
||||||
|
|
||||||
To create the package:
|
To create the package:
|
||||||
|
|
||||||
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
||||||
2. `cd` to the directory containing the `PackageLayout.xml` with the correct paths (if you use the local path as in the sample package layout, this would be from your .exe output directory)
|
2. `cd` to the directory containing the `PackageLayout.xml` with the correct paths (if you use the local path as in the sample package layout, this would be from your .exe output directory)
|
||||||
3. `mkdir Package` to create an output directory
|
3. `mkdir Package` to create an output directory
|
||||||
4. To package the file into the `Package` directory, use:
|
4. To package the file into the `Package` directory, use:
|
||||||
`makepkg pack /f PackageLayout.xml /lt /d . /nogameos /pc /pd Package`
|
`makepkg pack /f PackageLayout.xml /lt /d . /nogameos /pc /pd Package`
|
||||||
5. To install the package, use:
|
5. To install the package, use:
|
||||||
`wdapp install PACKAGENAME.msixvc`
|
`wdapp install PACKAGENAME.msixvc`
|
||||||
6. Once the package is installed, you can run it from the start menu.
|
6. Once the package is installed, you can run it from the start menu.
|
||||||
7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox.
|
7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox.
|
||||||
|
|
||||||
Xbox GDKX Setup
|
Xbox GDKX Setup
|
||||||
---------------------
|
---------------------
|
||||||
In general, the same process in the Windows GDK instructions work. There are just a few additional notes:
|
In general, the same process in the Windows GDK instructions work. There are just a few additional notes:
|
||||||
* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target
|
* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target
|
||||||
* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target
|
* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target
|
||||||
* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define
|
* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define
|
||||||
* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox)
|
* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox)
|
||||||
* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons)
|
* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons)
|
||||||
* To create a package, use:
|
* To create a package, use:
|
||||||
`makepkg pack /f PackageLayout.xml /lt /d . /pd Package`
|
`makepkg pack /f PackageLayout.xml /lt /d . /pd Package`
|
||||||
* To install the package, use:
|
* To install the package, use:
|
||||||
`xbapp install [PACKAGE].xvc`
|
`xbapp install [PACKAGE].xvc`
|
||||||
* For some reason, if you make changes that require SDL2.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again
|
* For some reason, if you make changes that require SDL2.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again
|
||||||
* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets
|
* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
#### Xbox Live Login does not work
|
#### Xbox Live Login does not work
|
||||||
|
|
||||||
As of June 2022 GDK, you must have a valid Title Id and MSAAppId in order to test Xbox Live functionality such as user login. Make sure these are set correctly in the `MicrosoftGame.config`. This means that even testgdk will not let you login without setting these properties to valid values.
|
As of June 2022 GDK, you must have a valid Title Id and MSAAppId in order to test Xbox Live functionality such as user login. Make sure these are set correctly in the `MicrosoftGame.config`. This means that even testgdk will not let you login without setting these properties to valid values.
|
||||||
|
|
||||||
Furthermore, confirm that your PC is set to the correct sandbox.
|
Furthermore, confirm that your PC is set to the correct sandbox.
|
||||||
|
|
||||||
|
|
||||||
#### "The current user has already installed an unpackaged version of this app. A packaged version cannot replace this." error when installing
|
#### "The current user has already installed an unpackaged version of this app. A packaged version cannot replace this." error when installing
|
||||||
|
|
||||||
Prior to June 2022 GDK, running from the Visual Studio debugger would still locally register the app (and it would appear on the start menu). To fix this, you have to uninstall it (it's simplest to right click on it from the start menu to uninstall it).
|
Prior to June 2022 GDK, running from the Visual Studio debugger would still locally register the app (and it would appear on the start menu). To fix this, you have to uninstall it (it's simplest to right click on it from the start menu to uninstall it).
|
||||||
|
@@ -1,71 +1,71 @@
|
|||||||
Dollar Gestures
|
Dollar Gestures
|
||||||
===========================================================================
|
===========================================================================
|
||||||
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
||||||
|
|
||||||
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
|
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
|
||||||
|
|
||||||
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
|
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
|
||||||
|
|
||||||
Recording:
|
Recording:
|
||||||
----------
|
----------
|
||||||
To begin recording on a touch device call:
|
To begin recording on a touch device call:
|
||||||
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
|
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
|
||||||
|
|
||||||
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
|
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
|
||||||
A SDL_DOLLARRECORD event is a dgesture with the following fields:
|
A SDL_DOLLARRECORD event is a dgesture with the following fields:
|
||||||
|
|
||||||
* event.dgesture.touchId - the Id of the touch used to record the gesture.
|
* event.dgesture.touchId - the Id of the touch used to record the gesture.
|
||||||
* event.dgesture.gestureId - the unique id of the recorded gesture.
|
* event.dgesture.gestureId - the unique id of the recorded gesture.
|
||||||
|
|
||||||
|
|
||||||
Performing:
|
Performing:
|
||||||
-----------
|
-----------
|
||||||
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
|
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
|
||||||
|
|
||||||
* event.dgesture.touchId - the Id of the touch which performed the gesture.
|
* event.dgesture.touchId - the Id of the touch which performed the gesture.
|
||||||
* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
|
* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
|
||||||
* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
|
* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
|
||||||
* event.dgesture.numFingers - the number of fingers used to draw the stroke.
|
* event.dgesture.numFingers - the number of fingers used to draw the stroke.
|
||||||
|
|
||||||
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
|
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Saving:
|
Saving:
|
||||||
-------
|
-------
|
||||||
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||||
|
|
||||||
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||||
|
|
||||||
Both functions return the number of gestures successfully saved.
|
Both functions return the number of gestures successfully saved.
|
||||||
|
|
||||||
|
|
||||||
Loading:
|
Loading:
|
||||||
--------
|
--------
|
||||||
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
|
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
|
||||||
|
|
||||||
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
|
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
Multi Gestures
|
Multi Gestures
|
||||||
===========================================================================
|
===========================================================================
|
||||||
SDL provides simple support for pinch/rotate/swipe gestures.
|
SDL provides simple support for pinch/rotate/swipe gestures.
|
||||||
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
|
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
|
||||||
|
|
||||||
* event.mgesture.touchId - the Id of the touch on which the gesture was performed.
|
* event.mgesture.touchId - the Id of the touch on which the gesture was performed.
|
||||||
* event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
|
* event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
|
||||||
* event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
|
* event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
|
||||||
* event.mgesture.dTheta - the amount that the fingers rotated during this motion.
|
* event.mgesture.dTheta - the amount that the fingers rotated during this motion.
|
||||||
* event.mgesture.dDist - the amount that the fingers pinched during this motion.
|
* event.mgesture.dDist - the amount that the fingers pinched during this motion.
|
||||||
* event.mgesture.numFingers - the number of fingers used in the gesture.
|
* event.mgesture.numFingers - the number of fingers used in the gesture.
|
||||||
|
|
||||||
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
Notes
|
Notes
|
||||||
===========================================================================
|
===========================================================================
|
||||||
For a complete example see test/testgesture.c
|
For a complete example see test/testgesture.c
|
||||||
|
|
||||||
Please direct questions/comments to:
|
Please direct questions/comments to:
|
||||||
jim.tla+sdl_touch@gmail.com
|
jim.tla+sdl_touch@gmail.com
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
git
|
git
|
||||||
=========
|
=========
|
||||||
|
|
||||||
The latest development version of SDL is available via git.
|
The latest development version of SDL is available via git.
|
||||||
Git allows you to get up-to-the-minute fixes and enhancements;
|
Git allows you to get up-to-the-minute fixes and enhancements;
|
||||||
as a developer works on a source tree, you can use "git" to mirror that
|
as a developer works on a source tree, you can use "git" to mirror that
|
||||||
source tree instead of waiting for an official release. Please look
|
source tree instead of waiting for an official release. Please look
|
||||||
at the Git website ( https://git-scm.com/ ) for more
|
at the Git website ( https://git-scm.com/ ) for more
|
||||||
information on using git, where you can also download software for
|
information on using git, where you can also download software for
|
||||||
macOS, Windows, and Unix systems.
|
macOS, Windows, and Unix systems.
|
||||||
|
|
||||||
git clone https://github.com/libsdl-org/SDL
|
git clone https://github.com/libsdl-org/SDL
|
||||||
|
|
||||||
If you are building SDL via configure, you will need to run autogen.sh
|
If you are building SDL via configure, you will need to run autogen.sh
|
||||||
before running configure.
|
before running configure.
|
||||||
|
|
||||||
There is a web interface to the Git repository at:
|
There is a web interface to the Git repository at:
|
||||||
http://github.com/libsdl-org/SDL/
|
http://github.com/libsdl-org/SDL/
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
We are no longer hosted in Mercurial. Please see README-git.md for details.
|
We are no longer hosted in Mercurial. Please see README-git.md for details.
|
||||||
|
|
||||||
Thanks!
|
Thanks!
|
||||||
|
|
||||||
|
@@ -1,307 +1,307 @@
|
|||||||
iOS
|
iOS
|
||||||
======
|
======
|
||||||
|
|
||||||
Building the Simple DirectMedia Layer for iOS 9.0+
|
Building the Simple DirectMedia Layer for iOS 9.0+
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Requirements: Mac OS X 10.9 or later and the iOS 9.0 or newer SDK.
|
Requirements: Mac OS X 10.9 or later and the iOS 9.0 or newer SDK.
|
||||||
|
|
||||||
Instructions:
|
Instructions:
|
||||||
|
|
||||||
1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode.
|
1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode.
|
||||||
2. Select your desired target, and hit build.
|
2. Select your desired target, and hit build.
|
||||||
|
|
||||||
|
|
||||||
Using the Simple DirectMedia Layer for iOS
|
Using the Simple DirectMedia Layer for iOS
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology.
|
1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology.
|
||||||
2. In the main view, delete all files except for Assets and LaunchScreen
|
2. In the main view, delete all files except for Assets and LaunchScreen
|
||||||
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
|
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
|
||||||
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
|
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
|
||||||
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
|
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
|
||||||
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS"
|
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS"
|
||||||
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
|
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
|
||||||
8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files
|
8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files
|
||||||
9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
|
9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
|
||||||
10. Add any assets that your application needs.
|
10. Add any assets that your application needs.
|
||||||
11. Enjoy!
|
11. Enjoy!
|
||||||
|
|
||||||
|
|
||||||
TODO: Add information regarding App Store requirements such as icons, etc.
|
TODO: Add information regarding App Store requirements such as icons, etc.
|
||||||
|
|
||||||
|
|
||||||
Notes -- Retina / High-DPI and window sizes
|
Notes -- Retina / High-DPI and window sizes
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Window and display mode sizes in SDL are in "screen coordinates" (or "points",
|
Window and display mode sizes in SDL are in "screen coordinates" (or "points",
|
||||||
in Apple's terminology) rather than in pixels. On iOS this means that a window
|
in Apple's terminology) rather than in pixels. On iOS this means that a window
|
||||||
created on an iPhone 6 will have a size in screen coordinates of 375 x 667,
|
created on an iPhone 6 will have a size in screen coordinates of 375 x 667,
|
||||||
rather than a size in pixels of 750 x 1334. All iOS apps are expected to
|
rather than a size in pixels of 750 x 1334. All iOS apps are expected to
|
||||||
size their content based on screen coordinates / points rather than pixels,
|
size their content based on screen coordinates / points rather than pixels,
|
||||||
as this allows different iOS devices to have different pixel densities
|
as this allows different iOS devices to have different pixel densities
|
||||||
(Retina versus non-Retina screens, etc.) without apps caring too much.
|
(Retina versus non-Retina screens, etc.) without apps caring too much.
|
||||||
|
|
||||||
By default SDL will not use the full pixel density of the screen on
|
By default SDL will not use the full pixel density of the screen on
|
||||||
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
|
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
|
||||||
creating your window to enable high-dpi support.
|
creating your window to enable high-dpi support.
|
||||||
|
|
||||||
When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes
|
When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes
|
||||||
will still be in "screen coordinates" rather than pixels, but the window will
|
will still be in "screen coordinates" rather than pixels, but the window will
|
||||||
have a much greater pixel density when the device supports it, and the
|
have a much greater pixel density when the device supports it, and the
|
||||||
SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on
|
SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on
|
||||||
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
|
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
|
||||||
the size in pixels of the drawable screen framebuffer.
|
the size in pixels of the drawable screen framebuffer.
|
||||||
|
|
||||||
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
||||||
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
|
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
|
||||||
orthographic projection matrix using the size in screen coordinates
|
orthographic projection matrix using the size in screen coordinates
|
||||||
(SDL_GetWindowSize()) can be used in order to display content at the same scale
|
(SDL_GetWindowSize()) can be used in order to display content at the same scale
|
||||||
no matter whether a Retina device is used or not.
|
no matter whether a Retina device is used or not.
|
||||||
|
|
||||||
|
|
||||||
Notes -- Application events
|
Notes -- Application events
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
On iOS the application goes through a fixed life cycle and you will get
|
On iOS the application goes through a fixed life cycle and you will get
|
||||||
notifications of state changes via application events. When these events
|
notifications of state changes via application events. When these events
|
||||||
are delivered you must handle them in an event callback because the OS may
|
are delivered you must handle them in an event callback because the OS may
|
||||||
not give you any processing time after the events are delivered.
|
not give you any processing time after the events are delivered.
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
int HandleAppEvents(void *userdata, SDL_Event *event)
|
||||||
{
|
{
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case SDL_APP_TERMINATING:
|
case SDL_APP_TERMINATING:
|
||||||
/* Terminate the app.
|
/* Terminate the app.
|
||||||
Shut everything down before returning from this function.
|
Shut everything down before returning from this function.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_APP_LOWMEMORY:
|
case SDL_APP_LOWMEMORY:
|
||||||
/* You will get this when your app is paused and iOS wants more memory.
|
/* You will get this when your app is paused and iOS wants more memory.
|
||||||
Release as much memory as possible.
|
Release as much memory as possible.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_APP_WILLENTERBACKGROUND:
|
case SDL_APP_WILLENTERBACKGROUND:
|
||||||
/* Prepare your app to go into the background. Stop loops, etc.
|
/* Prepare your app to go into the background. Stop loops, etc.
|
||||||
This gets called when the user hits the home button, or gets a call.
|
This gets called when the user hits the home button, or gets a call.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_APP_DIDENTERBACKGROUND:
|
case SDL_APP_DIDENTERBACKGROUND:
|
||||||
/* This will get called if the user accepted whatever sent your app to the background.
|
/* This will get called if the user accepted whatever sent your app to the background.
|
||||||
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
|
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
|
||||||
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
||||||
Your app is NOT active at this point.
|
Your app is NOT active at this point.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_APP_WILLENTERFOREGROUND:
|
case SDL_APP_WILLENTERFOREGROUND:
|
||||||
/* This call happens when your app is coming back to the foreground.
|
/* This call happens when your app is coming back to the foreground.
|
||||||
Restore all your state here.
|
Restore all your state here.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_APP_DIDENTERFOREGROUND:
|
case SDL_APP_DIDENTERFOREGROUND:
|
||||||
/* Restart your loops here.
|
/* Restart your loops here.
|
||||||
Your app is interactive and getting CPU again.
|
Your app is interactive and getting CPU again.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
/* No special processing, add it to the event queue */
|
/* No special processing, add it to the event queue */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
SDL_SetEventFilter(HandleAppEvents, NULL);
|
SDL_SetEventFilter(HandleAppEvents, NULL);
|
||||||
|
|
||||||
... run your main loop
|
... run your main loop
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Notes -- Accelerometer as Joystick
|
Notes -- Accelerometer as Joystick
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||||
|
|
||||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||||
|
|
||||||
|
|
||||||
Notes -- OpenGL ES
|
Notes -- OpenGL ES
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Your SDL application for iOS uses OpenGL ES for video by default.
|
Your SDL application for iOS uses OpenGL ES for video by default.
|
||||||
|
|
||||||
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute().
|
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute().
|
||||||
|
|
||||||
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
||||||
|
|
||||||
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0.
|
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0.
|
||||||
|
|
||||||
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
|
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
|
||||||
|
|
||||||
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called.
|
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called.
|
||||||
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called.
|
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called.
|
||||||
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
|
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
|
||||||
|
|
||||||
The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h).
|
The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h).
|
||||||
|
|
||||||
|
|
||||||
Notes -- Keyboard
|
Notes -- Keyboard
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
The SDL keyboard API has been extended to support on-screen keyboards:
|
The SDL keyboard API has been extended to support on-screen keyboards:
|
||||||
|
|
||||||
void SDL_StartTextInput()
|
void SDL_StartTextInput()
|
||||||
-- enables text events and reveals the onscreen keyboard.
|
-- enables text events and reveals the onscreen keyboard.
|
||||||
|
|
||||||
void SDL_StopTextInput()
|
void SDL_StopTextInput()
|
||||||
-- disables text events and hides the onscreen keyboard.
|
-- disables text events and hides the onscreen keyboard.
|
||||||
|
|
||||||
SDL_bool SDL_IsTextInputActive()
|
SDL_bool SDL_IsTextInputActive()
|
||||||
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
|
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
|
||||||
|
|
||||||
|
|
||||||
Notes -- Mouse
|
Notes -- Mouse
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist
|
iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist
|
||||||
|
|
||||||
|
|
||||||
Notes -- Reading and Writing files
|
Notes -- Reading and Writing files
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
||||||
|
|
||||||
Once your application is installed its directory tree looks like:
|
Once your application is installed its directory tree looks like:
|
||||||
|
|
||||||
MySDLApp Home/
|
MySDLApp Home/
|
||||||
MySDLApp.app
|
MySDLApp.app
|
||||||
Documents/
|
Documents/
|
||||||
Library/
|
Library/
|
||||||
Preferences/
|
Preferences/
|
||||||
tmp/
|
tmp/
|
||||||
|
|
||||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
||||||
|
|
||||||
More information on this subject is available here:
|
More information on this subject is available here:
|
||||||
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
||||||
|
|
||||||
|
|
||||||
Notes -- xcFramework
|
Notes -- xcFramework
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
|
The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
|
||||||
|
|
||||||
In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package.
|
In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package.
|
||||||
|
|
||||||
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
|
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
|
||||||
|
|
||||||
This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes.
|
This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes.
|
||||||
|
|
||||||
In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this:
|
In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this:
|
||||||
|
|
||||||
#ifndef SDL_MAIN_HANDLED
|
#ifndef SDL_MAIN_HANDLED
|
||||||
#ifdef main
|
#ifdef main
|
||||||
#undef main
|
#undef main
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
return SDL_UIKitRunApp(argc, argv, SDL_main);
|
return SDL_UIKitRunApp(argc, argv, SDL_main);
|
||||||
}
|
}
|
||||||
#endif /* !SDL_MAIN_HANDLED */
|
#endif /* !SDL_MAIN_HANDLED */
|
||||||
|
|
||||||
Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected:
|
Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected:
|
||||||
|
|
||||||
#include "SDL_main.h"
|
#include "SDL_main.h"
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_main.h>
|
#include <SDL_main.h>
|
||||||
|
|
||||||
|
|
||||||
Notes -- iPhone SDL limitations
|
Notes -- iPhone SDL limitations
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
|
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
|
||||||
|
|
||||||
Textures:
|
Textures:
|
||||||
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
||||||
|
|
||||||
Loading Shared Objects:
|
Loading Shared Objects:
|
||||||
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h.
|
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h.
|
||||||
|
|
||||||
|
|
||||||
Notes -- CoreBluetooth.framework
|
Notes -- CoreBluetooth.framework
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot
|
SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot
|
||||||
more game controller devices, but it requires permission from the user before
|
more game controller devices, but it requires permission from the user before
|
||||||
your app will be able to talk to the Bluetooth hardware. "Made For iOS"
|
your app will be able to talk to the Bluetooth hardware. "Made For iOS"
|
||||||
branded controllers do not need this as we don't have to speak to them
|
branded controllers do not need this as we don't have to speak to them
|
||||||
directly with raw bluetooth, so many apps can live without this.
|
directly with raw bluetooth, so many apps can live without this.
|
||||||
|
|
||||||
You'll need to link with CoreBluetooth.framework and add something like this
|
You'll need to link with CoreBluetooth.framework and add something like this
|
||||||
to your Info.plist:
|
to your Info.plist:
|
||||||
|
|
||||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||||
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
|
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
|
||||||
|
|
||||||
|
|
||||||
Game Center
|
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:
|
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.
|
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.
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
void ShowFrame(void*)
|
void ShowFrame(void*)
|
||||||
{
|
{
|
||||||
... do event handling, frame logic and rendering ...
|
... do event handling, frame logic and rendering ...
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
... initialize game ...
|
... initialize game ...
|
||||||
|
|
||||||
#ifdef __IPHONEOS__
|
#ifdef __IPHONEOS__
|
||||||
// Initialize the Game Center for scoring and matchmaking
|
// Initialize the Game Center for scoring and matchmaking
|
||||||
InitGameCenter();
|
InitGameCenter();
|
||||||
|
|
||||||
// Set up the game to run in the window animation callback on iOS
|
// Set up the game to run in the window animation callback on iOS
|
||||||
// so that Game Center and so forth works correctly.
|
// so that Game Center and so forth works correctly.
|
||||||
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
|
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
|
||||||
#else
|
#else
|
||||||
while ( running ) {
|
while ( running ) {
|
||||||
ShowFrame(0);
|
ShowFrame(0);
|
||||||
DelayFrame();
|
DelayFrame();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Deploying to older versions of iOS
|
Deploying to older versions of iOS
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0
|
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0
|
||||||
|
|
||||||
In order to do that you need to download an older version of Xcode:
|
In order to do that you need to download an older version of Xcode:
|
||||||
https://developer.apple.com/download/more/?name=Xcode
|
https://developer.apple.com/download/more/?name=Xcode
|
||||||
|
|
||||||
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
|
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
|
||||||
|
|
||||||
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
|
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
|
||||||
|
|
||||||
Open your project and set your deployment target to the desired version of iOS
|
Open your project and set your deployment target to the desired version of iOS
|
||||||
|
|
||||||
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
|
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
|
||||||
|
@@ -1,27 +1,27 @@
|
|||||||
KMSDRM on *BSD
|
KMSDRM on *BSD
|
||||||
==================================================
|
==================================================
|
||||||
|
|
||||||
KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen.
|
KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen.
|
||||||
|
|
||||||
WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance.
|
WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance.
|
||||||
|
|
||||||
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
|
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
|
||||||
|
|
||||||
|
|
||||||
SDL2 WSCONS input backend features
|
SDL2 WSCONS input backend features
|
||||||
===================================================
|
===================================================
|
||||||
1. It is keymap-aware; it will work properly with different keymaps.
|
1. It is keymap-aware; it will work properly with different keymaps.
|
||||||
2. It has mouse support.
|
2. It has mouse support.
|
||||||
3. Accent input is supported.
|
3. Accent input is supported.
|
||||||
4. Compose keys are supported.
|
4. Compose keys are supported.
|
||||||
5. AltGr and Meta Shift keys work as intended.
|
5. AltGr and Meta Shift keys work as intended.
|
||||||
|
|
||||||
Partially working or no input on OpenBSD/NetBSD.
|
Partially working or no input on OpenBSD/NetBSD.
|
||||||
==================================================
|
==================================================
|
||||||
|
|
||||||
The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work.
|
The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work.
|
||||||
|
|
||||||
Partially working or no input on FreeBSD.
|
Partially working or no input on FreeBSD.
|
||||||
==================================================
|
==================================================
|
||||||
|
|
||||||
The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices.
|
The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices.
|
||||||
|
@@ -1,96 +1,96 @@
|
|||||||
Linux
|
Linux
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
By default SDL will only link against glibc, the rest of the features will be
|
By default SDL will only link against glibc, the rest of the features will be
|
||||||
enabled dynamically at runtime depending on the available features on the target
|
enabled dynamically at runtime depending on the available features on the target
|
||||||
system. So, for example if you built SDL with XRandR support and the target
|
system. So, for example if you built SDL with XRandR support and the target
|
||||||
system does not have the XRandR libraries installed, it will be disabled
|
system does not have the XRandR libraries installed, it will be disabled
|
||||||
at runtime, and you won't get a missing library error, at least with the
|
at runtime, and you won't get a missing library error, at least with the
|
||||||
default configuration parameters.
|
default configuration parameters.
|
||||||
|
|
||||||
|
|
||||||
Build Dependencies
|
Build Dependencies
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Ubuntu 18.04, all available features enabled:
|
Ubuntu 18.04, all available features enabled:
|
||||||
|
|
||||||
sudo apt-get install build-essential git make autoconf automake libtool \
|
sudo apt-get install build-essential git make autoconf automake libtool \
|
||||||
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
|
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
|
||||||
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-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 \
|
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
|
||||||
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-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
|
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
||||||
|
|
||||||
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libdecor-0-dev` to that command line.
|
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libdecor-0-dev` to that command line.
|
||||||
|
|
||||||
Fedora 35, all available features enabled:
|
Fedora 35, all available features enabled:
|
||||||
|
|
||||||
sudo yum install gcc git-core make cmake autoconf automake libtool \
|
sudo yum install gcc git-core make cmake autoconf automake libtool \
|
||||||
alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \
|
alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \
|
||||||
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
|
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
|
||||||
libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \
|
libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \
|
||||||
systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \
|
systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \
|
||||||
mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \
|
mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \
|
||||||
libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \
|
libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \
|
||||||
libsamplerate-devel pipewire-jack-audio-connection-kit-devel \
|
libsamplerate-devel pipewire-jack-audio-connection-kit-devel \
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
- This includes all the audio targets except arts and esd, because Ubuntu
|
- This includes all the audio targets except arts and esd, because Ubuntu
|
||||||
(and/or Debian) pulled their packages, but in theory SDL still supports them.
|
(and/or Debian) pulled their packages, but in theory SDL still supports them.
|
||||||
The sndio audio target is also unavailable on Fedora.
|
The sndio audio target is also unavailable on Fedora.
|
||||||
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
|
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
|
||||||
for higher-quality audio resampling. SDL will work without it if the library
|
for higher-quality audio resampling. SDL will work without it if the library
|
||||||
is missing, so it's safe to build in support even if the end user doesn't
|
is missing, so it's safe to build in support even if the end user doesn't
|
||||||
have this library installed.
|
have this library installed.
|
||||||
- DirectFB isn't included because the configure script (currently) fails to find
|
- DirectFB isn't included because the configure script (currently) fails to find
|
||||||
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
|
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
|
||||||
configure script to include DirectFB support. Send patches. :)
|
configure script to include DirectFB support. Send patches. :)
|
||||||
|
|
||||||
|
|
||||||
Joystick does not work
|
Joystick does not work
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
If you compiled or are using a version of SDL with udev support (and you should!)
|
If you compiled or are using a version of SDL with udev support (and you should!)
|
||||||
there's a few issues that may cause SDL to fail to detect your joystick. To
|
there's a few issues that may cause SDL to fail to detect your joystick. To
|
||||||
debug this, start by installing the evtest utility. On Ubuntu/Debian:
|
debug this, start by installing the evtest utility. On Ubuntu/Debian:
|
||||||
|
|
||||||
sudo apt-get install evtest
|
sudo apt-get install evtest
|
||||||
|
|
||||||
Then run:
|
Then run:
|
||||||
|
|
||||||
sudo evtest
|
sudo evtest
|
||||||
|
|
||||||
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
|
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
|
||||||
Now run:
|
Now run:
|
||||||
|
|
||||||
cat /dev/input/event/XX
|
cat /dev/input/event/XX
|
||||||
|
|
||||||
If you get a permission error, you need to set a udev rule to change the mode of
|
If you get a permission error, you need to set a udev rule to change the mode of
|
||||||
your device (see below)
|
your device (see below)
|
||||||
|
|
||||||
Also, try:
|
Also, try:
|
||||||
|
|
||||||
sudo udevadm info --query=all --name=input/eventXX
|
sudo udevadm info --query=all --name=input/eventXX
|
||||||
|
|
||||||
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
|
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
|
||||||
you need to set up an udev rule to force this variable.
|
you need to set up an udev rule to force this variable.
|
||||||
|
|
||||||
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
|
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
|
||||||
like:
|
like:
|
||||||
|
|
||||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||||
|
|
||||||
You can set up similar rules for your device by changing the values listed in
|
You can set up similar rules for your device by changing the values listed in
|
||||||
idProduct and idVendor. To obtain these values, try:
|
idProduct and idVendor. To obtain these values, try:
|
||||||
|
|
||||||
sudo udevadm info -a --name=input/eventXX | grep idVendor
|
sudo udevadm info -a --name=input/eventXX | grep idVendor
|
||||||
sudo udevadm info -a --name=input/eventXX | grep idProduct
|
sudo udevadm info -a --name=input/eventXX | grep idProduct
|
||||||
|
|
||||||
If multiple values come up for each of these, the one you want is the first one of each.
|
If multiple values come up for each of these, the one you want is the first one of each.
|
||||||
|
|
||||||
On other systems which ship with an older udev (such as CentOS), you may need
|
On other systems which ship with an older udev (such as CentOS), you may need
|
||||||
to set up a rule such as:
|
to set up a rule such as:
|
||||||
|
|
||||||
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
|
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
|
||||||
|
|
||||||
|
@@ -1,285 +1,285 @@
|
|||||||
# Mac OS X (aka macOS).
|
# Mac OS X (aka macOS).
|
||||||
|
|
||||||
These instructions are for people using Apple's Mac OS X (pronounced
|
These instructions are for people using Apple's Mac OS X (pronounced
|
||||||
"ten"), which in newer versions is just referred to as "macOS".
|
"ten"), which in newer versions is just referred to as "macOS".
|
||||||
|
|
||||||
From the developer's point of view, macOS is a sort of hybrid Mac and
|
From the developer's point of view, macOS is a sort of hybrid Mac and
|
||||||
Unix system, and you have the option of using either traditional
|
Unix system, and you have the option of using either traditional
|
||||||
command line tools or Apple's IDE Xcode.
|
command line tools or Apple's IDE Xcode.
|
||||||
|
|
||||||
# Command Line Build
|
# Command Line Build
|
||||||
|
|
||||||
To build SDL using the command line, use the standard configure and make
|
To build SDL using the command line, use the standard configure and make
|
||||||
process:
|
process:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
../configure
|
../configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
CMake is also known to work, although it continues to be a work in progress:
|
CMake is also known to work, although it continues to be a work in progress:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
You can also build SDL as a Universal library (a single binary for both
|
You can also build SDL as a Universal library (a single binary for both
|
||||||
64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh
|
64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh
|
||||||
script.
|
script.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
CC=$PWD/../build-scripts/clang-fat.sh ../configure
|
CC=$PWD/../build-scripts/clang-fat.sh ../configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0
|
This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0
|
||||||
ABI compatibility on ARM64 architectures. For best compatibility you
|
ABI compatibility on ARM64 architectures. For best compatibility you
|
||||||
should compile your application the same way.
|
should compile your application the same way.
|
||||||
|
|
||||||
Please note that building SDL requires at least Xcode 6 and the 10.9 SDK.
|
Please note that building SDL requires at least Xcode 6 and the 10.9 SDK.
|
||||||
PowerPC support for macOS has been officially dropped as of SDL 2.0.2.
|
PowerPC support for macOS has been officially dropped as of SDL 2.0.2.
|
||||||
32-bit Intel and macOS 10.8 runtime support has been officially dropped as
|
32-bit Intel and macOS 10.8 runtime support has been officially dropped as
|
||||||
of SDL 2.24.0.
|
of SDL 2.24.0.
|
||||||
|
|
||||||
To use the library once it's built, you essential have two possibilities:
|
To use the library once it's built, you essential have two possibilities:
|
||||||
use the traditional autoconf/automake/make method, or use Xcode.
|
use the traditional autoconf/automake/make method, or use Xcode.
|
||||||
|
|
||||||
|
|
||||||
# Caveats for using SDL with Mac OS X
|
# Caveats for using SDL with Mac OS X
|
||||||
|
|
||||||
If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
|
If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
|
||||||
SDL will not register its own. This means that SDL will not terminate using
|
SDL will not register its own. This means that SDL will not terminate using
|
||||||
SDL_Quit if it receives a termination request, it will terminate like a
|
SDL_Quit if it receives a termination request, it will terminate like a
|
||||||
normal app, and it will not send a SDL_DROPFILE when you request to open a
|
normal app, and it will not send a SDL_DROPFILE when you request to open a
|
||||||
file with the app. To solve these issues, put the following code in your
|
file with the app. To solve these issues, put the following code in your
|
||||||
NSApplicationDelegate implementation:
|
NSApplicationDelegate implementation:
|
||||||
|
|
||||||
|
|
||||||
```objc
|
```objc
|
||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||||
{
|
{
|
||||||
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
|
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
event.type = SDL_QUIT;
|
event.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NSTerminateCancel;
|
return NSTerminateCancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||||
{
|
{
|
||||||
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
|
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
event.type = SDL_DROPFILE;
|
event.type = SDL_DROPFILE;
|
||||||
event.drop.file = SDL_strdup([filename UTF8String]);
|
event.drop.file = SDL_strdup([filename UTF8String]);
|
||||||
return (SDL_PushEvent(&event) > 0);
|
return (SDL_PushEvent(&event) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
# Using the Simple DirectMedia Layer with a traditional Makefile
|
# Using the Simple DirectMedia Layer with a traditional Makefile
|
||||||
|
|
||||||
An existing autoconf/automake build system for your SDL app has good chances
|
An existing autoconf/automake build system for your SDL app has good chances
|
||||||
to work almost unchanged on macOS. However, to produce a "real" Mac binary
|
to work almost unchanged on macOS. However, to produce a "real" Mac binary
|
||||||
that you can distribute to users, you need to put the generated binary into a
|
that you can distribute to users, you need to put the generated binary into a
|
||||||
so called "bundle", which is basically a fancy folder with a name like
|
so called "bundle", which is basically a fancy folder with a name like
|
||||||
"MyCoolGame.app".
|
"MyCoolGame.app".
|
||||||
|
|
||||||
To get this build automatically, add something like the following rule to
|
To get this build automatically, add something like the following rule to
|
||||||
your Makefile.am:
|
your Makefile.am:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
bundle_contents = APP_NAME.app/Contents
|
bundle_contents = APP_NAME.app/Contents
|
||||||
APP_NAME_bundle: EXE_NAME
|
APP_NAME_bundle: EXE_NAME
|
||||||
mkdir -p $(bundle_contents)/MacOS
|
mkdir -p $(bundle_contents)/MacOS
|
||||||
mkdir -p $(bundle_contents)/Resources
|
mkdir -p $(bundle_contents)/Resources
|
||||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||||
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
||||||
```
|
```
|
||||||
|
|
||||||
You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is
|
You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is
|
||||||
what will be visible to the user in the Finder. Usually it will be the same
|
what will be visible to the user in the Finder. Usually it will be the same
|
||||||
as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME`
|
as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME`
|
||||||
usually is "TestGame". You might also want to use `@PACKAGE@` to use the
|
usually is "TestGame". You might also want to use `@PACKAGE@` to use the
|
||||||
package name as specified in your configure.ac file.
|
package name as specified in your configure.ac file.
|
||||||
|
|
||||||
If your project builds more than one application, you will have to do a bit
|
If your project builds more than one application, you will have to do a bit
|
||||||
more. For each of your target applications, you need a separate rule.
|
more. For each of your target applications, you need a separate rule.
|
||||||
|
|
||||||
If you want the created bundles to be installed, you may want to add this
|
If you want the created bundles to be installed, you may want to add this
|
||||||
rule to your Makefile.am:
|
rule to your Makefile.am:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
install-exec-hook: APP_NAME_bundle
|
install-exec-hook: APP_NAME_bundle
|
||||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||||
```
|
```
|
||||||
|
|
||||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||||
into "$(DESTDIR)$(prefix)/Applications/".
|
into "$(DESTDIR)$(prefix)/Applications/".
|
||||||
|
|
||||||
Again, if you want to install multiple applications, you will have to augment
|
Again, if you want to install multiple applications, you will have to augment
|
||||||
the make rule accordingly.
|
the make rule accordingly.
|
||||||
|
|
||||||
But beware! That is only part of the story! With the above, you end up with
|
But beware! That is only part of the story! With the above, you end up with
|
||||||
a barebones .app bundle, which is double-clickable from the Finder. But
|
a barebones .app bundle, which is double-clickable from the Finder. But
|
||||||
there are some more things you should do before shipping your product...
|
there are some more things you should do before shipping your product...
|
||||||
|
|
||||||
1. The bundle right now probably is dynamically linked against SDL. That
|
1. The bundle right now probably is dynamically linked against SDL. That
|
||||||
means that when you copy it to another computer, *it will not run*,
|
means that when you copy it to another computer, *it will not run*,
|
||||||
unless you also install SDL on that other computer. A good solution
|
unless you also install SDL on that other computer. A good solution
|
||||||
for this dilemma is to static link against SDL. On OS X, you can
|
for this dilemma is to static link against SDL. On OS X, you can
|
||||||
achieve that by linking against the libraries listed by
|
achieve that by linking against the libraries listed by
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sdl-config --static-libs
|
sdl-config --static-libs
|
||||||
```
|
```
|
||||||
|
|
||||||
instead of those listed by
|
instead of those listed by
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sdl-config --libs
|
sdl-config --libs
|
||||||
```
|
```
|
||||||
|
|
||||||
Depending on how exactly SDL is integrated into your build systems, the
|
Depending on how exactly SDL is integrated into your build systems, the
|
||||||
way to achieve that varies, so I won't describe it here in detail
|
way to achieve that varies, so I won't describe it here in detail
|
||||||
|
|
||||||
2. Add an 'Info.plist' to your application. That is a special XML file which
|
2. Add an 'Info.plist' to your application. That is a special XML file which
|
||||||
contains some meta-information about your application (like some copyright
|
contains some meta-information about your application (like some copyright
|
||||||
information, the version of your app, the name of an optional icon file,
|
information, the version of your app, the name of an optional icon file,
|
||||||
and other things). Part of that information is displayed by the Finder
|
and other things). Part of that information is displayed by the Finder
|
||||||
when you click on the .app, or if you look at the "Get Info" window.
|
when you click on the .app, or if you look at the "Get Info" window.
|
||||||
More information about Info.plist files can be found on Apple's homepage.
|
More information about Info.plist files can be found on Apple's homepage.
|
||||||
|
|
||||||
|
|
||||||
As a final remark, let me add that I use some of the techniques (and some
|
As a final remark, let me add that I use some of the techniques (and some
|
||||||
variations of them) in [Exult](https://github.com/exult/exult) and
|
variations of them) in [Exult](https://github.com/exult/exult) and
|
||||||
[ScummVM](https://github.com/scummvm/scummvm); both are available in source on
|
[ScummVM](https://github.com/scummvm/scummvm); both are available in source on
|
||||||
the net, so feel free to take a peek at them for inspiration!
|
the net, so feel free to take a peek at them for inspiration!
|
||||||
|
|
||||||
|
|
||||||
# Using the Simple DirectMedia Layer with Xcode
|
# Using the Simple DirectMedia Layer with Xcode
|
||||||
|
|
||||||
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
||||||
|
|
||||||
## First steps
|
## First steps
|
||||||
|
|
||||||
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||||
you should unpack the archive manually from the command line:
|
you should unpack the archive manually from the command line:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd [path_to_SDL_source]
|
cd [path_to_SDL_source]
|
||||||
tar zxf Xcode.tar.gz
|
tar zxf Xcode.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
This will create a new folder called Xcode, which you can browse
|
This will create a new folder called Xcode, which you can browse
|
||||||
normally from the Finder.
|
normally from the Finder.
|
||||||
|
|
||||||
## Building the Framework
|
## Building the Framework
|
||||||
|
|
||||||
The SDL Library is packaged as a framework bundle, an organized
|
The SDL Library is packaged as a framework bundle, an organized
|
||||||
relocatable folder hierarchy of executable code, interface headers,
|
relocatable folder hierarchy of executable code, interface headers,
|
||||||
and additional resources. For practical purposes, you can think of a
|
and additional resources. For practical purposes, you can think of a
|
||||||
framework as a more user and system-friendly shared library, whose library
|
framework as a more user and system-friendly shared library, whose library
|
||||||
file behaves more or less like a standard UNIX shared library.
|
file behaves more or less like a standard UNIX shared library.
|
||||||
|
|
||||||
To build the framework, simply open the framework project and build it.
|
To build the framework, simply open the framework project and build it.
|
||||||
By default, the framework bundle "SDL.framework" is installed in
|
By default, the framework bundle "SDL.framework" is installed in
|
||||||
/Library/Frameworks. Therefore, the testers and project stationary expect
|
/Library/Frameworks. Therefore, the testers and project stationary expect
|
||||||
it to be located there. However, it will function the same in any of the
|
it to be located there. However, it will function the same in any of the
|
||||||
following locations:
|
following locations:
|
||||||
|
|
||||||
* ~/Library/Frameworks
|
* ~/Library/Frameworks
|
||||||
* /Local/Library/Frameworks
|
* /Local/Library/Frameworks
|
||||||
* /System/Library/Frameworks
|
* /System/Library/Frameworks
|
||||||
|
|
||||||
## Build Options
|
## Build Options
|
||||||
|
|
||||||
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
||||||
"Deployment" should be used if you aren't tweaking the SDL library.
|
"Deployment" should be used if you aren't tweaking the SDL library.
|
||||||
"Development" should be used to debug SDL apps or the library itself.
|
"Development" should be used to debug SDL apps or the library itself.
|
||||||
|
|
||||||
## Building the Testers
|
## Building the Testers
|
||||||
|
|
||||||
Open the SDLTest project and build away!
|
Open the SDLTest project and build away!
|
||||||
|
|
||||||
## Using the Project Stationary
|
## Using the Project Stationary
|
||||||
|
|
||||||
Copy the stationary to the indicated folders to access it from
|
Copy the stationary to the indicated folders to access it from
|
||||||
the "New Project" and "Add target" menus. What could be easier?
|
the "New Project" and "Add target" menus. What could be easier?
|
||||||
|
|
||||||
## Setting up a new project by hand
|
## Setting up a new project by hand
|
||||||
|
|
||||||
Some of you won't want to use the Stationary so I'll give some tips:
|
Some of you won't want to use the Stationary so I'll give some tips:
|
||||||
|
|
||||||
(this is accurate as of Xcode 12.5.)
|
(this is accurate as of Xcode 12.5.)
|
||||||
|
|
||||||
* Click "File" -> "New" -> "Project...
|
* Click "File" -> "New" -> "Project...
|
||||||
* Choose "macOS" and then "App" from the "Application" section.
|
* Choose "macOS" and then "App" from the "Application" section.
|
||||||
* Fill out the options in the next window. User interface is "XIB" and
|
* Fill out the options in the next window. User interface is "XIB" and
|
||||||
Language is "Objective-C".
|
Language is "Objective-C".
|
||||||
* Remove "main.m" from your project
|
* Remove "main.m" from your project
|
||||||
* Remove "MainMenu.xib" from your project
|
* Remove "MainMenu.xib" from your project
|
||||||
* Remove "AppDelegates.*" from your project
|
* Remove "AppDelegates.*" from your project
|
||||||
* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
||||||
* Add "\$(HOME)/Library/Frameworks" to the frameworks search path
|
* Add "\$(HOME)/Library/Frameworks" to the frameworks search path
|
||||||
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
||||||
* Add your files
|
* Add your files
|
||||||
* Clean and build
|
* Clean and build
|
||||||
|
|
||||||
## Building from command line
|
## Building from command line
|
||||||
|
|
||||||
Use `xcode-build` in the same directory as your .pbxproj file
|
Use `xcode-build` in the same directory as your .pbxproj file
|
||||||
|
|
||||||
## Running your app
|
## Running your app
|
||||||
|
|
||||||
You can send command line args to your app by either invoking it from
|
You can send command line args to your app by either invoking it from
|
||||||
the command line (in *.app/Contents/MacOS) or by entering them in the
|
the command line (in *.app/Contents/MacOS) or by entering them in the
|
||||||
Executables" panel of the target settings.
|
Executables" panel of the target settings.
|
||||||
|
|
||||||
# Implementation Notes
|
# Implementation Notes
|
||||||
|
|
||||||
Some things that may be of interest about how it all works...
|
Some things that may be of interest about how it all works...
|
||||||
|
|
||||||
## Working directory
|
## Working directory
|
||||||
|
|
||||||
In SDL 1.2, the working directory of your SDL app is by default set to its
|
In SDL 1.2, the working directory of your SDL app is by default set to its
|
||||||
parent, but this is no longer the case in SDL 2.0 and later. SDL2 does not
|
parent, but this is no longer the case in SDL 2.0 and later. SDL2 does not
|
||||||
change the working directory, which means it'll be whatever the command line
|
change the working directory, which means it'll be whatever the command line
|
||||||
prompt that launched the program was using, or if launched by double-clicking
|
prompt that launched the program was using, or if launched by double-clicking
|
||||||
in the Finder, it will be "/", the _root of the filesystem_. Plan accordingly!
|
in the Finder, it will be "/", the _root of the filesystem_. Plan accordingly!
|
||||||
You can use SDL_GetBasePath() to find where the program is running from and
|
You can use SDL_GetBasePath() to find where the program is running from and
|
||||||
chdir() there directly.
|
chdir() there directly.
|
||||||
|
|
||||||
|
|
||||||
## You have a Cocoa App!
|
## You have a Cocoa App!
|
||||||
|
|
||||||
Your SDL app is essentially a Cocoa application. When your app
|
Your SDL app is essentially a Cocoa application. When your app
|
||||||
starts up and the libraries finish loading, a Cocoa procedure is called,
|
starts up and the libraries finish loading, a Cocoa procedure is called,
|
||||||
which sets up the working directory and calls your main() method.
|
which sets up the working directory and calls your main() method.
|
||||||
You are free to modify your Cocoa app with generally no consequence
|
You are free to modify your Cocoa app with generally no consequence
|
||||||
to SDL. You cannot, however, easily change the SDL window itself.
|
to SDL. You cannot, however, easily change the SDL window itself.
|
||||||
Functionality may be added in the future to help this.
|
Functionality may be added in the future to help this.
|
||||||
|
|
||||||
# Bug reports
|
# Bug reports
|
||||||
|
|
||||||
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).
|
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).
|
||||||
Please feel free to report bugs there!
|
Please feel free to report bugs there!
|
||||||
|
|
||||||
|
@@ -1,28 +1,28 @@
|
|||||||
# Nintendo 3DS
|
# Nintendo 3DS
|
||||||
|
|
||||||
SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by:
|
SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by:
|
||||||
|
|
||||||
- [Pierre Wendling](https://github.com/FtZPetruska)
|
- [Pierre Wendling](https://github.com/FtZPetruska)
|
||||||
|
|
||||||
Credits to:
|
Credits to:
|
||||||
|
|
||||||
- The awesome people who ported SDL to other homebrew platforms.
|
- The awesome people who ported SDL to other homebrew platforms.
|
||||||
- The Devkitpro team for making all the tools necessary to achieve this.
|
- The Devkitpro team for making all the tools necessary to achieve this.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run:
|
To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release
|
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build
|
cmake --build build
|
||||||
cmake --install build
|
cmake --install build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- Currently only software rendering is supported.
|
- Currently only software rendering is supported.
|
||||||
- SDL2main should be used to ensure ROMFS is enabled.
|
- SDL2main should be used to ensure ROMFS is enabled.
|
||||||
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
||||||
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
||||||
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
|
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
|
||||||
|
@@ -1,103 +1,103 @@
|
|||||||
Native Client
|
Native Client
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
* Native Client SDK (https://developer.chrome.com/native-client),
|
* Native Client SDK (https://developer.chrome.com/native-client),
|
||||||
(tested with Pepper version 33 or higher).
|
(tested with Pepper version 33 or higher).
|
||||||
|
|
||||||
The SDL backend for Chrome's Native Client has been tested only with the PNaCl
|
The SDL backend for Chrome's Native Client has been tested only with the PNaCl
|
||||||
toolchain, which generates binaries designed to run on ARM and x86_32/64
|
toolchain, which generates binaries designed to run on ARM and x86_32/64
|
||||||
platforms. This does not mean it won't work with the other toolchains!
|
platforms. This does not mean it won't work with the other toolchains!
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Building SDL for NaCl
|
Building SDL for NaCl
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Set up the right environment variables (see naclbuild.sh), then configure SDL with:
|
Set up the right environment variables (see naclbuild.sh), then configure SDL with:
|
||||||
|
|
||||||
configure --host=pnacl --prefix some/install/destination
|
configure --host=pnacl --prefix some/install/destination
|
||||||
|
|
||||||
Then "make".
|
Then "make".
|
||||||
|
|
||||||
As an example of how to create a deployable app a Makefile project is provided
|
As an example of how to create a deployable app a Makefile project is provided
|
||||||
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
|
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
|
||||||
provided by NaCl, without which linking properly to SDL won't work (the search
|
provided by NaCl, without which linking properly to SDL won't work (the search
|
||||||
path can't be modified externally, so the linker won't find SDL's binaries unless
|
path can't be modified externally, so the linker won't find SDL's binaries unless
|
||||||
you dump them into the SDK path, which is inconvenient).
|
you dump them into the SDK path, which is inconvenient).
|
||||||
Also provided in test/nacl is the required support file, such as index.html,
|
Also provided in test/nacl is the required support file, such as index.html,
|
||||||
manifest.json, etc.
|
manifest.json, etc.
|
||||||
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
|
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
|
||||||
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
|
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
|
||||||
hiding the asynchronous nature of the browser behind the scenes...which is not the
|
hiding the asynchronous nature of the browser behind the scenes...which is not the
|
||||||
same as making it disappear!
|
same as making it disappear!
|
||||||
|
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Running tests
|
Running tests
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Due to the nature of NaCl programs, building and running SDL tests is not as
|
Due to the nature of NaCl programs, building and running SDL tests is not as
|
||||||
straightforward as one would hope. The script naclbuild.sh in build-scripts
|
straightforward as one would hope. The script naclbuild.sh in build-scripts
|
||||||
automates the process and should serve as a guide for users of SDL trying to build
|
automates the process and should serve as a guide for users of SDL trying to build
|
||||||
their own applications.
|
their own applications.
|
||||||
|
|
||||||
Basic usage:
|
Basic usage:
|
||||||
|
|
||||||
./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
|
./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
|
||||||
|
|
||||||
This will build testgles2.c by default.
|
This will build testgles2.c by default.
|
||||||
|
|
||||||
If you want to build a different test, for example testrendercopyex.c:
|
If you want to build a different test, for example testrendercopyex.c:
|
||||||
|
|
||||||
SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
|
SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
|
||||||
|
|
||||||
Once the build finishes, you have to serve the contents with a web server (the
|
Once the build finishes, you have to serve the contents with a web server (the
|
||||||
script will give you instructions on how to do that with Python).
|
script will give you instructions on how to do that with Python).
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
RWops and nacl_io
|
RWops and nacl_io
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
SDL_RWops work transparently with nacl_io. Two functions control the mount points:
|
SDL_RWops work transparently with nacl_io. Two functions control the mount points:
|
||||||
|
|
||||||
int mount(const char* source, const char* target,
|
int mount(const char* source, const char* target,
|
||||||
const char* filesystemtype,
|
const char* filesystemtype,
|
||||||
unsigned long mountflags, const void *data);
|
unsigned long mountflags, const void *data);
|
||||||
int umount(const char *target);
|
int umount(const char *target);
|
||||||
|
|
||||||
For convenience, SDL will by default mount an httpfs tree at / before calling
|
For convenience, SDL will by default mount an httpfs tree at / before calling
|
||||||
the app's main function. Such setting can be overridden by calling:
|
the app's main function. Such setting can be overridden by calling:
|
||||||
|
|
||||||
umount("/");
|
umount("/");
|
||||||
|
|
||||||
And then mounting a different filesystem at /
|
And then mounting a different filesystem at /
|
||||||
|
|
||||||
It's important to consider that the asynchronous nature of file operations on a
|
It's important to consider that the asynchronous nature of file operations on a
|
||||||
browser is hidden from the application, effectively providing the developer with
|
browser is hidden from the application, effectively providing the developer with
|
||||||
a set of blocking file operations just like you get in a regular desktop
|
a set of blocking file operations just like you get in a regular desktop
|
||||||
environment, which eases the job of porting to Native Client, but also introduces
|
environment, which eases the job of porting to Native Client, but also introduces
|
||||||
a set of challenges of its own, in particular when big file sizes and slow
|
a set of challenges of its own, in particular when big file sizes and slow
|
||||||
connections are involved.
|
connections are involved.
|
||||||
|
|
||||||
For more information on how nacl_io and mount points work, see:
|
For more information on how nacl_io and mount points work, see:
|
||||||
|
|
||||||
https://developer.chrome.com/native-client/devguide/coding/nacl_io
|
https://developer.chrome.com/native-client/devguide/coding/nacl_io
|
||||||
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
|
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
|
||||||
|
|
||||||
To be able to save into the directory "/save/" (like backup of game) :
|
To be able to save into the directory "/save/" (like backup of game) :
|
||||||
|
|
||||||
mount("", "/save", "html5fs", 0, "type=PERSISTENT");
|
mount("", "/save", "html5fs", 0, "type=PERSISTENT");
|
||||||
|
|
||||||
And add to manifest.json :
|
And add to manifest.json :
|
||||||
|
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"unlimitedStorage"
|
"unlimitedStorage"
|
||||||
]
|
]
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
TODO - Known Issues
|
TODO - Known Issues
|
||||||
================================================================================
|
================================================================================
|
||||||
* Testing of all systems with a real application (something other than SDL's tests)
|
* Testing of all systems with a real application (something other than SDL's tests)
|
||||||
* Key events don't seem to work properly
|
* Key events don't seem to work properly
|
||||||
|
|
||||||
|
@@ -1,44 +1,44 @@
|
|||||||
Nokia N-Gage
|
Nokia N-Gage
|
||||||
============
|
============
|
||||||
|
|
||||||
SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
|
SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
|
||||||
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
|
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
|
||||||
|
|
||||||
Compiling
|
Compiling
|
||||||
---------
|
---------
|
||||||
|
|
||||||
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
|
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
|
||||||
The library is included in the
|
The library is included in the
|
||||||
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
|
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
|
||||||
sub-module.
|
sub-module.
|
||||||
|
|
||||||
A complete example project based on SDL2 can be found in the GitHub
|
A complete example project based on SDL2 can be found in the GitHub
|
||||||
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
|
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
|
||||||
|
|
||||||
Current level of implementation
|
Current level of implementation
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
The video driver currently provides full screen video support with
|
The video driver currently provides full screen video support with
|
||||||
keyboard input.
|
keyboard input.
|
||||||
|
|
||||||
At the moment only the software renderer works.
|
At the moment only the software renderer works.
|
||||||
|
|
||||||
Audio is not yet implemented.
|
Audio is not yet implemented.
|
||||||
|
|
||||||
Acknowledgements
|
Acknowledgements
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
|
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
|
||||||
valuable insight into Symbian programming. Without the SDL 1.2 port
|
valuable insight into Symbian programming. Without the SDL 1.2 port
|
||||||
which was specially developed for CDoom (Doom for the Nokia 9210), this
|
which was specially developed for CDoom (Doom for the Nokia 9210), this
|
||||||
adaptation would not have been possible.
|
adaptation would not have been possible.
|
||||||
|
|
||||||
I would like to thank my friends
|
I would like to thank my friends
|
||||||
[Razvan](https://twitter.com/bewarerazvan) and [Dan
|
[Razvan](https://twitter.com/bewarerazvan) and [Dan
|
||||||
Whelan](https://danwhelan.ie/), for their continuous support. Without
|
Whelan](https://danwhelan.ie/), for their continuous support. Without
|
||||||
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
|
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
|
||||||
have lost my patience long ago.
|
have lost my patience long ago.
|
||||||
|
|
||||||
Last but not least, I would like to thank the development team of
|
Last but not least, I would like to thank the development team of
|
||||||
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
|
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
|
||||||
patience and support in troubleshooting helped me a lot.
|
patience and support in troubleshooting helped me a lot.
|
||||||
|
@@ -1,92 +1,92 @@
|
|||||||
Simple DirectMedia Layer 2 for OS/2 & eComStation
|
Simple DirectMedia Layer 2 for OS/2 & eComStation
|
||||||
================================================================================
|
================================================================================
|
||||||
SDL port for OS/2, authored by Andrey Vasilkin <digi@os2.snc.ru>, 2016
|
SDL port for OS/2, authored by Andrey Vasilkin <digi@os2.snc.ru>, 2016
|
||||||
|
|
||||||
|
|
||||||
OpenGL not supported by this port.
|
OpenGL not supported by this port.
|
||||||
|
|
||||||
Additional optional environment variables:
|
Additional optional environment variables:
|
||||||
|
|
||||||
SDL_AUDIO_SHARE
|
SDL_AUDIO_SHARE
|
||||||
Values: 0 or 1, default is 0
|
Values: 0 or 1, default is 0
|
||||||
Initializes the device as shareable or exclusively acquired.
|
Initializes the device as shareable or exclusively acquired.
|
||||||
|
|
||||||
SDL_VIDEODRIVER
|
SDL_VIDEODRIVER
|
||||||
Values: DIVE or VMAN, default is DIVE
|
Values: DIVE or VMAN, default is DIVE
|
||||||
Use video subsystem: Direct interface video extensions (DIVE) or
|
Use video subsystem: Direct interface video extensions (DIVE) or
|
||||||
Video Manager (VMAN).
|
Video Manager (VMAN).
|
||||||
|
|
||||||
You may significantly increase video output speed with OS4 kernel and patched
|
You may significantly increase video output speed with OS4 kernel and patched
|
||||||
files vman.dll and dive.dll or with latest versions of ACPI support and video
|
files vman.dll and dive.dll or with latest versions of ACPI support and video
|
||||||
driver Panorama.
|
driver Panorama.
|
||||||
|
|
||||||
Latest versions of OS/4 kernel:
|
Latest versions of OS/4 kernel:
|
||||||
http://gus.biysk.ru/os4/
|
http://gus.biysk.ru/os4/
|
||||||
(Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4)
|
(Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4)
|
||||||
|
|
||||||
Patched files vman.dll and dive.dll:
|
Patched files vman.dll and dive.dll:
|
||||||
http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR
|
http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR
|
||||||
|
|
||||||
|
|
||||||
Compiling:
|
Compiling:
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see:
|
Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see:
|
||||||
https://github.com/open-watcom/ and https://open-watcom.github.io
|
https://github.com/open-watcom/ and https://open-watcom.github.io
|
||||||
WATCOM environment variable must to be set to the Open Watcom install
|
WATCOM environment variable must to be set to the Open Watcom install
|
||||||
directory. To compile, run: wmake -f Makefile.os2
|
directory. To compile, run: wmake -f Makefile.os2
|
||||||
|
|
||||||
|
|
||||||
Installing:
|
Installing:
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
- eComStation:
|
- eComStation:
|
||||||
|
|
||||||
If you have previously installed SDL2, make a Backup copy of SDL2.dll
|
If you have previously installed SDL2, make a Backup copy of SDL2.dll
|
||||||
located in D:\ecs\dll (where D: is disk on which installed eComStation).
|
located in D:\ecs\dll (where D: is disk on which installed eComStation).
|
||||||
Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll
|
Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll
|
||||||
|
|
||||||
- OS/2:
|
- OS/2:
|
||||||
|
|
||||||
Copy SDL2.dll to any directory on your LIBPATH. If you have a previous
|
Copy SDL2.dll to any directory on your LIBPATH. If you have a previous
|
||||||
version installed, close all SDL2 applications before replacing the old
|
version installed, close all SDL2 applications before replacing the old
|
||||||
copy. Also make sure that any other older versions of DLLs are removed
|
copy. Also make sure that any other older versions of DLLs are removed
|
||||||
from your system.
|
from your system.
|
||||||
|
|
||||||
|
|
||||||
Joysticks in SDL2:
|
Joysticks in SDL2:
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version.
|
The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version.
|
||||||
Here is the original documentation from SDL-1.2:
|
Here is the original documentation from SDL-1.2:
|
||||||
|
|
||||||
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
|
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
|
||||||
and the like). Therefore, if you use a non-standard joystick, you should
|
and the like). Therefore, if you use a non-standard joystick, you should
|
||||||
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
|
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
|
||||||
file or CONFIG.SYS, so SDL applications can provide full capability to your
|
file or CONFIG.SYS, so SDL applications can provide full capability to your
|
||||||
device. The syntax is:
|
device. The syntax is:
|
||||||
|
|
||||||
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
|
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
|
||||||
|
|
||||||
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
|
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
|
||||||
the line should be:
|
the line should be:
|
||||||
|
|
||||||
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
|
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
|
||||||
|
|
||||||
If you want to add spaces in your joystick name, just surround it with
|
If you want to add spaces in your joystick name, just surround it with
|
||||||
quotes or double-quotes:
|
quotes or double-quotes:
|
||||||
|
|
||||||
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
|
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
|
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
|
||||||
|
|
||||||
Note however that Balls and Hats are not supported under OS/2, and the
|
Note however that Balls and Hats are not supported under OS/2, and the
|
||||||
value will be ignored... but it is wise to define these correctly because
|
value will be ignored... but it is wise to define these correctly because
|
||||||
in the future those can be supported.
|
in the future those can be supported.
|
||||||
|
|
||||||
Also the number of buttons is limited to 2 when using two joysticks,
|
Also the number of buttons is limited to 2 when using two joysticks,
|
||||||
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
|
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
|
||||||
and 8 when using a joystick with 2 axes. Notice however these are limitations
|
and 8 when using a joystick with 2 axes. Notice however these are limitations
|
||||||
of the Joystick Port hardware, not OS/2.
|
of the Joystick Port hardware, not OS/2.
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
Pandora
|
Pandora
|
||||||
=====================================================================
|
=====================================================================
|
||||||
|
|
||||||
( http://openpandora.org/ )
|
( http://openpandora.org/ )
|
||||||
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
||||||
support to work on the pandora under the framebuffer. This driver do not have
|
support to work on the pandora under the framebuffer. This driver do not have
|
||||||
input support for now, so if you use it you will have to add your own control code.
|
input support for now, so if you use it you will have to add your own control code.
|
||||||
The video driver name is "pandora" so if you have problem running it from
|
The video driver name is "pandora" so if you have problem running it from
|
||||||
the framebuffer, try to set the following variable before starting your application :
|
the framebuffer, try to set the following variable before starting your application :
|
||||||
"export SDL_VIDEODRIVER=pandora"
|
"export SDL_VIDEODRIVER=pandora"
|
||||||
|
|
||||||
- OpenGL ES support was added to the x11 driver, so it's working like the normal
|
- OpenGL ES support was added to the x11 driver, so it's working like the normal
|
||||||
x11 driver one with OpenGLX support, with SDL input event's etc..
|
x11 driver one with OpenGLX support, with SDL input event's etc..
|
||||||
|
|
||||||
|
|
||||||
David Carré (Cpasjuste)
|
David Carré (Cpasjuste)
|
||||||
cpasjuste@gmail.com
|
cpasjuste@gmail.com
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
Platforms
|
Platforms
|
||||||
=========
|
=========
|
||||||
|
|
||||||
We maintain the list of supported platforms on our wiki now, and how to
|
We maintain the list of supported platforms on our wiki now, and how to
|
||||||
build and install SDL for those platforms:
|
build and install SDL for those platforms:
|
||||||
|
|
||||||
https://wiki.libsdl.org/Installation
|
https://wiki.libsdl.org/Installation
|
||||||
|
|
||||||
|
@@ -1,68 +1,68 @@
|
|||||||
Porting
|
Porting
|
||||||
=======
|
=======
|
||||||
|
|
||||||
* Porting To A New Platform
|
* Porting To A New Platform
|
||||||
|
|
||||||
The first thing you have to do when porting to a new platform, is look at
|
The first thing you have to do when porting to a new platform, is look at
|
||||||
include/SDL_platform.h and create an entry there for your operating system.
|
include/SDL_platform.h and create an entry there for your operating system.
|
||||||
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
|
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
|
||||||
Ideally SDL_platform.h will be able to auto-detect the system it's building
|
Ideally SDL_platform.h will be able to auto-detect the system it's building
|
||||||
on based on C preprocessor symbols.
|
on based on C preprocessor symbols.
|
||||||
|
|
||||||
There are two basic ways of building SDL at the moment:
|
There are two basic ways of building SDL at the moment:
|
||||||
|
|
||||||
1. The "UNIX" way: ./configure; make; make install
|
1. The "UNIX" way: ./configure; make; make install
|
||||||
|
|
||||||
If you have a GNUish system, then you might try this. Edit configure.ac,
|
If you have a GNUish system, then you might try this. Edit configure.ac,
|
||||||
take a look at the large section labelled:
|
take a look at the large section labelled:
|
||||||
|
|
||||||
"Set up the configuration based on the host platform!"
|
"Set up the configuration based on the host platform!"
|
||||||
|
|
||||||
Add a section for your platform, and then re-run autogen.sh and build!
|
Add a section for your platform, and then re-run autogen.sh and build!
|
||||||
|
|
||||||
2. Using an IDE:
|
2. Using an IDE:
|
||||||
|
|
||||||
If you're using an IDE or other non-configure build system, you'll probably
|
If you're using an IDE or other non-configure build system, you'll probably
|
||||||
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
|
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
|
||||||
add a section for your platform, and create a custom SDL_config_{platform}.h,
|
add a section for your platform, and create a custom SDL_config_{platform}.h,
|
||||||
based on SDL_config_minimal.h and SDL_config.h.in
|
based on SDL_config_minimal.h and SDL_config.h.in
|
||||||
|
|
||||||
Add the top level include directory to the header search path, and then add
|
Add the top level include directory to the header search path, and then add
|
||||||
the following sources to the project:
|
the following sources to the project:
|
||||||
|
|
||||||
src/*.c
|
src/*.c
|
||||||
src/atomic/*.c
|
src/atomic/*.c
|
||||||
src/audio/*.c
|
src/audio/*.c
|
||||||
src/cpuinfo/*.c
|
src/cpuinfo/*.c
|
||||||
src/events/*.c
|
src/events/*.c
|
||||||
src/file/*.c
|
src/file/*.c
|
||||||
src/haptic/*.c
|
src/haptic/*.c
|
||||||
src/joystick/*.c
|
src/joystick/*.c
|
||||||
src/power/*.c
|
src/power/*.c
|
||||||
src/render/*.c
|
src/render/*.c
|
||||||
src/render/software/*.c
|
src/render/software/*.c
|
||||||
src/stdlib/*.c
|
src/stdlib/*.c
|
||||||
src/thread/*.c
|
src/thread/*.c
|
||||||
src/timer/*.c
|
src/timer/*.c
|
||||||
src/video/*.c
|
src/video/*.c
|
||||||
src/audio/disk/*.c
|
src/audio/disk/*.c
|
||||||
src/audio/dummy/*.c
|
src/audio/dummy/*.c
|
||||||
src/filesystem/dummy/*.c
|
src/filesystem/dummy/*.c
|
||||||
src/video/dummy/*.c
|
src/video/dummy/*.c
|
||||||
src/haptic/dummy/*.c
|
src/haptic/dummy/*.c
|
||||||
src/joystick/dummy/*.c
|
src/joystick/dummy/*.c
|
||||||
src/main/dummy/*.c
|
src/main/dummy/*.c
|
||||||
src/thread/generic/*.c
|
src/thread/generic/*.c
|
||||||
src/timer/dummy/*.c
|
src/timer/dummy/*.c
|
||||||
src/loadso/dummy/*.c
|
src/loadso/dummy/*.c
|
||||||
|
|
||||||
|
|
||||||
Once you have a working library without any drivers, you can go back to each
|
Once you have a working library without any drivers, you can go back to each
|
||||||
of the major subsystems and start implementing drivers for your platform.
|
of the major subsystems and start implementing drivers for your platform.
|
||||||
|
|
||||||
If you have any questions, don't hesitate to ask on the SDL mailing list:
|
If you have any questions, don't hesitate to ask on the SDL mailing list:
|
||||||
http://www.libsdl.org/mailing-list.php
|
http://www.libsdl.org/mailing-list.php
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
Sam Lantinga (slouken@libsdl.org)
|
Sam Lantinga (slouken@libsdl.org)
|
||||||
|
|
||||||
|
@@ -1,51 +1,51 @@
|
|||||||
PS2
|
PS2
|
||||||
======
|
======
|
||||||
SDL2 port for the Sony Playstation 2 contributed by:
|
SDL2 port for the Sony Playstation 2 contributed by:
|
||||||
- Francisco Javier Trujillo Mata
|
- Francisco Javier Trujillo Mata
|
||||||
|
|
||||||
|
|
||||||
Credit to
|
Credit to
|
||||||
- The guys that ported SDL to PSP & Vita because I'm taking them as reference.
|
- The guys that ported SDL to PSP & Vita because I'm taking them as reference.
|
||||||
- David G. F. for helping me with several issues and tests.
|
- David G. F. for helping me with several issues and tests.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run:
|
To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run:
|
||||||
```bash
|
```bash
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake
|
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake
|
||||||
cmake --build build
|
cmake --build build
|
||||||
cmake --install build
|
cmake --install build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Hints
|
## Hints
|
||||||
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`.
|
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`.
|
||||||
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30.
|
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer.
|
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer.
|
||||||
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
|
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
|
||||||
It could be something similar as:
|
It could be something similar as:
|
||||||
```c
|
```c
|
||||||
.....
|
.....
|
||||||
|
|
||||||
SDL_PS2_SKIP_IOP_RESET();
|
SDL_PS2_SKIP_IOP_RESET();
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
.....
|
.....
|
||||||
```
|
```
|
||||||
For a release binary is recommendable to reset the IOP always.
|
For a release binary is recommendable to reset the IOP always.
|
||||||
|
|
||||||
Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected.
|
Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected.
|
||||||
|
|
||||||
## Getting PS2 Dev
|
## Getting PS2 Dev
|
||||||
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
|
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
|
||||||
|
|
||||||
## Running on PCSX2 Emulator
|
## Running on PCSX2 Emulator
|
||||||
[PCSX2](https://github.com/PCSX2/pcsx2)
|
[PCSX2](https://github.com/PCSX2/pcsx2)
|
||||||
|
|
||||||
[More PCSX2 information](https://pcsx2.net/)
|
[More PCSX2 information](https://pcsx2.net/)
|
||||||
|
|
||||||
## To Do
|
## To Do
|
||||||
- PS2 Screen Keyboard
|
- PS2 Screen Keyboard
|
||||||
- Dialogs
|
- Dialogs
|
||||||
- Others
|
- Others
|
||||||
|
@@ -1,36 +1,36 @@
|
|||||||
PSP
|
PSP
|
||||||
======
|
======
|
||||||
SDL2 port for the Sony PSP contributed by:
|
SDL2 port for the Sony PSP contributed by:
|
||||||
- Captian Lex
|
- Captian Lex
|
||||||
- Francisco Javier Trujillo Mata
|
- Francisco Javier Trujillo Mata
|
||||||
- Wouter Wijsman
|
- Wouter Wijsman
|
||||||
|
|
||||||
|
|
||||||
Credit to
|
Credit to
|
||||||
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
|
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
|
||||||
Geecko for his PSP GU lib "Glib2d"
|
Geecko for his PSP GU lib "Glib2d"
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run:
|
To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run:
|
||||||
```bash
|
```bash
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
|
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
|
||||||
cmake --build build
|
cmake --build build
|
||||||
cmake --install build
|
cmake --install build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Getting PSP Dev
|
## Getting PSP Dev
|
||||||
[Installing PSP Dev](https://github.com/pspdev/pspdev)
|
[Installing PSP Dev](https://github.com/pspdev/pspdev)
|
||||||
|
|
||||||
## Running on PPSSPP Emulator
|
## Running on PPSSPP Emulator
|
||||||
[PPSSPP](https://github.com/hrydgard/ppsspp)
|
[PPSSPP](https://github.com/hrydgard/ppsspp)
|
||||||
|
|
||||||
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
|
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
|
||||||
|
|
||||||
|
|
||||||
## Compiling a HelloWorld
|
## 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
|
## To Do
|
||||||
- PSP Screen Keyboard
|
- PSP Screen Keyboard
|
||||||
- Dialogs
|
- Dialogs
|
||||||
|
@@ -1,180 +1,180 @@
|
|||||||
Raspberry Pi
|
Raspberry Pi
|
||||||
============
|
============
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
Raspbian (other Linux distros may work as well).
|
Raspbian (other Linux distros may work as well).
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Works without X11
|
* Works without X11
|
||||||
* Hardware accelerated OpenGL ES 2.x
|
* Hardware accelerated OpenGL ES 2.x
|
||||||
* Sound via ALSA
|
* Sound via ALSA
|
||||||
* Input (mouse/keyboard/joystick) via EVDEV
|
* Input (mouse/keyboard/joystick) via EVDEV
|
||||||
* Hotplugging of input devices via UDEV
|
* Hotplugging of input devices via UDEV
|
||||||
|
|
||||||
|
|
||||||
Raspbian Build Dependencies
|
Raspbian Build Dependencies
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
||||||
|
|
||||||
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
||||||
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
|
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
|
||||||
|
|
||||||
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
||||||
|
|
||||||
|
|
||||||
NEON
|
NEON
|
||||||
----
|
----
|
||||||
|
|
||||||
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
|
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
|
||||||
that SDL will select some otherwise-disabled highly-optimized code. The
|
that SDL will select some otherwise-disabled highly-optimized code. The
|
||||||
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
|
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
|
||||||
definitely does.
|
definitely does.
|
||||||
|
|
||||||
|
|
||||||
Cross compiling from x86 Linux
|
Cross compiling from x86 Linux
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
To cross compile SDL for Raspbian from your desktop machine, you'll need a
|
To cross compile SDL for Raspbian from your desktop machine, you'll need a
|
||||||
Raspbian system root and the cross compilation tools. We'll assume these tools
|
Raspbian system root and the cross compilation tools. We'll assume these tools
|
||||||
will be placed in /opt/rpi-tools
|
will be placed in /opt/rpi-tools
|
||||||
|
|
||||||
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
||||||
|
|
||||||
You'll also need a Raspbian binary image.
|
You'll also need a Raspbian binary image.
|
||||||
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
||||||
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
|
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
|
||||||
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
||||||
|
|
||||||
export SYSROOT=/opt/rpi-sysroot
|
export SYSROOT=/opt/rpi-sysroot
|
||||||
sudo kpartx -a -v <path_to_raspbian_image>.img
|
sudo kpartx -a -v <path_to_raspbian_image>.img
|
||||||
sudo mount -o loop /dev/mapper/loop0p2 /mnt
|
sudo mount -o loop /dev/mapper/loop0p2 /mnt
|
||||||
sudo cp -r /mnt $SYSROOT
|
sudo cp -r /mnt $SYSROOT
|
||||||
sudo apt-get install qemu binfmt-support qemu-user-static
|
sudo apt-get install qemu binfmt-support qemu-user-static
|
||||||
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
|
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
|
||||||
sudo mount --bind /dev $SYSROOT/dev
|
sudo mount --bind /dev $SYSROOT/dev
|
||||||
sudo mount --bind /proc $SYSROOT/proc
|
sudo mount --bind /proc $SYSROOT/proc
|
||||||
sudo mount --bind /sys $SYSROOT/sys
|
sudo mount --bind /sys $SYSROOT/sys
|
||||||
|
|
||||||
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
|
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
|
||||||
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
|
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
|
||||||
|
|
||||||
sudo chroot $SYSROOT
|
sudo chroot $SYSROOT
|
||||||
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev
|
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev
|
||||||
exit
|
exit
|
||||||
sudo umount $SYSROOT/dev
|
sudo umount $SYSROOT/dev
|
||||||
sudo umount $SYSROOT/proc
|
sudo umount $SYSROOT/proc
|
||||||
sudo umount $SYSROOT/sys
|
sudo umount $SYSROOT/sys
|
||||||
sudo umount /mnt
|
sudo umount /mnt
|
||||||
|
|
||||||
There's one more fix required, as the libdl.so symlink uses an absolute path
|
There's one more fix required, as the libdl.so symlink uses an absolute path
|
||||||
which doesn't quite work in our setup.
|
which doesn't quite work in our setup.
|
||||||
|
|
||||||
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||||
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||||
|
|
||||||
The final step is compiling SDL itself.
|
The final step is compiling SDL itself.
|
||||||
|
|
||||||
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
|
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
|
||||||
cd <SDL SOURCE>
|
cd <SDL SOURCE>
|
||||||
mkdir -p build;cd build
|
mkdir -p build;cd build
|
||||||
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
|
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
||||||
|
|
||||||
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
|
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
|
||||||
|
|
||||||
Apps don't work or poor video/audio performance
|
Apps don't work or poor video/audio performance
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
|
|
||||||
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
|
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
|
||||||
update the RPi's firmware. Note that doing so will fix these problems, but it
|
update the RPi's firmware. Note that doing so will fix these problems, but it
|
||||||
will also render the CMA - Dynamic Memory Split functionality useless.
|
will also render the CMA - Dynamic Memory Split functionality useless.
|
||||||
|
|
||||||
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
|
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
|
||||||
low in general, specially if a 1080p TV is hooked up.
|
low in general, specially if a 1080p TV is hooked up.
|
||||||
|
|
||||||
See here how to configure this setting: http://elinux.org/RPiconfig
|
See here how to configure this setting: http://elinux.org/RPiconfig
|
||||||
|
|
||||||
Using a fixed gpu_mem=128 is the best option (specially if you updated the
|
Using a fixed gpu_mem=128 is the best option (specially if you updated the
|
||||||
firmware, using CMA probably won't work, at least it's the current case).
|
firmware, using CMA probably won't work, at least it's the current case).
|
||||||
|
|
||||||
No input
|
No input
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Make sure you belong to the "input" group.
|
Make sure you belong to the "input" group.
|
||||||
|
|
||||||
sudo usermod -aG input `whoami`
|
sudo usermod -aG input `whoami`
|
||||||
|
|
||||||
No HDMI Audio
|
No HDMI Audio
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
If you notice that ALSA works but there's no audio over HDMI, try adding:
|
If you notice that ALSA works but there's no audio over HDMI, try adding:
|
||||||
|
|
||||||
hdmi_drive=2
|
hdmi_drive=2
|
||||||
|
|
||||||
to your config.txt file and reboot.
|
to your config.txt file and reboot.
|
||||||
|
|
||||||
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
|
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
|
||||||
|
|
||||||
Text Input API support
|
Text Input API support
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
The Text Input API is supported, with translation of scan codes done via the
|
The Text Input API is supported, with translation of scan codes done via the
|
||||||
kernel symbol tables. For this to work, SDL needs access to a valid console.
|
kernel symbol tables. For this to work, SDL needs access to a valid console.
|
||||||
If you notice there's no SDL_TEXTINPUT message being emitted, double check that
|
If you notice there's no SDL_TEXTINPUT message being emitted, double check that
|
||||||
your app has read access to one of the following:
|
your app has read access to one of the following:
|
||||||
|
|
||||||
* /proc/self/fd/0
|
* /proc/self/fd/0
|
||||||
* /dev/tty
|
* /dev/tty
|
||||||
* /dev/tty[0...6]
|
* /dev/tty[0...6]
|
||||||
* /dev/vc/0
|
* /dev/vc/0
|
||||||
* /dev/console
|
* /dev/console
|
||||||
|
|
||||||
This is usually not a problem if you run from the physical terminal (as opposed
|
This is usually not a problem if you run from the physical terminal (as opposed
|
||||||
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
||||||
quick workaround is to run your app as root or add yourself to the tty group,
|
quick workaround is to run your app as root or add yourself to the tty group,
|
||||||
then re-login to the system.
|
then re-login to the system.
|
||||||
|
|
||||||
sudo usermod -aG tty `whoami`
|
sudo usermod -aG tty `whoami`
|
||||||
|
|
||||||
The keyboard layout used by SDL is the same as the one the kernel uses.
|
The keyboard layout used by SDL is the same as the one the kernel uses.
|
||||||
To configure the layout on Raspbian:
|
To configure the layout on Raspbian:
|
||||||
|
|
||||||
sudo dpkg-reconfigure keyboard-configuration
|
sudo dpkg-reconfigure keyboard-configuration
|
||||||
|
|
||||||
To configure the locale, which controls which keys are interpreted as letters,
|
To configure the locale, which controls which keys are interpreted as letters,
|
||||||
this determining the CAPS LOCK behavior:
|
this determining the CAPS LOCK behavior:
|
||||||
|
|
||||||
sudo dpkg-reconfigure locales
|
sudo dpkg-reconfigure locales
|
||||||
|
|
||||||
|
|
||||||
OpenGL problems
|
OpenGL problems
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
If you have desktop OpenGL headers installed at build time in your RPi or cross
|
If you have desktop OpenGL headers installed at build time in your RPi or cross
|
||||||
compilation environment, support for it will be built in. However, the chipset
|
compilation environment, support for it will be built in. However, the chipset
|
||||||
does not actually have support for it, which causes issues in certain SDL apps
|
does not actually have support for it, which causes issues in certain SDL apps
|
||||||
since the presence of OpenGL support supersedes the ES/ES2 variants.
|
since the presence of OpenGL support supersedes the ES/ES2 variants.
|
||||||
The workaround is to disable OpenGL at configuration time:
|
The workaround is to disable OpenGL at configuration time:
|
||||||
|
|
||||||
./configure --disable-video-opengl
|
./configure --disable-video-opengl
|
||||||
|
|
||||||
Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER
|
Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER
|
||||||
environment variable:
|
environment variable:
|
||||||
|
|
||||||
export SDL_RENDER_DRIVER=opengles2
|
export SDL_RENDER_DRIVER=opengles2
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
-----
|
-----
|
||||||
|
|
||||||
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
|
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
|
||||||
leaking into the console only if it has root privileges. Launching apps locally
|
leaking into the console only if it has root privileges. Launching apps locally
|
||||||
does not suffer from this issue.
|
does not suffer from this issue.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,41 +1,41 @@
|
|||||||
RISC OS
|
RISC OS
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
* RISC OS 3.5 or later.
|
* RISC OS 3.5 or later.
|
||||||
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
|
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
|
||||||
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
|
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
|
||||||
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
|
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
|
||||||
|
|
||||||
|
|
||||||
Compiling:
|
Compiling:
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported.
|
Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported.
|
||||||
|
|
||||||
The following commands can be used to build SDL2 for RISC OS using autoconf:
|
The following commands can be used to build SDL2 for RISC OS using autoconf:
|
||||||
|
|
||||||
./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics
|
./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
The following commands can be used to build SDL2 for RISC OS using CMake:
|
The following commands can be used to build SDL2 for RISC OS using CMake:
|
||||||
|
|
||||||
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF
|
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF
|
||||||
cmake --build build-riscos
|
cmake --build build-riscos
|
||||||
cmake --build build-riscos --target install
|
cmake --build build-riscos --target install
|
||||||
|
|
||||||
|
|
||||||
Current level of implementation
|
Current level of implementation
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
|
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
|
||||||
|
|
||||||
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
|
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
|
||||||
|
|
||||||
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
|
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
|
||||||
|
|
||||||
GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake.
|
GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake.
|
||||||
|
|
||||||
The joystick, locale and power APIs are not yet implemented.
|
The joystick, locale and power APIs are not yet implemented.
|
||||||
|
@@ -1,83 +1,86 @@
|
|||||||
Touch
|
Touch
|
||||||
===========================================================================
|
===========================================================================
|
||||||
System Specific Notes
|
System Specific Notes
|
||||||
===========================================================================
|
===========================================================================
|
||||||
Linux:
|
Linux:
|
||||||
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
|
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
|
||||||
|
|
||||||
Mac:
|
Mac:
|
||||||
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
|
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
|
||||||
|
|
||||||
iPhone:
|
iPhone:
|
||||||
Works out of box.
|
Works out of box.
|
||||||
|
|
||||||
Windows:
|
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
|
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
|
===========================================================================
|
||||||
===========================================================================
|
Events
|
||||||
SDL_FINGERDOWN:
|
===========================================================================
|
||||||
Sent when a finger (or stylus) is placed on a touch device.
|
SDL_FINGERDOWN:
|
||||||
Fields:
|
Sent when a finger (or stylus) is placed on a touch device.
|
||||||
* event.tfinger.touchId - the Id of the touch device.
|
Fields:
|
||||||
* event.tfinger.fingerId - the Id of the finger which just went down.
|
* event.tfinger.touchId - the Id of the touch device.
|
||||||
* event.tfinger.x - the x coordinate of the touch (0..1)
|
* event.tfinger.fingerId - the Id of the finger which just went down.
|
||||||
* event.tfinger.y - the y coordinate of the touch (0..1)
|
* event.tfinger.x - the x coordinate of the touch (0..1)
|
||||||
* event.tfinger.pressure - the pressure of the touch (0..1)
|
* event.tfinger.y - the y coordinate of the touch (0..1)
|
||||||
|
* event.tfinger.pressure - the pressure of the touch (0..1)
|
||||||
SDL_FINGERMOTION:
|
|
||||||
Sent when a finger (or stylus) is moved on the touch device.
|
SDL_FINGERMOTION:
|
||||||
Fields:
|
Sent when a finger (or stylus) is moved on the touch device.
|
||||||
Same as SDL_FINGERDOWN but with additional:
|
Fields:
|
||||||
* event.tfinger.dx - change in x coordinate during this motion event.
|
Same as SDL_FINGERDOWN but with additional:
|
||||||
* event.tfinger.dy - change in y coordinate during this motion event.
|
* event.tfinger.dx - change in x coordinate during this motion event.
|
||||||
|
* event.tfinger.dy - change in y coordinate during this motion event.
|
||||||
SDL_FINGERUP:
|
|
||||||
Sent when a finger (or stylus) is lifted from the touch device.
|
SDL_FINGERUP:
|
||||||
Fields:
|
Sent when a finger (or stylus) is lifted from the touch device.
|
||||||
Same as SDL_FINGERDOWN.
|
Fields:
|
||||||
|
Same as SDL_FINGERDOWN.
|
||||||
|
|
||||||
Functions
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
SDL provides the ability to access the underlying SDL_Finger structures.
|
Functions
|
||||||
These structures should _never_ be modified.
|
===========================================================================
|
||||||
|
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||||
The following functions are included from SDL_touch.h
|
These structures should _never_ be modified.
|
||||||
|
|
||||||
To get a SDL_TouchID call SDL_GetTouchDevice(int index).
|
The following functions are included from SDL_touch.h
|
||||||
This returns a SDL_TouchID.
|
|
||||||
IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this!
|
To get a SDL_TouchID call SDL_GetTouchDevice(int index).
|
||||||
|
This returns a SDL_TouchID.
|
||||||
The number of touch devices can be queried with SDL_GetNumTouchDevices().
|
IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this!
|
||||||
|
|
||||||
A SDL_TouchID may be used to get pointers to SDL_Finger.
|
The number of touch devices can be queried with SDL_GetNumTouchDevices().
|
||||||
|
|
||||||
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
|
A SDL_TouchID may be used to get pointers to SDL_Finger.
|
||||||
|
|
||||||
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
|
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
|
||||||
|
|
||||||
float x = event.tfinger.x;
|
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
|
||||||
float y = event.tfinger.y;
|
|
||||||
|
float x = event.tfinger.x;
|
||||||
|
float y = event.tfinger.y;
|
||||||
|
|
||||||
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
|
|
||||||
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
|
|
||||||
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
|
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
|
||||||
As a result, be very careful to check for NULL return values.
|
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
|
||||||
|
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
|
||||||
A SDL_Finger has the following fields:
|
As a result, be very careful to check for NULL return values.
|
||||||
* x, y:
|
|
||||||
The current coordinates of the touch.
|
A SDL_Finger has the following fields:
|
||||||
* pressure:
|
* x, y:
|
||||||
The pressure of the touch.
|
The current coordinates of the touch.
|
||||||
|
* pressure:
|
||||||
|
The pressure of the touch.
|
||||||
Notes
|
|
||||||
===========================================================================
|
|
||||||
For a complete example see test/testgesture.c
|
===========================================================================
|
||||||
|
Notes
|
||||||
Please direct questions/comments to:
|
===========================================================================
|
||||||
jim.tla+sdl_touch@gmail.com
|
For a complete example see test/testgesture.c
|
||||||
(original author, API was changed since)
|
|
||||||
|
Please direct questions/comments to:
|
||||||
|
jim.tla+sdl_touch@gmail.com
|
||||||
|
(original author, API was changed since)
|
||||||
|
@@ -1,60 +1,60 @@
|
|||||||
# Versioning
|
# Versioning
|
||||||
|
|
||||||
## Since 2.23.0
|
## Since 2.23.0
|
||||||
|
|
||||||
SDL follows an "odd/even" versioning policy, similar to GLib, GTK, Flatpak
|
SDL follows an "odd/even" versioning policy, similar to GLib, GTK, Flatpak
|
||||||
and older versions of the Linux kernel:
|
and older versions of the Linux kernel:
|
||||||
|
|
||||||
* The major version (first part) increases when backwards compatibility
|
* The major version (first part) increases when backwards compatibility
|
||||||
is broken, which will happen infrequently.
|
is broken, which will happen infrequently.
|
||||||
|
|
||||||
* If the minor version (second part) is divisible by 2
|
* If the minor version (second part) is divisible by 2
|
||||||
(for example 2.24.x, 2.26.x), this indicates a version of SDL that
|
(for example 2.24.x, 2.26.x), this indicates a version of SDL that
|
||||||
is believed to be stable and suitable for production use.
|
is believed to be stable and suitable for production use.
|
||||||
|
|
||||||
* In stable releases, the patchlevel or micro version (third part)
|
* In stable releases, the patchlevel or micro version (third part)
|
||||||
indicates bugfix releases. Bugfix releases should not add or
|
indicates bugfix releases. Bugfix releases should not add or
|
||||||
remove ABI, so the ".0" release (for example 2.24.0) should be
|
remove ABI, so the ".0" release (for example 2.24.0) should be
|
||||||
forwards-compatible with all the bugfix releases from the
|
forwards-compatible with all the bugfix releases from the
|
||||||
same cycle (for example 2.24.1).
|
same cycle (for example 2.24.1).
|
||||||
|
|
||||||
* The minor version increases when new API or ABI is added, or when
|
* The minor version increases when new API or ABI is added, or when
|
||||||
other significant changes are made. Newer minor versions are
|
other significant changes are made. Newer minor versions are
|
||||||
backwards-compatible, but not fully forwards-compatible.
|
backwards-compatible, but not fully forwards-compatible.
|
||||||
For example, programs built against SDL 2.24.x should work fine
|
For example, programs built against SDL 2.24.x should work fine
|
||||||
with SDL 2.26.x, but programs built against SDL 2.26.x will not
|
with SDL 2.26.x, but programs built against SDL 2.26.x will not
|
||||||
necessarily work with 2.24.x.
|
necessarily work with 2.24.x.
|
||||||
|
|
||||||
* If the minor version (second part) is not divisible by 2
|
* If the minor version (second part) is not divisible by 2
|
||||||
(for example 2.23.x, 2.25.x), this indicates a development prerelease
|
(for example 2.23.x, 2.25.x), this indicates a development prerelease
|
||||||
of SDL that is not suitable for stable software distributions.
|
of SDL that is not suitable for stable software distributions.
|
||||||
Use with caution.
|
Use with caution.
|
||||||
|
|
||||||
* The patchlevel or micro version (third part) increases with
|
* The patchlevel or micro version (third part) increases with
|
||||||
each prerelease.
|
each prerelease.
|
||||||
|
|
||||||
* Each prerelease might add new API and/or ABI.
|
* Each prerelease might add new API and/or ABI.
|
||||||
|
|
||||||
* Prereleases are backwards-compatible with older stable branches.
|
* Prereleases are backwards-compatible with older stable branches.
|
||||||
For example, 2.25.x will be backwards-compatible with 2.24.x.
|
For example, 2.25.x will be backwards-compatible with 2.24.x.
|
||||||
|
|
||||||
* Prereleases are not guaranteed to be backwards-compatible with
|
* Prereleases are not guaranteed to be backwards-compatible with
|
||||||
each other. For example, new API or ABI added in 2.25.1
|
each other. For example, new API or ABI added in 2.25.1
|
||||||
might be removed or changed in 2.25.2.
|
might be removed or changed in 2.25.2.
|
||||||
If this would be a problem for you, please do not use prereleases.
|
If this would be a problem for you, please do not use prereleases.
|
||||||
|
|
||||||
* Only upgrade to a prerelease if you can guarantee that you will
|
* Only upgrade to a prerelease if you can guarantee that you will
|
||||||
promptly upgrade to the stable release that follows it.
|
promptly upgrade to the stable release that follows it.
|
||||||
For example, do not upgrade to 2.23.x unless you will be able to
|
For example, do not upgrade to 2.23.x unless you will be able to
|
||||||
upgrade to 2.24.0 when it becomes available.
|
upgrade to 2.24.0 when it becomes available.
|
||||||
|
|
||||||
* Software distributions that have a freeze policy (in particular Linux
|
* Software distributions that have a freeze policy (in particular Linux
|
||||||
distributions with a release cycle, such as Debian and Fedora)
|
distributions with a release cycle, such as Debian and Fedora)
|
||||||
should usually only package stable releases, and not prereleases.
|
should usually only package stable releases, and not prereleases.
|
||||||
|
|
||||||
## Before 2.23.0
|
## Before 2.23.0
|
||||||
|
|
||||||
Older versions of SDL followed a similar policy, but instead of the
|
Older versions of SDL followed a similar policy, but instead of the
|
||||||
odd/even rule applying to the minor version, it applied to the patchlevel
|
odd/even rule applying to the minor version, it applied to the patchlevel
|
||||||
(micro version, third part). For example, 2.0.22 was a stable release
|
(micro version, third part). For example, 2.0.22 was a stable release
|
||||||
and 2.0.21 was a prerelease.
|
and 2.0.21 was a prerelease.
|
||||||
|
@@ -1,114 +1,114 @@
|
|||||||
Using SDL with Microsoft Visual C++
|
Using SDL with Microsoft Visual C++
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
### by Lion Kimbro with additions by James Turk
|
### by Lion Kimbro with additions by James Turk
|
||||||
|
|
||||||
You can either use the precompiled libraries from the [SDL](https://www.libsdl.org/download.php) web site, or you can build SDL
|
You can either use the precompiled libraries from the [SDL](https://www.libsdl.org/download.php) web site, or you can build SDL
|
||||||
yourself.
|
yourself.
|
||||||
|
|
||||||
### Building SDL
|
### Building SDL
|
||||||
|
|
||||||
0. To build SDL, your machine must, at a minimum, have the DirectX9.0c SDK installed. It may or may not be retrievable from
|
0. To build SDL, your machine must, at a minimum, have the DirectX9.0c SDK installed. It may or may not be retrievable from
|
||||||
the [Microsoft](https://www.microsoft.com) website, so you might need to locate it [online](https://duckduckgo.com/?q=directx9.0c+sdk+download&t=h_&ia=web).
|
the [Microsoft](https://www.microsoft.com) website, so you might need to locate it [online](https://duckduckgo.com/?q=directx9.0c+sdk+download&t=h_&ia=web).
|
||||||
_Editor's note: I've been able to successfully build SDL using Visual Studio 2019 **without** the DX9.0c SDK_
|
_Editor's note: I've been able to successfully build SDL using Visual Studio 2019 **without** the DX9.0c SDK_
|
||||||
|
|
||||||
1. Open the Visual Studio solution file at `./VisualC/SDL.sln`.
|
1. Open the Visual Studio solution file at `./VisualC/SDL.sln`.
|
||||||
|
|
||||||
2. Your IDE will likely prompt you to upgrade this solution file to whatever later version of the IDE you're using. In the `Retarget Projects` dialog,
|
2. Your IDE will likely prompt you to upgrade this solution file to whatever later version of the IDE you're using. In the `Retarget Projects` dialog,
|
||||||
all of the affected project files should be checked allowing you to use the latest `Windows SDK Version` you have installed, along with
|
all of the affected project files should be checked allowing you to use the latest `Windows SDK Version` you have installed, along with
|
||||||
the `Platform Toolset`.
|
the `Platform Toolset`.
|
||||||
|
|
||||||
If you choose *NOT* to upgrade to use the latest `Windows SDK Version` or `Platform Toolset`, then you'll need the `Visual Studio 2010 Platform Toolset`.
|
If you choose *NOT* to upgrade to use the latest `Windows SDK Version` or `Platform Toolset`, then you'll need the `Visual Studio 2010 Platform Toolset`.
|
||||||
|
|
||||||
3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_
|
3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_
|
||||||
panel in the _FileView_ tab), and selecting `Build`.
|
panel in the _FileView_ tab), and selecting `Build`.
|
||||||
|
|
||||||
You may get a few warnings, but you should not get any errors.
|
You may get a few warnings, but you should not get any errors.
|
||||||
|
|
||||||
Later, we will refer to the following `.lib` and `.dll` files that have just been generated:
|
Later, we will refer to the following `.lib` and `.dll` files that have just been generated:
|
||||||
|
|
||||||
- `./VisualC/Win32/Debug/SDL2.dll` or `./VisualC/Win32/Release/SDL2.dll`
|
- `./VisualC/Win32/Debug/SDL2.dll` or `./VisualC/Win32/Release/SDL2.dll`
|
||||||
- `./VisualC/Win32/Debug/SDL2.lib` or `./VisualC/Win32/Release/SDL2.lib`
|
- `./VisualC/Win32/Debug/SDL2.lib` or `./VisualC/Win32/Release/SDL2.lib`
|
||||||
- `./VisualC/Win32/Debug/SDL2main.lib` or `./VisualC/Win32/Release/SDL2main.lib`
|
- `./VisualC/Win32/Debug/SDL2main.lib` or `./VisualC/Win32/Release/SDL2main.lib`
|
||||||
|
|
||||||
_Note for the `x64` versions, just replace `Win32` in the path with `x64`_
|
_Note for the `x64` versions, just replace `Win32` in the path with `x64`_
|
||||||
|
|
||||||
### Creating a Project with SDL
|
### Creating a Project with SDL
|
||||||
|
|
||||||
- Create a project as a `Win32 Application`.
|
- Create a project as a `Win32 Application`.
|
||||||
|
|
||||||
- Create a C++ file for your project.
|
- Create a C++ file for your project.
|
||||||
|
|
||||||
- Set the C runtime to `Multi-threaded DLL` in the menu:
|
- Set the C runtime to `Multi-threaded DLL` in the menu:
|
||||||
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
|
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
|
||||||
|
|
||||||
- Add the SDL `include` directory to your list of includes in the menu:
|
- Add the SDL `include` directory to your list of includes in the menu:
|
||||||
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
|
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
|
||||||
|
|
||||||
*VC7 Specific: Instead of doing this, I find it easier to add the
|
*VC7 Specific: Instead of doing this, I find it easier to add the
|
||||||
include and library directories to the list that VC7 keeps. Do this by
|
include and library directories to the list that VC7 keeps. Do this by
|
||||||
selecting Tools|Options|Projects|VC++ Directories and under the "Show
|
selecting Tools|Options|Projects|VC++ Directories and under the "Show
|
||||||
Directories For:" dropbox select "Include Files", and click the "New
|
Directories For:" dropbox select "Include Files", and click the "New
|
||||||
Directory Icon" and add the [SDLROOT]\\include directory (e.g. If you
|
Directory Icon" and add the [SDLROOT]\\include directory (e.g. If you
|
||||||
installed to c:\\SDL\\ add c:\\SDL\\include). Proceed to change the
|
installed to c:\\SDL\\ add c:\\SDL\\include). Proceed to change the
|
||||||
dropbox selection to "Library Files" and add [SDLROOT]\\lib.*
|
dropbox selection to "Library Files" and add [SDLROOT]\\lib.*
|
||||||
|
|
||||||
The "include directory" I am referring to is the `./include` folder.
|
The "include directory" I am referring to is the `./include` folder.
|
||||||
|
|
||||||
Now we're going to use the files that we had created earlier in the *Build SDL* step.
|
Now we're going to use the files that we had created earlier in the *Build SDL* step.
|
||||||
|
|
||||||
Copy the following file into your Project directory:
|
Copy the following file into your Project directory:
|
||||||
|
|
||||||
- `SDL2.dll`
|
- `SDL2.dll`
|
||||||
|
|
||||||
Add the following files to your project (It is not necessary to copy them to your project directory):
|
Add the following files to your project (It is not necessary to copy them to your project directory):
|
||||||
|
|
||||||
- `SDL2.lib`
|
- `SDL2.lib`
|
||||||
- `SDL2main.lib`
|
- `SDL2main.lib`
|
||||||
|
|
||||||
To add them to your project, right click on your project, and select
|
To add them to your project, right click on your project, and select
|
||||||
`Add files to project`.
|
`Add files to project`.
|
||||||
|
|
||||||
**Instead of adding the files to your project, it is more desirable to add them to the linker options: Project|Properties|Linker|Command Line
|
**Instead of adding the files to your project, it is more desirable to add them to the linker options: Project|Properties|Linker|Command Line
|
||||||
and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration
|
and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration
|
||||||
(e.g. Release,Debug).**
|
(e.g. Release,Debug).**
|
||||||
|
|
||||||
### Hello SDL2
|
### Hello SDL2
|
||||||
|
|
||||||
Here's a sample SDL snippet to verify everything is setup in your IDE:
|
Here's a sample SDL snippet to verify everything is setup in your IDE:
|
||||||
|
|
||||||
```
|
```
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
const int WIDTH = 640;
|
const int WIDTH = 640;
|
||||||
const int HEIGHT = 480;
|
const int HEIGHT = 480;
|
||||||
SDL_Window* window = NULL;
|
SDL_Window* window = NULL;
|
||||||
SDL_Renderer* renderer = NULL;
|
SDL_Renderer* renderer = NULL;
|
||||||
|
|
||||||
SDL_Init(SDL_INIT_VIDEO);
|
SDL_Init(SDL_INIT_VIDEO);
|
||||||
window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN);
|
window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN);
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||||
|
|
||||||
SDL_DestroyRenderer(renderer);
|
SDL_DestroyRenderer(renderer);
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### That's it!
|
### That's it!
|
||||||
|
|
||||||
I hope that this document has helped you get through the most difficult part of using the SDL: installing it.
|
I hope that this document has helped you get through the most difficult part of using the SDL: installing it.
|
||||||
Suggestions for improvements should be posted to the [Github Issues](https://github.com/libsdl-org/SDL/issues).
|
Suggestions for improvements should be posted to the [Github Issues](https://github.com/libsdl-org/SDL/issues).
|
||||||
|
|
||||||
### Credits
|
### Credits
|
||||||
|
|
||||||
Thanks to [Paulus Esterhazy](mailto:pesterhazy@gmx.net), for the work on VC++ port.
|
Thanks to [Paulus Esterhazy](mailto:pesterhazy@gmx.net), for the work on VC++ port.
|
||||||
|
|
||||||
This document was originally called "VisualC.txt", and was written by [Sam Lantinga](mailto:slouken@libsdl.org).
|
This document was originally called "VisualC.txt", and was written by [Sam Lantinga](mailto:slouken@libsdl.org).
|
||||||
|
|
||||||
Later, it was converted to HTML and expanded into the document that you see today by [Lion Kimbro](mailto:snowlion@sprynet.com).
|
Later, it was converted to HTML and expanded into the document that you see today by [Lion Kimbro](mailto:snowlion@sprynet.com).
|
||||||
|
|
||||||
Minor Fixes and Visual C++ 7 Information (In Green) was added by [James Turk](mailto:james@conceptofzero.net)
|
Minor Fixes and Visual C++ 7 Information (In Green) was added by [James Turk](mailto:james@conceptofzero.net)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user