Merge branch 'main' into br_rename_shape_mode_to_shape_type

This commit is contained in:
Sylvain Becker 2023-02-12 21:31:30 +01:00 committed by GitHub
commit 4057e69beb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1164 changed files with 34634 additions and 33578 deletions

58
.clang-tidy Normal file
View file

@ -0,0 +1,58 @@
---
Checks: >
-*,
bugprone-assert-side-effect,
bugprone-assignment-in-if-condition,
bugprone-bool-pointer-implicit-conversion,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-infinite-loop,
bugprone-integer-division,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-not-null-terminated-result,
bugprone-posix-return,
bugprone-redundant-branch-condition,
bugprone-string-literal-with-embedded-nul,
bugprone-suspicious-memset-usage,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-too-small-loop-variable,
bugprone-unused-return-value,
cert-err33-c,
clang-analyzer-core.*,
clang-analyzer-valist.*,
clang-analyzer-unix.Malloc,
google-readability-casting,
misc-misleading-bidirectional,
misc-misleading-identifier,
misc-misplaced-const,
misc-redundant-expression,
objc-*,
performance-type-promotion-in-math-fn,
readability-avoid-const-params-in-decls,
readability-braces-around-statements,
readability-const-return-type,
readability-duplicate-include,
readability-inconsistent-declaration-parameter-name,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-preprocessor,
readability-simplify-boolean-expr
CheckOptions:
- key: bugprone-assert-side-effect.AssertMacros
value: "SDL_assert, SDL_assert_release, SDL_assert_paranoid, SDL_assert_always, SDL_COMPILE_TIME_ASSERT"
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: true
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
value: false # Do not recommend _s functions
FormatStyle: "file"
HeaderFilterRegex: "*.h$"
WarningsAsErrors: ""

View file

@ -4,7 +4,7 @@
root = true
[*.{c,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
[*.{c,cc,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
indent_size = 4
indent_style = space
insert_final_newline = true
@ -13,6 +13,7 @@ trim_trailing_whitespace = true
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
indent_size = 2
indent_style = space
trim_tailing_whitespace = true
[*.xml]
indent_size = 4
@ -63,3 +64,6 @@ tab_width = 4
[{*.bat,*.rc}]
end_of_line = crlf
[*.cocci]'
insert_final_newline = true

16
.github/cmake/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.0)
project(ci_utils C CXX)
set(txt "CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}
CFLAGS=${CMAKE_C_FLAGS}
CXXFLAGS=${CMAKE_CXX_FLAGS}
LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_C_STANDARD_LIBRARIES}
")
message("${txt}")
set(VAR_PATH "/tmp/env.txt" CACHE PATH "Where to write environment file")
message(STATUS "Writing CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS environment to ${VAR_PATH}")
file(WRITE "${VAR_PATH}" "${txt}")

View file

@ -3,7 +3,7 @@ name: Build (Android)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -16,7 +16,7 @@ jobs:
matrix:
platform:
- { name: Android.mk }
- { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" }
- { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64", artifact: "SDL-android-arm64" }
steps:
- uses: actions/checkout@v3
@ -36,9 +36,11 @@ jobs:
- name: Configure (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake -B build \
cmake -S . -B build \
-Wdeprecated -Wdev -Werror \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
-DSDL_WERROR=ON \
-DSDL_CLANG_TIDY=ON \
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
-DSDL_STATIC_PIC=ON \
@ -56,6 +58,10 @@ jobs:
cmake --install build --config Release
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
( cd prefix; find ) | LC_ALL=C sort -u
- name: Package (CPack)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
if: ${{ matrix.platform.name == 'CMake' }}
run: |
@ -72,8 +78,9 @@ jobs:
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.SDL3_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- name: Verify Android.mk
- uses: actions/upload-artifact@v3
if: ${{ matrix.platform.name == 'CMake' }}
run: |
export NDK_MODULE_PATH=${{ env.SDL3_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
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*

View file

@ -3,7 +3,7 @@ name: Build (Emscripten)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -18,16 +18,17 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get install -y ninja-build
- name: Configure CMake
- name: Configure (CMake)
run: |
emcmake cmake -S . -B build \
-Wdeprecated -Wdev -Werror \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix \
-GNinja
- name: Build
- name: Build (CMake)
run: cmake --build build/ --verbose
- name: Run build-time tests
run: |
@ -35,10 +36,13 @@ jobs:
export SDL_TESTS_QUICK=1
# FIXME: enable Emscripten build time tests
# ctest -VV --test-dir build/
- name: Install
- name: Install (CMake)
run: |
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
emcmake cmake -S cmake/test -B cmake_config_build \
@ -47,3 +51,8 @@ jobs:
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
cmake --build cmake_config_build --verbose
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: SDL-emscripten
path: build/dist/SDL3*

72
.github/workflows/haiku.yml vendored Normal file
View file

@ -0,0 +1,72 @@
name: Build (Haiku @QEMU)
on:
# push: # Disabled ci on push because of long build times
pull_request:
paths:
- '**/haiku/*'
- '.github/workflows/haiku.yml'
workflow_dispatch:
jobs:
haiku:
runs-on: ubuntu-latest
name: Haiku
container: docker.io/hectorm/qemu-haiku:latest
steps:
- name: Wait until the VM is ready
run: |
container-init & timeout 600 vmshell exit 0
- name: Setup Haiku dependencies
run: |
vmshell pkgman install -y cmd:cmake cmd:gcc cmd:ld cmd:ninja cmd:pkg_config haiku_devel devel:libgl devel:libglu
- name: Restart VM
run: |
sv force-restart qemu || true
timeout 600 vmshell exit 0
- uses: actions/checkout@v3
- name: Copy project to VM
run: |
vmshell mkdir ./src/
tar -cf - ./ | vmshell tar -xf - -C ./src/
- name: Configure (CMake)
run: |
vmshell cmake -S src -B build -GNinja \
-Wdeprecated -Wdev -Werror \
-DSDL_TESTS=ON \
-DSDL_WERROR=ON \
-DSDL_INSTALL_TESTS=ON \
-DSDL_VENDOR_INFO=Github_Workflow \
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \
-DSDL_TESTS_TIMEOUT_MULTIPLIER=10
- name: Build (CMake)
run: |
vmshell cmake --build ./build/ --config Release --verbose --parallel
- name: Run build-time tests (CMake)
run: |
vmshell ctest -VV --test-dir build/
- name: Install (CMake)
run: |
vmshell cmake --install ./build/ --config Release
- name: Package (CPack)
run: |
vmshell cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
vmshell cmake -S ./src/cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=\$PWD/cmake_prefix
vmshell cmake --build ./cmake_config_build --verbose
- name: Verify sdl3.pc
run: |
vmshell CC=c++ PKG_CONFIG_PATH=\$PWD/cmake_prefix/lib/pkgconfig src/cmake/test/test_pkgconfig.sh
- name: Copy package from VM
run: |
vmshell tar -cf - build/dist/ | tar -xf - -C ./
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: SDL-haiku
path: build/dist/SDL3*

View file

@ -3,7 +3,7 @@ name: Build (iOS/tvOS)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:

View file

@ -3,7 +3,7 @@ name: Build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -19,14 +19,15 @@ jobs:
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, os: ubuntu-20.04, shell: sh }
- { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh }
- { name: MacOS, os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, artifact: 'SDL-mingw32' }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, artifact: 'SDL-mingw64' }
- { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, artifact: 'SDL-msys2-clang32' }
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64, artifact: 'SDL-msys2-clang64' }
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64, artifact: 'SDL-msys2-ucrt64' }
- { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh, artifact: 'SDL-ubuntu20.04' }
- { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh, artifact: 'SDL-ubuntu22.04' }
- { name: MacOS (Framework), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DSDL_FRAMEWORK=ON -DSDL_CLANG_TIDY=OFF', skip_test_pkgconfig: true, artifact: 'SDL-macos-framework' }
- { name: MacOS (GNU prefix), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64" -DCLANG_TIDY_BINARY="$(brew --prefix llvm)/bin/clang-tidy"', artifact: 'SDL-macos-gnu' }
steps:
- name: Set up MSYS2
@ -39,6 +40,7 @@ jobs:
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-pkg-config
${{ matrix.platform.msys-env }}-clang-tools-extra
- name: Setup Linux dependencies
if: runner.os == 'Linux'
@ -60,7 +62,8 @@ jobs:
if: runner.os == 'macOS'
run: |
brew install \
ninja
ninja \
llvm
- uses: actions/checkout@v3
- name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build
@ -69,13 +72,15 @@ jobs:
- name: Configure (CMake)
run: |
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 }}
-Wdeprecated -Wdev -Werror \
-DSDL_TESTS=ON \
-DSDL_WERROR=ON \
-DSDL_INSTALL_TESTS=ON \
-DSDL_VENDOR_INFO="Github Workflow" \
-DSDL_CLANG_TIDY=ON \
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.platform.cmake }}
- name: Build (CMake)
run: |
cmake --build build/ --config Release --verbose --parallel
@ -92,15 +97,25 @@ jobs:
run: |
set -eu
cmake --install build/ --config Release
echo "SDL3_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
( cd cmake_prefix; find . ) | LC_ALL=C sort -u
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DTEST_SHARED=ON \
-DTEST_STATIC=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
-DCMAKE_PREFIX_PATH=$(echo "${{ github.workspace }}/cmake_prefix" | sed -e 's#\\#/#g')
cmake --build cmake_config_build --verbose
- name: Verify sdl3.pc
if: ${{ !matrix.platform.skip_test_pkgconfig }}
run: |
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
export PKG_CONFIG_PATH=$(echo "${{ github.workspace }}/cmake_prefix/lib/pkgconfig" | sed -e 's#\\#/#g')
cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*

View file

@ -3,7 +3,7 @@ name: Build (MSVC)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -15,16 +15,16 @@ jobs:
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: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64', artifact: 'SDL-VC-x64' }
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32', artifact: 'SDL-VC-x86' }
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-VC-static-VCRT-x64' }
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-VC-static-VCRT-x86' }
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64, artifact: 'SDL-clang-cl-x64' }
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32, artifact: 'SDL-clang-cl-x86' }
- { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32' }
- { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-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' }
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0', artifact: 'SDL-VC-UWP' }
steps:
- uses: actions/checkout@v3
@ -44,11 +44,13 @@ jobs:
"""))
- name: Configure (CMake)
run: cmake -S build -B build `
-Wdeprecated -Wdev -Werror `
-DSDL_WERROR=${{ !matrix.platform.nowerror }} `
-DSDL_TESTS=ON `
-DSDL_INSTALL_TESTS=ON `
-DSDL_VENDOR_INFO="Github Workflow" `
-DSDL3_DISABLE_INSTALL=OFF `
-DSDL_DISABLE_INSTALL=OFF `
-DSDL_DISABLE_INSTALL_CPACK=OFF `
${{ matrix.platform.flags }} `
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build (CMake)
@ -62,6 +64,9 @@ jobs:
run: |
echo "SDL3_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
cmake --install build/
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target PACKAGE
- name: Verify CMake configuration files
if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
run: |
@ -76,3 +81,8 @@ jobs:
- name: Build msbuild
if: ${{ matrix.platform.project != '' }}
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*

View file

@ -3,7 +3,7 @@ name: Build (Nintendo 3DS)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -17,9 +17,10 @@ jobs:
run: |
apt update
apt install ninja-build
- name: Configure CMake
- name: Configure (CMake)
run: |
cmake -S . -B build -G Ninja \
-Wdeprecated -Wdev -Werror \
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
@ -27,13 +28,17 @@ jobs:
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build
run: cmake --build build --verbose
- name: Install CMake
- name: Build (CMake)
run: |
cmake --build build --verbose
- name: Install (CMake)
run: |
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
( cd prefix; find ) | LC_ALL=C sort -u
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
@ -42,5 +47,19 @@ jobs:
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
# Not running test_pkgconfig.sh and test_sdlconfig.sh
# as invoking the compiler manually is not supported
- name: Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain
run: |
cmake -S .github/cmake -B /tmp/cmake_extract \
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DVAR_PATH=/tmp/n3ds_env.txt
cat /tmp/n3ds_env.txt >> $GITHUB_ENV
- name: Verify sdl3.pc
run: |
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: SDL-n3ds
path: build/dist/SDL3*

View file

@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
apk update
apk update
apk add cmake gmp mpc1 mpfr4 ninja pkgconf make git
# To be removed once ps2_drivers is part of PS2DEV
@ -32,9 +32,10 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
-DCMAKE_BUILD_TYPE=Release
- name: Build
- name: Build (CMake)
run: cmake --build build --config Release --verbose --parallel
- name: Install (CMake)
run: |
@ -42,10 +43,14 @@ jobs:
cmake --install build/ --config Release
echo "SDL3_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
( cd cmake_prefix; find ) | LC_ALL=C sort -u
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-Wdeprecated -Wdev -Werror \
-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
@ -54,18 +59,11 @@ jobs:
- name: Verify sdl3.pc
run: |
export CC=mips64r5900el-ps2-elf-gcc
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
export PKG_CONFIG_PATH=${{ env.SDL3_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
- uses: actions/upload-artifact@v3
with:
name: tests-${{ steps.slug.outputs.sha8 }}
path: |
build/test
if-no-files-found: error
name: SDL-ps2
path: build/dist/SDL3*

View file

@ -14,24 +14,28 @@ jobs:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
apk update
apk update
apk add cmake gmp mpc1 mpfr4 make pkgconf
- name: Configure CMake
- name: Configure (CMake)
run: |
cmake -S . -B build \
-Wdeprecated -Wdev -Werror \
-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
- name: Build (CMake)
run: cmake --build build --config Release --verbose
- name: Install
- name: Install (CMake)
run: |
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build --config Release
( cd prefix; find ) | LC_ALL=C sort -u
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build \
@ -43,6 +47,11 @@ jobs:
- name: Verify sdl3.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.SDL3_DIR }}/lib/pkgconfig
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: SDL-psp
path: build/dist/SDL3*

View file

@ -3,7 +3,7 @@ name: Build (RISC OS)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -26,6 +26,7 @@ jobs:
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: |
cmake -S . -B build -G Ninja \
-Wdeprecated -Wdev -Werror \
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
-DRISCOS:BOOL=ON \
-DSDL_GCC_ATOMICS=OFF \
@ -43,6 +44,9 @@ jobs:
echo "SDL3_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV
cmake --install build/
( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
@ -51,3 +55,8 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.platform.test_args }}
cmake --build cmake_config_build --verbose
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: SDL-riscos
path: build/dist/SDL3*

View file

@ -1,52 +0,0 @@
name: Build (Sony Playstation Vita)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: sh
jobs:
vita:
runs-on: ubuntu-latest
container:
image: vitasdk/vitasdk:latest
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
apk update
apk add cmake ninja pkgconf bash
- name: Configure CMake
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.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 --verbose
- name: Install CMake
run: |
echo "SDL3_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.SDL3_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
- name: Verify sdl3.pc
run: |
export CC=arm-vita-eabi-gcc
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh

107
.github/workflows/vita.yml vendored Normal file
View file

@ -0,0 +1,107 @@
name: Build (Sony Playstation Vita)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
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: Vita (GLES w/ pib), os: windows-latest, pib: true, artifact: SDL-vita-pib }
- { name: Vita (GLES w/ PVR_PSP2 + gles4vita), os: windows-latest, pvr: true, artifact: SDL-vita-pvr }
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
apk update
apk add cmake ninja pkgconf bash
- name: Configure PVR_PSP2 (GLES)
if: ${{ !!matrix.platform.pvr }}
run: |
pvr_psp2_version=3.9
# Configure PVR_PSP2 headers
wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
unzip /tmp/v$pvr_psp2_version.zip -d/tmp
cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* ${VITASDK}/arm-vita-eabi/include
rm /tmp/v$pvr_psp2_version.zip
# include guard of PVR_PSP2's khrplatform.h does not match the usual one
sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ ${VITASDK}/arm-vita-eabi/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 {} ${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 \
-Wdeprecated -Wdev -Werror \
-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 (CMake)
run: cmake --build build --verbose
- name: Install (CMake)
run: |
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
( cd prefix; find ) | LC_ALL=C sort -u
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
- 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.SDL3_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
- name: Verify sdl3.pc
run: |
export CC=arm-vita-eabi-gcc
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*

View file

@ -3,7 +3,7 @@ name: Build (VM Actions)
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@ -49,6 +49,14 @@ jobs:
run: |
cmake -S . -B build -GNinja \
-Wdeprecated -Wdev -Werror \
-DCMAKE_BUILD_TYPE=Release \
-DSDL_CHECK_REQUIRED_INCLUDES="/usr/local/include" \
-DSDL_CHECK_REQUIRED_LINK_OPTIONS="-L/usr/local/lib"
cmake --build build --verbose -- -j`sysctl -n hw.ncpu`
cmake --build build/ --config Release --verbose -- -j`sysctl -n hw.ncpu`
cmake --build build/ --config Release --target package
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: SDL-freebsd
path: build/dist/SDL3*

39
.gitignore vendored
View file

@ -48,11 +48,6 @@ cmake-build-*
xcuserdata
*.xcworkspace
# for QtCreator
CMakeLists.txt.user
build*/
*.pro.user*
# for Visual C++
.vs
Debug
@ -61,23 +56,23 @@ Release
*.ncb
*.suo
*.sdf
VisualC/tests/controllermap/axis.bmp
VisualC/tests/controllermap/button.bmp
VisualC/tests/controllermap/controllermap.bmp
VisualC/tests/controllermap/controllermap_back.bmp
VisualC/tests/gamepadmap/axis.bmp
VisualC/tests/gamepadmap/button.bmp
VisualC/tests/gamepadmap/gamepadmap.bmp
VisualC/tests/gamepadmap/gamepadmap_back.bmp
VisualC/tests/loopwave/sample.wav
VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
VisualC/tests/testgamecontroller/axis.bmp
VisualC/tests/testgamecontroller/button.bmp
VisualC/tests/testgamecontroller/controllermap.bmp
VisualC/tests/testgamecontroller/controllermap_back.bmp
VisualC/tests/testoverlay2/moose.dat
VisualC/tests/testgamepad/axis.bmp
VisualC/tests/testgamepad/button.bmp
VisualC/tests/testgamepad/gamepadmap.bmp
VisualC/tests/testgamepad/gamepadmap_back.bmp
VisualC/tests/testoverlay/moose.dat
VisualC/tests/testrendertarget/icon.bmp
VisualC/tests/testrendertarget/sample.bmp
VisualC/tests/testscale/icon.bmp
VisualC/tests/testscale/sample.bmp
VisualC/tests/testsprite2/icon.bmp
VisualC/tests/testsprite/icon.bmp
VisualC/tests/testyuv/testyuv.bmp
VisualC-GDK/**/Layout
@ -87,7 +82,7 @@ android-project/.gradle/
test/checkkeys
test/checkkeysthreads
test/controllermap
test/gamepadmap
test/loopwave
test/loopwavequeue
test/testatomic
@ -98,17 +93,17 @@ test/testautomation
test/testbounds
test/testcustomcursor
test/testdisplayinfo
test/testdraw2
test/testdraw
test/testdrawchessboard
test/testdropfile
test/testerror
test/testevdev
test/testfile
test/testfilesystem
test/testgamecontroller
test/testgamepad
test/testgeometry
test/testgesture
test/testgl2
test/testgl
test/testgles
test/testgles2
test/testhaptic
@ -126,7 +121,7 @@ test/testmessage
test/testmouse
test/testmultiaudio
test/testnative
test/testoverlay2
test/testoverlay
test/testplatform
test/testpower
test/testqsort
@ -140,7 +135,7 @@ test/testsem
test/testsensor
test/testshader
test/testshape
test/testsprite2
test/testsprite
test/testspriteminimal
test/teststreaming
test/testsurround
@ -150,6 +145,6 @@ test/testurl
test/testver
test/testviewport
test/testvulkan
test/testwm2
test/testwm
test/testyuv
test/torturethread

View file

@ -1,6 +1,6 @@
projectfullname = SDL
projectshortname = SDL
incsubdir = include
incsubdir = include/SDL3
wikisubdir =
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
mainincludefname = SDL.h
@ -13,4 +13,4 @@ projecturl = https://libsdl.org/
wikiurl = https://wiki.libsdl.org
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
warn_about_missing = 0
wikipreamble = (This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)
wikipreamble = (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)

View file

@ -56,14 +56,11 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c))
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
LOCAL_CFLAGS += \
-Wall -Wextra \
-Wdocumentation \
-Wdocumentation-unknown-command \
-Wmissing-prototypes \
-Wunreachable-code-break \
-Wunneeded-internal-declaration \
@ -91,6 +88,29 @@ LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
###########################
#
# SDL_test static library
#
###########################
LOCAL_MODULE := SDL3_test
LOCAL_MODULE_FILENAME := libSDL3_test
LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
LOCAL_LDLIBS :=
LOCAL_LDFLAGS :=
LOCAL_EXPORT_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)
###########################
#
# SDL static library
@ -110,3 +130,4 @@ LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
include $(BUILD_STATIC_LIBRARY)
$(call import-module,android/cpufeatures)

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,61 +0,0 @@
# Makefile to build the SDL library
INCLUDE = -I./include
CFLAGS = -g -O2 $(INCLUDE)
AR = ar
RANLIB = ranlib
TARGET = libSDL3.a
TESTTARGET = libSDL3_test.a
SOURCES = \
src/*.c \
src/atomic/*.c \
src/audio/*.c \
src/audio/dummy/*.c \
src/cpuinfo/*.c \
src/events/*.c \
src/file/*.c \
src/haptic/*.c \
src/haptic/dummy/*.c \
src/hidapi/*.c \
src/joystick/*.c \
src/joystick/dummy/*.c \
src/loadso/dummy/*.c \
src/power/*.c \
src/filesystem/dummy/*.c \
src/locale/*.c \
src/locale/dummy/*.c \
src/misc/*.c \
src/misc/dummy/*.c \
src/render/*.c \
src/render/software/*.c \
src/sensor/*.c \
src/sensor/dummy/*.c \
src/stdlib/*.c \
src/libm/*.c \
src/thread/*.c \
src/thread/generic/*.c \
src/timer/*.c \
src/timer/dummy/*.c \
src/video/*.c \
src/video/yuv2rgb/*.c \
src/video/dummy/*.c \
TSOURCES = src/test/*.c
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
TOBJECTS= $(shell echo $(TSOURCES) | sed -e 's,\.c,\.o,g')
all: $(TARGET) $(TESTTARGET)
$(TARGET): $(OBJECTS)
$(AR) crv $@ $^
$(RANLIB) $@
$(TESTTARGET): $(TOBJECTS)
$(AR) crv $@ $^
$(RANLIB) $@
clean:
rm -f $(TARGET) $(TESTTARGET) $(OBJECTS) $(TOBJECTS)

View file

@ -6,11 +6,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite", "tests\testsprite\testsprite.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamepad", "tests\testgamepad\testgamepad.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgdk", "tests\testgdk\testgdk.vcxproj", "{1C9A3F71-35A5-4C56-B292-F4375B3C3649}"
EndProject

View file

@ -304,7 +304,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_error.h" />
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gamecontroller.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
@ -332,6 +332,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
<ClInclude Include="..\..\include\SDL3\SDL_quit.h" />
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
@ -353,7 +354,6 @@
<ClInclude Include="..\..\include\SDL3\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_images.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_memory.h" />
@ -403,7 +403,8 @@
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
@ -622,7 +623,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
@ -665,6 +666,7 @@
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_modf.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />

View file

@ -222,7 +222,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_gamecontroller.h">
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_guid.h">
@ -300,6 +300,9 @@
<ClInclude Include="..\..\include\SDL3\SDL_platform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_power.h">
<Filter>API Headers</Filter>
</ClInclude>
@ -363,9 +366,6 @@
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_test_images.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h">
<Filter>API Headers</Filter>
</ClInclude>
@ -483,7 +483,10 @@
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h">
<Filter>haptic</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h">
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h">
<Filter>joystick</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h">
<Filter>joystick</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h">
@ -916,7 +919,7 @@
<ClCompile Include="..\..\src\joystick\controller_type.c">
<Filter>joystick</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c">
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c">
<Filter>joystick</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\SDL_joystick.c">
@ -973,6 +976,9 @@
<ClCompile Include="..\..\src\libm\s_floor.c">
<Filter>libm</Filter>
</ClCompile>
<ClCompile Include="..\..\src\libm\s_modf.c">
<Filter>libm</Filter>
</ClCompile>
<ClCompile Include="..\..\src\libm\s_scalbn.c">
<Filter>libm</Filter>
</ClCompile>

View file

@ -198,11 +198,6 @@
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />

View file

@ -1,6 +1,6 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testgamecontroller.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="testgamepad.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />

View file

@ -28,7 +28,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08305}</ProjectGuid>
<RootNamespace>testgamecontroller</RootNamespace>
<RootNamespace>testgamepad</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -124,7 +124,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -147,7 +147,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -170,7 +170,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -193,7 +193,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -219,7 +219,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -245,7 +245,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -327,7 +327,7 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\controllermap.bmp">
<CopyFileToFolders Include="..\..\..\test\gamepadmap.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
@ -353,7 +353,7 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\controllermap_back.bmp">
<CopyFileToFolders Include="..\..\..\test\gamepadmap_back.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
@ -381,7 +381,7 @@
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testgamepad.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>

View file

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testgamepad.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\controllermap_back.bmp" />
<CopyFileToFolders Include="..\..\..\test\gamepadmap_back.bmp" />
<CopyFileToFolders Include="..\..\..\test\axis.bmp" />
<CopyFileToFolders Include="..\..\..\test\button.bmp" />
<CopyFileToFolders Include="..\..\..\test\controllermap.bmp" />
<CopyFileToFolders Include="..\..\..\test\gamepadmap.bmp" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png">
<Filter>logos</Filter>
</CopyFileToFolders>

View file

@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
<Executable Name="testgamepad.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
@ -22,12 +22,12 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testsprite2"
<ShellVisuals DefaultDisplayName="testgamepad"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testsprite2"
Description="testgamepad"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View file

@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
<Executable Name="testgamepad.exe"
TargetDeviceFamily="XboxOne"
Id="Game" />
</ExecutableList>
@ -16,13 +16,13 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testsprite2"
<ShellVisuals DefaultDisplayName="testgamepad"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
SplashScreenImage="SplashScreenImage.png"
Description="testsprite2"
Description="testgamepad"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View file

@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
<Executable Name="testgamepad.exe"
TargetDeviceFamily="Scarlett"
Id="Game" />
</ExecutableList>
@ -16,13 +16,13 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testsprite2"
<ShellVisuals DefaultDisplayName="testgamepad"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testsprite2"
SplashScreenImage="SplashScreenImage.png"
Description="testgamepad"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -70,7 +70,7 @@ quit(int rc)
{
SDL_free(sprites);
close_audio();
SDL_FreeWAV(wave.sound);
SDL_free(wave.sound);
SDLTest_CommonQuit(state);
/* If rc is 0, just let main return normally rather than calling exit.
* This allows testing of platforms where SDL_main is required and does meaningful cleanup.
@ -87,7 +87,7 @@ open_audio()
device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0);
if (!device) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
SDL_FreeWAV(wave.sound);
SDL_free(wave.sound);
quit(2);
}

View file

@ -28,7 +28,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1C9A3F71-35A5-4C56-B292-F4375B3C3649}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<RootNamespace>testsprite</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -124,7 +124,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -151,7 +151,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -178,7 +178,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -205,7 +205,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -235,7 +235,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -265,7 +265,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>

View file

@ -1,6 +1,6 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testsprite2.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="testsprite.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />

View file

@ -28,7 +28,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{40FB7794-D3C3-4CFE-BCF4-A80C96635682}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<RootNamespace>testsprite</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -124,7 +124,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -151,7 +151,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -178,7 +178,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -205,7 +205,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -235,7 +235,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -265,7 +265,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -333,7 +333,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testsprite.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testsprite.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>

View file

@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
<Executable Name="testsprite.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
@ -22,12 +22,12 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
<ShellVisuals DefaultDisplayName="testsprite"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testgamecontroller"
Description="testsprite"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View file

@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
<Executable Name="testsprite.exe"
TargetDeviceFamily="XboxOne"
Id="Game" />
</ExecutableList>
@ -16,13 +16,13 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
<ShellVisuals DefaultDisplayName="testsprite"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
SplashScreenImage="SplashScreenImage.png"
Description="testgamecontroller"
Description="testsprite"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View file

@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
<Executable Name="testsprite.exe"
TargetDeviceFamily="Scarlett"
Id="Game" />
</ExecutableList>
@ -16,13 +16,13 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
<ShellVisuals DefaultDisplayName="testsprite"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testsprite"
SplashScreenImage="SplashScreenImage.png"
Description="testgamecontroller"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View file

@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3-UWP", "SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDraw2", "TestDraw2\TestDraw2.vcxproj", "{95943BBE-F378-4068-A3FD-DAE1B8309B6E}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw", "testdraw\testdraw.vcxproj", "{95943BBE-F378-4068-A3FD-DAE1B8309B6E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -70,6 +70,7 @@
<ClInclude Include="..\include\SDL3\SDL_opengles2.h" />
<ClInclude Include="..\include\SDL3\SDL_pixels.h" />
<ClInclude Include="..\include\SDL3\SDL_platform.h" />
<ClInclude Include="..\include\SDL3\SDL_platform_defines.h" />
<ClInclude Include="..\include\SDL3\SDL_power.h" />
<ClInclude Include="..\include\SDL3\SDL_quit.h" />
<ClInclude Include="..\include\SDL3\SDL_rect.h" />
@ -121,7 +122,8 @@
<ClInclude Include="..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\src\haptic\windows\SDL_xinputhaptic_c.h" />
<ClInclude Include="..\src\joystick\controller_type.h" />
<ClInclude Include="..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
@ -317,7 +319,7 @@
<ClCompile Include="..\src\hidapi\SDL_hidapi.c" />
<ClCompile Include="..\src\joystick\dummy\SDL_sysjoystick.c" />
<ClCompile Include="..\src\joystick\controller_type.c" />
<ClCompile Include="..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\src\joystick\windows\SDL_dinputjoystick.c" />
@ -837,4 +839,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -108,6 +108,9 @@
<ClInclude Include="..\include\SDL3\SDL_platform.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL3\SDL_platform_defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL3\SDL_power.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -162,7 +165,10 @@
<ClInclude Include="..\include\SDL3\SDL_video.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\SDL_gamecontrollerdb.h">
<ClInclude Include="..\src\joystick\SDL_gamepad_c.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\SDL_gamepad_db.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\disk\SDL_diskaudio.h">
@ -540,7 +546,7 @@
<ClCompile Include="..\src\joystick\dummy\SDL_sysjoystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\SDL_gamecontroller.c">
<ClCompile Include="..\src\joystick\SDL_gamepad.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\SDL_joystick.c">
@ -843,4 +849,4 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
</Project>

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -14,7 +14,7 @@
<mp:PhoneIdentity PhoneProductId="a430d85b-5cf1-4705-9fe1-7da520f91d4b" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>TestDraw2</DisplayName>
<DisplayName>testdraw</DisplayName>
<PublisherDisplayName>Daniel</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
@ -30,12 +30,12 @@
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="TestDraw2.App">
EntryPoint="testdraw.App">
<uap:VisualElements
DisplayName="TestDraw2"
DisplayName="testdraw"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="TestDraw2"
Description="testdraw"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />

View file

@ -37,7 +37,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{95943bbe-f378-4068-a3fd-dae1b8309b6e}</ProjectGuid>
<Keyword>DirectXApp</Keyword>
<RootNamespace>TestDraw2</RootNamespace>
<RootNamespace>testdraw</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
@ -291,11 +291,6 @@
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />
@ -310,7 +305,7 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\..\test\testdraw2.c">
<ClCompile Include="..\..\test\testdraw.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</CompileAsWinRT>
@ -333,4 +328,4 @@
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.targets" />
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.targets" />
</ImportGroup>
</Project>
</Project>

View file

@ -42,7 +42,7 @@
<ClCompile Include="..\..\test\main.cpp">
<Filter>Content</Filter>
</ClCompile>
<ClCompile Include="..\..\test\testdraw2.c">
<ClCompile Include="..\..\test\testdraw.c">
<Filter>Content</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_assert.c">
@ -66,21 +66,6 @@
<ClCompile Include="..\..\src\test\SDL_test_harness.c">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_imageBlit.c">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\test\SDL_test_log.c">
<Filter>Common</Filter>
</ClCompile>
@ -100,4 +85,4 @@
<ItemGroup>
<ResourceCompile Include="..\..\src\main\winrt\SDL3-WinRTResources.rc" />
</ItemGroup>
</Project>
</Project>

View file

@ -12,15 +12,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testato
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation.vcxproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw", "tests\testdraw\testdraw.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl", "tests\testgl\testgl.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08304}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2.vcxproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay", "tests\testoverlay\testoverlay.vcxproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
EndProject
@ -34,19 +34,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscal
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape.vcxproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite", "tests\testsprite\testsprite.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamepad", "tests\testgamepad\testgamepad.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2.vcxproj", "{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\controllermap\controllermap.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08306}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamepadmap", "tests\gamepadmap\gamepadmap.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08306}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvulkan", "tests\testvulkan\testvulkan.vcxproj", "{0D604DFD-AAB6-442C-9368-F91A344146AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm2", "tests\testwm2\testwm2.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\testwm.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testyuv", "tests\testyuv\testyuv.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C97635682}"
EndProject

View file

@ -86,16 +86,16 @@
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(SolutionDir)/../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(SolutionDir)/../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(SolutionDir)/../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)/../src;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
@ -250,7 +250,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_error.h" />
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gamecontroller.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
@ -278,6 +278,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
<ClInclude Include="..\..\include\SDL3\SDL_quit.h" />
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
@ -299,7 +300,6 @@
<ClInclude Include="..\..\include\SDL3\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_images.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_memory.h" />
@ -347,7 +347,8 @@
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
@ -520,7 +521,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
@ -545,6 +546,7 @@
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_modf.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />

View file

@ -219,7 +219,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_gamecontroller.h">
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_guid.h">
@ -297,6 +297,9 @@
<ClInclude Include="..\..\include\SDL3\SDL_platform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_power.h">
<Filter>API Headers</Filter>
</ClInclude>
@ -360,9 +363,6 @@
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_test_images.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h">
<Filter>API Headers</Filter>
</ClInclude>
@ -477,7 +477,10 @@
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h">
<Filter>haptic</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h">
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h">
<Filter>joystick</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h">
<Filter>joystick</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h">
@ -904,7 +907,7 @@
<ClCompile Include="..\..\src\joystick\controller_type.c">
<Filter>joystick</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c">
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c">
<Filter>joystick</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\SDL_joystick.c">
@ -961,6 +964,9 @@
<ClCompile Include="..\..\src\libm\s_floor.c">
<Filter>libm</Filter>
</ClCompile>
<ClCompile Include="..\..\src\libm\s_modf.c">
<Filter>libm</Filter>
</ClCompile>
<ClCompile Include="..\..\src\libm\s_scalbn.c">
<Filter>libm</Filter>
</ClCompile>

View file

@ -160,11 +160,6 @@
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />

View file

@ -39,14 +39,9 @@ else()
return()
endif()
# For compatibility with autotools sdl3-config.cmake, provide SDL3_* variables.
set_and_check(SDL3_PREFIX "${CMAKE_CURRENT_LIST_DIR}/..")
set_and_check(SDL3_EXEC_PREFIX "${CMAKE_CURRENT_LIST_DIR}/..")
set_and_check(SDL3_INCLUDE_DIR "${SDL3_PREFIX}/include")
set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR}")
set_and_check(SDL3_BINDIR "${SDL3_PREFIX}/lib/${_sdl_arch_subdir}")
set_and_check(SDL3_LIBDIR "${SDL3_PREFIX}/lib/${_sdl_arch_subdir}")
set_and_check(_sdl3_prefix "${CMAKE_CURRENT_LIST_DIR}/..")
set(_sdl3_include_dirs "${_sdl3_prefix}/include;${_sdl3_prefix}/include/SDL3")
unset(_sdl3_prefix)
set(SDL3_LIBRARIES SDL3::SDL3)
set(SDL3TEST_LIBRARY SDL3::SDL3_test)
@ -55,6 +50,16 @@ set(SDL3TEST_LIBRARY SDL3::SDL3_test)
# All targets are created, even when some might not be requested though COMPONENTS.
# This is done for compatibility with CMake generated SDL3-target.cmake files.
if(NOT TARGET SDL3::Headers)
add_library(SDL3::Headers INTERFACE IMPORTED)
set_target_properties(SDL3::SDL3
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_sdl3_include_dirs}"
)
endif()
set(SDL3_Headers_FOUND TRUE)
unset(_sdl3_include_dirs)
set(_sdl3_library "${SDL3_LIBDIR}/SDL3.lib")
set(_sdl3_dll_library "${SDL3_BINDIR}/SDL3.dll")
if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}")
@ -62,7 +67,7 @@ if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}")
add_library(SDL3::SDL3 SHARED IMPORTED)
set_target_properties(SDL3::SDL3
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
IMPORTED_IMPLIB "${_sdl3_library}"
IMPORTED_LOCATION "${_sdl3_dll_library}"
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
@ -82,7 +87,7 @@ if(EXISTS "${_sdl3test_library}")
add_library(SDL3::SDL3_test STATIC IMPORTED)
set_target_properties(SDL3::SDL3_test
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
IMPORTED_LOCATION "${_sdl3test_library}"
)
endif()

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08306}</ProjectGuid>
<RootNamespace>controllermap</RootNamespace>
<RootNamespace>gamepadmap</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/controllermap.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/gamepadmap.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -112,7 +112,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/controllermap.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/gamepadmap.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -135,7 +135,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/controllermap.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/gamepadmap.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -161,7 +161,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/controllermap.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/gamepadmap.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -226,7 +226,7 @@
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\test\controllermap.bmp">
<CustomBuild Include="..\..\..\test\gamepadmap.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
@ -244,7 +244,7 @@
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\test\controllermap_back.bmp">
<CustomBuild Include="..\..\..\test\gamepadmap_back.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
@ -264,7 +264,7 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\controllermap.c" />
<ClCompile Include="..\..\..\test\gamepadmap.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View file

@ -202,6 +202,7 @@
<ClCompile Include="..\..\..\test\testautomation_events.c" />
<ClCompile Include="..\..\..\test\testautomation_guid.c" />
<ClCompile Include="..\..\..\test\testautomation_hints.c" />
<ClCompile Include="..\..\..\test\testautomation_images.c" />
<ClCompile Include="..\..\..\test\testautomation_joystick.c" />
<ClCompile Include="..\..\..\test\testautomation_keyboard.c" />
<ClCompile Include="..\..\..\test\testautomation_main.c" />
@ -225,4 +226,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}</ProjectGuid>
<RootNamespace>testdraw2</RootNamespace>
<RootNamespace>testdraw</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/testdraw2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -112,7 +112,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/testdraw2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -135,7 +135,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/testdraw2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -161,7 +161,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/testdraw2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -196,7 +196,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testdraw2.c" />
<ClCompile Include="..\..\..\test\testdraw.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08305}</ProjectGuid>
<RootNamespace>testgamecontroller</RootNamespace>
<RootNamespace>testgamepad</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -112,7 +112,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -135,7 +135,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -161,7 +161,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgamepad.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -226,7 +226,7 @@
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\test\controllermap.bmp">
<CustomBuild Include="..\..\..\test\gamepadmap.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
@ -244,7 +244,7 @@
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\test\controllermap_back.bmp">
<CustomBuild Include="..\..\..\test\gamepadmap_back.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
@ -264,7 +264,7 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testgamepad.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}</ProjectGuid>
<RootNamespace>testgl2</RootNamespace>
<RootNamespace>testgl</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/testgl2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -116,7 +116,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/testgl2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -143,7 +143,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/testgl2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -167,7 +167,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/testgl2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -200,7 +200,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testgl2.c" />
<ClCompile Include="..\..\..\test\testgl.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}</ProjectGuid>
<RootNamespace>testoverlay2</RootNamespace>
<RootNamespace>testoverlay</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/testoverlay2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -112,7 +112,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/testoverlay2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -135,7 +135,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/testoverlay2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -161,7 +161,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/testoverlay2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -216,7 +216,7 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testoverlay2.c" />
<ClCompile Include="..\..\..\test\testoverlay.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{40FB7794-D3C3-4CFE-BCF4-A80C96635682}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<RootNamespace>testsprite</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -112,7 +112,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -135,7 +135,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -161,7 +161,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -216,7 +216,7 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testsprite.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View file

@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5}</ProjectGuid>
<RootNamespace>testwm2</RootNamespace>
<RootNamespace>testwm</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -89,7 +89,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/testwm2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -115,7 +115,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Debug/testwm2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
@ -141,7 +141,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/testwm2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -164,7 +164,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\Release/testwm2.tlb</TypeLibraryName>
<TypeLibraryName>.\Release/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -196,7 +196,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testwm2.c" />
<ClCompile Include="..\..\..\test\testwm.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -7,67 +7,21 @@ This is a list of major changes in SDL's version history.
General:
* SDL headers should now be included as `#include <SDL3/SDL.h>`
* M_PI is no longer defined in SDL_stdinc.h, now the symbols SDL_PI_D (double) and SDL_PI_F (float) are available
* SDL_GetWindowWMInfo() returns a standard int result code instead of SDL_bool, and takes SDL_SYSWM_CURRENT_VERSION as a new third parameter
* Many functions and symbols have changed since SDL 2.0, see the [migration guide](docs/README-migration.md) for details
* The preprocessor symbol __MACOSX__ has been renamed __MACOS__
* The preprocessor symbol __IPHONEOS__ has been renamed __IOS__
* The following macros have been renamed:
* RW_SEEK_CUR -> SDL_RW_SEEK_CUR
* RW_SEEK_END -> SDL_RW_SEEK_END
* RW_SEEK_SET -> SDL_RW_SEEK_SET
* The following functions have been renamed:
* Removed the following functions from the API, see docs/README-migration.md for details:
* SDL_CalculateGammaRamp()
* SDL_CreateRGBSurface()
* SDL_CreateRGBSurfaceFrom()
* SDL_CreateRGBSurfaceWithFormat()
* SDL_CreateRGBSurfaceWithFormatFrom()
* SDL_GameControllerGetSensorDataWithTimestamp()
* SDL_GetRevisionNumber()
* SDL_GetWindowBrightness()
* SDL_GetWindowGammaRamp()
* SDL_RWFromFP()
* SDL_SensorGetDataWithTimestamp()
* SDL_SetWindowBrightness()
* SDL_SetWindowGammaRamp()
* Removed the following hints from the API, see docs/README-migration.md for details:
* SDL_HINT_IDLE_TIMER_DISABLED
* SDL_HINT_VIDEO_X11_FORCE_EGL
* SDL_HINT_VIDEO_X11_XINERAMA
* SDL_HINT_VIDEO_X11_XVIDMODE
* Renamed hints 'SDL_HINT_VIDEODRIVER' and 'SDL_HINT_AUDIODRIVER' to 'SDL_HINT_VIDEO_DRIVER' and 'SDL_HINT_AUDIO_DRIVER'
* Renamed environment variables 'SDL_VIDEODRIVER' and 'SDL_AUDIODRIVER' to 'SDL_VIDEO_DRIVER' and 'SDL_AUDIO_DRIVER'
* SDL_stdinc.h no longer includes stdio.h, stdlib.h, etc., it only provides the SDL C runtime functionality
* Added SDL_CreateSurface() and SDL_CreateSurfaceFrom() which replace the SDL_CreateRGBSurface*(), and can also be used to create YUV surfaces
* Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
* Removed 'SDL_GL_CONTEXT_EGL' from OpenGL configuration attributes
* SDL_intrin.h now includes the intrinsics headers that were in SDL_cpuinfo.h
* Added SDL_CreateSurface() and SDL_CreateSurfaceFrom() which replace SDL_CreateRGBSurface*(), and can also be used to create YUV surfaces
* Added SDL_GetJoysticks(), SDL_GetJoystickInstanceName(), SDL_GetJoystickInstancePath(), SDL_GetJoystickInstancePlayerIndex(), SDL_GetJoystickInstanceGUID(), SDL_GetJoystickInstanceVendor(), SDL_GetJoystickInstanceProduct(), SDL_GetJoystickInstanceProductVersion(), and SDL_GetJoystickInstanceType() to directly query the list of available joysticks
* Added SDL_GetGamepads(), SDL_GetGamepadInstanceName(), SDL_GetGamepadInstancePath(), SDL_GetGamepadInstancePlayerIndex(), SDL_GetGamepadInstanceGUID(), SDL_GetGamepadInstanceVendor(), SDL_GetGamepadInstanceProduct(), SDL_GetGamepadInstanceProductVersion(), and SDL_GetGamepadInstanceType() to directly query the list of available gamepads
* Added SDL_GetSensors(), SDL_GetSensorInstanceName(), SDL_GetSensorInstanceType(), and SDL_GetSensorInstanceNonPortableType() to directly query the list of available sensors
* SDL_GetTicks() now returns a 64-bit value and the tick values should be directly compared instead of using the SDL_TICKS_PASSED macro
* Added SDL_GetTicksNS() to return the number of nanoseconds since the SDL library initialized
* Added SDL_DelayNS() to specify a delay in nanoseconds, to the highest precision the system will support
* The timestamp member of the SDL_Event structure is now in nanoseconds, filled in with the time the event was generated, or the time it was queued if that's not available
* The `SDL_DISPLAYEVENT_*` and `SDL_WINDOWEVENT_*` events have been moved to top level events
* Intrinsic headers are no longer included in the public SDL headers
* The following enums have been renamed:
* KMOD_ALT => SDL_KMOD_ALT
* KMOD_CAPS => SDL_KMOD_CAPS
* KMOD_CTRL => SDL_KMOD_CTRL
* KMOD_GUI => SDL_KMOD_GUI
* KMOD_LALT => SDL_KMOD_LALT
* KMOD_LCTRL => SDL_KMOD_LCTRL
* KMOD_LGUI => SDL_KMOD_LGUI
* KMOD_LSHIFT => SDL_KMOD_LSHIFT
* KMOD_MODE => SDL_KMOD_MODE
* KMOD_NONE => SDL_KMOD_NONE
* KMOD_NUM => SDL_KMOD_NUM
* KMOD_RALT => SDL_KMOD_RALT
* KMOD_RCTRL => SDL_KMOD_RCTRL
* KMOD_RESERVED => SDL_KMOD_RESERVED
* KMOD_RGUI => SDL_KMOD_RGUI
* KMOD_RSHIFT => SDL_KMOD_RSHIFT
* KMOD_SCROLL => SDL_KMOD_SCROLL
* KMOD_SHIFT => SDL_KMOD_SHIFT
* ShapeModeBinarizeAlpha => SDL_SHAPETYPE_BINARIZE_ALPHA
* ShapeModeColorKey => SDL_SHAPETYPE_COLORKEY
* ShapeModeDefault => SDL_SHAPETYPE_DEFAULT
* ShapeModeReverseBinarizeAlpha => SDL_SHAPETYPE_REVERSE_BINARIZE_ALPHA
* WindowShapeMode => SDL_WindowShapeType
* Added SDL_modf() and SDL_modff() to separate the whole and fractional portions of a floating point number
* Added SDL_aligned_alloc() and SDL_aligned_free() to allocate and free memory with a given alignment
* Added SDL_GetRenderVSync() to get vsync of the given renderer
* Added SDL_PlayAudioDevice() to start audio playback
* Added SDL_ConvertAudioSamples() to convert audio samples from one format to another

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -1,43 +0,0 @@
==============================================================================
About the iPhone OS Demo Applications
==============================================================================
Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 3.0 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script.
Common files:
common.c and common.h contain code common to all demo applications. This includes functions about delta timing (in seconds), simple error handling, and functions for generating random numbers.
Rectangles (rectangles.c):
Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFillRect. This is the simplest of all the demos.
Happy (happy.c):
Loads the classic happy-face bitmap and draws a large number of happy faces bouncing around the screen. Shows how you can load a bitmap into an SDL_Texture.
Accelerometer (accelerometer.c):
Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen. Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_ios.h) which converts between the Sint16 number returned by SDL_JoystickGetAxis, and the floating point units of g-force reported natively by the iPhone.
Touch (touch.c):
Acts as a finger-paint type program. Demonstrates how you can use SDL mouse input to accept touch input from the iPhone. If SDL for iPhone is compiled with multitouch as multiple mouse emulation (SDL_IPHONE_MULTIPLE_MICE in SDL_config_ios.h) then the program will accept multiple finger inputs simultaneously.
Mixer (mixer.c):
Displays several rectangular buttons which can be used as a virtual drumkit. Demonstrates how you can play .wav sounds in SDL and how you can use SDL_MixAudioFormat to build a software mixer that can play multiple sounds at once.
Keyboard (keyboard.c):
Loads a bitmap font and let's the user type words, numbers, and symbols using the iPhone's virtual keyboard. The iPhone's onscreen keyboard visibility is toggled when the user taps the screen. If the user types ':)' a happy face is displayed. Demonstrates how to use functions added to the iPhone implementation of SDL to toggle keyboard onscreen visibility.
Fireworks (fireworks.c):
Displays a fireworks show. When you tap the iPhone's screen, fireworks fly from the bottom of the screen and explode at the point that you tapped. Demonstrates how you can use SDL on iPhone to build an OpenGL ES based application. Shows you how you can use SDL_LoadBMP to load a bmp image and convert it to an OpenGL ES texture. Of lesser importance, shows how you can use OpenGL ES point sprites to build an efficient particle system.
==============================================================================
Building and Running the demos
==============================================================================
Before building the demos you must first build SDL as a static library for BOTH the iPhone Simulator and the iPhone itself. See the iPhone SDL main README file for directions on how to do this. Once this is done, simply launch XCode, select the target you'd like to build, select the active SDK (simulator or device), and then build and go.

View file

@ -1,14 +0,0 @@
//
// config.xcconfig
// SDL tests
//
// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
// Include any optional config for this build
#include? "build.xcconfig"
CONFIG_FRAMEWORK_LDFLAGS[sdk=macos*] = $(inherited) -framework SDL3 -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreHaptics -framework CoreVideo -framework ForceFeedback -framework GameController -framework IOKit -framework Metal
CONFIG_FRAMEWORK_LDFLAGS[sdk=iphone*] = $(inherited) -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit
CONFIG_FRAMEWORK_LDFLAGS[sdk=appletv*] = $(inherited) -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

View file

@ -1,258 +0,0 @@
__ _ _
/ _| | | | |
| |_ ___ _ __ | |_ _ __ __ _ ___| | __
| _/ _ \| '_ \| __| '_ \ / _` |/ __| |/ /
| || (_) | | | | |_| |_) | (_| | (__| <
|_| \___/|_| |_|\__| .__/ \__,_|\___|_|\_\
| |
|_|
----------------------------------------------------------------------
Product : font-pack.zip
Website : http://www.spicypixel.net
Author : Marc Russell
Released: 16th January 2008
----------------------------------------------------------------------
What is this?
-------------
font-pack is a package of free art assets to be used under the terms of this document. It is available to game developers and hobbyists alike.
Contents
--------
The contents of the font-pack ZIP file include 20 bitmap fonts
Usage License & Restrictions
----------------------------
font-pack is distributed under the "Common Public License Version 1.0."
The terms of which are given below. If you do not understand the terms of the license please refer to a solicitor. It should however, be relatively clear how this package can be used.
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial code and
documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from
and are distributed by that particular Contributor. A Contribution
'originates' from a Contributor if it was added to the Program by
such Contributor itself or anyone acting on such Contributor's
behalf. Contributions do not include additions to the Program which:
(i) are separate modules of software distributed in conjunction with
the Program under their own license agreement, and (ii) are not
derivative works of the Program.
"Contributor" means any person or entity that distributes the Program.
"Licensed Patents " mean patent claims licensable by a Contributor which
are necessarily infringed by the use or sale of its Contribution alone
or when combined with the Program.
"Program" means the Contributions distributed in accordance with this
Agreement.
"Recipient" means anyone who receives the Program under this Agreement,
including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free copyright
license to reproduce, prepare derivative works of, publicly display,
publicly perform, distribute and sublicense the Contribution of such
Contributor, if any, and such derivative works, in source code and
object code form.
b) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free patent
license under Licensed Patents to make, use, sell, offer to sell,
import and otherwise transfer the Contribution of such Contributor,
if any, in source code and object code form. This patent license
shall apply to the combination of the Contribution and the Program
if, at the time the Contribution is added by the Contributor, such
addition of the Contribution causes such combination to be covered
by the Licensed Patents. The patent license shall not apply to any
other combinations which include the Contribution. No hardware per
se is licensed hereunder.
c) Recipient understands that although each Contributor grants the
licenses to its Contributions set forth herein, no assurances are
provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity.
Each Contributor disclaims any liability to Recipient for claims
brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, each Recipient hereby assumes
sole responsibility to secure any other intellectual property rights
needed, if any. For example, if a third party patent license is
required to allow Recipient to distribute the Program, it is
Recipient's responsibility to acquire that license before
distributing the Program.
d) Each Contributor represents that to its knowledge it has
sufficient copyright rights in its Contribution, if any, to grant
the copyright license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form
under its own license agreement, provided that:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all
warranties and conditions, express and implied, including warranties
or conditions of title and non-infringement, and implied warranties
or conditions of merchantability and fitness for a particular
purpose;
ii) effectively excludes on behalf of all Contributors all liability
for damages, including direct, indirect, special, incidental and
consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are
offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a reasonable
manner on or through a medium customarily used for software
exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the
Program.
Contributors may not remove or alter any copyright notices contained
within the Program.
Each Contributor must identify itself as the originator of its
Contribution, if any, in a manner that reasonably allows subsequent
Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities
with respect to end users, business partners and the like. While this
license is intended to facilitate the commercial use of the Program, the
Contributor who includes the Program in a commercial product offering
should do so in a manner which does not create potential liability for
other Contributors. Therefore, if a Contributor includes the Program in
a commercial product offering, such Contributor ("Commercial
Contributor") hereby agrees to defend and indemnify every other
Contributor ("Indemnified Contributor") against any losses, damages and
costs (collectively "Losses") arising from claims, lawsuits and other
legal actions brought by a third party against the Indemnified
Contributor to the extent caused by the acts or omissions of such
Commercial Contributor in connection with its distribution of the
Program in a commercial product offering. The obligations in this
section do not apply to any claims or Losses relating to any actual or
alleged intellectual property infringement. In order to qualify, an
Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial
Contributor to control, and cooperate with the Commercial Contributor
in, the defense and any related settlement negotiations. The Indemnified
Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor's responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those
performance claims and warranties, and if a court requires any other
Contributor to pay any damages as a result, the Commercial Contributor
must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES
OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
A PARTICULAR PURPOSE. Each Recipient is solely responsible for
determining the appropriateness of using and distributing the Program
and assumes all risks associated with its exercise of rights under this
Agreement, including but not limited to the risks and costs of program
errors, compliance with applicable laws, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further action
by the parties hereto, such provision shall be reformed to the minimum
extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against a Contributor with
respect to a patent applicable to software (including a cross-claim or
counterclaim in a lawsuit), then any patent licenses granted by that
Contributor to such Recipient under this Agreement shall terminate as of
the date such litigation is filed. In addition, if Recipient institutes
patent litigation against any entity (including a cross-claim or
counterclaim in a lawsuit) alleging that the Program itself (excluding
combinations of the Program with other software or hardware) infringes
such Recipient's patent(s), then such Recipient's rights granted under
Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails
to comply with any of the material terms or conditions of this Agreement
and does not cure such failure in a reasonable period of time after
becoming aware of such noncompliance. If all Recipient's rights under
this Agreement terminate, Recipient agrees to cease use and distribution
of the Program as soon as reasonably practicable. However, Recipient's
obligations under this Agreement and any licenses granted by Recipient
relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement,
but in order to avoid inconsistency the Agreement is copyrighted and may
only be modified in the following manner. The Agreement Steward reserves
the right to publish new versions (including revisions) of this
Agreement from time to time. No one other than the Agreement Steward has
the right to modify this Agreement. IBM is the initial Agreement
Steward. IBM may assign the responsibility to serve as the Agreement
Steward to a suitable separate entity. Each new version of the Agreement
will be given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the
Agreement under which it was received. In addition, after a new version
of the Agreement is published, Contributor may elect to distribute the
Program (including its Contributions) under the new version. Except as
expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
rights or licenses to the intellectual property of any Contributor under
this Agreement, whether expressly, by implication, estoppel or
otherwise. All rights in the Program not expressly granted under this
Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the
intellectual property laws of the United States of America. No party to
this Agreement will bring a legal action under this Agreement more than
one year after the cause of action arose. Each party waives its rights
to a jury trial in any resulting litigation.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Default.png" translatesAutoresizingMaskIntoConstraints="NO" id="VeL-6u-rS3"/>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="VeL-6u-rS3" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="C5X-Vg-tvO"/>
<constraint firstAttribute="trailing" secondItem="VeL-6u-rS3" secondAttribute="trailing" id="X4i-1U-3JE"/>
<constraint firstItem="VeL-6u-rS3" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="dSu-2l-DcF"/>
<constraint firstItem="VeL-6u-rS3" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="xKC-uj-bxE"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52" y="374.66266866566718"/>
</scene>
</scenes>
<resources>
<image name="Default.png" width="320" height="480"/>
</resources>
</document>

View file

@ -1,225 +0,0 @@
/*
* accelerometer.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <math.h>
#include "common.h"
#define DAMPING 0.5f; /* after bouncing off a wall, damping coefficient determines final speed */
#define FRICTION 0.0008f /* coefficient of acceleration that opposes direction of motion */
#define GRAVITY_CONSTANT 0.004f /* how sensitive the ship is to the accelerometer */
/* If we aren't on an iPhone, then this definition ought to yield reasonable behavior */
#ifndef SDL_IPHONE_MAX_GFORCE
#define SDL_IPHONE_MAX_GFORCE 5.0f
#endif
static SDL_Joystick *accelerometer; /* used for controlling the ship */
static struct
{
float x, y; /* position of ship */
float vx, vy; /* velocity of ship (in pixels per millesecond) */
SDL_Rect rect; /* (drawn) position and size of ship */
} shipData;
static SDL_Texture *ship = 0; /* texture for spaceship */
static SDL_Texture *space = 0; /* texture for space (background */
void
render(SDL_Renderer *renderer, int w, int h, double deltaTime)
{
double deltaMilliseconds = deltaTime * 1000;
float speed;
/* get joystick (accelerometer) axis values and normalize them */
float ax = SDL_JoystickGetAxis(accelerometer, 0);
float ay = SDL_JoystickGetAxis(accelerometer, 1);
/* ship screen constraints */
Uint32 minx = 0.0f;
Uint32 maxx = w - shipData.rect.w;
Uint32 miny = 0.0f;
Uint32 maxy = h - shipData.rect.h;
#define SINT16_MAX ((float)(0x7FFF))
/* update velocity from accelerometer
the factor SDL_IPHONE_MAX_G_FORCE / SINT16_MAX converts between
SDL's units reported from the joytick, and units of g-force, as reported by the accelerometer
*/
shipData.vx +=
ax * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
deltaMilliseconds;
shipData.vy +=
ay * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
deltaMilliseconds;
speed = SDL_sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy);
if (speed > 0) {
/* compensate for friction */
float dirx = shipData.vx / speed; /* normalized x velocity */
float diry = shipData.vy / speed; /* normalized y velocity */
/* update velocity due to friction */
if (speed - FRICTION * deltaMilliseconds > 0) {
/* apply friction */
shipData.vx -= dirx * FRICTION * deltaMilliseconds;
shipData.vy -= diry * FRICTION * deltaMilliseconds;
} else {
/* applying friction would MORE than stop the ship, so just stop the ship */
shipData.vx = 0.0f;
shipData.vy = 0.0f;
}
}
/* update ship location */
shipData.x += shipData.vx * deltaMilliseconds;
shipData.y += shipData.vy * deltaMilliseconds;
if (shipData.x > maxx) {
shipData.x = maxx;
shipData.vx = -shipData.vx * DAMPING;
} else if (shipData.x < minx) {
shipData.x = minx;
shipData.vx = -shipData.vx * DAMPING;
}
if (shipData.y > maxy) {
shipData.y = maxy;
shipData.vy = -shipData.vy * DAMPING;
} else if (shipData.y < miny) {
shipData.y = miny;
shipData.vy = -shipData.vy * DAMPING;
}
/* draw the background */
SDL_RenderCopy(renderer, space, NULL, NULL);
/* draw the ship */
shipData.rect.x = shipData.x;
shipData.rect.y = shipData.y;
SDL_RenderCopy(renderer, ship, NULL, &shipData.rect);
/* update screen */
SDL_RenderPresent(renderer);
}
void
initializeTextures(SDL_Renderer *renderer)
{
SDL_Surface *bmp_surface;
/* load the ship */
bmp_surface = SDL_LoadBMP("ship.bmp");
if (bmp_surface == NULL) {
fatalError("could not ship.bmp");
}
/* set blue to transparent on the ship */
SDL_SetColorKey(bmp_surface, 1,
SDL_MapRGB(bmp_surface->format, 0, 0, 255));
/* create ship texture from surface */
ship = SDL_CreateTextureFromSurface(renderer, bmp_surface);
if (ship == NULL) {
fatalError("could not create ship texture");
}
SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND);
/* set the width and height of the ship from the surface dimensions */
shipData.rect.w = bmp_surface->w;
shipData.rect.h = bmp_surface->h;
SDL_FreeSurface(bmp_surface);
/* load the space background */
bmp_surface = SDL_LoadBMP("space.bmp");
if (bmp_surface == NULL) {
fatalError("could not load space.bmp");
}
/* create space texture from surface */
space = SDL_CreateTextureFromSurface(renderer, bmp_surface);
if (space == NULL) {
fatalError("could not create space texture");
}
SDL_FreeSurface(bmp_surface);
}
int
main(int argc, char *argv[])
{
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
int done; /* should we clean up and exit? */
int w, h;
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
fatalError("Could not initialize SDL");
}
/* create main window and renderer */
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, NULL, 0);
SDL_GetWindowSize(window, &w, &h);
SDL_RenderSetLogicalSize(renderer, w, h);
/* print out some info about joysticks and try to open accelerometer for use */
printf("There are %d joysticks available\n", SDL_NumJoysticks());
printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0));
accelerometer = SDL_JoystickOpen(0);
if (accelerometer == NULL) {
fatalError("Could not open joystick (accelerometer)");
}
printf("joystick number of axis = %d\n",
SDL_JoystickNumAxes(accelerometer));
printf("joystick number of hats = %d\n",
SDL_JoystickNumHats(accelerometer));
printf("joystick number of buttons = %d\n",
SDL_JoystickNumButtons(accelerometer));
/* load graphics */
initializeTextures(renderer);
/* setup ship */
shipData.x = (w - shipData.rect.w) / 2;
shipData.y = (h - shipData.rect.h) / 2;
shipData.vx = 0.0f;
shipData.vy = 0.0f;
done = 0;
/* enter main loop */
while (!done) {
double deltaTime = updateDeltaTime();
SDL_Event event;
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
}
}
render(renderer, w, h, deltaTime);
SDL_Delay(1);
}
/* delete textures */
SDL_DestroyTexture(ship);
SDL_DestroyTexture(space);
/* shutdown SDL */
SDL_Quit();
return 0;
}

View file

@ -1,56 +0,0 @@
/*
* common.c
* written by Holmes Futrell
* use however you want
*/
#include "common.h"
#include <SDL3/SDL.h>
#include <stdlib.h>
/*
Produces a random int x, min <= x <= max
following a uniform distribution
*/
int
randomInt(int min, int max)
{
return min + rand() % (max - min + 1);
}
/*
Produces a random float x, min <= x <= max
following a uniform distribution
*/
float
randomFloat(float min, float max)
{
return rand() / (float) RAND_MAX *(max - min) + min;
}
void
fatalError(const char *string)
{
printf("%s: %s\n", string, SDL_GetError());
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, string, SDL_GetError(), NULL);
exit(1);
}
static Uint64 prevTime = 0;
double
updateDeltaTime(void)
{
Uint64 curTime;
double deltaTime;
if (prevTime == 0) {
prevTime = SDL_GetPerformanceCounter();
}
curTime = SDL_GetPerformanceCounter();
deltaTime = (double) (curTime - prevTime) / (double) SDL_GetPerformanceFrequency();
prevTime = curTime;
return deltaTime;
}

View file

@ -1,10 +0,0 @@
/*
* common.h
* written by Holmes Futrell
* use however you want
*/
extern int randomInt(int min, int max);
extern float randomFloat(float min, float max);
extern void fatalError(const char *string);
extern double updateDeltaTime(void);

View file

@ -1,477 +0,0 @@
/*
* fireworks.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_opengles.h>
#include "common.h"
#include <math.h>
#include <stdlib.h>
#include <time.h>
#define ACCEL 0.0001f /* acceleration due to gravity, units in pixels per millesecond squared */
#define WIND_RESISTANCE 0.00005f /* acceleration per unit velocity due to wind resistance */
#define MAX_PARTICLES 2000 /* maximum number of particles displayed at once */
static GLuint particleTextureID; /* OpenGL particle texture id */
static SDL_bool pointSizeExtensionSupported; /* is GL_OES_point_size_array supported ? */
static float pointSizeScale;
/*
used to describe what type of particle a given struct particle is.
emitter - this particle flies up, shooting off trail particles, then finally explodes into dust particles.
trail - shoots off, following emitter particle
dust - radiates outwards from emitter explosion
*/
enum particleType
{
emitter = 0,
trail,
dust
};
/*
struct particle is used to describe each particle displayed on screen
*/
struct particle
{
GLfloat x; /* x position of particle */
GLfloat y; /* y position of particle */
GLubyte color[4]; /* rgba color of particle */
GLfloat size; /* size of particle in pixels */
GLfloat xvel; /* x velocity of particle in pixels per milesecond */
GLfloat yvel; /* y velocity of particle in pixels per millescond */
int isActive; /* if not active, then particle is overwritten */
enum particleType type; /* see enum particleType */
} particles[MAX_PARTICLES]; /* this array holds all our particles */
static int num_active_particles; /* how many members of the particle array are actually being drawn / animated? */
static int screen_w, screen_h;
/* function declarations */
void spawnTrailFromEmitter(struct particle *emitter);
void spawnEmitterParticle(GLfloat x, GLfloat y);
void explodeEmitter(struct particle *emitter);
void initializeParticles(void);
void initializeTexture();
int nextPowerOfTwo(int x);
void drawParticles();
void stepParticles(double deltaTime);
/* helper function (used in texture loading)
returns next power of two greater than or equal to x
*/
int
nextPowerOfTwo(int x)
{
int val = 1;
while (val < x) {
val *= 2;
}
return val;
}
/*
steps each active particle by timestep deltaTime
*/
void
stepParticles(double deltaTime)
{
float deltaMilliseconds = deltaTime * 1000;
int i;
struct particle *slot = particles;
struct particle *curr = particles;
for (i = 0; i < num_active_particles; i++) {
/* is the particle actually active, or is it marked for deletion? */
if (curr->isActive) {
/* is the particle off the screen? */
if (curr->y > screen_h) {
curr->isActive = 0;
} else if (curr->y < 0) {
curr->isActive = 0;
}
if (curr->x > screen_w) {
curr->isActive = 0;
} else if (curr->x < 0) {
curr->isActive = 0;
}
/* step velocity, then step position */
curr->yvel += ACCEL * deltaMilliseconds;
curr->xvel += 0.0f;
curr->y += curr->yvel * deltaMilliseconds;
curr->x += curr->xvel * deltaMilliseconds;
/* particle behavior */
if (curr->type == emitter) {
/* if we're an emitter, spawn a trail */
spawnTrailFromEmitter(curr);
/* if we've reached our peak, explode */
if (curr->yvel > 0.0) {
explodeEmitter(curr);
}
} else {
float speed =
SDL_sqrt(curr->xvel * curr->xvel + curr->yvel * curr->yvel);
/* if wind resistance is not powerful enough to stop us completely,
then apply winde resistance, otherwise just stop us completely */
if (WIND_RESISTANCE * deltaMilliseconds < speed) {
float normx = curr->xvel / speed;
float normy = curr->yvel / speed;
curr->xvel -=
normx * WIND_RESISTANCE * deltaMilliseconds;
curr->yvel -=
normy * WIND_RESISTANCE * deltaMilliseconds;
} else {
curr->xvel = curr->yvel = 0; /* stop particle */
}
if (curr->color[3] <= deltaMilliseconds * 0.1275f) {
/* if this next step will cause us to fade out completely
then just mark for deletion */
curr->isActive = 0;
} else {
/* otherwise, let's fade a bit more */
curr->color[3] -= deltaMilliseconds * 0.1275f;
}
/* if we're a dust particle, shrink our size */
if (curr->type == dust) {
curr->size -= deltaMilliseconds * 0.010f;
}
}
/* if we're still active, pack ourselves in the array next
to the last active guy (pack the array tightly) */
if (curr->isActive) {
*(slot++) = *curr;
}
} /* endif (curr->isActive) */
curr++;
}
/* the number of active particles is computed as the difference between
old number of active particles, where slot points, and the
new size of the array, where particles points */
num_active_particles = (int) (slot - particles);
}
/*
This draws all the particles shown on screen
*/
void
drawParticles()
{
/* draw the background */
glClear(GL_COLOR_BUFFER_BIT);
/* set up the position and color pointers */
glVertexPointer(2, GL_FLOAT, sizeof(struct particle), particles);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(struct particle),
particles[0].color);
if (pointSizeExtensionSupported) {
/* pass in our array of point sizes */
glPointSizePointerOES(GL_FLOAT, sizeof(struct particle),
&(particles[0].size));
}
/* draw our particles! */
glDrawArrays(GL_POINTS, 0, num_active_particles);
}
/*
This causes an emitter to explode in a circular bloom of dust particles
*/
void
explodeEmitter(struct particle *emitter)
{
/* first off, we're done with this particle, so turn active off */
emitter->isActive = 0;
int i;
for (i = 0; i < 200; i++) {
if (num_active_particles >= MAX_PARTICLES) {
return;
}
/* come up with a random angle and speed for new particle */
float theta = randomFloat(0, 2.0f * 3.141592);
float exponent = 3.0f;
float speed = randomFloat(0.00, SDL_powf(0.17, exponent));
speed = SDL_powf(speed, 1.0f / exponent);
/* select the particle at the end of our array */
struct particle *p = &particles[num_active_particles];
/* set the particles properties */
p->xvel = speed * SDL_cos(theta);
p->yvel = speed * SDL_sin(theta);
p->x = emitter->x + emitter->xvel;
p->y = emitter->y + emitter->yvel;
p->isActive = 1;
p->type = dust;
p->size = 15 * pointSizeScale;
/* inherit emitter's color */
p->color[0] = emitter->color[0];
p->color[1] = emitter->color[1];
p->color[2] = emitter->color[2];
p->color[3] = 255;
/* our array has expanded at the end */
num_active_particles++;
}
}
/*
This spawns a trail particle from an emitter
*/
void
spawnTrailFromEmitter(struct particle *emitter)
{
if (num_active_particles >= MAX_PARTICLES) {
return;
}
/* select the particle at the slot at the end of our array */
struct particle *p = &particles[num_active_particles];
/* set position and velocity to roughly that of the emitter */
p->x = emitter->x + randomFloat(-3.0, 3.0);
p->y = emitter->y + emitter->size / 2.0f;
p->xvel = emitter->xvel + randomFloat(-0.005, 0.005);
p->yvel = emitter->yvel + 0.1;
/* set the color to a random-ish orangy type color */
p->color[0] = (0.8f + randomFloat(-0.1, 0.0)) * 255;
p->color[1] = (0.4f + randomFloat(-0.1, 0.1)) * 255;
p->color[2] = (0.0f + randomFloat(0.0, 0.2)) * 255;
p->color[3] = (0.7f) * 255;
/* set other attributes */
p->size = 10 * pointSizeScale;
p->type = trail;
p->isActive = 1;
/* our array has expanded at the end */
num_active_particles++;
}
/*
spawns a new emitter particle at the bottom of the screen
destined for the point (x,y).
*/
void
spawnEmitterParticle(GLfloat x, GLfloat y)
{
if (num_active_particles >= MAX_PARTICLES) {
return;
}
/* find particle at endpoint of array */
struct particle *p = &particles[num_active_particles];
/* set the color randomly */
switch (rand() % 4) {
case 0:
p->color[0] = 255;
p->color[1] = 100;
p->color[2] = 100;
break;
case 1:
p->color[0] = 100;
p->color[1] = 255;
p->color[2] = 100;
break;
case 2:
p->color[0] = 100;
p->color[1] = 100;
p->color[2] = 255;
break;
case 3:
p->color[0] = 255;
p->color[1] = 150;
p->color[2] = 50;
break;
}
p->color[3] = 255;
/* set position to (x, screen_h) */
p->x = x;
p->y = screen_h;
/* set velocity so that terminal point is (x,y) */
p->xvel = 0;
p->yvel = -SDL_sqrt(2 * ACCEL * (screen_h - y));
/* set other attributes */
p->size = 10 * pointSizeScale;
p->type = emitter;
p->isActive = 1;
/* our array has expanded at the end */
num_active_particles++;
}
/* just sets the endpoint of the particle array to element zero */
void
initializeParticles(void)
{
num_active_particles = 0;
}
/*
loads the particle texture
*/
void
initializeTexture()
{
SDL_Surface *bmp_surface; /* the bmp is loaded here */
SDL_Surface *bmp_surface_rgba8888; /* this serves as a destination to convert the BMP
to format passed into OpenGL */
bmp_surface = SDL_LoadBMP("stroke.bmp");
if (bmp_surface == NULL) {
fatalError("could not load stroke.bmp");
}
/* Create surface that will hold pixels passed into OpenGL */
bmp_surface_rgba8888 = SDL_CreateSurface(bmp_surface->w, bmp_surface->h, SDL_PIXELFORMAT_ABGR8888);
/* Blit to this surface, effectively converting the format */
SDL_BlitSurface(bmp_surface, NULL, bmp_surface_rgba8888, NULL);
glGenTextures(1, &particleTextureID);
glBindTexture(GL_TEXTURE_2D, particleTextureID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
nextPowerOfTwo(bmp_surface->w),
nextPowerOfTwo(bmp_surface->h),
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
/* this is where we actually pass in the pixel data */
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmp_surface->w, bmp_surface->h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, bmp_surface_rgba8888->pixels);
/* free bmp surface and converted bmp surface */
SDL_FreeSurface(bmp_surface);
SDL_FreeSurface(bmp_surface_rgba8888);
}
int
main(int argc, char *argv[])
{
SDL_Window *window; /* main window */
SDL_GLContext context;
int drawableW, drawableH;
int done; /* should we clean up and exit? */
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fatalError("Could not initialize SDL");
}
/* seed the random number generator */
srand(time(NULL));
/*
request some OpenGL parameters
that may speed drawing
*/
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 0);
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
/* create main window and renderer */
window = SDL_CreateWindow(NULL, 0, 0, 320, 480,
SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI);
context = SDL_GL_CreateContext(window);
/* The window size and drawable size may be different when highdpi is enabled,
* due to the increased pixel density of the drawable. */
SDL_GetWindowSize(window, &screen_w, &screen_h);
SDL_GL_GetDrawableSize(window, &drawableW, &drawableH);
/* In OpenGL, point sizes are always in pixels. We don't want them looking
* tiny on a retina screen. */
pointSizeScale = (float) drawableH / (float) screen_h;
/* load the particle texture */
initializeTexture();
/* check if GL_POINT_SIZE_ARRAY_OES is supported
this is used to give each particle its own size
*/
pointSizeExtensionSupported =
SDL_GL_ExtensionSupported("GL_OES_point_size_array");
/* set up some OpenGL state */
glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0, 0, drawableW, drawableH);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof((GLfloat) 0,
(GLfloat) screen_w,
(GLfloat) screen_h,
(GLfloat) 0, 0.0, 1.0);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnable(GL_POINT_SPRITE_OES);
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, 1);
if (pointSizeExtensionSupported) {
/* we use this to set the sizes of all the particles */
glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
} else {
/* if extension not available then all particles have size 10 */
glPointSize(10 * pointSizeScale);
}
done = 0;
/* enter main loop */
while (!done) {
SDL_Event event;
double deltaTime = updateDeltaTime();
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
}
if (event.type == SDL_MOUSEBUTTONDOWN) {
int x, y;
SDL_GetMouseState(&x, &y);
spawnEmitterParticle(x, y);
}
}
stepParticles(deltaTime);
drawParticles();
SDL_GL_SwapWindow(window);
SDL_Delay(1);
}
/* delete textures */
glDeleteTextures(1, &particleTextureID);
/* shutdown SDL */
SDL_Quit();
return 0;
}

View file

@ -1,181 +0,0 @@
/*
* happy.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include "common.h"
#define NUM_HAPPY_FACES 100 /* number of faces to draw */
#define HAPPY_FACE_SIZE 32 /* width and height of happyface */
static SDL_Texture *texture = 0; /* reference to texture holding happyface */
static struct
{
float x, y; /* position of happyface */
float xvel, yvel; /* velocity of happyface */
} faces[NUM_HAPPY_FACES];
/*
Sets initial positions and velocities of happyfaces
units of velocity are pixels per millesecond
*/
void
initializeHappyFaces(SDL_Renderer *renderer)
{
int i;
int w;
int h;
SDL_RenderGetLogicalSize(renderer, &w, &h);
for (i = 0; i < NUM_HAPPY_FACES; i++) {
faces[i].x = randomFloat(0.0f, w - HAPPY_FACE_SIZE);
faces[i].y = randomFloat(0.0f, h - HAPPY_FACE_SIZE);
faces[i].xvel = randomFloat(-60.0f, 60.0f);
faces[i].yvel = randomFloat(-60.0f, 60.0f);
}
}
void
render(SDL_Renderer *renderer, double deltaTime)
{
int i;
SDL_Rect srcRect;
SDL_Rect dstRect;
int w;
int h;
SDL_RenderGetLogicalSize(renderer, &w, &h);
/* setup boundaries for happyface bouncing */
int maxx = w - HAPPY_FACE_SIZE;
int maxy = h - HAPPY_FACE_SIZE;
int minx = 0;
int miny = 0;
/* setup rects for drawing */
srcRect.x = 0;
srcRect.y = 0;
srcRect.w = HAPPY_FACE_SIZE;
srcRect.h = HAPPY_FACE_SIZE;
dstRect.w = HAPPY_FACE_SIZE;
dstRect.h = HAPPY_FACE_SIZE;
/* fill background in with black */
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
/*
loop through all the happy faces:
- update position
- update velocity (if boundary is hit)
- draw
*/
for (i = 0; i < NUM_HAPPY_FACES; i++) {
faces[i].x += faces[i].xvel * deltaTime;
faces[i].y += faces[i].yvel * deltaTime;
if (faces[i].x > maxx) {
faces[i].x = maxx;
faces[i].xvel = -faces[i].xvel;
} else if (faces[i].y > maxy) {
faces[i].y = maxy;
faces[i].yvel = -faces[i].yvel;
}
if (faces[i].x < minx) {
faces[i].x = minx;
faces[i].xvel = -faces[i].xvel;
} else if (faces[i].y < miny) {
faces[i].y = miny;
faces[i].yvel = -faces[i].yvel;
}
dstRect.x = faces[i].x;
dstRect.y = faces[i].y;
SDL_RenderCopy(renderer, texture, &srcRect, &dstRect);
}
/* update screen */
SDL_RenderPresent(renderer);
}
/*
loads the happyface graphic into a texture
*/
void
initializeTexture(SDL_Renderer *renderer)
{
SDL_Surface *bmp_surface;
/* load the bmp */
bmp_surface = SDL_LoadBMP("icon.bmp");
if (bmp_surface == NULL) {
fatalError("could not load bmp");
}
/* set white to transparent on the happyface */
SDL_SetColorKey(bmp_surface, 1,
SDL_MapRGB(bmp_surface->format, 255, 255, 255));
/* convert RGBA surface to texture */
texture = SDL_CreateTextureFromSurface(renderer, bmp_surface);
if (texture == NULL) {
fatalError("could not create texture");
}
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
/* free up allocated memory */
SDL_FreeSurface(bmp_surface);
}
int
main(int argc, char *argv[])
{
SDL_Window *window;
SDL_Renderer *renderer;
int done;
int width;
int height;
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fatalError("Could not initialize SDL");
}
/* The specified window size doesn't matter - except for its aspect ratio,
* which determines whether the window is in portrait or landscape on iOS
* (if SDL_WINDOW_RESIZABLE isn't specified). */
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, NULL, 0);
SDL_GetWindowSize(window, &width, &height);
SDL_RenderSetLogicalSize(renderer, width, height);
initializeTexture(renderer);
initializeHappyFaces(renderer);
/* main loop */
done = 0;
while (!done) {
SDL_Event event;
double deltaTime = updateDeltaTime();
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
}
}
render(renderer, deltaTime);
SDL_Delay(1);
}
/* cleanup */
SDL_DestroyTexture(texture);
/* shutdown SDL */
SDL_Quit();
return 0;
}

View file

@ -1,298 +0,0 @@
/*
* keyboard.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include "common.h"
#define TEST_INPUT_RECT
#define GLYPH_SIZE_IMAGE 16 /* size of glyphs (characters) in the bitmap font file */
#define GLYPH_SIZE_SCREEN 32 /* size of glyphs (characters) as shown on the screen */
#define MAX_CHARS 1024
static SDL_Texture *texture; /* texture where we'll hold our font */
static SDL_Renderer *renderer;
static int numChars = 0; /* number of characters we've typed so far */
static SDL_Color bg_color = { 50, 50, 100, 255 }; /* color of background */
static int glyphs[MAX_CHARS];
/* this structure maps a scancode to an index in our bitmap font.
it also contains data about under which modifiers the mapping is valid
(for example, we don't want shift + 1 to produce the character '1',
but rather the character '!')
*/
typedef struct
{
SDL_Scancode scancode; /* scancode of the key we want to map */
int allow_no_mod; /* is the map valid if the key has no modifiers? */
SDL_Keymod mod; /* what modifiers are allowed for the mapping */
int index; /* what index in the font does the scancode map to */
} fontMapping;
#define TABLE_SIZE 51 /* size of our table which maps keys and modifiers to font indices */
/* Below is the table that defines the mapping between scancodes and modifiers to indices in the
bitmap font. As an example, then line '{ SDL_SCANCODE_A, 1, SDL_KMOD_SHIFT, 33 }' means, map
the key A (which has scancode SDL_SCANCODE_A) to index 33 in the font (which is a picture of an A),
The '1' means that the mapping is valid even if there are no modifiers, and SDL_KMOD_SHIFT means the
mapping is also valid if the user is holding shift.
*/
fontMapping map[TABLE_SIZE] = {
{SDL_SCANCODE_A, 1, SDL_KMOD_SHIFT, 33}, /* A */
{SDL_SCANCODE_B, 1, SDL_KMOD_SHIFT, 34}, /* B */
{SDL_SCANCODE_C, 1, SDL_KMOD_SHIFT, 35}, /* C */
{SDL_SCANCODE_D, 1, SDL_KMOD_SHIFT, 36}, /* D */
{SDL_SCANCODE_E, 1, SDL_KMOD_SHIFT, 37}, /* E */
{SDL_SCANCODE_F, 1, SDL_KMOD_SHIFT, 38}, /* F */
{SDL_SCANCODE_G, 1, SDL_KMOD_SHIFT, 39}, /* G */
{SDL_SCANCODE_H, 1, SDL_KMOD_SHIFT, 40}, /* H */
{SDL_SCANCODE_I, 1, SDL_KMOD_SHIFT, 41}, /* I */
{SDL_SCANCODE_J, 1, SDL_KMOD_SHIFT, 42}, /* J */
{SDL_SCANCODE_K, 1, SDL_KMOD_SHIFT, 43}, /* K */
{SDL_SCANCODE_L, 1, SDL_KMOD_SHIFT, 44}, /* L */
{SDL_SCANCODE_M, 1, SDL_KMOD_SHIFT, 45}, /* M */
{SDL_SCANCODE_N, 1, SDL_KMOD_SHIFT, 46}, /* N */
{SDL_SCANCODE_O, 1, SDL_KMOD_SHIFT, 47}, /* O */
{SDL_SCANCODE_P, 1, SDL_KMOD_SHIFT, 48}, /* P */
{SDL_SCANCODE_Q, 1, SDL_KMOD_SHIFT, 49}, /* Q */
{SDL_SCANCODE_R, 1, SDL_KMOD_SHIFT, 50}, /* R */
{SDL_SCANCODE_S, 1, SDL_KMOD_SHIFT, 51}, /* S */
{SDL_SCANCODE_T, 1, SDL_KMOD_SHIFT, 52}, /* T */
{SDL_SCANCODE_U, 1, SDL_KMOD_SHIFT, 53}, /* U */
{SDL_SCANCODE_V, 1, SDL_KMOD_SHIFT, 54}, /* V */
{SDL_SCANCODE_W, 1, SDL_KMOD_SHIFT, 55}, /* W */
{SDL_SCANCODE_X, 1, SDL_KMOD_SHIFT, 56}, /* X */
{SDL_SCANCODE_Y, 1, SDL_KMOD_SHIFT, 57}, /* Y */
{SDL_SCANCODE_Z, 1, SDL_KMOD_SHIFT, 58}, /* Z */
{SDL_SCANCODE_0, 1, 0, 16}, /* 0 */
{SDL_SCANCODE_1, 1, 0, 17}, /* 1 */
{SDL_SCANCODE_2, 1, 0, 18}, /* 2 */
{SDL_SCANCODE_3, 1, 0, 19}, /* 3 */
{SDL_SCANCODE_4, 1, 0, 20}, /* 4 */
{SDL_SCANCODE_5, 1, 0, 21}, /* 5 */
{SDL_SCANCODE_6, 1, 0, 22}, /* 6 */
{SDL_SCANCODE_7, 1, 0, 23}, /* 7 */
{SDL_SCANCODE_8, 1, 0, 24}, /* 8 */
{SDL_SCANCODE_9, 1, 0, 25}, /* 9 */
{SDL_SCANCODE_SPACE, 1, 0, 0}, /* ' ' */
{SDL_SCANCODE_1, 0, SDL_KMOD_SHIFT, 1}, /* ! */
{SDL_SCANCODE_SLASH, 0, SDL_KMOD_SHIFT, 31}, /* ? */
{SDL_SCANCODE_SLASH, 1, 0, 15}, /* / */
{SDL_SCANCODE_COMMA, 1, 0, 12}, /* , */
{SDL_SCANCODE_SEMICOLON, 1, 0, 27}, /* ; */
{SDL_SCANCODE_SEMICOLON, 0, SDL_KMOD_SHIFT, 26}, /* : */
{SDL_SCANCODE_PERIOD, 1, 0, 14}, /* . */
{SDL_SCANCODE_MINUS, 1, 0, 13}, /* - */
{SDL_SCANCODE_EQUALS, 0, SDL_KMOD_SHIFT, 11}, /* = */
{SDL_SCANCODE_APOSTROPHE, 1, 0, 7}, /* ' */
{SDL_SCANCODE_APOSTROPHE, 0, SDL_KMOD_SHIFT, 2}, /* " */
{SDL_SCANCODE_5, 0, SDL_KMOD_SHIFT, 5}, /* % */
};
/*
This function maps an SDL_KeySym to an index in the bitmap font.
It does so by scanning through the font mapping table one entry
at a time.
If a match is found (scancode and allowed modifiers), the proper
index is returned.
If there is no entry for the key, -1 is returned
*/
int
keyToGlyphIndex(SDL_Keysym key)
{
int i, index = -1;
for (i = 0; i < TABLE_SIZE; i++) {
fontMapping compare = map[i];
if (key.scancode == compare.scancode) {
/* if this entry is valid with no key mod and we have no keymod, or if
the key's modifiers are allowed modifiers for that mapping */
if ((compare.allow_no_mod && key.mod == 0)
|| (key.mod & compare.mod)) {
index = compare.index;
break;
}
}
}
return index;
}
/*
This function returns and x,y position for a given character number.
It is used for positioning each character of text
*/
void
getPositionForCharNumber(int n, int *x, int *y)
{
int renderW, renderH;
SDL_RenderGetLogicalSize(renderer, &renderW, &renderH);
int x_padding = 16; /* padding space on left and right side of screen */
int y_padding = 32; /* padding space at top of screen */
/* figure out the number of characters that can fit horizontally across the screen */
int max_x_chars = (renderW - 2 * x_padding) / GLYPH_SIZE_SCREEN;
int line_separation = 5; /* pixels between each line */
*x = (n % max_x_chars) * GLYPH_SIZE_SCREEN + x_padding;
#ifdef TEST_INPUT_RECT
*y = renderH - GLYPH_SIZE_SCREEN;
#else
*y = (n / max_x_chars) * (GLYPH_SIZE_SCREEN + line_separation) + y_padding;
#endif
}
void
drawGlyph(int glyph, int positionIndex)
{
int x, y;
getPositionForCharNumber(positionIndex, &x, &y);
SDL_Rect srcRect = { GLYPH_SIZE_IMAGE * glyph, 0, GLYPH_SIZE_IMAGE, GLYPH_SIZE_IMAGE };
SDL_Rect dstRect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
SDL_RenderCopy(renderer, texture, &srcRect, &dstRect);
}
/* this function loads our font into an SDL_Texture and returns the SDL_Texture */
SDL_Texture*
loadFont(void)
{
SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp");
if (surface == NULL) {
printf("Error loading bitmap: %s\n", SDL_GetError());
return 0;
} else {
/* set the transparent color for the bitmap font (hot pink) */
SDL_SetColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252));
/* now we convert the surface to our desired pixel format */
int format = SDL_PIXELFORMAT_ABGR8888; /* desired texture format */
SDL_Surface *converted = SDL_CreateSurface(surface->w, surface->h, format);
SDL_BlitSurface(surface, NULL, converted, NULL);
/* create our texture */
texture = SDL_CreateTextureFromSurface(renderer, converted);
if (texture == NULL) {
printf("texture creation failed: %s\n", SDL_GetError());
} else {
/* set blend mode for our texture */
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
}
SDL_FreeSurface(surface);
SDL_FreeSurface(converted);
return texture;
}
}
void
draw()
{
SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a);
SDL_RenderClear(renderer);
for (int i = 0; i < numChars; i++) {
drawGlyph(glyphs[i], i);
}
drawGlyph(29, numChars); /* cursor is at index 29 in the bitmap font */
SDL_RenderPresent(renderer);
}
int
main(int argc, char *argv[])
{
SDL_Window *window;
SDL_Event event; /* last event received */
SDL_Scancode scancode; /* scancode of last key we pushed */
int width;
int height;
int done;
SDL_Rect textrect;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("Error initializing SDL: %s", SDL_GetError());
}
/* create window */
window = SDL_CreateWindow("iOS keyboard test", 0, 0, 0, 0, SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
/* create renderer */
renderer = SDL_CreateRenderer(window, NULL, SDL_RENDERER_PRESENTVSYNC);
SDL_GetWindowSize(window, &width, &height);
SDL_RenderSetLogicalSize(renderer, width, height);
/* load up our font */
loadFont();
/* Show onscreen keyboard */
#ifdef TEST_INPUT_RECT
textrect.x = 0;
textrect.y = height - GLYPH_SIZE_IMAGE;
textrect.w = width;
textrect.h = GLYPH_SIZE_IMAGE;
SDL_SetTextInputRect(&textrect);
#endif
SDL_StartTextInput();
done = 0;
while (!done) {
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
done = 1;
break;
case SDL_WINDOWEVENT:
if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
width = event.window.data1;
height = event.window.data2;
SDL_RenderSetLogicalSize(renderer, width, height);
#ifdef TEST_INPUT_RECT
textrect.x = 0;
textrect.y = height - GLYPH_SIZE_IMAGE;
textrect.w = width;
textrect.h = GLYPH_SIZE_IMAGE;
SDL_SetTextInputRect(&textrect);
#endif
}
break;
case SDL_KEYDOWN:
if (event.key.keysym.scancode == SDL_SCANCODE_BACKSPACE) {
if (numChars > 0) {
numChars--;
}
} else if (numChars + 1 < MAX_CHARS) {
int index = keyToGlyphIndex(event.key.keysym);
if (index >= 0) {
glyphs[numChars++] = index;
}
}
break;
case SDL_MOUSEBUTTONUP:
/* mouse up toggles onscreen keyboard visibility */
if (SDL_IsTextInputActive()) {
SDL_StopTextInput();
} else {
SDL_StartTextInput();
}
break;
}
}
draw();
SDL_Delay(15);
}
SDL_DestroyTexture(texture);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}

View file

@ -1,345 +0,0 @@
/*
* mixer.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include "common.h"
#define NUM_CHANNELS 8 /* max number of sounds we can play at once */
#define NUM_DRUMS 4 /* number of drums in our set */
static struct
{
SDL_Rect rect; /* where the button is drawn */
SDL_Color upColor; /* color when button is not active */
SDL_Color downColor; /* color when button is active */
int isPressed; /* is the button being pressed ? */
int touchIndex; /* what mouse (touch) index pressed the button ? */
} buttons[NUM_DRUMS];
struct sound
{
Uint8 *buffer; /* audio buffer for sound file */
Uint32 length; /* length of the buffer (in bytes) */
};
/* this array holds the audio for the drum noises */
static struct sound drums[NUM_DRUMS];
/* function declarations */
void handleMouseButtonDown(SDL_Event * event);
void handleMouseButtonUp(SDL_Event * event);
int playSound(struct sound *);
void initializeButtons(SDL_Renderer *);
void audioCallback(void *userdata, Uint8 * stream, int len);
void loadSound(const char *file, struct sound *s);
struct
{
/* channel array holds information about currently playing sounds */
struct
{
Uint8 *position; /* what is the current position in the buffer of this sound ? */
Uint32 remaining; /* how many bytes remaining before we're done playing the sound ? */
Uint32 timestamp; /* when did this sound start playing ? */
} channels[NUM_CHANNELS];
SDL_AudioSpec outputSpec; /* what audio format are we using for output? */
int numSoundsPlaying; /* how many sounds are currently playing */
} mixer;
/* sets up the buttons (color, position, state) */
void
initializeButtons(SDL_Renderer *renderer)
{
int i;
int spacing = 10; /* gap between drum buttons */
SDL_Rect buttonRect; /* keeps track of where to position drum */
SDL_Color upColor = { 86, 86, 140, 255 }; /* color of drum when not pressed */
SDL_Color downColor = { 191, 191, 221, 255 }; /* color of drum when pressed */
int renderW, renderH;
SDL_RenderGetLogicalSize(renderer, &renderW, &renderH);
buttonRect.x = spacing;
buttonRect.y = spacing;
buttonRect.w = renderW - 2 * spacing;
buttonRect.h = (renderH - (NUM_DRUMS + 1) * spacing) / NUM_DRUMS;
/* setup each button */
for (i = 0; i < NUM_DRUMS; i++) {
buttons[i].rect = buttonRect;
buttons[i].isPressed = 0;
buttons[i].upColor = upColor;
buttons[i].downColor = downColor;
buttonRect.y += spacing + buttonRect.h; /* setup y coordinate for next drum */
}
}
/*
loads a wav file (stored in 'file'), converts it to the mixer's output format,
and stores the resulting buffer and length in the sound structure
*/
void
loadSound(const char *file, struct sound *s)
{
SDL_AudioSpec spec; /* the audio format of the .wav file */
SDL_AudioCVT cvt; /* used to convert .wav to output format when formats differ */
int result;
if (SDL_LoadWAV(file, &spec, &s->buffer, &s->length) == NULL) {
fatalError("could not load .wav");
}
/* build the audio converter */
result = SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq,
mixer.outputSpec.format,
mixer.outputSpec.channels,
mixer.outputSpec.freq);
if (result == -1) {
fatalError("could not build audio CVT");
} else if (result != 0) {
/*
this happens when the .wav format differs from the output format.
we convert the .wav buffer here
*/
cvt.buf = (Uint8 *) SDL_malloc(s->length * cvt.len_mult); /* allocate conversion buffer */
cvt.len = s->length; /* set conversion buffer length */
SDL_memcpy(cvt.buf, s->buffer, s->length); /* copy sound to conversion buffer */
if (SDL_ConvertAudio(&cvt) == -1) { /* convert the sound */
fatalError("could not convert .wav");
}
SDL_free(s->buffer); /* Free the original (unconverted) buffer */
s->buffer = cvt.buf; /* point sound buffer to converted buffer */
s->length = cvt.len_cvt; /* set sound buffer's new length */
}
}
/* called from main event loop */
void
handleMouseButtonDown(SDL_Event * event)
{
int x, y, mouseIndex, i, drumIndex;
mouseIndex = 0;
drumIndex = -1;
SDL_GetMouseState(&x, &y);
/* check if we hit any of the drum buttons */
for (i = 0; i < NUM_DRUMS; i++) {
if (x >= buttons[i].rect.x
&& x < buttons[i].rect.x + buttons[i].rect.w
&& y >= buttons[i].rect.y
&& y < buttons[i].rect.y + buttons[i].rect.h) {
drumIndex = i;
break;
}
}
if (drumIndex != -1) {
/* if we hit a button */
buttons[drumIndex].touchIndex = mouseIndex;
buttons[drumIndex].isPressed = 1;
playSound(&drums[drumIndex]);
}
}
/* called from main event loop */
void
handleMouseButtonUp(SDL_Event * event)
{
int i;
int mouseIndex = 0;
/* check if this should cause any of the buttons to become unpressed */
for (i = 0; i < NUM_DRUMS; i++) {
if (buttons[i].touchIndex == mouseIndex) {
buttons[i].isPressed = 0;
}
}
}
/* draws buttons to screen */
void
render(SDL_Renderer *renderer)
{
int i;
SDL_SetRenderDrawColor(renderer, 50, 50, 50, 255);
SDL_RenderClear(renderer); /* draw background (gray) */
/* draw the drum buttons */
for (i = 0; i < NUM_DRUMS; i++) {
SDL_Color color =
buttons[i].isPressed ? buttons[i].downColor : buttons[i].upColor;
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
SDL_RenderFillRect(renderer, &buttons[i].rect);
}
/* update the screen */
SDL_RenderPresent(renderer);
}
/*
finds a sound channel in the mixer for a sound
and sets it up to start playing
*/
int
playSound(struct sound *s)
{
/*
find an empty channel to play on.
if no channel is available, use oldest channel
*/
int i;
int selected_channel = -1;
int oldest_channel = 0;
if (mixer.numSoundsPlaying == 0) {
/* we're playing a sound now, so start audio callback back up */
SDL_PauseAudio(0);
}
/* find a sound channel to play the sound on */
for (i = 0; i < NUM_CHANNELS; i++) {
if (mixer.channels[i].position == NULL) {
/* if no sound on this channel, select it */
selected_channel = i;
break;
}
/* if this channel's sound is older than the oldest so far, set it to oldest */
if (mixer.channels[i].timestamp < mixer.channels[oldest_channel].timestamp) {
oldest_channel = i;
}
}
/* no empty channels, take the oldest one */
if (selected_channel == -1)
selected_channel = oldest_channel;
else
mixer.numSoundsPlaying++;
/* point channel data to wav data */
mixer.channels[selected_channel].position = s->buffer;
mixer.channels[selected_channel].remaining = s->length;
mixer.channels[selected_channel].timestamp = SDL_GetTicks();
return selected_channel;
}
/*
Called from SDL's audio system. Supplies sound input with data by mixing together all
currently playing sound effects.
*/
void
audioCallback(void *userdata, Uint8 * stream, int len)
{
int i;
int copy_amt;
SDL_memset(stream, mixer.outputSpec.silence, len); /* initialize buffer to silence */
/* for each channel, mix in whatever is playing on that channel */
for (i = 0; i < NUM_CHANNELS; i++) {
if (mixer.channels[i].position == NULL) {
/* if no sound is playing on this channel */
continue; /* nothing to do for this channel */
}
/* copy len bytes to the buffer, unless we have fewer than len bytes remaining */
copy_amt =
mixer.channels[i].remaining <
len ? mixer.channels[i].remaining : len;
/* mix this sound effect with the output */
SDL_MixAudioFormat(stream, mixer.channels[i].position,
mixer.outputSpec.format, copy_amt, SDL_MIX_MAXVOLUME);
/* update buffer position in sound effect and the number of bytes left */
mixer.channels[i].position += copy_amt;
mixer.channels[i].remaining -= copy_amt;
/* did we finish playing the sound effect ? */
if (mixer.channels[i].remaining == 0) {
mixer.channels[i].position = NULL; /* indicates no sound playing on channel anymore */
mixer.numSoundsPlaying--;
if (mixer.numSoundsPlaying == 0) {
/* if no sounds left playing, pause audio callback */
SDL_PauseAudio(1);
}
}
}
}
int
main(int argc, char *argv[])
{
int done; /* has user tried to quit ? */
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
SDL_Event event;
int i;
int width;
int height;
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
fatalError("could not initialize SDL");
}
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, NULL, 0);
SDL_GetWindowSize(window, &width, &height);
SDL_RenderSetLogicalSize(renderer, width, height);
/* initialize the mixer */
SDL_memset(&mixer, 0, sizeof(mixer));
/* setup output format */
mixer.outputSpec.freq = 44100;
mixer.outputSpec.format = AUDIO_S16LSB;
mixer.outputSpec.channels = 2;
mixer.outputSpec.samples = 256;
mixer.outputSpec.callback = audioCallback;
mixer.outputSpec.userdata = NULL;
/* open audio for output */
if (SDL_OpenAudio(&mixer.outputSpec, NULL) != 0) {
fatalError("Opening audio failed");
}
/* load our drum noises */
loadSound("ds_kick_big_amb.wav", &drums[3]);
loadSound("ds_brush_snare.wav", &drums[2]);
loadSound("ds_loose_skin_mute.wav", &drums[1]);
loadSound("ds_china.wav", &drums[0]);
/* setup positions, colors, and state of buttons */
initializeButtons(renderer);
/* enter main loop */
done = 0;
while (!done) {
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_MOUSEBUTTONDOWN:
handleMouseButtonDown(&event);
break;
case SDL_MOUSEBUTTONUP:
handleMouseButtonUp(&event);
break;
case SDL_QUIT:
done = 1;
break;
}
}
render(renderer); /* draw buttons */
SDL_Delay(1);
}
/* cleanup code, let's free up those sound buffers */
for (i = 0; i < NUM_DRUMS; i++) {
SDL_free(drums[i].buffer);
}
/* let SDL do its exit code */
SDL_Quit();
return 0;
}

View file

@ -1,94 +0,0 @@
/*
* rectangles.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <stdlib.h>
#include <time.h>
#include "common.h"
void
render(SDL_Renderer *renderer)
{
Uint8 r, g, b;
int renderW;
int renderH;
SDL_RenderGetLogicalSize(renderer, &renderW, &renderH);
/* Come up with a random rectangle */
SDL_Rect rect;
rect.w = randomInt(64, 128);
rect.h = randomInt(64, 128);
rect.x = randomInt(0, renderW);
rect.y = randomInt(0, renderH);
/* Come up with a random color */
r = randomInt(50, 255);
g = randomInt(50, 255);
b = randomInt(50, 255);
/* Fill the rectangle in the color */
SDL_SetRenderDrawColor(renderer, r, g, b, 255);
SDL_RenderFillRect(renderer, &rect);
/* update screen */
SDL_RenderPresent(renderer);
}
int
main(int argc, char *argv[])
{
SDL_Window *window;
SDL_Renderer *renderer;
int done;
SDL_Event event;
int windowW;
int windowH;
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fatalError("Could not initialize SDL");
}
/* seed random number generator */
srand(time(NULL));
/* create window and renderer */
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI);
if (window == NULL) {
fatalError("Could not initialize Window");
}
renderer = SDL_CreateRenderer(window, NULL, 0);
if (renderer == NULL) {
fatalError("Could not create renderer");
}
SDL_GetWindowSize(window, &windowW, &windowH);
SDL_RenderSetLogicalSize(renderer, windowW, windowH);
/* Fill screen with black */
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
/* Enter render loop, waiting for user to quit */
done = 0;
while (!done) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
}
}
render(renderer);
SDL_Delay(1);
}
/* shutdown SDL */
SDL_Quit();
return 0;
}

View file

@ -1,140 +0,0 @@
/*
* touch.c
* written by Holmes Futrell
* use however you want
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <math.h>
#include "common.h"
#define BRUSH_SIZE 32 /* width and height of the brush */
#define PIXELS_PER_ITERATION 5 /* number of pixels between brush blots when forming a line */
static SDL_Texture *brush = 0; /* texture for the brush */
/*
draws a line from (startx, starty) to (startx + dx, starty + dy)
this is accomplished by drawing several blots spaced PIXELS_PER_ITERATION apart
*/
void
drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy)
{
float distance = SDL_sqrt(dx * dx + dy * dy); /* length of line segment (pythagoras) */
int iterations = distance / PIXELS_PER_ITERATION + 1; /* number of brush sprites to draw for the line */
float dx_prime = dx / iterations; /* x-shift per iteration */
float dy_prime = dy / iterations; /* y-shift per iteration */
SDL_Rect dstRect; /* rect to draw brush sprite into */
float x;
float y;
int i;
dstRect.w = BRUSH_SIZE;
dstRect.h = BRUSH_SIZE;
/* setup x and y for the location of the first sprite */
x = startx - BRUSH_SIZE / 2.0f;
y = starty - BRUSH_SIZE / 2.0f;
/* draw a series of blots to form the line */
for (i = 0; i < iterations; i++) {
dstRect.x = x;
dstRect.y = y;
/* shift x and y for next sprite location */
x += dx_prime;
y += dy_prime;
/* draw brush blot */
SDL_RenderCopy(renderer, brush, NULL, &dstRect);
}
}
/*
loads the brush texture
*/
void
initializeTexture(SDL_Renderer *renderer)
{
SDL_Surface *bmp_surface;
bmp_surface = SDL_LoadBMP("stroke.bmp");
if (bmp_surface == NULL) {
fatalError("could not load stroke.bmp");
}
brush =
SDL_CreateTextureFromSurface(renderer, bmp_surface);
SDL_FreeSurface(bmp_surface);
if (brush == NULL) {
fatalError("could not create brush texture");
}
/* additive blending -- laying strokes on top of eachother makes them brighter */
SDL_SetTextureBlendMode(brush, SDL_BLENDMODE_ADD);
/* set brush color (red) */
SDL_SetTextureColorMod(brush, 255, 100, 100);
}
int
main(int argc, char *argv[])
{
int x, y, dx, dy; /* mouse location */
Uint8 state; /* mouse (touch) state */
SDL_Event event;
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
SDL_Texture *target;
int done; /* does user want to quit? */
int w, h;
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fatalError("Could not initialize SDL");
}
/* create main window and renderer */
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, NULL, 0);
SDL_GetWindowSize(window, &w, &h);
SDL_RenderSetLogicalSize(renderer, w, h);
/* load brush texture */
initializeTexture(renderer);
/* fill canvass initially with all black */
target = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, w, h);
SDL_SetRenderTarget(renderer, target);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
SDL_SetRenderTarget(renderer, NULL);
done = 0;
while (!done) {
while (SDL_PollEvent(&event) == 1) {
switch (event.type) {
case SDL_QUIT:
done = 1;
break;
case SDL_MOUSEMOTION:
state = SDL_GetMouseState(&x, &y); /* get its location */
SDL_GetRelativeMouseState(&dx, &dy); /* find how much the mouse moved */
if (state & SDL_BUTTON_LMASK) { /* is the mouse (touch) down? */
SDL_SetRenderTarget(renderer, target);
drawLine(renderer, x - dx, y - dy, dx, dy); /* draw line segment */
SDL_SetRenderTarget(renderer, NULL);
}
break;
}
}
SDL_RenderCopy(renderer, target, NULL, NULL);
SDL_RenderPresent(renderer);
}
/* cleanup */
SDL_DestroyTexture(brush);
SDL_DestroyTexture(target);
SDL_Quit();
return 0;
}

File diff suppressed because it is too large Load diff

View file

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A7D88A1423E2437C00DCD162"
BuildableName = "SDL3.framework"
BlueprintName = "Framework-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A7D88A1423E2437C00DCD162"
BuildableName = "SDL3.framework"
BlueprintName = "Framework-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2D187CE28A5673500D2B4F1"
BuildableName = "SDL3.framework"
BlueprintName = "xcFramework-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2D187CE28A5673500D2B4F1"
BuildableName = "SDL3.framework"
BlueprintName = "xcFramework-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -31,34 +31,45 @@ endmacro()
set(SDL3_FOUND TRUE)
string(REGEX REPLACE "SDL3\\.framework.*" "SDL3.framework" SDL3_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}")
string(REGEX REPLACE "SDL3\\.framework.*" "" SDL3_FRAMEWORK_PARENT_PATH "${CMAKE_CURRENT_LIST_DIR}")
# Compute the installation prefix relative to this file.
get_filename_component(_sdl3_framework_path "${CMAKE_CURRENT_LIST_FILE}" PATH) # /SDL3.framework/Resources/CMake/
get_filename_component(_sdl3_framework_path "${_IMPORT_PREFIX}" PATH) # /SDL3.framework/Resources/
get_filename_component(_sdl3_framework_path "${_IMPORT_PREFIX}" PATH) # /SDL3.framework/
get_filename_component(_sdl3_framework_parent_path "${_sdl3_framework_path}" PATH) # /
# For compatibility with autotools sdl3-config.cmake, provide SDL3_* variables.
set_and_check(SDL3_PREFIX "${SDL3_FRAMEWORK_PATH}")
set_and_check(SDL3_EXEC_PREFIX "${SDL3_FRAMEWORK_PATH}")
set_and_check(SDL3_INCLUDE_DIR "${SDL3_FRAMEWORK_PATH}/Headers")
set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR};${SDL3_FRAMEWORK_PATH}")
set_and_check(SDL3_BINDIR "${SDL3_FRAMEWORK_PATH}")
set_and_check(SDL3_LIBDIR "${SDL3_FRAMEWORK_PATH}")
set_and_check(_sdl3_include_dirs "${_sdl3_framework_path}/Headers")
set(SDL3_LIBRARIES "SDL3::SDL3")
# All targets are created, even when some might not be requested though COMPONENTS.
# This is done for compatibility with CMake generated SDL3-target.cmake files.
if(NOT TARGET SDL3::Headers)
add_library(SDL3::Headers INTERFACE IMPORTED)
set_target_properties(SDL3::Headers
PROPERTIES
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${_sdl3_framework_parent_path}\""
INTERFACE_INCLUDE_DIRECTORIES "${_sdl3_include_dirs}"
)
endif()
set(SDL3_Headers_FOUND TRUE)
unset(_sdl3_include_dirs)
if(NOT TARGET SDL3::SDL3)
add_library(SDL3::SDL3 INTERFACE IMPORTED)
add_library(SDL3::SDL3 SHARED IMPORTED)
set_target_properties(SDL3::SDL3
PROPERTIES
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${SDL3_FRAMEWORK_PARENT_PATH}\""
INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}"
INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL3_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL3"
FRAMEWORK "TRUE"
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
IMPORTED_LOCATION "${_sdl3_framework_path}/SDL3"
IMPORTED_SONAME "${_sdl3_framework_path}/SDL3"
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
INTERFACE_SDL3_SHARED "ON"
)
endif()
set(SDL3_SDL3_FOUND TRUE)
unset(_sdl3_framework_parent_path)
unset(_sdl3_framework_path)
check_required_components(SDL3)

View file

@ -1,6 +1,6 @@
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

File diff suppressed because it is too large Load diff

View file

@ -170,7 +170,7 @@ public class HIDDeviceManager {
Log.i(TAG," Interface protocol: " + mUsbInterface.getInterfaceProtocol());
Log.i(TAG," Endpoint count: " + mUsbInterface.getEndpointCount());
// Get endpoint details
// Get endpoint details
for (int epi = 0; epi < mUsbInterface.getEndpointCount(); epi++)
{
UsbEndpoint mEndpoint = mUsbInterface.getEndpoint(epi);
@ -272,10 +272,12 @@ public class HIDDeviceManager {
final int XB1_IFACE_SUBCLASS = 71;
final int XB1_IFACE_PROTOCOL = 208;
final int[] SUPPORTED_VENDORS = {
0x044f, // Thrustmaster
0x045e, // Microsoft
0x0738, // Mad Catz
0x0e6f, // PDP
0x0f0d, // Hori
0x10f5, // Turtle Beach
0x1532, // Razer Wildcat
0x20d6, // PowerA
0x24c6, // PowerA
@ -525,7 +527,7 @@ public class HIDDeviceManager {
for (HIDDevice device : mDevicesById.values()) {
device.setFrozen(frozen);
}
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////

Some files were not shown because too many files have changed in this diff Show more