mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-30 14:21:51 +00:00
Merge remote-tracking branch 'upstream/master' into cmake-use-internal-libs
This commit is contained in:
commit
0f9611df76
654 changed files with 46933 additions and 31768 deletions
60
.circleci/config.yml
Normal file
60
.circleci/config.yml
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
working_directory: /root/SRB2
|
||||||
|
docker:
|
||||||
|
- image: debian:jessie
|
||||||
|
environment:
|
||||||
|
CC: ccache gcc -m32
|
||||||
|
PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
|
||||||
|
LIBGME_CFLAGS: -I/usr/include
|
||||||
|
LIBGME_LDFLAGS: -lgme
|
||||||
|
CCACHE_COMPRESS: true
|
||||||
|
WFLAGS: -Wno-unsuffixed-float-constants
|
||||||
|
GCC49: true
|
||||||
|
#- image: ubuntu:trusty
|
||||||
|
# environment:
|
||||||
|
# CC: ccache gcc -m32
|
||||||
|
# PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
|
||||||
|
# LIBGME_CFLAGS: -I/usr/include
|
||||||
|
# LIBGME_LDFLAGS: -lgme
|
||||||
|
# CCACHE_COMPRESS: true
|
||||||
|
# WFLAGS: -Wno-unsuffixed-float-constants
|
||||||
|
# GCC48: true
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Add i386 arch
|
||||||
|
command: dpkg --add-architecture i386
|
||||||
|
- run:
|
||||||
|
name: Update APT listing
|
||||||
|
command: apt-get -qq update
|
||||||
|
- run:
|
||||||
|
name: Support S3 upload
|
||||||
|
command: apt-get -qq -y install ca-certificates
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-SRB2-APT
|
||||||
|
- run:
|
||||||
|
name: Install SDK
|
||||||
|
command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx
|
||||||
|
- save_cache:
|
||||||
|
key: v1-SRB2-APT
|
||||||
|
paths:
|
||||||
|
- /var/cache/apt/archives
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Clean build
|
||||||
|
command: make -C src LINUX=1 clean
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
||||||
|
- run:
|
||||||
|
name: Compile
|
||||||
|
command: make -C src LINUX=1 ERRORMODE=1 -k
|
||||||
|
- store_artifacts:
|
||||||
|
path: /root/SRB2/bin/Linux/Release/
|
||||||
|
destination: bin
|
||||||
|
- save_cache:
|
||||||
|
key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
||||||
|
paths:
|
||||||
|
- /root/.ccache
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -18,3 +18,4 @@ Win32_LIB_ASM_Release
|
||||||
*.user
|
*.user
|
||||||
*.db
|
*.db
|
||||||
*.opendb
|
*.opendb
|
||||||
|
/.vs
|
||||||
|
|
88
.travis.yml
88
.travis.yml
|
@ -68,38 +68,10 @@ matrix:
|
||||||
- libgl1-mesa-dev
|
- libgl1-mesa-dev
|
||||||
- libgme-dev
|
- libgme-dev
|
||||||
- p7zip-full
|
- p7zip-full
|
||||||
- gcc-4.9
|
- gcc-7
|
||||||
compiler: gcc-4.9
|
compiler: gcc-7
|
||||||
#gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
|
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3"
|
||||||
- os: linux
|
#gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- libsdl2-mixer-dev
|
|
||||||
- libpng-dev
|
|
||||||
- libgl1-mesa-dev
|
|
||||||
- libgme-dev
|
|
||||||
- p7zip-full
|
|
||||||
- gcc-5
|
|
||||||
compiler: gcc-5
|
|
||||||
#gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204
|
|
||||||
- os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- libsdl2-mixer-dev
|
|
||||||
- libpng-dev
|
|
||||||
- libgl1-mesa-dev
|
|
||||||
- libgme-dev
|
|
||||||
- p7zip-full
|
|
||||||
- gcc-6
|
|
||||||
compiler: gcc-6
|
|
||||||
env: WFLAGS="-Wno-tautological-compare"
|
|
||||||
#gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
#clang version 3.5.0 (tags/RELEASE_350/final)
|
#clang version 3.5.0 (tags/RELEASE_350/final)
|
||||||
|
@ -162,6 +134,51 @@ matrix:
|
||||||
- clang-3.8
|
- clang-3.8
|
||||||
compiler: clang-3.8
|
compiler: clang-3.8
|
||||||
#clang version 3.8.1-svn271127-1~exp1 (branches/release_38)
|
#clang version 3.8.1-svn271127-1~exp1 (branches/release_38)
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-precise-3.9
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- p7zip-full
|
||||||
|
- clang-3.9
|
||||||
|
compiler: clang-3.9
|
||||||
|
#clang version 3.9.X
|
||||||
|
# - os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# sources:
|
||||||
|
# - llvm-toolchain-precise-4.0
|
||||||
|
# - ubuntu-toolchain-r-test
|
||||||
|
# packages:
|
||||||
|
# - libsdl2-mixer-dev
|
||||||
|
# - libpng-dev
|
||||||
|
# - libgl1-mesa-dev
|
||||||
|
# - libgme-dev
|
||||||
|
# - p7zip-full
|
||||||
|
# - clang-4.0
|
||||||
|
# compiler: clang-4.0
|
||||||
|
# #clang version 4.0.X
|
||||||
|
# - os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# sources:
|
||||||
|
# - llvm-toolchain-precise-5.0
|
||||||
|
# - ubuntu-toolchain-r-test
|
||||||
|
# packages:
|
||||||
|
# - libsdl2-mixer-dev
|
||||||
|
# - libpng-dev
|
||||||
|
# - libgl1-mesa-dev
|
||||||
|
# - libgme-dev
|
||||||
|
# - p7zip-full
|
||||||
|
# - clang-5.0
|
||||||
|
# compiler: clang-5.0
|
||||||
|
# #clang version 5.0.X
|
||||||
# - os: osx
|
# - os: osx
|
||||||
# osx_image: beta-xcode6.1
|
# osx_image: beta-xcode6.1
|
||||||
# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
|
# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
|
||||||
|
@ -192,6 +209,9 @@ matrix:
|
||||||
- compiler: clang-3.6
|
- compiler: clang-3.6
|
||||||
- compiler: clang-3.7
|
- compiler: clang-3.7
|
||||||
- compiler: clang-3.8
|
- compiler: clang-3.8
|
||||||
|
- compiler: clang-3.9
|
||||||
|
- compiler: clang-4.0
|
||||||
|
- compiler: clang-5.0
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
apt: true
|
apt: true
|
||||||
|
@ -219,9 +239,9 @@ before_script:
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2 sdl2_mixer game-music-emu p7zip; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake||true; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake||true; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.6.dmg; hdiutil attach SDL2-2.0.6.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi
|
||||||
- mkdir -p $HOME/srb2_cache
|
- mkdir -p $HOME/srb2_cache
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
project(SRB2
|
project(SRB2
|
||||||
VERSION 2.1.14
|
VERSION 2.1.20
|
||||||
LANGUAGES C)
|
LANGUAGES C)
|
||||||
|
|
||||||
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[![Build status](https://ci.appveyor.com/api/projects/status/399d4hcw9yy7hg2y?svg=true)](https://ci.appveyor.com/project/STJr/srb2)
|
[![Build status](https://ci.appveyor.com/api/projects/status/399d4hcw9yy7hg2y?svg=true)](https://ci.appveyor.com/project/STJr/srb2)
|
||||||
[![Build status](https://travis-ci.org/STJr/SRB2.svg?branch=master)](https://travis-ci.org/STJr/SRB2)
|
[![Build status](https://travis-ci.org/STJr/SRB2.svg?branch=master)](https://travis-ci.org/STJr/SRB2)
|
||||||
|
[![CircleCI](https://circleci.com/gh/STJr/SRB2/tree/master.svg?style=svg)](https://circleci.com/gh/STJr/SRB2/tree/master)
|
||||||
|
|
||||||
[Sonic Robo Blast 2](https://srb2.org/) is a 3D Sonic the Hedgehog fangame based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
|
[Sonic Robo Blast 2](https://srb2.org/) is a 3D Sonic the Hedgehog fangame based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<AssemblerOutput>All</AssemblerOutput>
|
<AssemblerOutput>All</AssemblerOutput>
|
||||||
<SmallerTypeCheck>true</SmallerTypeCheck>
|
<SmallerTypeCheck>false</SmallerTypeCheck>
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
|
|
43
appveyor.yml
43
appveyor.yml
|
@ -1,4 +1,4 @@
|
||||||
version: 2.1.16.{branch}-{build}
|
version: 2.1.20.{branch}-{build}
|
||||||
os: MinGW
|
os: MinGW
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
@ -6,7 +6,7 @@ environment:
|
||||||
CCACHE_CC: i686-w64-mingw32-gcc
|
CCACHE_CC: i686-w64-mingw32-gcc
|
||||||
WINDRES: windres
|
WINDRES: windres
|
||||||
MINGW_SDK: c:\msys64\mingw32
|
MINGW_SDK: c:\msys64\mingw32
|
||||||
CFLAGS: -Wall -W -Werror
|
CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn
|
||||||
NASM_ZIP: nasm-2.12.01
|
NASM_ZIP: nasm-2.12.01
|
||||||
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
|
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
|
||||||
UPX_ZIP: upx391w
|
UPX_ZIP: upx391w
|
||||||
|
@ -39,6 +39,10 @@ configuration:
|
||||||
- SDL
|
- SDL
|
||||||
- DD
|
- DD
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- configuration: DD
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- set Path=%MINGW_SDK%\bin;%Path%
|
- set Path=%MINGW_SDK%\bin;%Path%
|
||||||
- i686-w64-mingw32-gcc --version
|
- i686-w64-mingw32-gcc --version
|
||||||
|
@ -47,7 +51,7 @@ before_build:
|
||||||
- upx -V
|
- upx -V
|
||||||
- ccache -V
|
- ccache -V
|
||||||
- ccache -s
|
- ccache -s
|
||||||
- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC53=1 CCACHE=1
|
- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC72=1 CCACHE=1 NOOBJDUMP=1
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean
|
- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean
|
||||||
|
@ -58,26 +62,29 @@ after_build:
|
||||||
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
|
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
|
||||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||||
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
|
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
|
||||||
|
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
|
||||||
- cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore
|
- cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore
|
||||||
- appveyor PushArtifact %BUILD_ARCHIVE%
|
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||||
|
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||||
|
- appveyor PushArtifact %BUILDSARCHIVE%
|
||||||
|
|
||||||
test: off
|
test: off
|
||||||
|
|
||||||
deploy:
|
#deploy:
|
||||||
- provider: FTP
|
# - provider: FTP
|
||||||
protocol: ftps
|
# protocol: ftps
|
||||||
host:
|
# host:
|
||||||
secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||||
username:
|
# username:
|
||||||
secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||||
password:
|
# password:
|
||||||
secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||||
folder: appveyor
|
# folder: appveyor
|
||||||
application:
|
# application:
|
||||||
active_mode: false
|
# active_mode: false
|
||||||
on:
|
# on:
|
||||||
branch: master
|
# branch: master
|
||||||
appveyor_repo_tag: true
|
# appveyor_repo_tag: true
|
||||||
|
|
||||||
|
|
||||||
on_finish:
|
on_finish:
|
||||||
|
|
2
bin/DC/.gitignore
vendored
Normal file
2
bin/DC/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/Dos/Debug/.gitignore
vendored
Normal file
2
bin/Dos/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/Dos/Release/.gitignore
vendored
Normal file
2
bin/Dos/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/FreeBSD/Debug/.gitignore
vendored
Normal file
2
bin/FreeBSD/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/FreeBSD/Release/.gitignore
vendored
Normal file
2
bin/FreeBSD/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
6
bin/Mingw/Debug/.gitignore
vendored
6
bin/Mingw/Debug/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
||||||
/srb2sdl.exe
|
*.exe
|
||||||
/srb2win.exe
|
*.mo
|
||||||
/r_opengl.dll
|
r_opengl.dll
|
||||||
|
|
6
bin/Mingw/Release/.gitignore
vendored
6
bin/Mingw/Release/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
||||||
/srb2sdl.exe
|
*.exe
|
||||||
/srb2win.exe
|
*.mo
|
||||||
/r_opengl.dll
|
r_opengl.dll
|
||||||
|
|
2
bin/SDL/Debug/.gitignore
vendored
Normal file
2
bin/SDL/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/SDL/Release/.gitignore
vendored
Normal file
2
bin/SDL/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4IDbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4IDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4IRel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4IRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4Rel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4TDbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4TDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4TRel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4TRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPS16Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPS16Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPS16Rel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPS16Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIIDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIIDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIIRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIIRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSII_FPDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSII_FPDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSII_FPRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSII_FPRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIVDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIVDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIVRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIVRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIV_FPDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIV_FPDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIV_FPRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIV_FPRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/Release/.gitignore
vendored
Normal file
2
bin/WinCE/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/SH3Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/SH3Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/SH3Rel/.gitignore
vendored
Normal file
2
bin/WinCE/SH3Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/SH4Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/SH4Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/SH4Rel/.gitignore
vendored
Normal file
2
bin/WinCE/SH4Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/X86Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/X86Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/X86Rel/.gitignore
vendored
Normal file
2
bin/WinCE/X86Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/emulatorDbg/.gitignore
vendored
Normal file
2
bin/WinCE/emulatorDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/WinCE/emulatorRel/.gitignore
vendored
Normal file
2
bin/WinCE/emulatorRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
2
bin/dummy/.gitignore
vendored
Normal file
2
bin/dummy/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# DON'T REMOVE
|
||||||
|
# This keeps the folder from disappearing
|
3
debian/docs
vendored
3
debian/docs
vendored
|
@ -1,2 +1 @@
|
||||||
readme.txt
|
README.md
|
||||||
readme.txt
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
|
|
||||||
Bugs are now managed in the SDL bug tracker, here:
|
Bugs are now managed in the SDL bug tracker, here:
|
||||||
|
|
||||||
http://bugzilla.libsdl.org/
|
https://bugzilla.libsdl.org/
|
||||||
|
|
||||||
You may report bugs there, and search to see if a given issue has already
|
You may report bugs there, and search to see if a given issue has already
|
||||||
been reported, discussed, and maybe even fixed.
|
been reported, discussed, and maybe even fixed.
|
||||||
|
|
||||||
|
|
||||||
You may also find help on the SDL mailing list. Subscription information:
|
You may also find help at the SDL forums/mailing list:
|
||||||
|
|
||||||
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
https://discourse.libsdl.org/
|
||||||
|
|
||||||
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
|
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
|
||||||
bugs discussed on the mailing list may be forgotten or missed.
|
bugs discussed on the mailing list may be forgotten or missed.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
The 32-bit files are in i686-w64-mingw32
|
||||||
|
The 64-bit files are in x86_64-w64-mingw32
|
||||||
|
|
||||||
To install SDL for native development:
|
To install SDL for native development:
|
||||||
make native
|
make native
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32
|
||||||
|
|
||||||
all install:
|
all install:
|
||||||
@echo "Type \"make native\" to install 32-bit to /usr"
|
@echo "Type \"make native\" to install 32-bit to /usr"
|
||||||
@echo "Type \"make cross\" to install 32-bit and 64-bit to $(CROSS_PATH)"
|
@echo "Type \"make cross\" to install 32-bit and 64-bit to CROSS_PATH ($(CROSS_PATH))"
|
||||||
|
|
||||||
native:
|
native:
|
||||||
make install-package arch=i686-w64-mingw32 prefix=/usr
|
make install-package arch=i686-w64-mingw32 prefix=/usr
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
Please distribute this file with the SDL runtime environment:
|
Please distribute this file with the SDL runtime environment:
|
||||||
|
|
||||||
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
|
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
|
||||||
designed to make it easy to write multi-media software, such as games and
|
designed to make it easy to write multi-media software, such as games
|
||||||
emulators.
|
and emulators.
|
||||||
|
|
||||||
The Simple DirectMedia Layer library source code is available from:
|
The Simple DirectMedia Layer library source code is available from:
|
||||||
http://www.libsdl.org/
|
https://www.libsdl.org/
|
||||||
|
|
||||||
This library is distributed under the terms of the zlib license:
|
This library is distributed under the terms of the zlib license:
|
||||||
http://www.zlib.net/zlib_license.html
|
http://www.zlib.net/zlib_license.html
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
---
|
---
|
||||||
http://www.libsdl.org/
|
https://www.libsdl.org/
|
||||||
|
|
||||||
Simple DirectMedia Layer is a cross-platform development library designed
|
Simple DirectMedia Layer is a cross-platform development library designed
|
||||||
to provide low level access to audio, keyboard, mouse, joystick, and graphics
|
to provide low level access to audio, keyboard, mouse, joystick, and graphics
|
||||||
|
|
|
@ -1,6 +1,156 @@
|
||||||
|
|
||||||
This is a list of major changes in SDL's version history.
|
This is a list of major changes in SDL's version history.
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.0.7:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Added audio stream conversion functions:
|
||||||
|
SDL_NewAudioStream
|
||||||
|
SDL_AudioStreamPut
|
||||||
|
SDL_AudioStreamGet
|
||||||
|
SDL_AudioStreamAvailable
|
||||||
|
SDL_AudioStreamFlush
|
||||||
|
SDL_AudioStreamClear
|
||||||
|
SDL_FreeAudioStream
|
||||||
|
* Added functions to query and set the SDL memory allocation functions:
|
||||||
|
SDL_GetMemoryFunctions()
|
||||||
|
SDL_SetMemoryFunctions()
|
||||||
|
SDL_GetNumAllocations()
|
||||||
|
* Added locking functions for multi-threaded access to the joystick and game controller APIs:
|
||||||
|
SDL_LockJoysticks()
|
||||||
|
SDL_UnlockJoysticks()
|
||||||
|
* The following functions are now thread-safe:
|
||||||
|
SDL_SetEventFilter()
|
||||||
|
SDL_GetEventFilter()
|
||||||
|
SDL_AddEventWatch()
|
||||||
|
SDL_DelEventWatch()
|
||||||
|
|
||||||
|
|
||||||
|
General:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.0.6:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Added cross-platform Vulkan graphics support in SDL_vulkan.h
|
||||||
|
SDL_Vulkan_LoadLibrary()
|
||||||
|
SDL_Vulkan_GetVkGetInstanceProcAddr()
|
||||||
|
SDL_Vulkan_GetInstanceExtensions()
|
||||||
|
SDL_Vulkan_CreateSurface()
|
||||||
|
SDL_Vulkan_GetDrawableSize()
|
||||||
|
SDL_Vulkan_UnloadLibrary()
|
||||||
|
This is all the platform-specific code you need to bring up Vulkan on all SDL platforms. You can look at an example in test/testvulkan.c
|
||||||
|
* Added SDL_ComposeCustomBlendMode() to create custom blend modes for 2D rendering
|
||||||
|
* Added SDL_HasNEON() which returns whether the CPU has NEON instruction support
|
||||||
|
* Added support for many game controllers, including the Nintendo Switch Pro Controller
|
||||||
|
* Added support for inverted axes and separate axis directions in game controller mappings
|
||||||
|
* Added functions to return information about a joystick before it's opened:
|
||||||
|
SDL_JoystickGetDeviceVendor()
|
||||||
|
SDL_JoystickGetDeviceProduct()
|
||||||
|
SDL_JoystickGetDeviceProductVersion()
|
||||||
|
SDL_JoystickGetDeviceType()
|
||||||
|
SDL_JoystickGetDeviceInstanceID()
|
||||||
|
* Added functions to return information about an open joystick:
|
||||||
|
SDL_JoystickGetVendor()
|
||||||
|
SDL_JoystickGetProduct()
|
||||||
|
SDL_JoystickGetProductVersion()
|
||||||
|
SDL_JoystickGetType()
|
||||||
|
SDL_JoystickGetAxisInitialState()
|
||||||
|
* Added functions to return information about an open game controller:
|
||||||
|
SDL_GameControllerGetVendor()
|
||||||
|
SDL_GameControllerGetProduct()
|
||||||
|
SDL_GameControllerGetProductVersion()
|
||||||
|
* Added SDL_GameControllerNumMappings() and SDL_GameControllerMappingForIndex() to be able to enumerate the built-in game controller mappings
|
||||||
|
* Added SDL_LoadFile() and SDL_LoadFile_RW() to load a file into memory
|
||||||
|
* Added SDL_DuplicateSurface() to make a copy of a surface
|
||||||
|
* Added an experimental JACK audio driver
|
||||||
|
* Implemented non-power-of-two audio resampling, optionally using libsamplerate to perform the resampling
|
||||||
|
* Added the hint SDL_HINT_AUDIO_RESAMPLING_MODE to control the quality of resampling
|
||||||
|
* Added the hint SDL_HINT_RENDER_LOGICAL_SIZE_MODE to control the scaling policy for SDL_RenderSetLogicalSize():
|
||||||
|
"0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen (the default)
|
||||||
|
"1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
|
||||||
|
* Added the hints SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the mouse speed when being read from raw mouse input
|
||||||
|
* Added the hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether SDL will synthesize mouse events from touch events
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
* The new default audio driver on Windows is WASAPI and supports hot-plugging devices and changing the default audio device
|
||||||
|
* The old XAudio2 audio driver is deprecated and will be removed in the next release
|
||||||
|
* Added hints SDL_HINT_WINDOWS_INTRESOURCE_ICON and SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL to specify a custom icon resource ID for SDL windows
|
||||||
|
* The hint SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING is now on by default for compatibility with .NET languages and various Windows debuggers
|
||||||
|
* Updated the GUID format for game controller mappings, older mappings will be automatically converted on load
|
||||||
|
* Implemented the SDL_WINDOW_ALWAYS_ON_TOP flag on Windows
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
* Added an experimental KMS/DRM video driver for embedded development
|
||||||
|
|
||||||
|
iOS:
|
||||||
|
* Added a hint SDL_HINT_AUDIO_CATEGORY to control the audio category, determining whether the phone mute switch affects the audio
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.0.5:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Implemented audio capture support for some platforms
|
||||||
|
* Added SDL_DequeueAudio() to retrieve audio when buffer queuing is turned on for audio capture
|
||||||
|
* Added events for dragging and dropping text
|
||||||
|
* Added events for dragging and dropping multiple items
|
||||||
|
* By default the click raising a window will not be delivered to the SDL application. You can set the hint SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH to "1" to allow that click through to the window.
|
||||||
|
* Saving a surface with an alpha channel as a BMP will use a newer BMP format that supports alpha information. You can set the hint SDL_HINT_BMP_SAVE_LEGACY_FORMAT to "1" to use the old format.
|
||||||
|
* Added SDL_GetHintBoolean() to get the boolean value of a hint
|
||||||
|
* Added SDL_RenderSetIntegerScale() to set whether to smoothly scale or use integral multiples of the viewport size when scaling the rendering output
|
||||||
|
* Added SDL_CreateRGBSurfaceWithFormat() and SDL_CreateRGBSurfaceWithFormatFrom() to create an SDL surface with a specific pixel format
|
||||||
|
* Added SDL_GetDisplayUsableBounds() which returns the area usable for windows. For example, on Mac OS X, this subtracts the area occupied by the menu bar and dock.
|
||||||
|
* Added SDL_GetWindowBordersSize() which returns the size of the window's borders around the client area
|
||||||
|
* Added a window event SDL_WINDOWEVENT_HIT_TEST when a window had a hit test that wasn't SDL_HITTEST_NORMAL (e.g. in the title bar or window frame)
|
||||||
|
* Added SDL_SetWindowResizable() to change whether a window is resizable
|
||||||
|
* Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity() to affect the window transparency
|
||||||
|
* Added SDL_SetWindowModalFor() to set a window as modal for another window
|
||||||
|
* Added support for AUDIO_U16LSB and AUDIO_U16MSB to SDL_MixAudioFormat()
|
||||||
|
* Fixed flipped images when reading back from target textures when using the OpenGL renderer
|
||||||
|
* Fixed texture color modulation with SDL_BLENDMODE_NONE when using the OpenGL renderer
|
||||||
|
* Fixed bug where the alpha value of colorkeys was ignored when blitting in some cases
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
* Added a hint SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING to prevent SDL from raising a debugger exception to name threads. This exception can cause problems with .NET applications when running under a debugger.
|
||||||
|
* The hint SDL_HINT_THREAD_STACK_SIZE is now supported on Windows
|
||||||
|
* Fixed XBox controller triggers automatically being pulled at startup
|
||||||
|
* The first icon from the executable is used as the default window icon at runtime
|
||||||
|
* Fixed SDL log messages being printed twice if SDL was built with C library support
|
||||||
|
* Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications.
|
||||||
|
|
||||||
|
Mac OS X:
|
||||||
|
* Fixed selecting the dummy video driver
|
||||||
|
* The caps lock key now generates a pressed event when pressed and a released event when released, instead of a press/release event pair when pressed.
|
||||||
|
* Fixed mouse wheel events on Mac OS X 10.12
|
||||||
|
* The audio driver has been updated to use AVFoundation for better compatibility with newer versions of Mac OS X
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
* Added support for the Fcitx IME
|
||||||
|
* Added a window event SDL_WINDOWEVENT_TAKE_FOCUS when a window manager asks the SDL window whether it wants to take focus.
|
||||||
|
* Refresh rates are now rounded instead of truncated, e.g. 59.94 Hz is rounded up to 60 Hz instead of 59.
|
||||||
|
* Added initial support for touchscreens on Raspberry Pi
|
||||||
|
|
||||||
|
OpenBSD:
|
||||||
|
* SDL_GetBasePath() is now implemented on OpenBSD
|
||||||
|
|
||||||
|
iOS:
|
||||||
|
* Added support for dynamically loaded objects on iOS 8 and newer
|
||||||
|
|
||||||
|
tvOS:
|
||||||
|
* Added support for Apple TV
|
||||||
|
* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote.
|
||||||
|
|
||||||
|
Android:
|
||||||
|
* Fixed SDL not resizing window when Android screen resolution changes
|
||||||
|
* Corrected the joystick Z axis reporting for the accelerometer
|
||||||
|
|
||||||
|
Emscripten (running in a web browser):
|
||||||
|
* Many bug fixes and improvements
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
2.0.4:
|
2.0.4:
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,16 +1,23 @@
|
||||||
Android
|
Android
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Requirements:
|
Matt Styles wrote a tutorial on building SDL for Android with Visual Studio:
|
||||||
|
http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html
|
||||||
|
|
||||||
Android SDK (version 12 or later)
|
The rest of this README covers the old style build process.
|
||||||
http://developer.android.com/sdk/index.html
|
|
||||||
|
================================================================================
|
||||||
|
Requirements
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
Android SDK (version 16 or later)
|
||||||
|
https://developer.android.com/sdk/index.html
|
||||||
|
|
||||||
Android NDK r7 or later
|
Android NDK r7 or later
|
||||||
http://developer.android.com/tools/sdk/ndk/index.html
|
https://developer.android.com/tools/sdk/ndk/index.html
|
||||||
|
|
||||||
Minimum API level supported by SDL: 10 (Android 2.3.3)
|
Minimum API level supported by SDL: 10 (Android 2.3.3)
|
||||||
Joystick support is available for API level >=12 devices.
|
Joystick support is available for API level >= 12 devices.
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
How the port works
|
How the port works
|
||||||
|
@ -67,13 +74,13 @@ For more complex projects, follow these instructions:
|
||||||
|
|
||||||
1. Copy the android-project directory wherever you want to keep your projects
|
1. Copy the android-project directory wherever you want to keep your projects
|
||||||
and rename it to the name of your project.
|
and rename it to the name of your project.
|
||||||
2. Move or symlink this SDL directory into the <project>/jni directory
|
2. Move or symlink this SDL directory into the "<project>/jni" directory
|
||||||
3. Edit <project>/jni/src/Android.mk to include your source files
|
3. Edit "<project>/jni/src/Android.mk" to include your source files
|
||||||
4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
||||||
|
|
||||||
If you want to use the Eclipse IDE, skip to the Eclipse section below.
|
If you want to use the Eclipse IDE, skip to the Eclipse section below.
|
||||||
|
|
||||||
5. Create <project>/local.properties and use that to point to the Android SDK directory, by writing a line with the following form:
|
5. Create "<project>/local.properties" and use that to point to the Android SDK directory, by writing a line with the following form:
|
||||||
|
|
||||||
sdk.dir=PATH_TO_ANDROID_SDK
|
sdk.dir=PATH_TO_ANDROID_SDK
|
||||||
|
|
||||||
|
@ -121,15 +128,15 @@ This build uses the Android NDK module system.
|
||||||
Instructions:
|
Instructions:
|
||||||
1. Copy the android-project directory wherever you want to keep your projects
|
1. Copy the android-project directory wherever you want to keep your projects
|
||||||
and rename it to the name of your project.
|
and rename it to the name of your project.
|
||||||
2. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk
|
2. Rename "<project>/jni/src/Android_static.mk" to "<project>/jni/src/Android.mk"
|
||||||
(overwrite the existing one)
|
(overwrite the existing one)
|
||||||
3. Edit <project>/jni/src/Android.mk to include your source files
|
3. Edit "<project>/jni/src/Android.mk" to include your source files
|
||||||
4. create and export an environment variable named NDK_MODULE_PATH that points
|
4. create and export an environment variable named NDK_MODULE_PATH that points
|
||||||
to the parent directory of this SDL directory. e.g.:
|
to the parent directory of this SDL directory. e.g.:
|
||||||
|
|
||||||
export NDK_MODULE_PATH="$PWD"/..
|
export NDK_MODULE_PATH="$PWD"/..
|
||||||
|
|
||||||
5. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to
|
5. Edit "<project>/src/org/libsdl/app/SDLActivity.java" and remove the call to
|
||||||
System.loadLibrary("SDL2").
|
System.loadLibrary("SDL2").
|
||||||
6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
||||||
|
|
||||||
|
@ -229,7 +236,7 @@ under iOS, if the OS can not restore your GL context it will just kill your app)
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
For a quick tour on how Linux native threads interoperate with the Java VM, take
|
For a quick tour on how Linux native threads interoperate with the Java VM, take
|
||||||
a look here: http://developer.android.com/guide/practices/jni.html
|
a look here: https://developer.android.com/guide/practices/jni.html
|
||||||
|
|
||||||
If you want to use threads in your SDL app, it's strongly recommended that you
|
If you want to use threads in your SDL app, it's strongly recommended that you
|
||||||
do so by creating them using SDL functions. This way, the required attach/detach
|
do so by creating them using SDL functions. This way, the required attach/detach
|
||||||
|
@ -265,7 +272,7 @@ The best place to start is with docs/OVERVIEW.TXT
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
First make sure that you've installed Eclipse and the Android extensions as described here:
|
First make sure that you've installed Eclipse and the Android extensions as described here:
|
||||||
http://developer.android.com/tools/sdk/eclipse-adt.html
|
https://developer.android.com/tools/sdk/eclipse-adt.html
|
||||||
|
|
||||||
Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
|
Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
|
||||||
* File -> New -> Other
|
* File -> New -> Other
|
||||||
|
@ -281,7 +288,7 @@ Once you've copied the SDL android project and customized it, you can create an
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
There are some good tips and tricks for getting the most out of the
|
There are some good tips and tricks for getting the most out of the
|
||||||
emulator here: http://developer.android.com/tools/devices/emulator.html
|
emulator here: https://developer.android.com/tools/devices/emulator.html
|
||||||
|
|
||||||
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
|
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
|
||||||
|
|
||||||
|
@ -419,6 +426,19 @@ When you're done instrumenting with valgrind, you can disable the wrapper:
|
||||||
|
|
||||||
adb shell setprop wrap.org.libsdl.app ""
|
adb shell setprop wrap.org.libsdl.app ""
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
Graphics debugging
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
If you are developing on a compatible Tegra-based tablet, NVidia provides
|
||||||
|
Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL
|
||||||
|
and GLES libraries, you must follow their instructions for installing the
|
||||||
|
interposer library on a rooted device. The non-rooted instructions are not
|
||||||
|
compatible with applications that use SDL2 for video.
|
||||||
|
|
||||||
|
The Tegra Graphics Debugger is available from NVidia here:
|
||||||
|
https://developer.nvidia.com/tegra-graphics-debugger
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Why is API level 10 the minimum required?
|
Why is API level 10 the minimum required?
|
||||||
================================================================================
|
================================================================================
|
||||||
|
@ -433,7 +453,7 @@ Support for native OpenGL ES and ES2 applications was introduced in the NDK for
|
||||||
API level 4 and 8. EGL was made a stable API in the NDK for API level 9, which
|
API level 4 and 8. EGL was made a stable API in the NDK for API level 9, which
|
||||||
has since then been obsoleted, with the recommendation to developers to bump the
|
has since then been obsoleted, with the recommendation to developers to bump the
|
||||||
required API level to 10.
|
required API level to 10.
|
||||||
As of this writing, according to http://developer.android.com/about/dashboards/index.html
|
As of this writing, according to https://developer.android.com/about/dashboards/index.html
|
||||||
about 90% of the Android devices accessing Google Play support API level 10 or
|
about 90% of the Android devices accessing Google Play support API level 10 or
|
||||||
higher (March 2013).
|
higher (March 2013).
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ Build:
|
||||||
|
|
||||||
$ mkdir build
|
$ mkdir build
|
||||||
$ cd build
|
$ cd build
|
||||||
$ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
|
$ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2"
|
||||||
$ emmake make
|
$ emmake make
|
||||||
|
|
||||||
Or with cmake:
|
Or with cmake:
|
||||||
|
@ -22,8 +22,6 @@ To build one of the tests:
|
||||||
|
|
||||||
Uses GLES2 renderer or software
|
Uses GLES2 renderer or software
|
||||||
|
|
||||||
tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
|
|
||||||
|
|
||||||
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
|
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
|
||||||
|
|
||||||
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
|
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
|
||||||
|
|
|
@ -5,15 +5,12 @@ The latest development version of SDL is available via Mercurial.
|
||||||
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
||||||
as a developer works on a source tree, you can use "hg" to mirror that
|
as a developer works on a source tree, you can use "hg" to mirror that
|
||||||
source tree instead of waiting for an official release. Please look
|
source tree instead of waiting for an official release. Please look
|
||||||
at the Mercurial website ( http://mercurial.selenic.com/ ) for more
|
at the Mercurial website ( https://www.mercurial-scm.org/ ) for more
|
||||||
information on using hg, where you can also download software for
|
information on using hg, where you can also download software for
|
||||||
Mac OS X, Windows, and Unix systems.
|
Mac OS X, Windows, and Unix systems.
|
||||||
|
|
||||||
hg clone http://hg.libsdl.org/SDL
|
hg clone http://hg.libsdl.org/SDL
|
||||||
|
|
||||||
If you are building SDL with an IDE, you will need to copy the file
|
|
||||||
include/SDL_config.h.default to include/SDL_config.h before building.
|
|
||||||
|
|
||||||
If you are building SDL via configure, you will need to run autogen.sh
|
If you are building SDL via configure, you will need to run autogen.sh
|
||||||
before running configure.
|
before running configure.
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ Building the Simple DirectMedia Layer for iOS 5.1+
|
||||||
Requirements: Mac OS X 10.8 or later and the iOS 7+ SDK.
|
Requirements: Mac OS X 10.8 or later and the iOS 7+ SDK.
|
||||||
|
|
||||||
Instructions:
|
Instructions:
|
||||||
|
|
||||||
1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in Xcode.
|
1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in Xcode.
|
||||||
2. Select your desired target, and hit build.
|
2. Select your desired target, and hit build.
|
||||||
|
|
||||||
|
@ -74,17 +75,17 @@ By default SDL will not use the full pixel density of the screen on
|
||||||
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
|
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
|
||||||
creating your window to enable high-dpi support.
|
creating your window to enable high-dpi support.
|
||||||
|
|
||||||
When high-dpi support is enabled, SDL_GetWindowSize and display mode sizes
|
When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes
|
||||||
will still be in "screen coordinates" rather than pixels, but the window will
|
will still be in "screen coordinates" rather than pixels, but the window will
|
||||||
have a much greater pixel density when the device supports it, and the
|
have a much greater pixel density when the device supports it, and the
|
||||||
SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize functions (depending on
|
SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on
|
||||||
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
|
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
|
||||||
the size in pixels of the drawable screen framebuffer.
|
the size in pixels of the drawable screen framebuffer.
|
||||||
|
|
||||||
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
||||||
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
|
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
|
||||||
orthographic projection matrix using the size in screen coordinates
|
orthographic projection matrix using the size in screen coordinates
|
||||||
(SDL_GetWindowSize) can be used in order to display content at the same scale
|
(SDL_GetWindowSize()) can be used in order to display content at the same scale
|
||||||
no matter whether a Retina device is used or not.
|
no matter whether a Retina device is used or not.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
@ -156,7 +157,7 @@ Notes -- Accelerometer as Joystick
|
||||||
|
|
||||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||||
|
|
||||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Notes -- OpenGL ES
|
Notes -- OpenGL ES
|
||||||
|
@ -164,7 +165,7 @@ Notes -- OpenGL ES
|
||||||
|
|
||||||
Your SDL application for iOS uses OpenGL ES for video by default.
|
Your SDL application for iOS uses OpenGL ES for video by default.
|
||||||
|
|
||||||
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute.
|
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute().
|
||||||
|
|
||||||
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
||||||
|
|
||||||
|
@ -172,11 +173,11 @@ Finally, if your application completely redraws the screen each frame, you may f
|
||||||
|
|
||||||
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
|
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
|
||||||
|
|
||||||
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow is called.
|
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called.
|
||||||
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow is called.
|
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called.
|
||||||
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
|
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
|
||||||
|
|
||||||
The above objects can be obtained via SDL_GetWindowWMInfo (in SDL_syswm.h).
|
The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h).
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Notes -- Keyboard
|
Notes -- Keyboard
|
||||||
|
@ -219,7 +220,7 @@ Notes -- iPhone SDL limitations
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS).
|
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
|
||||||
|
|
||||||
Textures:
|
Textures:
|
||||||
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
||||||
|
@ -264,3 +265,20 @@ e.g.
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
Deploying to older versions of iOS
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 6.1
|
||||||
|
|
||||||
|
In order to do that you need to download an older version of Xcode:
|
||||||
|
https://developer.apple.com/download/more/?name=Xcode
|
||||||
|
|
||||||
|
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
|
||||||
|
|
||||||
|
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
|
||||||
|
|
||||||
|
Open your project and set your deployment target to the desired version of iOS
|
||||||
|
|
||||||
|
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
|
||||||
|
|
|
@ -19,14 +19,22 @@ sudo apt-get install build-essential mercurial make cmake autoconf automake \
|
||||||
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
|
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
|
||||||
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
|
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
|
||||||
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
|
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
|
||||||
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev
|
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
|
||||||
|
fcitx-libs-dev libsamplerate0-dev libsndio-dev
|
||||||
|
|
||||||
Ubuntu 14.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev"
|
Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
|
||||||
to that command line for Wayland and Mir support.
|
to that command line for Wayland support.
|
||||||
|
|
||||||
|
Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
|
||||||
|
line for Mir support.
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
- This includes all the audio targets except arts, because Ubuntu pulled the
|
- This includes all the audio targets except arts, because Ubuntu pulled the
|
||||||
artsc0-dev package, but in theory SDL still supports it.
|
artsc0-dev package, but in theory SDL still supports it.
|
||||||
|
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
|
||||||
|
for higher-quality audio resampling. SDL will work without it if the library
|
||||||
|
is missing, so it's safe to build in support even if the end user doesn't
|
||||||
|
have this library installed.
|
||||||
- DirectFB isn't included because the configure script (currently) fails to find
|
- DirectFB isn't included because the configure script (currently) fails to find
|
||||||
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
|
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
|
||||||
configure script to include DirectFB support. Send patches. :)
|
configure script to include DirectFB support. Send patches. :)
|
||||||
|
|
|
@ -8,6 +8,9 @@ From the developer's point of view, OS X is a sort of hybrid Mac and
|
||||||
Unix system, and you have the option of using either traditional
|
Unix system, and you have the option of using either traditional
|
||||||
command line tools or Apple's IDE Xcode.
|
command line tools or Apple's IDE Xcode.
|
||||||
|
|
||||||
|
Command Line Build
|
||||||
|
==================
|
||||||
|
|
||||||
To build SDL using the command line, use the standard configure and make
|
To build SDL using the command line, use the standard configure and make
|
||||||
process:
|
process:
|
||||||
|
|
||||||
|
@ -21,7 +24,7 @@ the gcc-fat.sh script in build-scripts:
|
||||||
|
|
||||||
mkdir mybuild
|
mkdir mybuild
|
||||||
cd mybuild
|
cd mybuild
|
||||||
CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++fat.sh ../configure
|
CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++-fat.sh ../configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
|
@ -86,8 +89,8 @@ so called "bundle", which basically is a fancy folder with a name like
|
||||||
To get this build automatically, add something like the following rule to
|
To get this build automatically, add something like the following rule to
|
||||||
your Makefile.am:
|
your Makefile.am:
|
||||||
|
|
||||||
bundle_contents = APP_NAME.app/Contents
|
bundle_contents = APP_NAME.app/Contents
|
||||||
APP_NAME_bundle: EXE_NAME
|
APP_NAME_bundle: EXE_NAME
|
||||||
mkdir -p $(bundle_contents)/MacOS
|
mkdir -p $(bundle_contents)/MacOS
|
||||||
mkdir -p $(bundle_contents)/Resources
|
mkdir -p $(bundle_contents)/Resources
|
||||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||||
|
@ -96,7 +99,7 @@ APP_NAME_bundle: EXE_NAME
|
||||||
You should replace EXE_NAME with the name of the executable. APP_NAME is what
|
You should replace EXE_NAME with the name of the executable. APP_NAME is what
|
||||||
will be visible to the user in the Finder. Usually it will be the same
|
will be visible to the user in the Finder. Usually it will be the same
|
||||||
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
|
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
|
||||||
usually is "TestGame". You might also want to use @PACKAGE@ to use the package
|
usually is "TestGame". You might also want to use `@PACKAGE@` to use the package
|
||||||
name as specified in your configure.in file.
|
name as specified in your configure.in file.
|
||||||
|
|
||||||
If your project builds more than one application, you will have to do a bit
|
If your project builds more than one application, you will have to do a bit
|
||||||
|
@ -105,13 +108,13 @@ more. For each of your target applications, you need a separate rule.
|
||||||
If you want the created bundles to be installed, you may want to add this
|
If you want the created bundles to be installed, you may want to add this
|
||||||
rule to your Makefile.am:
|
rule to your Makefile.am:
|
||||||
|
|
||||||
install-exec-hook: APP_NAME_bundle
|
install-exec-hook: APP_NAME_bundle
|
||||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||||
|
|
||||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||||
into $(DESTDIR)$(prefix)/Applications/.
|
into "$(DESTDIR)$(prefix)/Applications/".
|
||||||
|
|
||||||
Again, if you want to install multiple applications, you will have to augment
|
Again, if you want to install multiple applications, you will have to augment
|
||||||
the make rule accordingly.
|
the make rule accordingly.
|
||||||
|
@ -126,11 +129,16 @@ there are some more things you should do before shipping your product...
|
||||||
unless you also install SDL on that other computer. A good solution
|
unless you also install SDL on that other computer. A good solution
|
||||||
for this dilemma is to static link against SDL. On OS X, you can
|
for this dilemma is to static link against SDL. On OS X, you can
|
||||||
achieve that by linking against the libraries listed by
|
achieve that by linking against the libraries listed by
|
||||||
|
|
||||||
sdl-config --static-libs
|
sdl-config --static-libs
|
||||||
|
|
||||||
instead of those listed by
|
instead of those listed by
|
||||||
|
|
||||||
sdl-config --libs
|
sdl-config --libs
|
||||||
|
|
||||||
Depending on how exactly SDL is integrated into your build systems, the
|
Depending on how exactly SDL is integrated into your build systems, the
|
||||||
way to achieve that varies, so I won't describe it here in detail
|
way to achieve that varies, so I won't describe it here in detail
|
||||||
|
|
||||||
2) Add an 'Info.plist' to your application. That is a special XML file which
|
2) Add an 'Info.plist' to your application. That is a special XML file which
|
||||||
contains some meta-information about your application (like some copyright
|
contains some meta-information about your application (like some copyright
|
||||||
information, the version of your app, the name of an optional icon file,
|
information, the version of your app, the name of an optional icon file,
|
||||||
|
@ -156,8 +164,10 @@ The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||||
you should unpack the archive manually from the command line:
|
you should unpack the archive manually from the command line:
|
||||||
|
|
||||||
cd [path_to_SDL_source]
|
cd [path_to_SDL_source]
|
||||||
tar zxf Xcode.tar.gz
|
tar zxf Xcode.tar.gz
|
||||||
|
|
||||||
This will create a new folder called Xcode, which you can browse
|
This will create a new folder called Xcode, which you can browse
|
||||||
normally from the Finder.
|
normally from the Finder.
|
||||||
|
|
||||||
|
@ -227,4 +237,4 @@ following locations:
|
||||||
Functionality may be added in the future to help this.
|
Functionality may be added in the future to help this.
|
||||||
|
|
||||||
|
|
||||||
Known bugs are listed in the file "BUGS"
|
Known bugs are listed in the file "BUGS.txt".
|
||||||
|
|
|
@ -5,7 +5,7 @@ Porting
|
||||||
|
|
||||||
The first thing you have to do when porting to a new platform, is look at
|
The first thing you have to do when porting to a new platform, is look at
|
||||||
include/SDL_platform.h and create an entry there for your operating system.
|
include/SDL_platform.h and create an entry there for your operating system.
|
||||||
The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
|
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
|
||||||
Ideally SDL_platform.h will be able to auto-detect the system it's building
|
Ideally SDL_platform.h will be able to auto-detect the system it's building
|
||||||
on based on C preprocessor symbols.
|
on based on C preprocessor symbols.
|
||||||
|
|
||||||
|
@ -15,7 +15,9 @@ There are two basic ways of building SDL at the moment:
|
||||||
|
|
||||||
If you have a GNUish system, then you might try this. Edit configure.in,
|
If you have a GNUish system, then you might try this. Edit configure.in,
|
||||||
take a look at the large section labelled:
|
take a look at the large section labelled:
|
||||||
|
|
||||||
"Set up the configuration based on the host platform!"
|
"Set up the configuration based on the host platform!"
|
||||||
|
|
||||||
Add a section for your platform, and then re-run autogen.sh and build!
|
Add a section for your platform, and then re-run autogen.sh and build!
|
||||||
|
|
||||||
2. Using an IDE:
|
2. Using an IDE:
|
||||||
|
@ -23,10 +25,11 @@ There are two basic ways of building SDL at the moment:
|
||||||
If you're using an IDE or other non-configure build system, you'll probably
|
If you're using an IDE or other non-configure build system, you'll probably
|
||||||
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
|
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
|
||||||
add a section for your platform, and create a custom SDL_config_{platform}.h,
|
add a section for your platform, and create a custom SDL_config_{platform}.h,
|
||||||
based on SDL_config.h.minimal and SDL_config.h.in
|
based on SDL_config_minimal.h and SDL_config.h.in
|
||||||
|
|
||||||
Add the top level include directory to the header search path, and then add
|
Add the top level include directory to the header search path, and then add
|
||||||
the following sources to the project:
|
the following sources to the project:
|
||||||
|
|
||||||
src/*.c
|
src/*.c
|
||||||
src/atomic/*.c
|
src/atomic/*.c
|
||||||
src/audio/*.c
|
src/audio/*.c
|
||||||
|
@ -37,6 +40,7 @@ There are two basic ways of building SDL at the moment:
|
||||||
src/joystick/*.c
|
src/joystick/*.c
|
||||||
src/power/*.c
|
src/power/*.c
|
||||||
src/render/*.c
|
src/render/*.c
|
||||||
|
src/render/software/*.c
|
||||||
src/stdlib/*.c
|
src/stdlib/*.c
|
||||||
src/thread/*.c
|
src/thread/*.c
|
||||||
src/timer/*.c
|
src/timer/*.c
|
||||||
|
|
|
@ -23,7 +23,7 @@ Raspbian (other Linux distros may work as well).
|
||||||
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
||||||
|
|
||||||
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
||||||
OpenGL ES 2.x, it usually comes pre installed, but in any case:
|
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
|
||||||
|
|
||||||
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ will be placed in /opt/rpi-tools
|
||||||
|
|
||||||
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
||||||
|
|
||||||
You'll also need a Rasbian binary image.
|
You'll also need a Raspbian binary image.
|
||||||
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
||||||
After unzipping, you'll get file with a name like: <date>-wheezy-raspbian.img
|
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
|
||||||
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
||||||
|
|
||||||
export SYSROOT=/opt/rpi-sysroot
|
export SYSROOT=/opt/rpi-sysroot
|
||||||
|
@ -136,7 +136,7 @@ your app has read access to one of the following:
|
||||||
This is usually not a problem if you run from the physical terminal (as opposed
|
This is usually not a problem if you run from the physical terminal (as opposed
|
||||||
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
||||||
quick workaround is to run your app as root or add yourself to the tty group,
|
quick workaround is to run your app as root or add yourself to the tty group,
|
||||||
then re login to the system.
|
then re-login to the system.
|
||||||
|
|
||||||
sudo usermod -aG tty `whoami`
|
sudo usermod -aG tty `whoami`
|
||||||
|
|
||||||
|
|
|
@ -42,14 +42,14 @@ Same as SDL_FINGERDOWN.
|
||||||
===========================================================================
|
===========================================================================
|
||||||
Functions
|
Functions
|
||||||
===========================================================================
|
===========================================================================
|
||||||
SDL provides the ability to access the underlying Finger structures.
|
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||||
These structures should _never_ be modified.
|
These structures should _never_ be modified.
|
||||||
|
|
||||||
The following functions are included from SDL_touch.h
|
The following functions are included from SDL_touch.h
|
||||||
|
|
||||||
To get a SDL_TouchID call SDL_GetTouchDevice(index).
|
To get a SDL_TouchID call SDL_GetTouchDevice(int index).
|
||||||
This returns a SDL_TouchID.
|
This returns a SDL_TouchID.
|
||||||
IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this!
|
IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this!
|
||||||
|
|
||||||
The number of touch devices can be queried with SDL_GetNumTouchDevices().
|
The number of touch devices can be queried with SDL_GetNumTouchDevices().
|
||||||
|
|
||||||
|
@ -64,13 +64,13 @@ The most common reason to access SDL_Finger is to query the fingers outside the
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger.
|
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
|
||||||
This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed.
|
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
|
||||||
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
|
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
|
||||||
As a result, be very careful to check for NULL return values.
|
As a result, be very careful to check for NULL return values.
|
||||||
|
|
||||||
A SDL_Finger has the following fields:
|
A SDL_Finger has the following fields:
|
||||||
* x,y,pressure:
|
* x, y:
|
||||||
The current coordinates of the touch.
|
The current coordinates of the touch.
|
||||||
* pressure:
|
* pressure:
|
||||||
The pressure of the touch.
|
The pressure of the touch.
|
||||||
|
|
|
@ -39,3 +39,7 @@ Known Bugs:
|
||||||
that there's a bug in the library which prevents the window contents from
|
that there's a bug in the library which prevents the window contents from
|
||||||
refreshing if this is set to anything other than the default value.
|
refreshing if this is set to anything other than the default value.
|
||||||
|
|
||||||
|
Vulkan Surface Support
|
||||||
|
==============
|
||||||
|
|
||||||
|
Support for creating Vulkan surfaces is configured on by default. To disable it change the value of `SDL_VIDEO_VULKAN` to 0 in `SDL_config_windows.h`. You must install the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) in order to use Vulkan graphics in your application.
|
||||||
|
|
|
@ -2,11 +2,8 @@ WinRT
|
||||||
=====
|
=====
|
||||||
|
|
||||||
This port allows SDL applications to run on Microsoft's platforms that require
|
This port allows SDL applications to run on Microsoft's platforms that require
|
||||||
use of "Windows Runtime", aka. "WinRT", APIs. WinRT apps are currently
|
use of "Windows Runtime", aka. "WinRT", APIs. Microsoft may, in some cases,
|
||||||
full-screen only, and run in what Microsoft sometimes refers to as their
|
refer to them as either "Windows Store", or for Windows 10, "UWP" apps.
|
||||||
"Modern" (formerly, "Metro"), environment. For Windows 8.x, Microsoft may also
|
|
||||||
refer to them as "Windows Store" apps, due to them being distributed,
|
|
||||||
primarily, via a Microsoft-run online store (of the same name).
|
|
||||||
|
|
||||||
Some of the operating systems that include WinRT, are:
|
Some of the operating systems that include WinRT, are:
|
||||||
|
|
||||||
|
@ -19,13 +16,22 @@ Some of the operating systems that include WinRT, are:
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* Microsoft Visual C++ (aka Visual Studio), either 2015, 2013, or 2012
|
* Microsoft Visual C++ (aka Visual Studio), either 2017, 2015, 2013, or 2012
|
||||||
- Free, "Community" or "Express" editions may be used, so long as they
|
- Free, "Community" or "Express" editions may be used, so long as they
|
||||||
include support for either "Windows Store" or "Windows Phone" apps.
|
include support for either "Windows Store" or "Windows Phone" apps.
|
||||||
"Express" versions marked as supporting "Windows Desktop" development
|
"Express" versions marked as supporting "Windows Desktop" development
|
||||||
typically do not include support for creating WinRT apps, to note.
|
typically do not include support for creating WinRT apps, to note.
|
||||||
(The "Community" editions of Visual C++ do, however, support both
|
(The "Community" editions of Visual C++ do, however, support both
|
||||||
desktop/Win32 and WinRT development).
|
desktop/Win32 and WinRT development).
|
||||||
|
- Visual Studio 2017 can be used, however it is recommented that you install
|
||||||
|
the Visual C++ 2015 build tools. These build tools can be installed
|
||||||
|
using VS 2017's installer. Be sure to also install the workload for
|
||||||
|
"Universal Windows Platform development", its optional component, the
|
||||||
|
"C++ Universal Windows Platform tools", and for UWP / Windows 10
|
||||||
|
development, the "Windows 10 SDK (10.0.10240.0)". Please note that
|
||||||
|
targeting UWP / Windows 10 apps from development machine(s) running
|
||||||
|
earlier versions of Windows, such as Windows 7, is not always supported
|
||||||
|
by Visual Studio, and you may get error(s) when attempting to do so.
|
||||||
- Visual C++ 2012 can only build apps that target versions 8.0 of Windows,
|
- Visual C++ 2012 can only build apps that target versions 8.0 of Windows,
|
||||||
or Windows Phone. 8.0-targetted apps will run on devices running 8.1
|
or Windows Phone. 8.0-targetted apps will run on devices running 8.1
|
||||||
editions of Windows, however they will not be able to take advantage of
|
editions of Windows, however they will not be able to take advantage of
|
||||||
|
@ -69,7 +75,10 @@ Here is a rough list of what works, and what doens't:
|
||||||
anything outside of the app is not supported.
|
anything outside of the app is not supported.
|
||||||
* system path retrieval via SDL's filesystem APIs
|
* system path retrieval via SDL's filesystem APIs
|
||||||
* game controllers. Support is provided via the SDL_Joystick and
|
* game controllers. Support is provided via the SDL_Joystick and
|
||||||
SDL_GameController APIs, and is backed by Microsoft's XInput API.
|
SDL_GameController APIs, and is backed by Microsoft's XInput API. Please
|
||||||
|
note, however, that Windows limits game-controller support in UWP apps to,
|
||||||
|
"Xbox compatible controllers" (many controllers that work in Win32 apps,
|
||||||
|
do not work in UWP, due to restrictions in UWP itself.)
|
||||||
* multi-touch input
|
* multi-touch input
|
||||||
* app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
|
* app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
|
||||||
appropriate.
|
appropriate.
|
||||||
|
@ -82,7 +91,9 @@ Here is a rough list of what works, and what doens't:
|
||||||
|
|
||||||
* What partially works:
|
* What partially works:
|
||||||
* keyboard input. Most of WinRT's documented virtual keys are supported, as
|
* keyboard input. Most of WinRT's documented virtual keys are supported, as
|
||||||
well as many keys with documented hardware scancodes.
|
well as many keys with documented hardware scancodes. Converting
|
||||||
|
SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs
|
||||||
|
(MapVirtualKey()) in Microsoft's Windows Store / UWP APIs.
|
||||||
* SDLmain. WinRT uses a different signature for each app's main() function.
|
* SDLmain. WinRT uses a different signature for each app's main() function.
|
||||||
SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
|
SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
|
||||||
(in `SDL\src\main\winrt\`) directly in order for their C-style main()
|
(in `SDL\src\main\winrt\`) directly in order for their C-style main()
|
||||||
|
@ -95,8 +106,10 @@ Here is a rough list of what works, and what doens't:
|
||||||
SDL_CreateSystemCursor() (unsupported on Windows Phone)
|
SDL_CreateSystemCursor() (unsupported on Windows Phone)
|
||||||
* SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal(). This are not currently
|
* SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal(). This are not currently
|
||||||
supported by WinRT itself.
|
supported by WinRT itself.
|
||||||
* joysticks and game controllers that aren't supported by Microsoft's XInput
|
* joysticks and game controllers that either are not supported by
|
||||||
API.
|
Microsoft's XInput API, or are not supported within UWP apps (many
|
||||||
|
controllers that work in Win32, do not work in UWP, due to restrictions in
|
||||||
|
UWP itself).
|
||||||
* turning off VSync when rendering on Windows Phone. Attempts to turn VSync
|
* turning off VSync when rendering on Windows Phone. Attempts to turn VSync
|
||||||
off on Windows Phone result either in Direct3D not drawing anything, or it
|
off on Windows Phone result either in Direct3D not drawing anything, or it
|
||||||
forcing VSync back on. As such, SDL_RENDERER_PRESENTVSYNC will always get
|
forcing VSync back on. As such, SDL_RENDERER_PRESENTVSYNC will always get
|
||||||
|
@ -160,7 +173,9 @@ following, at a high-level:
|
||||||
the linker, and will copy SDL's .dll files to your app's final output.
|
the linker, and will copy SDL's .dll files to your app's final output.
|
||||||
4. adjust your app's build settings, at minimum, telling it where to find SDL's
|
4. adjust your app's build settings, at minimum, telling it where to find SDL's
|
||||||
header files.
|
header files.
|
||||||
5. add a file that contains a WinRT-appropriate main function.
|
5. add files that contains a WinRT-appropriate main function, along with some
|
||||||
|
data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls)
|
||||||
|
work properly.
|
||||||
6. add SDL-specific app code.
|
6. add SDL-specific app code.
|
||||||
7. build and run your app.
|
7. build and run your app.
|
||||||
|
|
||||||
|
@ -268,33 +283,27 @@ To change these settings:
|
||||||
10. close the dialog, saving settings, by clicking the "OK" button
|
10. close the dialog, saving settings, by clicking the "OK" button
|
||||||
|
|
||||||
|
|
||||||
### 5. Add a WinRT-appropriate main function to the app. ###
|
### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ###
|
||||||
|
|
||||||
C/C++-based WinRT apps do contain a `main` function that the OS will invoke when
|
A few files should be included directly in your app's MSVC project, specifically:
|
||||||
the app starts launching. The parameters of WinRT main functions are different
|
1. a WinRT-appropriate main function (which is different than main() functions on
|
||||||
than those found on other platforms, Win32 included. SDL/WinRT provides a
|
other platforms)
|
||||||
platform-appropriate main function that will perform these actions, setup key
|
2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor
|
||||||
portions of the app, then invoke a classic, C/C++-style main function (that take
|
(if and when the app needs to do so). *If this cursor resource is not
|
||||||
in "argc" and "argv" parameters). The code for this file is contained inside
|
included, mouse-position reporting may fail if and when the cursor is
|
||||||
SDL's source distribution, under `src/main/winrt/SDL_winrt_main_NonXAML.cpp`.
|
hidden, due to possible bugs/design-oddities in Windows itself.*
|
||||||
You'll need to add this file, or a copy of it, to your app's project, and make
|
|
||||||
sure it gets compiled using a Microsoft-specific set of C++ extensions called
|
|
||||||
C++/CX.
|
|
||||||
|
|
||||||
**NOTE: C++/CX compilation is currently required in at least one file of your
|
To include these files:
|
||||||
app's project. This is to make sure that Visual C++'s linker builds a 'Windows
|
|
||||||
Metadata' file (.winmd) for your app. Not doing so can lead to build errors.**
|
|
||||||
|
|
||||||
To include `SDL_winrt_main_NonXAML.cpp`:
|
|
||||||
|
|
||||||
1. right-click on your project (again, in Visual C++'s Solution Explorer),
|
1. right-click on your project (again, in Visual C++'s Solution Explorer),
|
||||||
navigate to "Add", then choose "Existing Item...".
|
navigate to "Add", then choose "Existing Item...".
|
||||||
2. open `SDL_winrt_main_NonXAML.cpp`, which is found inside SDL's source
|
2. navigate to the directory containing SDL's source code, then into its
|
||||||
distribution, under `src/main/winrt/`. Make sure that the open-file dialog
|
subdirectory, 'src/main/winrt/'. Select, then add, the following files:
|
||||||
closes, either by double-clicking on the file, or single-clicking on it and
|
- `SDL_winrt_main_NonXAML.cpp`
|
||||||
then clicking Add.
|
- `SDL2-WinRTResources.rc`
|
||||||
3. right-click on the file (as listed in your project), then click on
|
- `SDL2-WinRTResource_BlankCursor.cur`
|
||||||
"Properties...".
|
3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your
|
||||||
|
project), then click on "Properties...".
|
||||||
4. in the drop-down box next to "Configuration", choose, "All Configurations"
|
4. in the drop-down box next to "Configuration", choose, "All Configurations"
|
||||||
5. in the drop-down box next to "Platform", choose, "All Platforms"
|
5. in the drop-down box next to "Platform", choose, "All Platforms"
|
||||||
6. in the left-hand list, click on "C/C++"
|
6. in the left-hand list, click on "C/C++"
|
||||||
|
@ -302,6 +311,11 @@ To include `SDL_winrt_main_NonXAML.cpp`:
|
||||||
8. click the OK button. This will close the dialog.
|
8. click the OK button. This will close the dialog.
|
||||||
|
|
||||||
|
|
||||||
|
**NOTE: C++/CX compilation is currently required in at least one file of your
|
||||||
|
app's project. This is to make sure that Visual C++'s linker builds a 'Windows
|
||||||
|
Metadata' file (.winmd) for your app. Not doing so can lead to build errors.**
|
||||||
|
|
||||||
|
|
||||||
### 6. Add app code and assets ###
|
### 6. Add app code and assets ###
|
||||||
|
|
||||||
At this point, you can add in SDL-specific source code. Be sure to include a
|
At this point, you can add in SDL-specific source code. Be sure to include a
|
||||||
|
@ -466,3 +480,62 @@ section.
|
||||||
|
|
||||||
/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib
|
/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib
|
||||||
|
|
||||||
|
|
||||||
|
#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values
|
||||||
|
|
||||||
|
This may be caused by a bug in Windows itself, whereby hiding the mouse
|
||||||
|
cursor can cause mouse-position reporting to fail.
|
||||||
|
|
||||||
|
SDL provides a workaround for this, but it requires that an app links to a
|
||||||
|
set of Win32-style cursor image-resource files. A copy of suitable resource
|
||||||
|
files can be found in `src/main/winrt/`. Adding them to an app's Visual C++
|
||||||
|
project file should be sufficient to get the app to use them.
|
||||||
|
|
||||||
|
|
||||||
|
#### SDL's Visual Studio project file fails to open, with message, "The system can't find the file specified."
|
||||||
|
|
||||||
|
This can be caused for any one of a few reasons, which Visual Studio can
|
||||||
|
report, but won't always do so in an up-front manner.
|
||||||
|
|
||||||
|
To help determine why this error comes up:
|
||||||
|
|
||||||
|
1. open a copy of Visual Studio without opening a project file. This can be
|
||||||
|
accomplished via Windows' Start Menu, among other means.
|
||||||
|
2. show Visual Studio's Output window. This can be done by going to VS'
|
||||||
|
menu bar, then to View, and then to Output.
|
||||||
|
3. try opening the SDL project file directly by going to VS' menu bar, then
|
||||||
|
to File, then to Open, then to Project/Solution. When a File-Open dialog
|
||||||
|
appears, open the SDL project (such as the one in SDL's source code, in its
|
||||||
|
directory, VisualC-WinRT/UWP_VS2015/).
|
||||||
|
4. after attempting to open SDL's Visual Studio project file, additional error
|
||||||
|
information will be output to the Output window.
|
||||||
|
|
||||||
|
If Visual Studio reports (via its Output window) that the project:
|
||||||
|
|
||||||
|
"could not be loaded because it's missing install components. To fix this launch Visual Studio setup with the following selections:
|
||||||
|
Microsoft.VisualStudio.ComponentGroup.UWP.VC"
|
||||||
|
|
||||||
|
... then you will need to re-launch Visual Studio's installer, and make sure that
|
||||||
|
the workflow for "Universal Windows Platform development" is checked, and that its
|
||||||
|
optional component, "C++ Universal Windows Platform tools" is also checked. While
|
||||||
|
you are there, if you are planning on targeting UWP / Windows 10, also make sure
|
||||||
|
that you check the optional component, "Windows 10 SDK (10.0.10240.0)". After
|
||||||
|
making sure these items are checked as-appropriate, install them.
|
||||||
|
|
||||||
|
Once you install these components, try re-launching Visual Studio, and re-opening
|
||||||
|
the SDL project file. If you still get the error dialog, try using the Output
|
||||||
|
window, again, seeing what Visual Studio says about it.
|
||||||
|
|
||||||
|
|
||||||
|
#### Game controllers / joysticks aren't working!
|
||||||
|
|
||||||
|
Windows only permits certain game controllers and joysticks to work within
|
||||||
|
WinRT / UWP apps. Even if a game controller or joystick works in a Win32
|
||||||
|
app, that device is not guaranteed to work inside a WinRT / UWP app.
|
||||||
|
|
||||||
|
According to Microsoft, "Xbox compatible controllers" should work inside
|
||||||
|
UWP apps, potentially with more working in the future. This includes, but
|
||||||
|
may not be limited to, Microsoft-made Xbox controllers and USB adapters.
|
||||||
|
(Source: https://social.msdn.microsoft.com/Forums/en-US/9064838b-e8c3-4c18-8a83-19bf0dfe150d/xinput-fails-to-detect-game-controllers?forum=wpdevelop)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ If you need help with the library, or just want to discuss SDL related
|
||||||
issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php)
|
issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php)
|
||||||
|
|
||||||
If you want to report bugs or contribute patches, please submit them to
|
If you want to report bugs or contribute patches, please submit them to
|
||||||
[bugzilla](http://bugzilla.libsdl.org/)
|
[bugzilla](https://bugzilla.libsdl.org/)
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
prefix=/usr/local/cross-tools/i686-w64-mingw32
|
prefix=/usr/local/i686-w64-mingw32
|
||||||
exec_prefix=${prefix}
|
exec_prefix=${prefix}
|
||||||
exec_prefix_set=no
|
exec_prefix_set=no
|
||||||
libdir=${exec_prefix}/lib
|
libdir=${exec_prefix}/lib
|
||||||
|
@ -39,7 +39,7 @@ while test $# -gt 0; do
|
||||||
echo $exec_prefix
|
echo $exec_prefix
|
||||||
;;
|
;;
|
||||||
--version)
|
--version)
|
||||||
echo 2.0.4
|
echo 2.0.7
|
||||||
;;
|
;;
|
||||||
--cflags)
|
--cflags)
|
||||||
echo -I${prefix}/include/SDL2 -Dmain=SDL_main
|
echo -I${prefix}/include/SDL2 -Dmain=SDL_main
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -26,8 +26,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _SDL_H
|
#ifndef SDL_h_
|
||||||
#define _SDL_H
|
#define SDL_h_
|
||||||
|
|
||||||
#include "SDL_main.h"
|
#include "SDL_main.h"
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
@ -40,10 +40,10 @@
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
#include "SDL_events.h"
|
#include "SDL_events.h"
|
||||||
#include "SDL_filesystem.h"
|
#include "SDL_filesystem.h"
|
||||||
#include "SDL_joystick.h"
|
|
||||||
#include "SDL_gamecontroller.h"
|
#include "SDL_gamecontroller.h"
|
||||||
#include "SDL_haptic.h"
|
#include "SDL_haptic.h"
|
||||||
#include "SDL_hints.h"
|
#include "SDL_hints.h"
|
||||||
|
#include "SDL_joystick.h"
|
||||||
#include "SDL_loadso.h"
|
#include "SDL_loadso.h"
|
||||||
#include "SDL_log.h"
|
#include "SDL_log.h"
|
||||||
#include "SDL_messagebox.h"
|
#include "SDL_messagebox.h"
|
||||||
|
@ -51,6 +51,7 @@
|
||||||
#include "SDL_power.h"
|
#include "SDL_power.h"
|
||||||
#include "SDL_render.h"
|
#include "SDL_render.h"
|
||||||
#include "SDL_rwops.h"
|
#include "SDL_rwops.h"
|
||||||
|
#include "SDL_shape.h"
|
||||||
#include "SDL_system.h"
|
#include "SDL_system.h"
|
||||||
#include "SDL_thread.h"
|
#include "SDL_thread.h"
|
||||||
#include "SDL_timer.h"
|
#include "SDL_timer.h"
|
||||||
|
@ -72,14 +73,14 @@ extern "C" {
|
||||||
* specify the subsystems which you will be using in your application.
|
* specify the subsystems which you will be using in your application.
|
||||||
*/
|
*/
|
||||||
/* @{ */
|
/* @{ */
|
||||||
#define SDL_INIT_TIMER 0x00000001
|
#define SDL_INIT_TIMER 0x00000001u
|
||||||
#define SDL_INIT_AUDIO 0x00000010
|
#define SDL_INIT_AUDIO 0x00000010u
|
||||||
#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
|
#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
|
||||||
#define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
|
#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
|
||||||
#define SDL_INIT_HAPTIC 0x00001000
|
#define SDL_INIT_HAPTIC 0x00001000u
|
||||||
#define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
|
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
|
||||||
#define SDL_INIT_EVENTS 0x00004000
|
#define SDL_INIT_EVENTS 0x00004000u
|
||||||
#define SDL_INIT_NOPARACHUTE 0x00100000 /**< compatibility; this flag is ignored. */
|
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
|
||||||
#define SDL_INIT_EVERYTHING ( \
|
#define SDL_INIT_EVERYTHING ( \
|
||||||
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
||||||
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
|
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
|
||||||
|
@ -95,8 +96,8 @@ extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
|
||||||
* This function initializes specific SDL subsystems
|
* This function initializes specific SDL subsystems
|
||||||
*
|
*
|
||||||
* Subsystem initialization is ref-counted, you must call
|
* Subsystem initialization is ref-counted, you must call
|
||||||
* SDL_QuitSubSystem for each SDL_InitSubSystem to correctly
|
* SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
|
||||||
* shutdown a subsystem manually (or call SDL_Quit to force shutdown).
|
* shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
|
||||||
* If a subsystem is already loaded then this call will
|
* If a subsystem is already loaded then this call will
|
||||||
* increase the ref-count and return.
|
* increase the ref-count and return.
|
||||||
*/
|
*/
|
||||||
|
@ -127,6 +128,6 @@ extern DECLSPEC void SDLCALL SDL_Quit(void);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_H */
|
#endif /* SDL_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_assert_h
|
#ifndef SDL_assert_h_
|
||||||
#define _SDL_assert_h
|
#define SDL_assert_h_
|
||||||
|
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
|
@ -51,9 +51,11 @@ assert can have unique static variables associated with it.
|
||||||
/* Don't include intrin.h here because it contains C++ code */
|
/* Don't include intrin.h here because it contains C++ code */
|
||||||
extern void __cdecl __debugbreak(void);
|
extern void __cdecl __debugbreak(void);
|
||||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||||
#elif (!defined(__NACL__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
|
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||||
#elif defined(HAVE_SIGNAL_H)
|
#elif defined(__386__) && defined(__WATCOMC__)
|
||||||
|
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||||
|
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
||||||
#else
|
#else
|
||||||
|
@ -63,7 +65,7 @@ assert can have unique static variables associated with it.
|
||||||
|
|
||||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||||
# define SDL_FUNCTION __func__
|
# define SDL_FUNCTION __func__
|
||||||
#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
|
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
|
||||||
# define SDL_FUNCTION __FUNCTION__
|
# define SDL_FUNCTION __FUNCTION__
|
||||||
#else
|
#else
|
||||||
# define SDL_FUNCTION "???"
|
# define SDL_FUNCTION "???"
|
||||||
|
@ -201,7 +203,7 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||||
*
|
*
|
||||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
||||||
*
|
*
|
||||||
* \return SDL_AssertState value of how to handle the assertion failure.
|
* Return SDL_AssertState value of how to handle the assertion failure.
|
||||||
*
|
*
|
||||||
* \param handler Callback function, called when an assertion fails.
|
* \param handler Callback function, called when an assertion fails.
|
||||||
* \param userdata A pointer passed to the callback as-is.
|
* \param userdata A pointer passed to the callback as-is.
|
||||||
|
@ -250,7 +252,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse
|
||||||
* <code>
|
* <code>
|
||||||
* const SDL_AssertData *item = SDL_GetAssertionReport();
|
* const SDL_AssertData *item = SDL_GetAssertionReport();
|
||||||
* while (item) {
|
* while (item) {
|
||||||
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
|
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
|
||||||
* item->condition, item->function, item->filename,
|
* item->condition, item->function, item->filename,
|
||||||
* item->linenum, item->trigger_count,
|
* item->linenum, item->trigger_count,
|
||||||
* item->always_ignore ? "yes" : "no");
|
* item->always_ignore ? "yes" : "no");
|
||||||
|
@ -284,6 +286,6 @@ extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_assert_h */
|
#endif /* SDL_assert_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -56,8 +56,8 @@
|
||||||
* All of the atomic operations that modify memory are full memory barriers.
|
* All of the atomic operations that modify memory are full memory barriers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_atomic_h_
|
#ifndef SDL_atomic_h_
|
||||||
#define _SDL_atomic_h_
|
#define SDL_atomic_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_platform.h"
|
#include "SDL_platform.h"
|
||||||
|
@ -118,13 +118,16 @@ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||||
* The compiler barrier prevents the compiler from reordering
|
* The compiler barrier prevents the compiler from reordering
|
||||||
* reads and writes to globally visible variables across the call.
|
* reads and writes to globally visible variables across the call.
|
||||||
*/
|
*/
|
||||||
#if defined(_MSC_VER) && (_MSC_VER > 1200)
|
#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
|
||||||
void _ReadWriteBarrier(void);
|
void _ReadWriteBarrier(void);
|
||||||
#pragma intrinsic(_ReadWriteBarrier)
|
#pragma intrinsic(_ReadWriteBarrier)
|
||||||
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
||||||
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||||
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
||||||
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
extern _inline void SDL_CompilerBarrier (void);
|
||||||
|
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
|
||||||
#else
|
#else
|
||||||
#define SDL_CompilerBarrier() \
|
#define SDL_CompilerBarrier() \
|
||||||
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
||||||
|
@ -149,6 +152,9 @@ void _ReadWriteBarrier(void);
|
||||||
* For more information on these semantics, take a look at the blog post:
|
* For more information on these semantics, take a look at the blog post:
|
||||||
* http://preshing.com/20120913/acquire-and-release-semantics
|
* http://preshing.com/20120913/acquire-and-release-semantics
|
||||||
*/
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
||||||
|
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
||||||
|
|
||||||
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
|
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
|
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
|
||||||
|
@ -156,11 +162,11 @@ void _ReadWriteBarrier(void);
|
||||||
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
|
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||||
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
|
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
|
||||||
#ifdef __thumb__
|
#ifdef __thumb__
|
||||||
/* The mcr instruction isn't available in thumb mode, use real functions */
|
/* The mcr instruction isn't available in thumb mode, use real functions */
|
||||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease();
|
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
|
||||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire();
|
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
|
||||||
#else
|
#else
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
||||||
|
@ -263,6 +269,6 @@ extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
||||||
|
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_atomic_h_ */
|
#endif /* SDL_atomic_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Access to the raw audio mixing buffer for the SDL library.
|
* Access to the raw audio mixing buffer for the SDL library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_audio_h
|
#ifndef SDL_audio_h_
|
||||||
#define _SDL_audio_h
|
#define SDL_audio_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -164,6 +164,15 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
||||||
|
*
|
||||||
|
* For multi-channel audio, the default SDL channel mapping is:
|
||||||
|
* 2: FL FR (stereo)
|
||||||
|
* 3: FL FR LFE (2.1 surround)
|
||||||
|
* 4: FL FR BL BR (quad)
|
||||||
|
* 5: FL FR FC BL BR (quad + center)
|
||||||
|
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
||||||
|
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
||||||
|
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
||||||
*/
|
*/
|
||||||
typedef struct SDL_AudioSpec
|
typedef struct SDL_AudioSpec
|
||||||
{
|
{
|
||||||
|
@ -171,7 +180,7 @@ typedef struct SDL_AudioSpec
|
||||||
SDL_AudioFormat format; /**< Audio data format */
|
SDL_AudioFormat format; /**< Audio data format */
|
||||||
Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
|
Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
|
||||||
Uint8 silence; /**< Audio buffer silence value (calculated) */
|
Uint8 silence; /**< Audio buffer silence value (calculated) */
|
||||||
Uint16 samples; /**< Audio buffer size in samples (power of 2) */
|
Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */
|
||||||
Uint16 padding; /**< Necessary for some compile environments */
|
Uint16 padding; /**< Necessary for some compile environments */
|
||||||
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
||||||
SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */
|
SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */
|
||||||
|
@ -184,7 +193,23 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
|
||||||
SDL_AudioFormat format);
|
SDL_AudioFormat format);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A structure to hold a set of audio conversion filters and buffers.
|
* \brief Upper limit of filters in SDL_AudioCVT
|
||||||
|
*
|
||||||
|
* The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
|
||||||
|
* currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
|
||||||
|
* one of which is the terminating NULL pointer.
|
||||||
|
*/
|
||||||
|
#define SDL_AUDIOCVT_MAX_FILTERS 9
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \struct SDL_AudioCVT
|
||||||
|
* \brief A structure to hold a set of audio conversion filters and buffers.
|
||||||
|
*
|
||||||
|
* Note that various parts of the conversion pipeline can take advantage
|
||||||
|
* of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require
|
||||||
|
* you to pass it aligned data, but can possibly run much faster if you
|
||||||
|
* set both its (buf) field to a pointer that is aligned to 16 bytes, and its
|
||||||
|
* (len) field to something that's a multiple of 16, if possible.
|
||||||
*/
|
*/
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
|
/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
|
||||||
|
@ -208,7 +233,7 @@ typedef struct SDL_AudioCVT
|
||||||
int len_cvt; /**< Length of converted audio buffer */
|
int len_cvt; /**< Length of converted audio buffer */
|
||||||
int len_mult; /**< buffer must be len*len_mult big */
|
int len_mult; /**< buffer must be len*len_mult big */
|
||||||
double len_ratio; /**< Given len, final size is len*len_ratio */
|
double len_ratio; /**< Given len, final size is len*len_ratio */
|
||||||
SDL_AudioFilter filters[10]; /**< Filter list */
|
SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */
|
||||||
int filter_index; /**< Current audio conversion function */
|
int filter_index; /**< Current audio conversion function */
|
||||||
} SDL_AUDIOCVT_PACKED SDL_AudioCVT;
|
} SDL_AUDIOCVT_PACKED SDL_AudioCVT;
|
||||||
|
|
||||||
|
@ -278,7 +303,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||||
* protect data structures that it accesses by calling SDL_LockAudio()
|
* protect data structures that it accesses by calling SDL_LockAudio()
|
||||||
* and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
|
* and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
|
||||||
* pointer here, and call SDL_QueueAudio() with some frequency, to queue
|
* pointer here, and call SDL_QueueAudio() with some frequency, to queue
|
||||||
* more audio samples to be played.
|
* more audio samples to be played (or for capture devices, call
|
||||||
|
* SDL_DequeueAudio() with some frequency, to obtain audio samples).
|
||||||
* - \c desired->userdata is passed as the first parameter to your callback
|
* - \c desired->userdata is passed as the first parameter to your callback
|
||||||
* function. If you passed a NULL callback, this value is ignored.
|
* function. If you passed a NULL callback, this value is ignored.
|
||||||
*
|
*
|
||||||
|
@ -433,10 +459,10 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
|
||||||
* This function takes a source format and rate and a destination format
|
* This function takes a source format and rate and a destination format
|
||||||
* and rate, and initializes the \c cvt structure with information needed
|
* and rate, and initializes the \c cvt structure with information needed
|
||||||
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
|
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
|
||||||
* to the other.
|
* to the other. An unsupported format causes an error and -1 will be returned.
|
||||||
*
|
*
|
||||||
* \return -1 if the format conversion is not supported, 0 if there's
|
* \return 0 if no conversion is needed, 1 if the audio filter is set up,
|
||||||
* no conversion needed, or 1 if the audio filter is set up.
|
* or -1 on error.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
||||||
SDL_AudioFormat src_format,
|
SDL_AudioFormat src_format,
|
||||||
|
@ -455,9 +481,137 @@ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
||||||
* The data conversion may expand the size of the audio data, so the buffer
|
* The data conversion may expand the size of the audio data, so the buffer
|
||||||
* \c cvt->buf should be allocated after the \c cvt structure is initialized by
|
* \c cvt->buf should be allocated after the \c cvt structure is initialized by
|
||||||
* SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
|
* SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
|
||||||
|
*
|
||||||
|
* \return 0 on success or -1 if \c cvt->buf is NULL.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt);
|
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt);
|
||||||
|
|
||||||
|
/* SDL_AudioStream is a new audio conversion interface.
|
||||||
|
The benefits vs SDL_AudioCVT:
|
||||||
|
- it can handle resampling data in chunks without generating
|
||||||
|
artifacts, when it doesn't have the complete buffer available.
|
||||||
|
- it can handle incoming data in any variable size.
|
||||||
|
- You push data as you have it, and pull it when you need it
|
||||||
|
*/
|
||||||
|
/* this is opaque to the outside world. */
|
||||||
|
struct _SDL_AudioStream;
|
||||||
|
typedef struct _SDL_AudioStream SDL_AudioStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new audio stream
|
||||||
|
*
|
||||||
|
* \param src_format The format of the source audio
|
||||||
|
* \param src_channels The number of channels of the source audio
|
||||||
|
* \param src_rate The sampling rate of the source audio
|
||||||
|
* \param dst_format The format of the desired audio output
|
||||||
|
* \param dst_channels The number of channels of the desired audio output
|
||||||
|
* \param dst_rate The sampling rate of the desired audio output
|
||||||
|
* \return 0 on success, or -1 on error.
|
||||||
|
*
|
||||||
|
* \sa SDL_AudioStreamPut
|
||||||
|
* \sa SDL_AudioStreamGet
|
||||||
|
* \sa SDL_AudioStreamAvailable
|
||||||
|
* \sa SDL_AudioStreamFlush
|
||||||
|
* \sa SDL_AudioStreamClear
|
||||||
|
* \sa SDL_FreeAudioStream
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format,
|
||||||
|
const Uint8 src_channels,
|
||||||
|
const int src_rate,
|
||||||
|
const SDL_AudioFormat dst_format,
|
||||||
|
const Uint8 dst_channels,
|
||||||
|
const int dst_rate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add data to be converted/resampled to the stream
|
||||||
|
*
|
||||||
|
* \param stream The stream the audio data is being added to
|
||||||
|
* \param buf A pointer to the audio data to add
|
||||||
|
* \param int The number of bytes to write to the stream
|
||||||
|
* \return 0 on success, or -1 on error.
|
||||||
|
*
|
||||||
|
* \sa SDL_NewAudioStream
|
||||||
|
* \sa SDL_AudioStreamGet
|
||||||
|
* \sa SDL_AudioStreamAvailable
|
||||||
|
* \sa SDL_AudioStreamFlush
|
||||||
|
* \sa SDL_AudioStreamClear
|
||||||
|
* \sa SDL_FreeAudioStream
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get converted/resampled data from the stream
|
||||||
|
*
|
||||||
|
* \param stream The stream the audio is being requested from
|
||||||
|
* \param buf A buffer to fill with audio data
|
||||||
|
* \param len The maximum number of bytes to fill
|
||||||
|
* \return The number of bytes read from the stream, or -1 on error
|
||||||
|
*
|
||||||
|
* \sa SDL_NewAudioStream
|
||||||
|
* \sa SDL_AudioStreamPut
|
||||||
|
* \sa SDL_AudioStreamAvailable
|
||||||
|
* \sa SDL_AudioStreamFlush
|
||||||
|
* \sa SDL_AudioStreamClear
|
||||||
|
* \sa SDL_FreeAudioStream
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of converted/resampled bytes available. The stream may be
|
||||||
|
* buffering data behind the scenes until it has enough to resample
|
||||||
|
* correctly, so this number might be lower than what you expect, or even
|
||||||
|
* be zero. Add more data or flush the stream if you need the data now.
|
||||||
|
*
|
||||||
|
* \sa SDL_NewAudioStream
|
||||||
|
* \sa SDL_AudioStreamPut
|
||||||
|
* \sa SDL_AudioStreamGet
|
||||||
|
* \sa SDL_AudioStreamFlush
|
||||||
|
* \sa SDL_AudioStreamClear
|
||||||
|
* \sa SDL_FreeAudioStream
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the stream that you're done sending data, and anything being buffered
|
||||||
|
* should be converted/resampled and made available immediately.
|
||||||
|
*
|
||||||
|
* It is legal to add more data to a stream after flushing, but there will
|
||||||
|
* be audio gaps in the output. Generally this is intended to signal the
|
||||||
|
* end of input, so the complete output becomes available.
|
||||||
|
*
|
||||||
|
* \sa SDL_NewAudioStream
|
||||||
|
* \sa SDL_AudioStreamPut
|
||||||
|
* \sa SDL_AudioStreamGet
|
||||||
|
* \sa SDL_AudioStreamAvailable
|
||||||
|
* \sa SDL_AudioStreamClear
|
||||||
|
* \sa SDL_FreeAudioStream
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear any pending data in the stream without converting it
|
||||||
|
*
|
||||||
|
* \sa SDL_NewAudioStream
|
||||||
|
* \sa SDL_AudioStreamPut
|
||||||
|
* \sa SDL_AudioStreamGet
|
||||||
|
* \sa SDL_AudioStreamAvailable
|
||||||
|
* \sa SDL_AudioStreamFlush
|
||||||
|
* \sa SDL_FreeAudioStream
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free an audio stream
|
||||||
|
*
|
||||||
|
* \sa SDL_NewAudioStream
|
||||||
|
* \sa SDL_AudioStreamPut
|
||||||
|
* \sa SDL_AudioStreamGet
|
||||||
|
* \sa SDL_AudioStreamAvailable
|
||||||
|
* \sa SDL_AudioStreamFlush
|
||||||
|
* \sa SDL_AudioStreamClear
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
|
||||||
|
|
||||||
#define SDL_MIX_MAXVOLUME 128
|
#define SDL_MIX_MAXVOLUME 128
|
||||||
/**
|
/**
|
||||||
* This takes two audio buffers of the playing audio format and mixes
|
* This takes two audio buffers of the playing audio format and mixes
|
||||||
|
@ -482,6 +636,10 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||||
/**
|
/**
|
||||||
* Queue more audio on non-callback devices.
|
* Queue more audio on non-callback devices.
|
||||||
*
|
*
|
||||||
|
* (If you are looking to retrieve queued audio from a non-callback capture
|
||||||
|
* device, you want SDL_DequeueAudio() instead. This will return -1 to
|
||||||
|
* signify an error if you use it with capture devices.)
|
||||||
|
*
|
||||||
* SDL offers two ways to feed audio to the device: you can either supply a
|
* SDL offers two ways to feed audio to the device: you can either supply a
|
||||||
* callback that SDL triggers with some frequency to obtain more audio
|
* callback that SDL triggers with some frequency to obtain more audio
|
||||||
* (pull method), or you can supply no callback, and then SDL will expect
|
* (pull method), or you can supply no callback, and then SDL will expect
|
||||||
|
@ -509,28 +667,83 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||||
* \param dev The device ID to which we will queue audio.
|
* \param dev The device ID to which we will queue audio.
|
||||||
* \param data The data to queue to the device for later playback.
|
* \param data The data to queue to the device for later playback.
|
||||||
* \param len The number of bytes (not samples!) to which (data) points.
|
* \param len The number of bytes (not samples!) to which (data) points.
|
||||||
* \return zero on success, -1 on error.
|
* \return 0 on success, or -1 on error.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetQueuedAudioSize
|
* \sa SDL_GetQueuedAudioSize
|
||||||
* \sa SDL_ClearQueuedAudio
|
* \sa SDL_ClearQueuedAudio
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len);
|
extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dequeue more audio on non-callback devices.
|
||||||
|
*
|
||||||
|
* (If you are looking to queue audio for output on a non-callback playback
|
||||||
|
* device, you want SDL_QueueAudio() instead. This will always return 0
|
||||||
|
* if you use it with playback devices.)
|
||||||
|
*
|
||||||
|
* SDL offers two ways to retrieve audio from a capture device: you can
|
||||||
|
* either supply a callback that SDL triggers with some frequency as the
|
||||||
|
* device records more audio data, (push method), or you can supply no
|
||||||
|
* callback, and then SDL will expect you to retrieve data at regular
|
||||||
|
* intervals (pull method) with this function.
|
||||||
|
*
|
||||||
|
* There are no limits on the amount of data you can queue, short of
|
||||||
|
* exhaustion of address space. Data from the device will keep queuing as
|
||||||
|
* necessary without further intervention from you. This means you will
|
||||||
|
* eventually run out of memory if you aren't routinely dequeueing data.
|
||||||
|
*
|
||||||
|
* Capture devices will not queue data when paused; if you are expecting
|
||||||
|
* to not need captured audio for some length of time, use
|
||||||
|
* SDL_PauseAudioDevice() to stop the capture device from queueing more
|
||||||
|
* data. This can be useful during, say, level loading times. When
|
||||||
|
* unpaused, capture devices will start queueing data from that point,
|
||||||
|
* having flushed any capturable data available while paused.
|
||||||
|
*
|
||||||
|
* This function is thread-safe, but dequeueing from the same device from
|
||||||
|
* two threads at once does not promise which thread will dequeued data
|
||||||
|
* first.
|
||||||
|
*
|
||||||
|
* You may not dequeue audio from a device that is using an
|
||||||
|
* application-supplied callback; doing so returns an error. You have to use
|
||||||
|
* the audio callback, or dequeue audio with this function, but not both.
|
||||||
|
*
|
||||||
|
* You should not call SDL_LockAudio() on the device before queueing; SDL
|
||||||
|
* handles locking internally for this function.
|
||||||
|
*
|
||||||
|
* \param dev The device ID from which we will dequeue audio.
|
||||||
|
* \param data A pointer into where audio data should be copied.
|
||||||
|
* \param len The number of bytes (not samples!) to which (data) points.
|
||||||
|
* \return number of bytes dequeued, which could be less than requested.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetQueuedAudioSize
|
||||||
|
* \sa SDL_ClearQueuedAudio
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of bytes of still-queued audio.
|
* Get the number of bytes of still-queued audio.
|
||||||
*
|
*
|
||||||
* This is the number of bytes that have been queued for playback with
|
* For playback device:
|
||||||
* SDL_QueueAudio(), but have not yet been sent to the hardware.
|
|
||||||
*
|
*
|
||||||
* Once we've sent it to the hardware, this function can not decide the exact
|
* This is the number of bytes that have been queued for playback with
|
||||||
* byte boundary of what has been played. It's possible that we just gave the
|
* SDL_QueueAudio(), but have not yet been sent to the hardware. This
|
||||||
* hardware several kilobytes right before you called this function, but it
|
* number may shrink at any time, so this only informs of pending data.
|
||||||
* hasn't played any of it yet, or maybe half of it, etc.
|
*
|
||||||
|
* Once we've sent it to the hardware, this function can not decide the
|
||||||
|
* exact byte boundary of what has been played. It's possible that we just
|
||||||
|
* gave the hardware several kilobytes right before you called this
|
||||||
|
* function, but it hasn't played any of it yet, or maybe half of it, etc.
|
||||||
|
*
|
||||||
|
* For capture devices:
|
||||||
|
*
|
||||||
|
* This is the number of bytes that have been captured by the device and
|
||||||
|
* are waiting for you to dequeue. This number may grow at any time, so
|
||||||
|
* this only informs of the lower-bound of available data.
|
||||||
*
|
*
|
||||||
* You may not queue audio on a device that is using an application-supplied
|
* You may not queue audio on a device that is using an application-supplied
|
||||||
* callback; calling this function on such a device always returns 0.
|
* callback; calling this function on such a device always returns 0.
|
||||||
* You have to use the audio callback or queue audio with SDL_QueueAudio(),
|
* You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
|
||||||
* but not both.
|
* the audio callback, but not both.
|
||||||
*
|
*
|
||||||
* You should not call SDL_LockAudio() on the device before querying; SDL
|
* You should not call SDL_LockAudio() on the device before querying; SDL
|
||||||
* handles locking internally for this function.
|
* handles locking internally for this function.
|
||||||
|
@ -544,10 +757,17 @@ extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *da
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drop any queued audio data waiting to be sent to the hardware.
|
* Drop any queued audio data. For playback devices, this is any queued data
|
||||||
|
* still waiting to be submitted to the hardware. For capture devices, this
|
||||||
|
* is any data that was queued by the device that hasn't yet been dequeued by
|
||||||
|
* the application.
|
||||||
*
|
*
|
||||||
* Immediately after this call, SDL_GetQueuedAudioSize() will return 0 and
|
* Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For
|
||||||
* the hardware will start playing silence if more audio isn't queued.
|
* playback devices, the hardware will start playing silence if more audio
|
||||||
|
* isn't queued. Unpaused capture devices will start filling the queue again
|
||||||
|
* as soon as they have more data available (which, depending on the state
|
||||||
|
* of the hardware and the thread, could be before this function call
|
||||||
|
* returns!).
|
||||||
*
|
*
|
||||||
* This will not prevent playback of queued audio that's already been sent
|
* This will not prevent playback of queued audio that's already been sent
|
||||||
* to the hardware, as we can not undo that, so expect there to be some
|
* to the hardware, as we can not undo that, so expect there to be some
|
||||||
|
@ -557,8 +777,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
||||||
*
|
*
|
||||||
* You may not queue audio on a device that is using an application-supplied
|
* You may not queue audio on a device that is using an application-supplied
|
||||||
* callback; calling this function on such a device is always a no-op.
|
* callback; calling this function on such a device is always a no-op.
|
||||||
* You have to use the audio callback or queue audio with SDL_QueueAudio(),
|
* You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
|
||||||
* but not both.
|
* the audio callback, but not both.
|
||||||
*
|
*
|
||||||
* You should not call SDL_LockAudio() on the device before clearing the
|
* You should not call SDL_LockAudio() on the device before clearing the
|
||||||
* queue; SDL handles locking internally for this function.
|
* queue; SDL handles locking internally for this function.
|
||||||
|
@ -600,6 +820,6 @@ extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_audio_h */
|
#endif /* SDL_audio_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Functions for fiddling with bits and bitmasks.
|
* Functions for fiddling with bits and bitmasks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_bits_h
|
#ifndef SDL_bits_h_
|
||||||
#define _SDL_bits_h
|
#define SDL_bits_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -47,10 +47,20 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* \return Index of the most significant bit, or -1 if the value is 0.
|
* \return Index of the most significant bit, or -1 if the value is 0.
|
||||||
*/
|
*/
|
||||||
|
#if defined(__WATCOMC__) && defined(__386__)
|
||||||
|
extern _inline int _SDL_clz_watcom (Uint32);
|
||||||
|
#pragma aux _SDL_clz_watcom = \
|
||||||
|
"bsr eax, eax" \
|
||||||
|
"xor eax, 31" \
|
||||||
|
parm [eax] nomemory \
|
||||||
|
value [eax] \
|
||||||
|
modify exact [eax] nomemory;
|
||||||
|
#endif
|
||||||
|
|
||||||
SDL_FORCE_INLINE int
|
SDL_FORCE_INLINE int
|
||||||
SDL_MostSignificantBitIndex32(Uint32 x)
|
SDL_MostSignificantBitIndex32(Uint32 x)
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||||
/* Count Leading Zeroes builtin in GCC.
|
/* Count Leading Zeroes builtin in GCC.
|
||||||
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
|
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
|
||||||
*/
|
*/
|
||||||
|
@ -58,6 +68,11 @@ SDL_MostSignificantBitIndex32(Uint32 x)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 31 - __builtin_clz(x);
|
return 31 - __builtin_clz(x);
|
||||||
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
if (x == 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 31 - _SDL_clz_watcom(x);
|
||||||
#else
|
#else
|
||||||
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
|
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
|
||||||
* <seander@cs.stanford.edu>, released in the public domain.
|
* <seander@cs.stanford.edu>, released in the public domain.
|
||||||
|
@ -92,6 +107,6 @@ SDL_MostSignificantBitIndex32(Uint32 x)
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_bits_h */
|
#endif /* SDL_bits_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Header file declaring the SDL_BlendMode enumeration
|
* Header file declaring the SDL_BlendMode enumeration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_blendmode_h
|
#ifndef SDL_blendmode_h_
|
||||||
#define _SDL_blendmode_h
|
#define SDL_blendmode_h_
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
@ -47,17 +47,74 @@ typedef enum
|
||||||
SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
|
SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
|
||||||
dstRGB = (srcRGB * srcA) + dstRGB
|
dstRGB = (srcRGB * srcA) + dstRGB
|
||||||
dstA = dstA */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate
|
SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate
|
||||||
dstRGB = srcRGB * dstRGB
|
dstRGB = srcRGB * dstRGB
|
||||||
dstA = dstA */
|
dstA = dstA */
|
||||||
|
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
||||||
|
|
||||||
|
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
||||||
|
|
||||||
} SDL_BlendMode;
|
} SDL_BlendMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The blend operation used when combining source and destination pixel components
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
||||||
|
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||||
|
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||||
|
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */
|
||||||
|
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */
|
||||||
|
|
||||||
|
} SDL_BlendOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The normalized factor used to multiply pixel components
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */
|
||||||
|
SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */
|
||||||
|
SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */
|
||||||
|
SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */
|
||||||
|
SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
|
||||||
|
SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
|
||||||
|
|
||||||
|
} SDL_BlendFactor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Create a custom blend mode, which may or may not be supported by a given renderer
|
||||||
|
*
|
||||||
|
* \param srcColorFactor
|
||||||
|
* \param dstColorFactor
|
||||||
|
* \param colorOperation
|
||||||
|
* \param srcAlphaFactor
|
||||||
|
* \param dstAlphaFactor
|
||||||
|
* \param alphaOperation
|
||||||
|
*
|
||||||
|
* The result of the blend mode operation will be:
|
||||||
|
* dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
|
||||||
|
* and
|
||||||
|
* dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
|
||||||
|
SDL_BlendFactor dstColorFactor,
|
||||||
|
SDL_BlendOperation colorOperation,
|
||||||
|
SDL_BlendFactor srcAlphaFactor,
|
||||||
|
SDL_BlendFactor dstAlphaFactor,
|
||||||
|
SDL_BlendOperation alphaOperation);
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_blendmode_h */
|
#endif /* SDL_blendmode_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL clipboard handling
|
* Include file for SDL clipboard handling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_clipboard_h
|
#ifndef SDL_clipboard_h_
|
||||||
#define _SDL_clipboard_h
|
#define SDL_clipboard_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -66,6 +66,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_clipboard_h */
|
#endif /* SDL_clipboard_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,9 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_config_windows_h
|
#ifndef SDL_config_windows_h_
|
||||||
#define _SDL_config_windows_h
|
#define SDL_config_windows_h_
|
||||||
|
#define SDL_config_h_
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
#include "SDL_platform.h"
|
||||||
|
|
||||||
|
@ -85,12 +86,14 @@ typedef unsigned int uintptr_t;
|
||||||
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
|
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
|
||||||
#ifdef HAVE_LIBC
|
#ifdef HAVE_LIBC
|
||||||
/* Useful headers */
|
/* Useful headers */
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
#define STDC_HEADERS 1
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
#define HAVE_CTYPE_H 1
|
||||||
|
#define HAVE_FLOAT_H 1
|
||||||
|
#define HAVE_LIMITS_H 1
|
||||||
#define HAVE_MATH_H 1
|
#define HAVE_MATH_H 1
|
||||||
#define HAVE_SIGNAL_H 1
|
#define HAVE_SIGNAL_H 1
|
||||||
|
#define HAVE_STDIO_H 1
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
/* C library functions */
|
/* C library functions */
|
||||||
#define HAVE_MALLOC 1
|
#define HAVE_MALLOC 1
|
||||||
|
@ -139,12 +142,19 @@ typedef unsigned int uintptr_t;
|
||||||
#define HAVE_SQRTF 1
|
#define HAVE_SQRTF 1
|
||||||
#define HAVE_TAN 1
|
#define HAVE_TAN 1
|
||||||
#define HAVE_TANF 1
|
#define HAVE_TANF 1
|
||||||
|
#define HAVE__COPYSIGN 1
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
/* These functions were added with the VC++ 2013 C runtime library */
|
||||||
#if _MSC_VER >= 1800
|
#if _MSC_VER >= 1800
|
||||||
#define HAVE_STRTOLL 1
|
#define HAVE_STRTOLL 1
|
||||||
#define HAVE_VSSCANF 1
|
#define HAVE_VSSCANF 1
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_SCALBN 1
|
#define HAVE_SCALBN 1
|
||||||
#endif
|
#endif
|
||||||
|
/* This function is available with at least the VC++ 2008 C runtime library */
|
||||||
|
#if _MSC_VER >= 1400
|
||||||
|
#define HAVE__FSEEKI64 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
|
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
|
||||||
#define HAVE_M_PI 1
|
#define HAVE_M_PI 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -154,8 +164,9 @@ typedef unsigned int uintptr_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
/* Enable various audio drivers */
|
||||||
|
#define SDL_AUDIO_DRIVER_WASAPI 1
|
||||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
#define SDL_AUDIO_DRIVER_DSOUND 1
|
||||||
#define SDL_AUDIO_DRIVER_XAUDIO2 1
|
#define SDL_AUDIO_DRIVER_XAUDIO2 0
|
||||||
#define SDL_AUDIO_DRIVER_WINMM 1
|
#define SDL_AUDIO_DRIVER_WINMM 1
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
#define SDL_AUDIO_DRIVER_DISK 1
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||||
|
@ -206,6 +217,8 @@ typedef unsigned int uintptr_t;
|
||||||
#define SDL_VIDEO_OPENGL_EGL 1
|
#define SDL_VIDEO_OPENGL_EGL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Enable Vulkan support */
|
||||||
|
#define SDL_VIDEO_VULKAN 1
|
||||||
|
|
||||||
/* Enable system power support */
|
/* Enable system power support */
|
||||||
#define SDL_POWER_WINDOWS 1
|
#define SDL_POWER_WINDOWS 1
|
||||||
|
@ -218,4 +231,4 @@ typedef unsigned int uintptr_t;
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
#define SDL_ASSEMBLY_ROUTINES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _SDL_config_windows_h */
|
#endif /* SDL_config_windows_h_ */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,14 +25,20 @@
|
||||||
* CPU feature detection for SDL.
|
* CPU feature detection for SDL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_cpuinfo_h
|
#ifndef SDL_cpuinfo_h_
|
||||||
#define _SDL_cpuinfo_h
|
#define SDL_cpuinfo_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
/* Need to do this here because intrin.h has C++ code in it */
|
/* Need to do this here because intrin.h has C++ code in it */
|
||||||
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
||||||
|
#ifdef __clang__
|
||||||
|
/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */
|
||||||
|
#undef __MMX__
|
||||||
|
#undef __SSE__
|
||||||
|
#undef __SSE2__
|
||||||
|
#else
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#ifndef _WIN64
|
#ifndef _WIN64
|
||||||
#define __MMX__
|
#define __MMX__
|
||||||
|
@ -40,6 +46,7 @@
|
||||||
#endif
|
#endif
|
||||||
#define __SSE__
|
#define __SSE__
|
||||||
#define __SSE2__
|
#define __SSE2__
|
||||||
|
#endif /* __clang__ */
|
||||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
#elif defined(__MINGW64_VERSION_MAJOR)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#else
|
#else
|
||||||
|
@ -61,6 +68,9 @@
|
||||||
#ifdef __SSE2__
|
#ifdef __SSE2__
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __SSE3__
|
||||||
|
#include <pmmintrin.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
|
@ -144,6 +154,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns true if the CPU has NEON (ARM SIMD) features.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns the amount of RAM configured in the system, in MB.
|
* This function returns the amount of RAM configured in the system, in MB.
|
||||||
*/
|
*/
|
||||||
|
@ -156,6 +171,6 @@ extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_cpuinfo_h */
|
#endif /* SDL_cpuinfo_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
* This precedes the return type of the function in the function prototype.
|
* This precedes the return type of the function in the function prototype.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
#if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(SDL_VIDEO_STATIC_ANGLE)
|
||||||
# define KHRONOS_APICALL __declspec(dllimport)
|
# define KHRONOS_APICALL __declspec(dllimport)
|
||||||
#elif defined (__SYMBIAN32__)
|
#elif defined (__SYMBIAN32__)
|
||||||
# define KHRONOS_APICALL IMPORT_C
|
# define KHRONOS_APICALL IMPORT_C
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Functions for reading and writing endian-specific values
|
* Functions for reading and writing endian-specific values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_endian_h
|
#ifndef SDL_endian_h_
|
||||||
#define _SDL_endian_h
|
#define SDL_endian_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -96,6 +96,12 @@ SDL_Swap16(Uint16 x)
|
||||||
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
|
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
extern _inline Uint16 SDL_Swap16(Uint16);
|
||||||
|
#pragma aux SDL_Swap16 = \
|
||||||
|
"xchg al, ah" \
|
||||||
|
parm [ax] \
|
||||||
|
modify [ax];
|
||||||
#else
|
#else
|
||||||
SDL_FORCE_INLINE Uint16
|
SDL_FORCE_INLINE Uint16
|
||||||
SDL_Swap16(Uint16 x)
|
SDL_Swap16(Uint16 x)
|
||||||
|
@ -136,6 +142,21 @@ SDL_Swap32(Uint32 x)
|
||||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
|
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
extern _inline Uint32 SDL_Swap32(Uint32);
|
||||||
|
#ifndef __SW_3 /* 486+ */
|
||||||
|
#pragma aux SDL_Swap32 = \
|
||||||
|
"bswap eax" \
|
||||||
|
parm [eax] \
|
||||||
|
modify [eax];
|
||||||
|
#else /* 386-only */
|
||||||
|
#pragma aux SDL_Swap32 = \
|
||||||
|
"xchg al, ah" \
|
||||||
|
"ror eax, 16" \
|
||||||
|
"xchg al, ah" \
|
||||||
|
parm [eax] \
|
||||||
|
modify [eax];
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
SDL_FORCE_INLINE Uint32
|
SDL_FORCE_INLINE Uint32
|
||||||
SDL_Swap32(Uint32 x)
|
SDL_Swap32(Uint32 x)
|
||||||
|
@ -234,6 +255,6 @@ SDL_SwapFloat(float x)
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_endian_h */
|
#endif /* SDL_endian_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Simple error message routines for SDL.
|
* Simple error message routines for SDL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_error_h
|
#ifndef SDL_error_h_
|
||||||
#define _SDL_error_h
|
#define SDL_error_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -71,6 +71,6 @@ extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_error_h */
|
#endif /* SDL_error_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL event handling.
|
* Include file for SDL event handling.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_events_h
|
#ifndef SDL_events_h_
|
||||||
#define _SDL_events_h
|
#define SDL_events_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -136,6 +136,9 @@ typedef enum
|
||||||
|
|
||||||
/* Drag and drop events */
|
/* Drag and drop events */
|
||||||
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
|
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
|
||||||
|
SDL_DROPTEXT, /**< text/plain drag-and-drop event */
|
||||||
|
SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */
|
||||||
|
SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */
|
||||||
|
|
||||||
/* Audio hotplug events */
|
/* Audio hotplug events */
|
||||||
SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
|
SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
|
||||||
|
@ -162,7 +165,7 @@ typedef enum
|
||||||
typedef struct SDL_CommonEvent
|
typedef struct SDL_CommonEvent
|
||||||
{
|
{
|
||||||
Uint32 type;
|
Uint32 type;
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
} SDL_CommonEvent;
|
} SDL_CommonEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,7 +174,7 @@ typedef struct SDL_CommonEvent
|
||||||
typedef struct SDL_WindowEvent
|
typedef struct SDL_WindowEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_WINDOWEVENT */
|
Uint32 type; /**< ::SDL_WINDOWEVENT */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The associated window */
|
Uint32 windowID; /**< The associated window */
|
||||||
Uint8 event; /**< ::SDL_WindowEventID */
|
Uint8 event; /**< ::SDL_WindowEventID */
|
||||||
Uint8 padding1;
|
Uint8 padding1;
|
||||||
|
@ -187,7 +190,7 @@ typedef struct SDL_WindowEvent
|
||||||
typedef struct SDL_KeyboardEvent
|
typedef struct SDL_KeyboardEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
|
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||||
Uint8 repeat; /**< Non-zero if this is a key repeat */
|
Uint8 repeat; /**< Non-zero if this is a key repeat */
|
||||||
|
@ -203,7 +206,7 @@ typedef struct SDL_KeyboardEvent
|
||||||
typedef struct SDL_TextEditingEvent
|
typedef struct SDL_TextEditingEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_TEXTEDITING */
|
Uint32 type; /**< ::SDL_TEXTEDITING */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||||
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
|
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
|
||||||
Sint32 start; /**< The start cursor of selected editing text */
|
Sint32 start; /**< The start cursor of selected editing text */
|
||||||
|
@ -218,7 +221,7 @@ typedef struct SDL_TextEditingEvent
|
||||||
typedef struct SDL_TextInputEvent
|
typedef struct SDL_TextInputEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_TEXTINPUT */
|
Uint32 type; /**< ::SDL_TEXTINPUT */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
|
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
|
||||||
} SDL_TextInputEvent;
|
} SDL_TextInputEvent;
|
||||||
|
@ -229,7 +232,7 @@ typedef struct SDL_TextInputEvent
|
||||||
typedef struct SDL_MouseMotionEvent
|
typedef struct SDL_MouseMotionEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_MOUSEMOTION */
|
Uint32 type; /**< ::SDL_MOUSEMOTION */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||||
Uint32 state; /**< The current button state */
|
Uint32 state; /**< The current button state */
|
||||||
|
@ -245,7 +248,7 @@ typedef struct SDL_MouseMotionEvent
|
||||||
typedef struct SDL_MouseButtonEvent
|
typedef struct SDL_MouseButtonEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
|
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||||
Uint8 button; /**< The mouse button index */
|
Uint8 button; /**< The mouse button index */
|
||||||
|
@ -262,7 +265,7 @@ typedef struct SDL_MouseButtonEvent
|
||||||
typedef struct SDL_MouseWheelEvent
|
typedef struct SDL_MouseWheelEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_MOUSEWHEEL */
|
Uint32 type; /**< ::SDL_MOUSEWHEEL */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||||
Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
|
Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
|
||||||
|
@ -276,7 +279,7 @@ typedef struct SDL_MouseWheelEvent
|
||||||
typedef struct SDL_JoyAxisEvent
|
typedef struct SDL_JoyAxisEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_JOYAXISMOTION */
|
Uint32 type; /**< ::SDL_JOYAXISMOTION */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Uint8 axis; /**< The joystick axis index */
|
Uint8 axis; /**< The joystick axis index */
|
||||||
Uint8 padding1;
|
Uint8 padding1;
|
||||||
|
@ -292,7 +295,7 @@ typedef struct SDL_JoyAxisEvent
|
||||||
typedef struct SDL_JoyBallEvent
|
typedef struct SDL_JoyBallEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Uint8 ball; /**< The joystick trackball index */
|
Uint8 ball; /**< The joystick trackball index */
|
||||||
Uint8 padding1;
|
Uint8 padding1;
|
||||||
|
@ -308,7 +311,7 @@ typedef struct SDL_JoyBallEvent
|
||||||
typedef struct SDL_JoyHatEvent
|
typedef struct SDL_JoyHatEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_JOYHATMOTION */
|
Uint32 type; /**< ::SDL_JOYHATMOTION */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Uint8 hat; /**< The joystick hat index */
|
Uint8 hat; /**< The joystick hat index */
|
||||||
Uint8 value; /**< The hat position value.
|
Uint8 value; /**< The hat position value.
|
||||||
|
@ -328,7 +331,7 @@ typedef struct SDL_JoyHatEvent
|
||||||
typedef struct SDL_JoyButtonEvent
|
typedef struct SDL_JoyButtonEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
|
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Uint8 button; /**< The joystick button index */
|
Uint8 button; /**< The joystick button index */
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||||
|
@ -342,7 +345,7 @@ typedef struct SDL_JoyButtonEvent
|
||||||
typedef struct SDL_JoyDeviceEvent
|
typedef struct SDL_JoyDeviceEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
|
Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
||||||
} SDL_JoyDeviceEvent;
|
} SDL_JoyDeviceEvent;
|
||||||
|
|
||||||
|
@ -353,7 +356,7 @@ typedef struct SDL_JoyDeviceEvent
|
||||||
typedef struct SDL_ControllerAxisEvent
|
typedef struct SDL_ControllerAxisEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
|
Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
|
Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
|
||||||
Uint8 padding1;
|
Uint8 padding1;
|
||||||
|
@ -370,7 +373,7 @@ typedef struct SDL_ControllerAxisEvent
|
||||||
typedef struct SDL_ControllerButtonEvent
|
typedef struct SDL_ControllerButtonEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
|
Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Uint8 button; /**< The controller button (SDL_GameControllerButton) */
|
Uint8 button; /**< The controller button (SDL_GameControllerButton) */
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||||
|
@ -385,7 +388,7 @@ typedef struct SDL_ControllerButtonEvent
|
||||||
typedef struct SDL_ControllerDeviceEvent
|
typedef struct SDL_ControllerDeviceEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
|
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
|
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
|
||||||
} SDL_ControllerDeviceEvent;
|
} SDL_ControllerDeviceEvent;
|
||||||
|
|
||||||
|
@ -395,7 +398,7 @@ typedef struct SDL_ControllerDeviceEvent
|
||||||
typedef struct SDL_AudioDeviceEvent
|
typedef struct SDL_AudioDeviceEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
|
Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
||||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
||||||
Uint8 padding1;
|
Uint8 padding1;
|
||||||
|
@ -410,7 +413,7 @@ typedef struct SDL_AudioDeviceEvent
|
||||||
typedef struct SDL_TouchFingerEvent
|
typedef struct SDL_TouchFingerEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
|
Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_TouchID touchId; /**< The touch device id */
|
SDL_TouchID touchId; /**< The touch device id */
|
||||||
SDL_FingerID fingerId;
|
SDL_FingerID fingerId;
|
||||||
float x; /**< Normalized in the range 0...1 */
|
float x; /**< Normalized in the range 0...1 */
|
||||||
|
@ -427,8 +430,8 @@ typedef struct SDL_TouchFingerEvent
|
||||||
typedef struct SDL_MultiGestureEvent
|
typedef struct SDL_MultiGestureEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_MULTIGESTURE */
|
Uint32 type; /**< ::SDL_MULTIGESTURE */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_TouchID touchId; /**< The touch device index */
|
SDL_TouchID touchId; /**< The touch device id */
|
||||||
float dTheta;
|
float dTheta;
|
||||||
float dDist;
|
float dDist;
|
||||||
float x;
|
float x;
|
||||||
|
@ -444,7 +447,7 @@ typedef struct SDL_MultiGestureEvent
|
||||||
typedef struct SDL_DollarGestureEvent
|
typedef struct SDL_DollarGestureEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
|
Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_TouchID touchId; /**< The touch device id */
|
SDL_TouchID touchId; /**< The touch device id */
|
||||||
SDL_GestureID gestureId;
|
SDL_GestureID gestureId;
|
||||||
Uint32 numFingers;
|
Uint32 numFingers;
|
||||||
|
@ -461,9 +464,10 @@ typedef struct SDL_DollarGestureEvent
|
||||||
*/
|
*/
|
||||||
typedef struct SDL_DropEvent
|
typedef struct SDL_DropEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_DROPFILE */
|
Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
char *file; /**< The file name, which should be freed with SDL_free() */
|
char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
|
||||||
|
Uint32 windowID; /**< The window that was dropped on, if any */
|
||||||
} SDL_DropEvent;
|
} SDL_DropEvent;
|
||||||
|
|
||||||
|
|
||||||
|
@ -473,7 +477,7 @@ typedef struct SDL_DropEvent
|
||||||
typedef struct SDL_QuitEvent
|
typedef struct SDL_QuitEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_QUIT */
|
Uint32 type; /**< ::SDL_QUIT */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
} SDL_QuitEvent;
|
} SDL_QuitEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -482,7 +486,7 @@ typedef struct SDL_QuitEvent
|
||||||
typedef struct SDL_OSEvent
|
typedef struct SDL_OSEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_QUIT */
|
Uint32 type; /**< ::SDL_QUIT */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
} SDL_OSEvent;
|
} SDL_OSEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -491,7 +495,7 @@ typedef struct SDL_OSEvent
|
||||||
typedef struct SDL_UserEvent
|
typedef struct SDL_UserEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
|
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Uint32 windowID; /**< The associated window if any */
|
Uint32 windowID; /**< The associated window if any */
|
||||||
Sint32 code; /**< User defined event code */
|
Sint32 code; /**< User defined event code */
|
||||||
void *data1; /**< User defined data pointer */
|
void *data1; /**< User defined data pointer */
|
||||||
|
@ -511,7 +515,7 @@ typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
||||||
typedef struct SDL_SysWMEvent
|
typedef struct SDL_SysWMEvent
|
||||||
{
|
{
|
||||||
Uint32 type; /**< ::SDL_SYSWMEVENT */
|
Uint32 type; /**< ::SDL_SYSWMEVENT */
|
||||||
Uint32 timestamp;
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
||||||
} SDL_SysWMEvent;
|
} SDL_SysWMEvent;
|
||||||
|
|
||||||
|
@ -720,7 +724,7 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
||||||
/**
|
/**
|
||||||
* This function allows you to set the state of processing certain events.
|
* This function allows you to set the state of processing certain events.
|
||||||
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
|
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
|
||||||
* dropped from the event queue and will not event be filtered.
|
* dropped from the event queue and will not be filtered.
|
||||||
* - If \c state is set to ::SDL_ENABLE, that event will be processed
|
* - If \c state is set to ::SDL_ENABLE, that event will be processed
|
||||||
* normally.
|
* normally.
|
||||||
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
|
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
|
||||||
|
@ -745,6 +749,6 @@ extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_events_h */
|
#endif /* SDL_events_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* \brief Include file for filesystem SDL API functions
|
* \brief Include file for filesystem SDL API functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_filesystem_h
|
#ifndef SDL_filesystem_h_
|
||||||
#define _SDL_filesystem_h
|
#define SDL_filesystem_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -131,6 +131,6 @@ extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_filesystem_h */
|
#endif /* SDL_filesystem_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL game controller event handling
|
* Include file for SDL game controller event handling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_gamecontroller_h
|
#ifndef SDL_gamecontroller_h_
|
||||||
#define _SDL_gamecontroller_h
|
#define SDL_gamecontroller_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -51,7 +51,9 @@ extern "C" {
|
||||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The gamecontroller structure used to identify an SDL game controller */
|
/**
|
||||||
|
* The gamecontroller structure used to identify an SDL game controller
|
||||||
|
*/
|
||||||
struct _SDL_GameController;
|
struct _SDL_GameController;
|
||||||
typedef struct _SDL_GameController SDL_GameController;
|
typedef struct _SDL_GameController SDL_GameController;
|
||||||
|
|
||||||
|
@ -87,13 +89,13 @@ typedef struct SDL_GameControllerButtonBind
|
||||||
* To count the number of game controllers in the system for the following:
|
* To count the number of game controllers in the system for the following:
|
||||||
* int nJoysticks = SDL_NumJoysticks();
|
* int nJoysticks = SDL_NumJoysticks();
|
||||||
* int nGameControllers = 0;
|
* int nGameControllers = 0;
|
||||||
* for ( int i = 0; i < nJoysticks; i++ ) {
|
* for (int i = 0; i < nJoysticks; i++) {
|
||||||
* if ( SDL_IsGameController(i) ) {
|
* if (SDL_IsGameController(i)) {
|
||||||
* nGameControllers++;
|
* nGameControllers++;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
||||||
* guid,name,mappings
|
* guid,name,mappings
|
||||||
*
|
*
|
||||||
* Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
|
* Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
|
||||||
|
@ -105,7 +107,7 @@ typedef struct SDL_GameControllerButtonBind
|
||||||
* Buttons can be used as a controller axis and vice versa.
|
* Buttons can be used as a controller axis and vice versa.
|
||||||
*
|
*
|
||||||
* This string shows an example of a valid mapping for a controller
|
* This string shows an example of a valid mapping for a controller
|
||||||
* "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -117,7 +119,7 @@ typedef struct SDL_GameControllerButtonBind
|
||||||
*
|
*
|
||||||
* \return number of mappings added, -1 on error
|
* \return number of mappings added, -1 on error
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW( SDL_RWops * rw, int freerw );
|
extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
|
* Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
|
||||||
|
@ -131,28 +133,41 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW( SDL_RWops * rw,
|
||||||
*
|
*
|
||||||
* \return 1 if mapping is added, 0 if updated, -1 on error
|
* \return 1 if mapping is added, 0 if updated, -1 on error
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString );
|
extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of mappings installed
|
||||||
|
*
|
||||||
|
* \return the number of mappings
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the mapping at a particular index.
|
||||||
|
*
|
||||||
|
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a mapping string for a GUID
|
* Get a mapping string for a GUID
|
||||||
*
|
*
|
||||||
* \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available
|
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid );
|
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a mapping string for an open GameController
|
* Get a mapping string for an open GameController
|
||||||
*
|
*
|
||||||
* \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available
|
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller );
|
extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the joystick on this index supported by the game controller interface?
|
* Is the joystick on this index supported by the game controller interface?
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the implementation dependent name of a game controller.
|
* Get the implementation dependent name of a game controller.
|
||||||
* This can be called before any controllers are opened.
|
* This can be called before any controllers are opened.
|
||||||
|
@ -181,6 +196,24 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the USB vendor ID of an opened controller, if available.
|
||||||
|
* If the vendor ID isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the USB product ID of an opened controller, if available.
|
||||||
|
* If the product ID isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the product version of an opened controller, if available.
|
||||||
|
* If the product version isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns SDL_TRUE if the controller has been opened and currently connected,
|
* Returns SDL_TRUE if the controller has been opened and currently connected,
|
||||||
* or SDL_FALSE if it has not.
|
* or SDL_FALSE if it has not.
|
||||||
|
@ -214,6 +247,12 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of axes available from a controller
|
* The list of axes available from a controller
|
||||||
|
*
|
||||||
|
* Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
|
||||||
|
* and are centered within ~8000 of zero, though advanced UI will allow users to set
|
||||||
|
* or autodetect the dead zone, which varies between controllers.
|
||||||
|
*
|
||||||
|
* Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -318,6 +357,6 @@ extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecon
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_gamecontroller_h */
|
#endif /* SDL_gamecontroller_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL gesture event handling.
|
* Include file for SDL gesture event handling.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_gesture_h
|
#ifndef SDL_gesture_h_
|
||||||
#define _SDL_gesture_h
|
#define SDL_gesture_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -82,6 +82,6 @@ extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWo
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_gesture_h */
|
#endif /* SDL_gesture_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -22,12 +22,12 @@
|
||||||
/**
|
/**
|
||||||
* \file SDL_haptic.h
|
* \file SDL_haptic.h
|
||||||
*
|
*
|
||||||
* \brief The SDL Haptic subsystem allows you to control haptic (force feedback)
|
* \brief The SDL haptic subsystem allows you to control haptic (force feedback)
|
||||||
* devices.
|
* devices.
|
||||||
*
|
*
|
||||||
* The basic usage is as follows:
|
* The basic usage is as follows:
|
||||||
* - Initialize the Subsystem (::SDL_INIT_HAPTIC).
|
* - Initialize the subsystem (::SDL_INIT_HAPTIC).
|
||||||
* - Open a Haptic Device.
|
* - Open a haptic device.
|
||||||
* - SDL_HapticOpen() to open from index.
|
* - SDL_HapticOpen() to open from index.
|
||||||
* - SDL_HapticOpenFromJoystick() to open from an existing joystick.
|
* - SDL_HapticOpenFromJoystick() to open from an existing joystick.
|
||||||
* - Create an effect (::SDL_HapticEffect).
|
* - Create an effect (::SDL_HapticEffect).
|
||||||
|
@ -104,8 +104,8 @@
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_haptic_h
|
#ifndef SDL_haptic_h_
|
||||||
#define _SDL_haptic_h
|
#define SDL_haptic_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -149,7 +149,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticCondition
|
* \sa SDL_HapticCondition
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_CONSTANT (1<<0)
|
#define SDL_HAPTIC_CONSTANT (1u<<0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sine wave effect supported.
|
* \brief Sine wave effect supported.
|
||||||
|
@ -158,7 +158,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticPeriodic
|
* \sa SDL_HapticPeriodic
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_SINE (1<<1)
|
#define SDL_HAPTIC_SINE (1u<<1)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Left/Right effect supported.
|
* \brief Left/Right effect supported.
|
||||||
|
@ -169,7 +169,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
* \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
|
* \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
|
||||||
* we ran out of bits, and this is important for XInput devices.
|
* we ran out of bits, and this is important for XInput devices.
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_LEFTRIGHT (1<<2)
|
#define SDL_HAPTIC_LEFTRIGHT (1u<<2)
|
||||||
|
|
||||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||||
/* #define SDL_HAPTIC_SQUARE (1<<2) */
|
/* #define SDL_HAPTIC_SQUARE (1<<2) */
|
||||||
|
@ -181,7 +181,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticPeriodic
|
* \sa SDL_HapticPeriodic
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_TRIANGLE (1<<3)
|
#define SDL_HAPTIC_TRIANGLE (1u<<3)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sawtoothup wave effect supported.
|
* \brief Sawtoothup wave effect supported.
|
||||||
|
@ -190,7 +190,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticPeriodic
|
* \sa SDL_HapticPeriodic
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_SAWTOOTHUP (1<<4)
|
#define SDL_HAPTIC_SAWTOOTHUP (1u<<4)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sawtoothdown wave effect supported.
|
* \brief Sawtoothdown wave effect supported.
|
||||||
|
@ -199,7 +199,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticPeriodic
|
* \sa SDL_HapticPeriodic
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)
|
#define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Ramp effect supported.
|
* \brief Ramp effect supported.
|
||||||
|
@ -208,7 +208,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticRamp
|
* \sa SDL_HapticRamp
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_RAMP (1<<6)
|
#define SDL_HAPTIC_RAMP (1u<<6)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Spring effect supported - uses axes position.
|
* \brief Spring effect supported - uses axes position.
|
||||||
|
@ -218,7 +218,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticCondition
|
* \sa SDL_HapticCondition
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_SPRING (1<<7)
|
#define SDL_HAPTIC_SPRING (1u<<7)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Damper effect supported - uses axes velocity.
|
* \brief Damper effect supported - uses axes velocity.
|
||||||
|
@ -228,7 +228,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticCondition
|
* \sa SDL_HapticCondition
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_DAMPER (1<<8)
|
#define SDL_HAPTIC_DAMPER (1u<<8)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Inertia effect supported - uses axes acceleration.
|
* \brief Inertia effect supported - uses axes acceleration.
|
||||||
|
@ -238,7 +238,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticCondition
|
* \sa SDL_HapticCondition
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_INERTIA (1<<9)
|
#define SDL_HAPTIC_INERTIA (1u<<9)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Friction effect supported - uses axes movement.
|
* \brief Friction effect supported - uses axes movement.
|
||||||
|
@ -248,14 +248,14 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticCondition
|
* \sa SDL_HapticCondition
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_FRICTION (1<<10)
|
#define SDL_HAPTIC_FRICTION (1u<<10)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Custom effect is supported.
|
* \brief Custom effect is supported.
|
||||||
*
|
*
|
||||||
* User defined custom haptic effect.
|
* User defined custom haptic effect.
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_CUSTOM (1<<11)
|
#define SDL_HAPTIC_CUSTOM (1u<<11)
|
||||||
|
|
||||||
/* @} *//* Haptic effects */
|
/* @} *//* Haptic effects */
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticSetGain
|
* \sa SDL_HapticSetGain
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_GAIN (1<<12)
|
#define SDL_HAPTIC_GAIN (1u<<12)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Device can set autocenter.
|
* \brief Device can set autocenter.
|
||||||
|
@ -277,24 +277,26 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticSetAutocenter
|
* \sa SDL_HapticSetAutocenter
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_AUTOCENTER (1<<13)
|
#define SDL_HAPTIC_AUTOCENTER (1u<<13)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Device can be queried for effect status.
|
* \brief Device can be queried for effect status.
|
||||||
*
|
*
|
||||||
* Device can be queried for effect status.
|
* Device supports querying effect status.
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticGetEffectStatus
|
* \sa SDL_HapticGetEffectStatus
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_STATUS (1<<14)
|
#define SDL_HAPTIC_STATUS (1u<<14)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Device can be paused.
|
* \brief Device can be paused.
|
||||||
*
|
*
|
||||||
|
* Devices supports being paused.
|
||||||
|
*
|
||||||
* \sa SDL_HapticPause
|
* \sa SDL_HapticPause
|
||||||
* \sa SDL_HapticUnpause
|
* \sa SDL_HapticUnpause
|
||||||
*/
|
*/
|
||||||
#define SDL_HAPTIC_PAUSE (1<<15)
|
#define SDL_HAPTIC_PAUSE (1u<<15)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -444,7 +446,7 @@ typedef struct SDL_HapticDirection
|
||||||
/**
|
/**
|
||||||
* \brief A structure containing a template for a Constant effect.
|
* \brief A structure containing a template for a Constant effect.
|
||||||
*
|
*
|
||||||
* The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect.
|
* This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect.
|
||||||
*
|
*
|
||||||
* A constant effect applies a constant force in the specified direction
|
* A constant effect applies a constant force in the specified direction
|
||||||
* to the joystick.
|
* to the joystick.
|
||||||
|
@ -676,6 +678,8 @@ typedef struct SDL_HapticLeftRight
|
||||||
/**
|
/**
|
||||||
* \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
|
* \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
|
||||||
*
|
*
|
||||||
|
* This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect.
|
||||||
|
*
|
||||||
* A custom force feedback effect is much like a periodic effect, where the
|
* A custom force feedback effect is much like a periodic effect, where the
|
||||||
* application can define its exact shape. You will have to allocate the
|
* application can define its exact shape. You will have to allocate the
|
||||||
* data yourself. Data should consist of channels * samples Uint16 samples.
|
* data yourself. Data should consist of channels * samples Uint16 samples.
|
||||||
|
@ -804,7 +808,7 @@ typedef union SDL_HapticEffect
|
||||||
extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
|
extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the implementation dependent name of a Haptic device.
|
* \brief Get the implementation dependent name of a haptic device.
|
||||||
*
|
*
|
||||||
* This can be called before any joysticks are opened.
|
* This can be called before any joysticks are opened.
|
||||||
* If no name can be found, this function returns NULL.
|
* If no name can be found, this function returns NULL.
|
||||||
|
@ -817,9 +821,9 @@ extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
|
||||||
extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
|
extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Opens a Haptic device for usage.
|
* \brief Opens a haptic device for use.
|
||||||
*
|
*
|
||||||
* The index passed as an argument refers to the N'th Haptic device on this
|
* The index passed as an argument refers to the N'th haptic device on this
|
||||||
* system.
|
* system.
|
||||||
*
|
*
|
||||||
* When opening a haptic device, its gain will be set to maximum and
|
* When opening a haptic device, its gain will be set to maximum and
|
||||||
|
@ -885,15 +889,15 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
|
||||||
* \brief Checks to see if a joystick has haptic features.
|
* \brief Checks to see if a joystick has haptic features.
|
||||||
*
|
*
|
||||||
* \param joystick Joystick to test for haptic capabilities.
|
* \param joystick Joystick to test for haptic capabilities.
|
||||||
* \return 1 if the joystick is haptic, 0 if it isn't
|
* \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
|
||||||
* or -1 if an error ocurred.
|
* or -1 if an error occurred.
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticOpenFromJoystick
|
* \sa SDL_HapticOpenFromJoystick
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
|
extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Opens a Haptic device for usage from a Joystick device.
|
* \brief Opens a haptic device for use from a joystick device.
|
||||||
*
|
*
|
||||||
* You must still close the haptic device separately. It will not be closed
|
* You must still close the haptic device separately. It will not be closed
|
||||||
* with the joystick.
|
* with the joystick.
|
||||||
|
@ -913,7 +917,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
|
||||||
joystick);
|
joystick);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Closes a Haptic device previously opened with SDL_HapticOpen().
|
* \brief Closes a haptic device previously opened with SDL_HapticOpen().
|
||||||
*
|
*
|
||||||
* \param haptic Haptic device to close.
|
* \param haptic Haptic device to close.
|
||||||
*/
|
*/
|
||||||
|
@ -957,7 +961,7 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
|
||||||
* Example:
|
* Example:
|
||||||
* \code
|
* \code
|
||||||
* if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
|
* if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
|
||||||
* printf("We have constant haptic effect!");
|
* printf("We have constant haptic effect!\n");
|
||||||
* }
|
* }
|
||||||
* \endcode
|
* \endcode
|
||||||
*
|
*
|
||||||
|
@ -996,7 +1000,7 @@ extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
|
||||||
*
|
*
|
||||||
* \param haptic Haptic device to create the effect on.
|
* \param haptic Haptic device to create the effect on.
|
||||||
* \param effect Properties of the effect to create.
|
* \param effect Properties of the effect to create.
|
||||||
* \return The id of the effect on success or -1 on error.
|
* \return The identifier of the effect on success or -1 on error.
|
||||||
*
|
*
|
||||||
* \sa SDL_HapticUpdateEffect
|
* \sa SDL_HapticUpdateEffect
|
||||||
* \sa SDL_HapticRunEffect
|
* \sa SDL_HapticRunEffect
|
||||||
|
@ -1008,13 +1012,13 @@ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
|
||||||
/**
|
/**
|
||||||
* \brief Updates the properties of an effect.
|
* \brief Updates the properties of an effect.
|
||||||
*
|
*
|
||||||
* Can be used dynamically, although behaviour when dynamically changing
|
* Can be used dynamically, although behavior when dynamically changing
|
||||||
* direction may be strange. Specifically the effect may reupload itself
|
* direction may be strange. Specifically the effect may reupload itself
|
||||||
* and start playing from the start. You cannot change the type either when
|
* and start playing from the start. You cannot change the type either when
|
||||||
* running SDL_HapticUpdateEffect().
|
* running SDL_HapticUpdateEffect().
|
||||||
*
|
*
|
||||||
* \param haptic Haptic device that has the effect.
|
* \param haptic Haptic device that has the effect.
|
||||||
* \param effect Effect to update.
|
* \param effect Identifier of the effect to update.
|
||||||
* \param data New effect properties to use.
|
* \param data New effect properties to use.
|
||||||
* \return 0 on success or -1 on error.
|
* \return 0 on success or -1 on error.
|
||||||
*
|
*
|
||||||
|
@ -1218,6 +1222,6 @@ extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_haptic_h */
|
#endif /* SDL_haptic_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -36,8 +36,8 @@
|
||||||
* to how they would like the library to work.
|
* to how they would like the library to work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_hints_h
|
#ifndef SDL_hints_h_
|
||||||
#define _SDL_hints_h
|
#define SDL_hints_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -118,6 +118,17 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG"
|
#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen
|
||||||
|
* "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
|
||||||
|
*
|
||||||
|
* By default letterbox is used
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling the scaling quality
|
* \brief A variable controlling the scaling quality
|
||||||
*
|
*
|
||||||
|
@ -210,6 +221,12 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
|
#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable to specify custom icon resource id from RC file on Windows platform
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON"
|
||||||
|
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling whether the windows message loop is processed by SDL
|
* \brief A variable controlling whether the windows message loop is processed by SDL
|
||||||
*
|
*
|
||||||
|
@ -233,16 +250,48 @@ extern "C" {
|
||||||
#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
|
#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling whether relative mouse mode is implemented using mouse warping
|
* \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
|
||||||
*
|
*/
|
||||||
* This variable can be set to the following values:
|
#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE"
|
||||||
* "0" - Relative mouse mode uses raw input
|
|
||||||
* "1" - Relative mouse mode uses mouse warping
|
/**
|
||||||
*
|
* \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
|
||||||
* By default SDL will use raw input for relative mouse mode
|
*/
|
||||||
*/
|
#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling whether relative mouse mode is implemented using mouse warping
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Relative mouse mode uses raw input
|
||||||
|
* "1" - Relative mouse mode uses mouse warping
|
||||||
|
*
|
||||||
|
* By default SDL will use raw input for relative mouse mode
|
||||||
|
*/
|
||||||
#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP"
|
#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Allow mouse click events when clicking to focus an SDL window
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Ignore mouse clicks that activate a window
|
||||||
|
* "1" - Generate events for mouse clicks that activate a window
|
||||||
|
*
|
||||||
|
* By default SDL will ignore mouse clicks that activate a window
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling whether touch events should generate synthetic mouse events
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Touch events will not generate mouse events
|
||||||
|
* "1" - Touch events will generate mouse events
|
||||||
|
*
|
||||||
|
* By default SDL will generate mouse events for touch events
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
|
* \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
|
||||||
*
|
*
|
||||||
|
@ -257,8 +306,8 @@ extern "C" {
|
||||||
* this is problematic. This functionality can be disabled by setting this
|
* this is problematic. This functionality can be disabled by setting this
|
||||||
* hint.
|
* hint.
|
||||||
*
|
*
|
||||||
* As of SDL 2.0.4, SDL_EnableScreenSaver and SDL_DisableScreenSaver accomplish
|
* As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver()
|
||||||
* the same thing on iOS. They should be preferred over this hint.
|
* accomplish the same thing on iOS. They should be preferred over this hint.
|
||||||
*
|
*
|
||||||
* This variable can be set to the following values:
|
* This variable can be set to the following values:
|
||||||
* "0" - Enable idle timer
|
* "0" - Enable idle timer
|
||||||
|
@ -277,6 +326,34 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
|
#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling whether controllers used with the Apple TV
|
||||||
|
* generate UI events.
|
||||||
|
*
|
||||||
|
* When UI events are generated by controller input, the app will be
|
||||||
|
* backgrounded when the Apple TV remote's menu button is pressed, and when the
|
||||||
|
* pause or B buttons on gamepads are pressed.
|
||||||
|
*
|
||||||
|
* More information about properly making use of controllers for the Apple TV
|
||||||
|
* can be found here:
|
||||||
|
* https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Controller input does not generate UI events (the default).
|
||||||
|
* "1" - Controller input generates UI events.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling whether the Apple TV remote's joystick axes
|
||||||
|
* will automatically match the rotation of the remote.
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Remote orientation does not affect joystick axes (the default).
|
||||||
|
* "1" - Joystick axes are based on the orientation of the remote.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling whether the Android / iOS built-in
|
* \brief A variable controlling whether the Android / iOS built-in
|
||||||
* accelerometer should be listed as a joystick device, rather than listing
|
* accelerometer should be listed as a joystick device, rather than listing
|
||||||
|
@ -288,7 +365,6 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK"
|
#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable that lets you disable the detection and use of Xinput gamepad devices
|
* \brief A variable that lets you disable the detection and use of Xinput gamepad devices
|
||||||
*
|
*
|
||||||
|
@ -298,7 +374,6 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
|
#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
|
* \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
|
||||||
*
|
*
|
||||||
|
@ -308,9 +383,8 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
|
#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable that lets you manually hint extra gamecontroller db entries
|
* \brief A variable that lets you manually hint extra gamecontroller db entries.
|
||||||
*
|
*
|
||||||
* The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
|
* The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
|
||||||
*
|
*
|
||||||
|
@ -319,6 +393,31 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
|
#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable containing a list of devices to skip when scanning for game controllers.
|
||||||
|
*
|
||||||
|
* The format of the string is a comma separated list of USB VID/PID pairs
|
||||||
|
* in hexadecimal form, e.g.
|
||||||
|
*
|
||||||
|
* 0xAAAA/0xBBBB,0xCCCC/0xDDDD
|
||||||
|
*
|
||||||
|
* The variable can also take the form of @file, in which case the named
|
||||||
|
* file will be loaded and interpreted as the value of the variable.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable.
|
||||||
|
*
|
||||||
|
* The format of the string is a comma separated list of USB VID/PID pairs
|
||||||
|
* in hexadecimal form, e.g.
|
||||||
|
*
|
||||||
|
* 0xAAAA/0xBBBB,0xCCCC/0xDDDD
|
||||||
|
*
|
||||||
|
* The variable can also take the form of @file, in which case the named
|
||||||
|
* file will be loaded and interpreted as the value of the variable.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
|
* \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
|
||||||
|
@ -333,7 +432,6 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
|
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
|
* \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
|
||||||
* This is a debugging aid for developers and not expected to be used by end users. The default is "1"
|
* This is a debugging aid for developers and not expected to be used by end users. The default is "1"
|
||||||
|
@ -344,7 +442,6 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
|
#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable that controls the timer resolution, in milliseconds.
|
* \brief A variable that controls the timer resolution, in milliseconds.
|
||||||
*
|
*
|
||||||
|
@ -362,6 +459,33 @@ extern "C" {
|
||||||
#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
|
#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable describing the content orientation on QtWayland-based platforms.
|
||||||
|
*
|
||||||
|
* On QtWayland platforms, windows are rotated client-side to allow for custom
|
||||||
|
* transitions. In order to correctly position overlays (e.g. volume bar) and
|
||||||
|
* gestures (e.g. events view, close/minimize gestures), the system needs to
|
||||||
|
* know in which orientation the application is currently drawing its contents.
|
||||||
|
*
|
||||||
|
* This does not cause the window to be rotated or resized, the application
|
||||||
|
* needs to take care of drawing the content in the right orientation (the
|
||||||
|
* framebuffer is always in portrait mode).
|
||||||
|
*
|
||||||
|
* This variable can be one of the following values:
|
||||||
|
* "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Flags to set on QtWayland windows to integrate with the native window manager.
|
||||||
|
*
|
||||||
|
* On QtWayland platforms, this hint controls the flags to set on the windows.
|
||||||
|
* For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures.
|
||||||
|
*
|
||||||
|
* This variable is a space-separated list of the following values (empty = no flags):
|
||||||
|
* "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager"
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size
|
* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size
|
||||||
|
@ -369,7 +493,7 @@ extern "C" {
|
||||||
* Use this hint in case you need to set SDL's threads stack size to other than the default.
|
* Use this hint in case you need to set SDL's threads stack size to other than the default.
|
||||||
* This is specially useful if you build SDL against a non glibc libc library (such as musl) which
|
* This is specially useful if you build SDL against a non glibc libc library (such as musl) which
|
||||||
* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
|
* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
|
||||||
* Support for this hint is currently available only in the pthread backend.
|
* Support for this hint is currently available only in the pthread, Windows, and PSP backend.
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE"
|
#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE"
|
||||||
|
|
||||||
|
@ -431,7 +555,7 @@ extern "C" {
|
||||||
* privacy policy.
|
* privacy policy.
|
||||||
*
|
*
|
||||||
* To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
|
* To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
|
||||||
* before calling any SDL_Init functions. The contents of the hint should
|
* before calling any SDL_Init() functions. The contents of the hint should
|
||||||
* be a valid URL. For example, "http://www.example.com".
|
* be a valid URL. For example, "http://www.example.com".
|
||||||
*
|
*
|
||||||
* The default value is "", which will prevent SDL from adding a privacy policy
|
* The default value is "", which will prevent SDL from adding a privacy policy
|
||||||
|
@ -461,7 +585,7 @@ extern "C" {
|
||||||
* The contents of this hint should be encoded as a UTF8 string.
|
* The contents of this hint should be encoded as a UTF8 string.
|
||||||
*
|
*
|
||||||
* The default value is "Privacy Policy". This hint should only be set during app
|
* The default value is "Privacy Policy". This hint should only be set during app
|
||||||
* initialization, preferably before any calls to SDL_Init.
|
* initialization, preferably before any calls to SDL_Init().
|
||||||
*
|
*
|
||||||
* For additional information on linking to a privacy policy, see the documentation for
|
* For additional information on linking to a privacy policy, see the documentation for
|
||||||
* SDL_HINT_WINRT_PRIVACY_POLICY_URL.
|
* SDL_HINT_WINRT_PRIVACY_POLICY_URL.
|
||||||
|
@ -630,6 +754,119 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
|
#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs.
|
||||||
|
*
|
||||||
|
* The bitmap header version 4 is required for proper alpha channel support and
|
||||||
|
* SDL will use it when required. Should this not be desired, this hint can
|
||||||
|
* force the use of the 40 byte header version which is supported everywhere.
|
||||||
|
*
|
||||||
|
* The variable can be set to the following values:
|
||||||
|
* "0" - Surfaces with a colorkey or an alpha channel are saved to a
|
||||||
|
* 32-bit BMP file with an alpha mask. SDL will use the bitmap
|
||||||
|
* header version 4 and set the alpha mask accordingly.
|
||||||
|
* "1" - Surfaces with a colorkey or an alpha channel are saved to a
|
||||||
|
* 32-bit BMP file without an alpha mask. The alpha channel data
|
||||||
|
* will be in the file, but applications are going to ignore it.
|
||||||
|
*
|
||||||
|
* The default value is "0".
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
|
||||||
|
* The 0x406D1388 Exception is a trick used to inform Visual Studio of a
|
||||||
|
* thread's name, but it tends to cause problems with other debuggers,
|
||||||
|
* and the .NET runtime. Note that SDL 2.0.6 and later will still use
|
||||||
|
* the (safer) SetThreadDescription API, introduced in the Windows 10
|
||||||
|
* Creators Update, if available.
|
||||||
|
*
|
||||||
|
* The variable can be set to the following values:
|
||||||
|
* "0" - SDL will raise the 0x406D1388 Exception to name threads.
|
||||||
|
* This is the default behavior of SDL <= 2.0.4.
|
||||||
|
* "1" - SDL will not raise this exception, and threads will be unnamed. (default)
|
||||||
|
* This is necessary with .NET languages or debuggers that aren't Visual Studio.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Tell SDL which Dispmanx layer to use on a Raspberry PI
|
||||||
|
*
|
||||||
|
* Also known as Z-order. The variable can take a negative or positive value.
|
||||||
|
* The default is 10000.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling what driver to use for OpenGL ES contexts.
|
||||||
|
*
|
||||||
|
* On some platforms, currently Windows and X11, OpenGL drivers may support
|
||||||
|
* creating contexts with an OpenGL ES profile. By default SDL uses these
|
||||||
|
* profiles, when available, otherwise it attempts to load an OpenGL ES
|
||||||
|
* library, e.g. that provided by the ANGLE project. This variable controls
|
||||||
|
* whether SDL follows this default behaviour or will always load an
|
||||||
|
* OpenGL ES library.
|
||||||
|
*
|
||||||
|
* Circumstances where this is useful include
|
||||||
|
* - Testing an app with a particular OpenGL ES implementation, e.g ANGLE,
|
||||||
|
* or emulator, e.g. those from ARM, Imagination or Qualcomm.
|
||||||
|
* - Resolving OpenGL ES function addresses at link time by linking with
|
||||||
|
* the OpenGL ES library instead of querying them at run time with
|
||||||
|
* SDL_GL_GetProcAddress().
|
||||||
|
*
|
||||||
|
* Caution: for an application to work with the default behaviour across
|
||||||
|
* different OpenGL drivers it must query the OpenGL ES function
|
||||||
|
* addresses at run time using SDL_GL_GetProcAddress().
|
||||||
|
*
|
||||||
|
* This variable is ignored on most platforms because OpenGL ES is native
|
||||||
|
* or not supported.
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Use ES profile of OpenGL, if available. (Default when not set.)
|
||||||
|
* "1" - Load OpenGL ES library using the default library names.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling speed/quality tradeoff of audio resampling.
|
||||||
|
*
|
||||||
|
* If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
|
||||||
|
* to handle audio resampling. There are different resampling modes available
|
||||||
|
* that produce different levels of quality, using more CPU.
|
||||||
|
*
|
||||||
|
* If this hint isn't specified to a valid setting, or libsamplerate isn't
|
||||||
|
* available, SDL will use the default, internal resampling algorithm.
|
||||||
|
*
|
||||||
|
* Note that this is currently only applicable to resampling audio that is
|
||||||
|
* being written to a device for playback or audio being read from a device
|
||||||
|
* for capture. SDL_AudioCVT always uses the default resampler (although this
|
||||||
|
* might change for SDL 2.1).
|
||||||
|
*
|
||||||
|
* This hint is currently only checked at audio subsystem initialization.
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
*
|
||||||
|
* "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast)
|
||||||
|
* "1" or "fast" - Use fast, slightly higher quality resampling, if available
|
||||||
|
* "2" or "medium" - Use medium quality resampling, if available
|
||||||
|
* "3" or "best" - Use high quality resampling, if available
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling the audio category on iOS and Mac OS X
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
*
|
||||||
|
* "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default)
|
||||||
|
* "playback" - Use the AVAudioSessionCategoryPlayback category
|
||||||
|
*
|
||||||
|
* For more information, see Apple's documentation:
|
||||||
|
* https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief An enumeration of hint priorities
|
* \brief An enumeration of hint priorities
|
||||||
*/
|
*/
|
||||||
|
@ -669,6 +906,18 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get a hint
|
||||||
|
*
|
||||||
|
* \return The boolean value of a hint variable.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief type definition of the hint callback function.
|
||||||
|
*/
|
||||||
|
typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Add a function to watch a particular hint
|
* \brief Add a function to watch a particular hint
|
||||||
*
|
*
|
||||||
|
@ -676,7 +925,6 @@ extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
||||||
* \param callback The function to call when the hint value changes
|
* \param callback The function to call when the hint value changes
|
||||||
* \param userdata A pointer to pass to the callback function
|
* \param userdata A pointer to pass to the callback function
|
||||||
*/
|
*/
|
||||||
typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name,
|
extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name,
|
||||||
SDL_HintCallback callback,
|
SDL_HintCallback callback,
|
||||||
void *userdata);
|
void *userdata);
|
||||||
|
@ -706,6 +954,6 @@ extern DECLSPEC void SDLCALL SDL_ClearHints(void);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_hints_h */
|
#endif /* SDL_hints_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Include file for SDL joystick event handling
|
* Include file for SDL joystick event handling
|
||||||
*
|
*
|
||||||
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick
|
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
|
||||||
* behind a device_index changing as joysticks are plugged and unplugged.
|
* behind a device_index changing as joysticks are plugged and unplugged.
|
||||||
*
|
*
|
||||||
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
||||||
|
@ -36,8 +36,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_joystick_h
|
#ifndef SDL_joystick_h_
|
||||||
#define _SDL_joystick_h
|
#define SDL_joystick_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -60,7 +60,9 @@ extern "C" {
|
||||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The joystick structure used to identify an SDL joystick */
|
/**
|
||||||
|
* The joystick structure used to identify an SDL joystick
|
||||||
|
*/
|
||||||
struct _SDL_Joystick;
|
struct _SDL_Joystick;
|
||||||
typedef struct _SDL_Joystick SDL_Joystick;
|
typedef struct _SDL_Joystick SDL_Joystick;
|
||||||
|
|
||||||
|
@ -69,8 +71,29 @@ typedef struct {
|
||||||
Uint8 data[16];
|
Uint8 data[16];
|
||||||
} SDL_JoystickGUID;
|
} SDL_JoystickGUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a unique ID for a joystick for the time it is connected to the system,
|
||||||
|
* and is never reused for the lifetime of the application. If the joystick is
|
||||||
|
* disconnected and reconnected, it will get a new ID.
|
||||||
|
*
|
||||||
|
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
||||||
|
*/
|
||||||
typedef Sint32 SDL_JoystickID;
|
typedef Sint32 SDL_JoystickID;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
SDL_JOYSTICK_TYPE_UNKNOWN,
|
||||||
|
SDL_JOYSTICK_TYPE_GAMECONTROLLER,
|
||||||
|
SDL_JOYSTICK_TYPE_WHEEL,
|
||||||
|
SDL_JOYSTICK_TYPE_ARCADE_STICK,
|
||||||
|
SDL_JOYSTICK_TYPE_FLIGHT_STICK,
|
||||||
|
SDL_JOYSTICK_TYPE_DANCE_PAD,
|
||||||
|
SDL_JOYSTICK_TYPE_GUITAR,
|
||||||
|
SDL_JOYSTICK_TYPE_DRUM_KIT,
|
||||||
|
SDL_JOYSTICK_TYPE_ARCADE_PAD,
|
||||||
|
SDL_JOYSTICK_TYPE_THROTTLE
|
||||||
|
} SDL_JoystickType;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
SDL_JOYSTICK_POWER_UNKNOWN = -1,
|
SDL_JOYSTICK_POWER_UNKNOWN = -1,
|
||||||
|
@ -83,6 +106,20 @@ typedef enum
|
||||||
} SDL_JoystickPowerLevel;
|
} SDL_JoystickPowerLevel;
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locking for multi-threaded access to the joystick API
|
||||||
|
*
|
||||||
|
* If you are using the joystick API or handling events from multiple threads
|
||||||
|
* you should use these locking functions to protect access to the joysticks.
|
||||||
|
*
|
||||||
|
* In particular, you are guaranteed that the joystick list won't change, so
|
||||||
|
* the API functions that take a joystick index will be valid, and joystick
|
||||||
|
* and game controller events will not be delivered.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
||||||
|
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count the number of joysticks attached to the system right now
|
* Count the number of joysticks attached to the system right now
|
||||||
*/
|
*/
|
||||||
|
@ -95,6 +132,46 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the GUID for the joystick at this index
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the USB vendor ID of a joystick, if available.
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
* If the vendor ID isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the USB product ID of a joystick, if available.
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
* If the product ID isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the product version of a joystick, if available.
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
* If the product version isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type of a joystick, if available.
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the instance ID of a joystick.
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
* If the index is out of range, this function will return -1.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a joystick for use.
|
* Open a joystick for use.
|
||||||
* The index passed as an argument refers to the N'th joystick on the system.
|
* The index passed as an argument refers to the N'th joystick on the system.
|
||||||
|
@ -117,16 +194,34 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
|
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the GUID for the joystick at this index
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the GUID for this opened joystick
|
* Return the GUID for this opened joystick
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick);
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the USB vendor ID of an opened joystick, if available.
|
||||||
|
* If the vendor ID isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the USB product ID of an opened joystick, if available.
|
||||||
|
* If the product ID isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the product version of an opened joystick, if available.
|
||||||
|
* If the product version isn't available this function returns 0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type of an opened joystick.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a string representation for this guid. pszGUID must point to at least 33 bytes
|
* Return a string representation for this guid. pszGUID must point to at least 33 bytes
|
||||||
* (32 for the string plus a NULL terminator).
|
* (32 for the string plus a NULL terminator).
|
||||||
|
@ -134,7 +229,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joys
|
||||||
extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convert a string into a joystick formatted guid
|
* Convert a string into a joystick guid
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
||||||
|
|
||||||
|
@ -190,6 +285,8 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||||
|
|
||||||
|
#define SDL_JOYSTICK_AXIS_MAX 32767
|
||||||
|
#define SDL_JOYSTICK_AXIS_MIN -32768
|
||||||
/**
|
/**
|
||||||
* Get the current state of an axis control on a joystick.
|
* Get the current state of an axis control on a joystick.
|
||||||
*
|
*
|
||||||
|
@ -200,6 +297,18 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||||
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
|
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
|
||||||
int axis);
|
int axis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the initial state of an axis control on a joystick.
|
||||||
|
*
|
||||||
|
* The state is a value ranging from -32768 to 32767.
|
||||||
|
*
|
||||||
|
* The axis indices start at index 0.
|
||||||
|
*
|
||||||
|
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick,
|
||||||
|
int axis, Sint16 *state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \name Hat positions
|
* \name Hat positions
|
||||||
*/
|
*/
|
||||||
|
@ -268,6 +377,6 @@ extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_joystick_h */
|
#endif /* SDL_joystick_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL keyboard event handling
|
* Include file for SDL keyboard event handling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_keyboard_h
|
#ifndef SDL_keyboard_h_
|
||||||
#define _SDL_keyboard_h
|
#define SDL_keyboard_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -136,7 +136,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
||||||
* copy it. If the key doesn't have a name, this function returns an
|
* copy it. If the key doesn't have a name, this function returns an
|
||||||
* empty string ("").
|
* empty string ("").
|
||||||
*
|
*
|
||||||
* \sa SDL_Key
|
* \sa SDL_Keycode
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
||||||
|
|
||||||
|
@ -212,6 +212,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_keyboard_h */
|
#endif /* SDL_keyboard_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Defines constants which identify keyboard keys and modifiers.
|
* Defines constants which identify keyboard keys and modifiers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_keycode_h
|
#ifndef SDL_keycode_h_
|
||||||
#define _SDL_keycode_h
|
#define SDL_keycode_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_scancode.h"
|
#include "SDL_scancode.h"
|
||||||
|
@ -38,6 +38,9 @@
|
||||||
* layout of the keyboard. These values include Unicode values representing
|
* layout of the keyboard. These values include Unicode values representing
|
||||||
* the unmodified character that would be generated by pressing the key, or
|
* the unmodified character that would be generated by pressing the key, or
|
||||||
* an SDLK_* constant for those keys that do not generate characters.
|
* an SDLK_* constant for those keys that do not generate characters.
|
||||||
|
*
|
||||||
|
* A special exception is the number keys at the top of the keyboard which
|
||||||
|
* always map to SDLK_0...SDLK_9, regardless of layout.
|
||||||
*/
|
*/
|
||||||
typedef Sint32 SDL_Keycode;
|
typedef Sint32 SDL_Keycode;
|
||||||
|
|
||||||
|
@ -308,7 +311,12 @@ enum
|
||||||
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
|
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
|
||||||
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
|
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
|
||||||
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
|
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
|
||||||
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP)
|
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP),
|
||||||
|
SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1),
|
||||||
|
SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
|
||||||
|
|
||||||
|
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
|
||||||
|
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -336,6 +344,6 @@ typedef enum
|
||||||
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
|
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
|
||||||
#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
|
#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
|
||||||
|
|
||||||
#endif /* _SDL_keycode_h */
|
#endif /* SDL_keycode_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
* the results you expect. :)
|
* the results you expect. :)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_loadso_h
|
#ifndef SDL_loadso_h_
|
||||||
#define _SDL_loadso_h
|
#define SDL_loadso_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -76,6 +76,6 @@ extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_loadso_h */
|
#endif /* SDL_loadso_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -34,8 +34,8 @@
|
||||||
* Others: standard error output (stderr)
|
* Others: standard error output (stderr)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_log_h
|
#ifndef SDL_log_h_
|
||||||
#define _SDL_log_h
|
#define SDL_log_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
||||||
/**
|
/**
|
||||||
* \brief The prototype for the log output function
|
* \brief The prototype for the log output function
|
||||||
*/
|
*/
|
||||||
typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the current log output function.
|
* \brief Get the current log output function.
|
||||||
|
@ -206,6 +206,6 @@ extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction call
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_log_h */
|
#endif /* SDL_log_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_main_h
|
#ifndef SDL_main_h_
|
||||||
#define _SDL_main_h
|
#define SDL_main_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
||||||
main activity entry point.
|
main activity entry point.
|
||||||
|
|
||||||
See README-android.txt for more details on extending that class.
|
See README-android.md for more details on extending that class.
|
||||||
*/
|
*/
|
||||||
#define SDL_MAIN_NEEDED
|
#define SDL_MAIN_NEEDED
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
/**
|
/**
|
||||||
* The prototype for the application's main() function
|
* The prototype for the application's main() function
|
||||||
*/
|
*/
|
||||||
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
|
extern C_LINKAGE DECLSPEC int SDL_main(int argc, char *argv[]);
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
|
@ -156,6 +156,6 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), v
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_main_h */
|
#endif /* SDL_main_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_messagebox_h
|
#ifndef SDL_messagebox_h_
|
||||||
#define _SDL_messagebox_h
|
#define SDL_messagebox_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_video.h" /* For SDL_Window */
|
#include "SDL_video.h" /* For SDL_Window */
|
||||||
|
@ -139,6 +139,6 @@ extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *t
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_messagebox_h */
|
#endif /* SDL_messagebox_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL mouse event handling.
|
* Include file for SDL mouse event handling.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_mouse_h
|
#ifndef SDL_mouse_h_
|
||||||
#define _SDL_mouse_h
|
#define SDL_mouse_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -38,10 +38,10 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */
|
typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cursor types for SDL_CreateSystemCursor.
|
* \brief Cursor types for SDL_CreateSystemCursor().
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -254,9 +254,11 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Frees a cursor created with SDL_CreateCursor().
|
* \brief Frees a cursor created with SDL_CreateCursor() or similar functions.
|
||||||
*
|
*
|
||||||
* \sa SDL_CreateCursor()
|
* \sa SDL_CreateCursor()
|
||||||
|
* \sa SDL_CreateColorCursor()
|
||||||
|
* \sa SDL_CreateSystemCursor()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
|
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
|
||||||
|
|
||||||
|
@ -295,6 +297,6 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_mouse_h */
|
#endif /* SDL_mouse_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_mutex_h
|
#ifndef SDL_mutex_h_
|
||||||
#define _SDL_mutex_h
|
#define SDL_mutex_h_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file SDL_mutex.h
|
* \file SDL_mutex.h
|
||||||
|
@ -246,6 +246,6 @@ extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_mutex_h */
|
#endif /* SDL_mutex_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDLname_h_
|
#ifndef SDLname_h_
|
||||||
#define _SDLname_h_
|
#define SDLname_h_
|
||||||
|
|
||||||
#if defined(__STDC__) || defined(__cplusplus)
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
#define NeedFunctionPrototypes 1
|
#define NeedFunctionPrototypes 1
|
||||||
|
@ -28,6 +28,6 @@
|
||||||
|
|
||||||
#define SDL_NAME(X) SDL_##X
|
#define SDL_NAME(X) SDL_##X
|
||||||
|
|
||||||
#endif /* _SDLname_h_ */
|
#endif /* SDLname_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -32,8 +32,8 @@
|
||||||
* version included in SDL_opengl.h.
|
* version included in SDL_opengl.h.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_opengl_h
|
#ifndef SDL_opengl_h_
|
||||||
#define _SDL_opengl_h
|
#define SDL_opengl_h_
|
||||||
|
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
|
@ -97,6 +97,13 @@
|
||||||
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
|
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
|
||||||
# define GLAPI extern
|
# define GLAPI extern
|
||||||
# define GLAPIENTRY __stdcall
|
# define GLAPIENTRY __stdcall
|
||||||
|
#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */
|
||||||
|
# define GLAPI extern
|
||||||
|
# define GLAPIENTRY _System
|
||||||
|
# define APIENTRY _System
|
||||||
|
# if defined(__GNUC__) && !defined(_System)
|
||||||
|
# define _System
|
||||||
|
# endif
|
||||||
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||||
# define GLAPI __attribute__((visibility("default")))
|
# define GLAPI __attribute__((visibility("default")))
|
||||||
# define GLAPIENTRY
|
# define GLAPIENTRY
|
||||||
|
@ -2171,6 +2178,6 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
|
||||||
|
|
||||||
#endif /* !__IPHONEOS__ */
|
#endif /* !__IPHONEOS__ */
|
||||||
|
|
||||||
#endif /* _SDL_opengl_h */
|
#endif /* SDL_opengl_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -24,6 +24,7 @@
|
||||||
*
|
*
|
||||||
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
||||||
*/
|
*/
|
||||||
|
#include "SDL_config.h"
|
||||||
|
|
||||||
#ifdef __IPHONEOS__
|
#ifdef __IPHONEOS__
|
||||||
#include <OpenGLES/ES1/gl.h>
|
#include <OpenGLES/ES1/gl.h>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -24,6 +24,8 @@
|
||||||
*
|
*
|
||||||
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
||||||
*/
|
*/
|
||||||
|
#include "SDL_config.h"
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
|
|
||||||
#ifdef __IPHONEOS__
|
#ifdef __IPHONEOS__
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,10 +25,11 @@
|
||||||
* Header for the enumerated pixel format definitions.
|
* Header for the enumerated pixel format definitions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_pixels_h
|
#ifndef SDL_pixels_h_
|
||||||
#define _SDL_pixels_h
|
#define SDL_pixels_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
#include "SDL_endian.h"
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
@ -260,6 +261,19 @@ enum
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
||||||
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
||||||
|
|
||||||
|
/* Aliases for RGBA byte arrays of color data, for the current platform */
|
||||||
|
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||||
|
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
|
||||||
|
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
|
||||||
|
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
|
||||||
|
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
|
||||||
|
#else
|
||||||
|
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
|
||||||
|
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
|
||||||
|
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
|
||||||
|
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
|
||||||
|
#endif
|
||||||
|
|
||||||
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
||||||
SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
|
SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
|
||||||
|
@ -449,6 +463,6 @@ extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_pixels_h */
|
#endif /* SDL_pixels_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Try to get a standard set of platform defines.
|
* Try to get a standard set of platform defines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_platform_h
|
#ifndef SDL_platform_h_
|
||||||
#define _SDL_platform_h
|
#define SDL_platform_h_
|
||||||
|
|
||||||
#if defined(_AIX)
|
#if defined(_AIX)
|
||||||
#undef __AIX__
|
#undef __AIX__
|
||||||
|
@ -70,18 +70,22 @@
|
||||||
/* lets us know what version of Mac OS X we're compiling on */
|
/* lets us know what version of Mac OS X we're compiling on */
|
||||||
#include "AvailabilityMacros.h"
|
#include "AvailabilityMacros.h"
|
||||||
#include "TargetConditionals.h"
|
#include "TargetConditionals.h"
|
||||||
|
#if TARGET_OS_TV
|
||||||
|
#undef __TVOS__
|
||||||
|
#define __TVOS__ 1
|
||||||
|
#endif
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
/* if compiling for iPhone */
|
/* if compiling for iOS */
|
||||||
#undef __IPHONEOS__
|
#undef __IPHONEOS__
|
||||||
#define __IPHONEOS__ 1
|
#define __IPHONEOS__ 1
|
||||||
#undef __MACOSX__
|
#undef __MACOSX__
|
||||||
#else
|
#else
|
||||||
/* if not compiling for iPhone */
|
/* if not compiling for iOS */
|
||||||
#undef __MACOSX__
|
#undef __MACOSX__
|
||||||
#define __MACOSX__ 1
|
#define __MACOSX__ 1
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
# error SDL for Mac OS X only supports deploying on 10.5 and above.
|
# error SDL for Mac OS X only supports deploying on 10.6 and above.
|
||||||
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
|
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
|
||||||
#endif /* TARGET_OS_IPHONE */
|
#endif /* TARGET_OS_IPHONE */
|
||||||
#endif /* defined(__APPLE__) */
|
#endif /* defined(__APPLE__) */
|
||||||
|
|
||||||
|
@ -93,7 +97,7 @@
|
||||||
#undef __OPENBSD__
|
#undef __OPENBSD__
|
||||||
#define __OPENBSD__ 1
|
#define __OPENBSD__ 1
|
||||||
#endif
|
#endif
|
||||||
#if defined(__OS2__)
|
#if defined(__OS2__) || defined(__EMX__)
|
||||||
#undef __OS2__
|
#undef __OS2__
|
||||||
#define __OS2__ 1
|
#define __OS2__ 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -116,21 +120,29 @@
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||||
/* Try to find out if we're compiling for WinRT or non-WinRT */
|
/* Try to find out if we're compiling for WinRT or non-WinRT */
|
||||||
/* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */
|
#if defined(_MSC_VER) && defined(__has_include)
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */
|
#define HAVE_WINAPIFAMILY_H __has_include(<winapifamily.h>)
|
||||||
|
/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
|
||||||
|
#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */
|
||||||
|
#define HAVE_WINAPIFAMILY_H 1
|
||||||
|
#else
|
||||||
|
#define HAVE_WINAPIFAMILY_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_WINAPIFAMILY_H
|
||||||
#include <winapifamily.h>
|
#include <winapifamily.h>
|
||||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP))
|
||||||
#undef __WINDOWS__
|
#else
|
||||||
#define __WINDOWS__ 1
|
#define WINAPI_FAMILY_WINRT 0
|
||||||
/* See if we're compiling for WinRT: */
|
#endif /* HAVE_WINAPIFAMILY_H */
|
||||||
#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
|
||||||
|
#if WINAPI_FAMILY_WINRT
|
||||||
#undef __WINRT__
|
#undef __WINRT__
|
||||||
#define __WINRT__ 1
|
#define __WINRT__ 1
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#undef __WINDOWS__
|
#undef __WINDOWS__
|
||||||
#define __WINDOWS__ 1
|
#define __WINDOWS__ 1
|
||||||
#endif /* _MSC_VER < 1700 */
|
#endif
|
||||||
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
|
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
|
@ -176,6 +188,6 @@ extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_platform_h */
|
#endif /* SDL_platform_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_power_h
|
#ifndef SDL_power_h_
|
||||||
#define _SDL_power_h
|
#define SDL_power_h_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file SDL_power.h
|
* \file SDL_power.h
|
||||||
|
@ -70,6 +70,6 @@ extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
|
||||||
#endif
|
#endif
|
||||||
#include "close_code.h"
|
#include "close_code.h"
|
||||||
|
|
||||||
#endif /* _SDL_power_h */
|
#endif /* SDL_power_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
* Include file for SDL quit event handling.
|
* Include file for SDL quit event handling.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SDL_quit_h
|
#ifndef SDL_quit_h_
|
||||||
#define _SDL_quit_h
|
#define SDL_quit_h_
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
@ -55,4 +55,4 @@
|
||||||
#define SDL_QuitRequested() \
|
#define SDL_QuitRequested() \
|
||||||
(SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
|
(SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
|
||||||
|
|
||||||
#endif /* _SDL_quit_h */
|
#endif /* SDL_quit_h_ */
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue