mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 11:28:15 +00:00
Compare commits
345 Commits
SDL2
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0aef2c3612 | ||
![]() |
9464f334b5 | ||
![]() |
1c9643249d | ||
![]() |
8236e01a9f | ||
![]() |
de1616baee | ||
![]() |
964b9da519 | ||
![]() |
364abb8702 | ||
![]() |
1650c0289d | ||
![]() |
97002d81a7 | ||
![]() |
18ecd2ccad | ||
![]() |
ba7ec31927 | ||
![]() |
72a9e5edad | ||
![]() |
43108beb5b | ||
![]() |
63521cb9a7 | ||
![]() |
48f21f434f | ||
![]() |
90c7f51d8a | ||
![]() |
5d3a382eb7 | ||
![]() |
b895741422 | ||
![]() |
66ce42b7d2 | ||
![]() |
f4f20c9255 | ||
![]() |
f71979dcb3 | ||
![]() |
81ce8d659e | ||
![]() |
732f779606 | ||
![]() |
a5c518bf71 | ||
![]() |
fa24d868ac | ||
![]() |
c38a40eff9 | ||
![]() |
439bb5377c | ||
![]() |
e38ea9df0c | ||
![]() |
6955c981bc | ||
![]() |
fb3bd3b233 | ||
![]() |
847f828e7f | ||
![]() |
ec0ba62326 | ||
![]() |
76816a3bfc | ||
![]() |
ea873d322a | ||
![]() |
1c3ad751de | ||
![]() |
eccd76a6ac | ||
![]() |
2e99b6e9ce | ||
![]() |
e305da0baf | ||
![]() |
ca8e33375b | ||
![]() |
4568e64d9e | ||
![]() |
5b3ce972e0 | ||
![]() |
bf3a264202 | ||
![]() |
fc2fd42197 | ||
![]() |
9c821dc21c | ||
![]() |
826c56b67c | ||
![]() |
f3245a6fed | ||
![]() |
43e9c5b247 | ||
![]() |
6d9ab4c984 | ||
![]() |
5418740c4a | ||
![]() |
0251b14be3 | ||
![]() |
2e43a69a5c | ||
![]() |
056a4a0960 | ||
![]() |
1bb627514d | ||
![]() |
1e3465dc99 | ||
![]() |
2f873636c7 | ||
![]() |
cb3e9578e3 | ||
![]() |
eecf3aab80 | ||
![]() |
779a6637b2 | ||
![]() |
482ff3b911 | ||
![]() |
616923c1b0 | ||
![]() |
c57874fde0 | ||
![]() |
9eebee9ff0 | ||
![]() |
bc8a1fd7d5 | ||
![]() |
01dee787c1 | ||
![]() |
eedf76f8ed | ||
![]() |
dccd23e6fb | ||
![]() |
7217771458 | ||
![]() |
3ee780ce9c | ||
![]() |
bee8874629 | ||
![]() |
11ffdd3abc | ||
![]() |
6f859d90f1 | ||
![]() |
96f4421e5f | ||
![]() |
ad602924a4 | ||
![]() |
9eca707549 | ||
![]() |
4fc47a774f | ||
![]() |
c98c4fbff6 | ||
![]() |
4d4f004968 | ||
![]() |
5d7a023430 | ||
![]() |
3e272e73d6 | ||
![]() |
cc2352f842 | ||
![]() |
f170ced2a7 | ||
![]() |
dcdb763de8 | ||
![]() |
5c9f37080e | ||
![]() |
257d75429d | ||
![]() |
c1adfb4c94 | ||
![]() |
217bc17a21 | ||
![]() |
7107e02315 | ||
![]() |
062a777240 | ||
![]() |
1842745c9c | ||
![]() |
bbcc9421d6 | ||
![]() |
b58a1c7f33 | ||
![]() |
79a8f7b3a0 | ||
![]() |
302ab09178 | ||
![]() |
e1e38e2250 | ||
![]() |
2638809c50 | ||
![]() |
36853f923e | ||
![]() |
63aff8e3d0 | ||
![]() |
7eebc2ad4d | ||
![]() |
0f695adb03 | ||
![]() |
79ec168f3c | ||
![]() |
40a3a80d45 | ||
![]() |
025fc35c87 | ||
![]() |
e9f5f3ac1f | ||
![]() |
235c87dc92 | ||
![]() |
b6535836aa | ||
![]() |
5e90dd3507 | ||
![]() |
d9139ff3de | ||
![]() |
5669b97fd7 | ||
![]() |
6f0fae7432 | ||
![]() |
1c4dd015ac | ||
![]() |
e9efcfb428 | ||
![]() |
d32189918b | ||
![]() |
38d3b1b6d6 | ||
![]() |
1df907b1ba | ||
![]() |
00a7191f67 | ||
![]() |
d53b22e8f0 | ||
![]() |
e5bb4fa90f | ||
![]() |
ba9b075eba | ||
![]() |
85b2733324 | ||
![]() |
9519b9916c | ||
![]() |
00494df2f1 | ||
![]() |
948196448f | ||
![]() |
7ca3d26e7a | ||
![]() |
f79d28085d | ||
![]() |
74a005f73f | ||
![]() |
6f7aa1e755 | ||
![]() |
847a6cce96 | ||
![]() |
95aed34a69 | ||
![]() |
21e0382edd | ||
![]() |
0cdfdb9970 | ||
![]() |
f75b0aa814 | ||
![]() |
403f87340f | ||
![]() |
07cfc34a2e | ||
![]() |
4222cebef6 | ||
![]() |
1e2aa2363b | ||
![]() |
0b25cd2196 | ||
![]() |
b7457ff61b | ||
![]() |
ba2f78a006 | ||
![]() |
dcbdf09709 | ||
![]() |
a9b11980d2 | ||
![]() |
906d0e9c03 | ||
![]() |
0952ab1ab9 | ||
![]() |
7635776ca4 | ||
![]() |
76a3457ad5 | ||
![]() |
881c4cb49e | ||
![]() |
0406d1c316 | ||
![]() |
1ca76a29d9 | ||
![]() |
e53df5b07e | ||
![]() |
e7a47e783b | ||
![]() |
279eb89ce5 | ||
![]() |
fe9020dcb8 | ||
![]() |
4927836b2d | ||
![]() |
5a072d38db | ||
![]() |
2d1ebf4850 | ||
![]() |
44ec2027f3 | ||
![]() |
000da98663 | ||
![]() |
87ba287f81 | ||
![]() |
d133701a72 | ||
![]() |
4635f8597d | ||
![]() |
802351be25 | ||
![]() |
d3765b27c2 | ||
![]() |
7b11fff2ee | ||
![]() |
de4573275a | ||
![]() |
275c94c900 | ||
![]() |
c084e647ed | ||
![]() |
2cdb419a21 | ||
![]() |
2eef7ca475 | ||
![]() |
d126e7bbba | ||
![]() |
e5024fae3d | ||
![]() |
eb053c7f3f | ||
![]() |
ed441c8289 | ||
![]() |
59b0a1dc65 | ||
![]() |
80d36aba5b | ||
![]() |
e1e36d213b | ||
![]() |
5c8d92e4d0 | ||
![]() |
8a39054b54 | ||
![]() |
c60e2704c8 | ||
![]() |
a9fdbf7f21 | ||
![]() |
ed86b02df8 | ||
![]() |
0811b4dc51 | ||
![]() |
d9901e0b85 | ||
![]() |
0f5752b0fc | ||
![]() |
31f77182d0 | ||
![]() |
620e875335 | ||
![]() |
c18173c260 | ||
![]() |
f08f458896 | ||
![]() |
53cf48f505 | ||
![]() |
c32a1a5023 | ||
![]() |
8b204815cc | ||
![]() |
a9bb92b3ae | ||
![]() |
630272eb55 | ||
![]() |
92fe3b19c8 | ||
![]() |
30e2b03a65 | ||
![]() |
f8943854fd | ||
![]() |
325465935d | ||
![]() |
1cdd37b32c | ||
![]() |
499bff9c3a | ||
![]() |
bd06e43b87 | ||
![]() |
72e5620202 | ||
![]() |
fbb9646806 | ||
![]() |
4b91f0793c | ||
![]() |
6243a80b3f | ||
![]() |
e0b0a98c8e | ||
![]() |
785eac863b | ||
![]() |
ab8659922d | ||
![]() |
d48f9c4af4 | ||
![]() |
5cc0644aa0 | ||
![]() |
91accc391d | ||
![]() |
3ee20388c5 | ||
![]() |
2449510673 | ||
![]() |
2c07ed320e | ||
![]() |
607f37dafd | ||
![]() |
acc2e040ce | ||
![]() |
faa9bbdc8e | ||
![]() |
cf6c760cd3 | ||
![]() |
e49349ac0c | ||
![]() |
1e5db996ff | ||
![]() |
793a0681a9 | ||
![]() |
825ffaa168 | ||
![]() |
9ad6a36b7b | ||
![]() |
c3b53c72c7 | ||
![]() |
0800d81fb4 | ||
![]() |
c27219695a | ||
![]() |
9dcfc308ef | ||
![]() |
77b3a6afaf | ||
![]() |
dd42795131 | ||
![]() |
fb1497566c | ||
![]() |
cc6c0fe230 | ||
![]() |
f9a46a319b | ||
![]() |
48a0592a45 | ||
![]() |
1c74a8b5ae | ||
![]() |
3d18043005 | ||
![]() |
6e1e00701e | ||
![]() |
5570d846ea | ||
![]() |
f5dcb8f7ad | ||
![]() |
f6f1b09b69 | ||
![]() |
bf540985aa | ||
![]() |
c39f86c28a | ||
![]() |
b5da8ad00d | ||
![]() |
f62b86263a | ||
![]() |
3449c734d5 | ||
![]() |
3f29d985fe | ||
![]() |
2f4a7bbced | ||
![]() |
a0522e4c21 | ||
![]() |
f461d91cd2 | ||
![]() |
ef54e0c4f4 | ||
![]() |
863f39fb9f | ||
![]() |
d33b28c9fe | ||
![]() |
c15a87a614 | ||
![]() |
45de0635ac | ||
![]() |
bca314c339 | ||
![]() |
f05490d0e2 | ||
![]() |
442e201705 | ||
![]() |
9c346b2321 | ||
![]() |
a6b684d05a | ||
![]() |
8fb82da226 | ||
![]() |
0949f89028 | ||
![]() |
350a49e1cc | ||
![]() |
bc19e38728 | ||
![]() |
228a2954d7 | ||
![]() |
3d6d4ca2cd | ||
![]() |
4c3e5cf1d1 | ||
![]() |
27b1b6d4eb | ||
![]() |
24269007d8 | ||
![]() |
d849036927 | ||
![]() |
5be47255ba | ||
![]() |
8f860b3698 | ||
![]() |
35992597ae | ||
![]() |
3f0d7a2937 | ||
![]() |
dae1232489 | ||
![]() |
8e388843b8 | ||
![]() |
5adbf3765a | ||
![]() |
e910e6f13d | ||
![]() |
2f2cca8ac6 | ||
![]() |
a2f39399a1 | ||
![]() |
c1149f88b6 | ||
![]() |
54adba6a31 | ||
![]() |
b48106f8a8 | ||
![]() |
f345428367 | ||
![]() |
e4287595c1 | ||
![]() |
73efbf2e14 | ||
![]() |
ad342dfca9 | ||
![]() |
f13d6d4b0f | ||
![]() |
dfb8241317 | ||
![]() |
c67f10e43f | ||
![]() |
932eea513e | ||
![]() |
5e51a37518 | ||
![]() |
372564299e | ||
![]() |
c397fe0c51 | ||
![]() |
95227e2732 | ||
![]() |
6f8d6da77f | ||
![]() |
6f15aec644 | ||
![]() |
9bed177f10 | ||
![]() |
7de4f16710 | ||
![]() |
beac43f41f | ||
![]() |
8538d5dcf1 | ||
![]() |
0fb294ade4 | ||
![]() |
0f6a682ea6 | ||
![]() |
c4fc20a033 | ||
![]() |
a24e2bfc76 | ||
![]() |
6a83588fdd | ||
![]() |
0092b3629e | ||
![]() |
c0eedcd4ce | ||
![]() |
d1b6d5f33d | ||
![]() |
fe297fc6d8 | ||
![]() |
384fcea585 | ||
![]() |
2f2b44a1bd | ||
![]() |
8386daddcb | ||
![]() |
739a23e506 | ||
![]() |
5a59155a05 | ||
![]() |
1ad917e2f6 | ||
![]() |
859844eae3 | ||
![]() |
857b9848d2 | ||
![]() |
5f98fcf00b | ||
![]() |
5a492e8196 | ||
![]() |
80cb52c944 | ||
![]() |
4436c09c9d | ||
![]() |
23cf7a2e0d | ||
![]() |
4a62e1c0ca | ||
![]() |
173afd8564 | ||
![]() |
f6b9ebb838 | ||
![]() |
f1b109005c | ||
![]() |
0bd58cd727 | ||
![]() |
de1292f8ac | ||
![]() |
a6d5c1fe05 | ||
![]() |
fc5bd11dac | ||
![]() |
e767840874 | ||
![]() |
fd08ca3823 | ||
![]() |
3bf60755cb | ||
![]() |
aac7d1c2ae | ||
![]() |
55caed2011 | ||
![]() |
53058af284 | ||
![]() |
ad1a11164c | ||
![]() |
5f6a4fe643 | ||
![]() |
c85ea238ca | ||
![]() |
5c0b2d04f4 | ||
![]() |
76e64053c3 | ||
![]() |
ddfa59a52b | ||
![]() |
e3fb974fc7 | ||
![]() |
9120fbd501 | ||
![]() |
52181848da | ||
![]() |
10cbe04fc5 | ||
![]() |
8367b00e8c | ||
![]() |
4a4f289adc | ||
![]() |
467f1d52e4 |
41
.github/workflows/create-test-plan.py
vendored
41
.github/workflows/create-test-plan.py
vendored
@@ -28,6 +28,7 @@ class JobOs(Enum):
|
||||
WindowsLatest = "windows-latest"
|
||||
UbuntuLatest = "ubuntu-latest"
|
||||
MacosLatest = "macos-latest"
|
||||
Ubuntu20_04 = "ubuntu-20.04"
|
||||
Ubuntu22_04 = "ubuntu-22.04"
|
||||
Ubuntu24_04 = "ubuntu-24.04"
|
||||
Macos13 = "macos-13"
|
||||
@@ -50,18 +51,19 @@ class SdlPlatform(Enum):
|
||||
Riscos = "riscos"
|
||||
FreeBSD = "freebsd"
|
||||
NetBSD = "netbsd"
|
||||
OpenBSD = "openbsd"
|
||||
Watcom = "watcom"
|
||||
|
||||
|
||||
class Msys2Platform(Enum):
|
||||
Mingw32 = "mingw32"
|
||||
Mingw64 = "mingw64"
|
||||
Clang32 = "clang32"
|
||||
Clang64 = "clang64"
|
||||
Ucrt64 = "ucrt64"
|
||||
|
||||
|
||||
class IntelCompiler(Enum):
|
||||
Icc = "icc"
|
||||
Icx = "icx"
|
||||
|
||||
|
||||
@@ -105,21 +107,24 @@ class JobSpec:
|
||||
JOB_SPECS = {
|
||||
"msys2-mingw32": JobSpec(name="Windows (msys2, mingw32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32", msys2_platform=Msys2Platform.Mingw32, ),
|
||||
"msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ),
|
||||
"msys2-clang32": JobSpec(name="Windows (msys2, clang32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32-clang", msys2_platform=Msys2Platform.Clang32, ),
|
||||
"msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ),
|
||||
"msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ),
|
||||
"msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ),
|
||||
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
|
||||
"msvc-static-x86": JobSpec(name="Windows (MSVC, static VCRT, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_static_crt=True, ),
|
||||
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
|
||||
"msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ),
|
||||
"msvc-static-x64": JobSpec(name="Windows (MSVC, static VCRT, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_static_crt=True, ),
|
||||
"msvc-static-x86": JobSpec(name="Windows (MSVC, static VCRT, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_static_crt=True, ),
|
||||
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
|
||||
"msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ),
|
||||
"msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ),
|
||||
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
|
||||
"msvc-uwp-x64": JobSpec(name="UWP (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-UWP", msvc_arch=MsvcArch.X64, msvc_project="VisualC-WinRT/SDL-UWP.sln", uwp=True, ),
|
||||
"msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ),
|
||||
"ubuntu-20.04": JobSpec(name="Ubuntu 20.04", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04", autotools=True),
|
||||
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", autotools=True),
|
||||
"steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ),
|
||||
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
|
||||
"ubuntu-intel-icx": JobSpec(name="Ubuntu 20.04 (Intel oneAPI)", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04-oneapi", intel=IntelCompiler.Icx, ),
|
||||
"ubuntu-intel-icc": JobSpec(name="Ubuntu 20.04 (Intel Compiler)", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04-icc", intel=IntelCompiler.Icc, ),
|
||||
"macos-gnu-arm64-x64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-x64-gnu",autotools=True, apple_archs={AppleArch.X86_64, AppleArch.ARM64, }, ),
|
||||
"ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ),
|
||||
"tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ),
|
||||
@@ -134,7 +139,6 @@ JOB_SPECS = {
|
||||
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
|
||||
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
|
||||
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", autotools=True, ),
|
||||
"openbsd": JobSpec(name="OpenBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.OpenBSD, artifact="SDL-openbsd-x64", autotools=True, ),
|
||||
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", autotools=True, ),
|
||||
"watcom-win32": JobSpec(name="Watcom (Windows)", os=JobOs.WindowsLatest, platform=SdlPlatform.Watcom, artifact="SDL-watcom-win32", no_cmake=True, watcom_platform=WatcomPlatform.Windows ),
|
||||
"watcom-os2": JobSpec(name="Watcom (OS/2)", os=JobOs.WindowsLatest, platform=SdlPlatform.Watcom, artifact="SDL-watcom-win32", no_cmake=True, watcom_platform=WatcomPlatform.OS2 ),
|
||||
@@ -177,7 +181,6 @@ class JobDetails:
|
||||
brew_packages: list[str] = dataclasses.field(default_factory=list)
|
||||
cmake_toolchain_file: str = ""
|
||||
cmake_arguments: list[str] = dataclasses.field(default_factory=list)
|
||||
cmake_generator: str = "Ninja"
|
||||
cmake_build_arguments: list[str] = dataclasses.field(default_factory=list)
|
||||
cppflags: list[str] = dataclasses.field(default_factory=list)
|
||||
cc: str = ""
|
||||
@@ -223,7 +226,6 @@ class JobDetails:
|
||||
setup_vita_gles_type: str = ""
|
||||
check_sources: bool = False
|
||||
watcom_makefile: str = ""
|
||||
binutils_strings: str = "strings"
|
||||
|
||||
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
|
||||
data = {
|
||||
@@ -257,7 +259,6 @@ class JobDetails:
|
||||
"cflags": my_shlex_join(self.cppflags + self.cflags),
|
||||
"cxxflags": my_shlex_join(self.cppflags + self.cxxflags),
|
||||
"ldflags": my_shlex_join(self.ldflags),
|
||||
"cmake-generator": self.cmake_generator,
|
||||
"cmake-toolchain-file": self.cmake_toolchain_file,
|
||||
"cmake-arguments": my_shlex_join(self.cmake_arguments),
|
||||
"cmake-build-arguments": my_shlex_join(self.cmake_build_arguments),
|
||||
@@ -290,7 +291,6 @@ class JobDetails:
|
||||
"setup-gdk-folder": self.setup_gdk_folder,
|
||||
"check-sources": self.check_sources,
|
||||
"watcom-makefile": self.watcom_makefile,
|
||||
"binutils-strings": self.binutils_strings,
|
||||
}
|
||||
return {k: v for k, v in data.items() if v != ""}
|
||||
|
||||
@@ -344,6 +344,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
case IntelCompiler.Icx:
|
||||
job.cc = "icx"
|
||||
job.cxx = "icpx"
|
||||
case IntelCompiler.Icc:
|
||||
job.cc = "icc"
|
||||
job.cxx = "icpc"
|
||||
job.cppflags.append("-diag-disable=10441")
|
||||
case _:
|
||||
raise ValueError(f"Invalid intel={spec.intel}")
|
||||
job.source_cmd = f"source /opt/intel/oneapi/setvars.sh;"
|
||||
@@ -380,9 +384,11 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
match spec.msvc_arch:
|
||||
case MsvcArch.X86:
|
||||
job.cflags.append("/clang:-m32")
|
||||
job.cxxflags.append("/clang:-m32")
|
||||
job.ldflags.append("/MACHINE:X86")
|
||||
case MsvcArch.X64:
|
||||
job.cflags.append("/clang:-m64")
|
||||
job.cxxflags.append("/clang:-m64")
|
||||
job.ldflags.append("/MACHINE:X64")
|
||||
case _:
|
||||
raise ValueError(f"Unsupported clang-cl architecture (arch={spec.msvc_arch})")
|
||||
@@ -606,14 +612,11 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
job.shared_lib = SharedLibType.SO_0
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.N3ds:
|
||||
job.cmake_generator = "Unix Makefiles"
|
||||
job.cmake_build_arguments.append("-j$(nproc)")
|
||||
job.shared = False
|
||||
job.apt_packages = []
|
||||
job.apt_packages = ["ninja-build", "binutils"]
|
||||
job.run_tests = False
|
||||
job.cc_from_cmake = True
|
||||
job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake"
|
||||
job.binutils_strings = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-strings"
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Msys2:
|
||||
job.shell = "msys2 {0}"
|
||||
@@ -626,7 +629,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
"clang64": "mingw-w64-clang-x86_64",
|
||||
"ucrt64": "mingw-w64-ucrt-x86_64",
|
||||
}[spec.msys2_platform.value]
|
||||
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, )
|
||||
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, Msys2Platform.Clang32)
|
||||
job.shared_lib = SharedLibType.WIN32
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.Riscos:
|
||||
@@ -645,7 +648,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
))
|
||||
job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake"
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD | SdlPlatform.OpenBSD:
|
||||
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD:
|
||||
job.build_autotools_tests = False
|
||||
job.cpactions = True
|
||||
job.no_cmake = True
|
||||
@@ -670,12 +673,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update"
|
||||
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
|
||||
case SdlPlatform.OpenBSD:
|
||||
job.cpactions_os = "openbsd"
|
||||
job.cpactions_version = "7.4"
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "sudo pkg_add -u"
|
||||
job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols xwayland libxkbcommon libinotify pulseaudio dbus ibus"
|
||||
case SdlPlatform.Watcom:
|
||||
match spec.watcom_platform:
|
||||
case WatcomPlatform.OS2:
|
||||
|
6
.github/workflows/generic.yml
vendored
6
.github/workflows/generic.yml
vendored
@@ -177,7 +177,7 @@ jobs:
|
||||
#shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -G "${{ matrix.platform.cmake-generator }}" \
|
||||
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -GNinja \
|
||||
-Wdeprecated -Wdev -Werror \
|
||||
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
||||
-DSDL_WERROR=${{ matrix.platform.werror }} \
|
||||
@@ -207,9 +207,9 @@ jobs:
|
||||
run: |
|
||||
echo "This should show us the SDL_REVISION"
|
||||
echo "Shared library:"
|
||||
${{ (matrix.platform.shared-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
|
||||
${{ (matrix.platform.shared-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
|
||||
echo "Static library:"
|
||||
${{ (matrix.platform.static-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
|
||||
${{ (matrix.platform.static-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
|
||||
- name: 'Run build-time tests (CMake)'
|
||||
id: cmake-tests
|
||||
if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }}
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -181,7 +181,7 @@ jobs:
|
||||
|
||||
msvc:
|
||||
needs: [src]
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2019
|
||||
outputs:
|
||||
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
|
||||
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -15,7 +15,7 @@ build
|
||||
gen
|
||||
Build
|
||||
buildbot
|
||||
/REVISION.txt
|
||||
/VERSION.txt
|
||||
dist
|
||||
|
||||
*.so
|
||||
|
@@ -1,9 +1,9 @@
|
||||
projectfullname = Simple Directmedia Layer
|
||||
projectshortname = SDL
|
||||
projectfullname = SDL2
|
||||
projectshortname = SDL2
|
||||
incsubdir = include
|
||||
wikisubdir = SDL2
|
||||
readmesubdir = docs
|
||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_|[US]int\d+)
|
||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
||||
mainincludefname = SDL.h
|
||||
versionfname = include/SDL_version.h
|
||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
||||
@@ -14,19 +14,4 @@ projecturl = https://libsdl.org/
|
||||
wikiurl = https://wiki.libsdl.org/SDL2
|
||||
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
||||
warn_about_missing = 0
|
||||
#wikipreamble = (This is the legacy documentation for SDL2, the previous stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current stable version.)
|
||||
wikiheaderfiletext = Defined in [%fname%](https://github.com/libsdl-org/SDL/blob/SDL2/include/%fname%)
|
||||
manpageheaderfiletext = Defined in %fname%
|
||||
|
||||
# All SDL_config_*.h headers are uncategorized, in case something slips in from them.
|
||||
# All SDL_test_* headers become uncategorized, everything else just converts like SDL_audio.h -> Audio
|
||||
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
|
||||
headercategoryeval = s/\ASDL_config_.*?\.h\Z//; s/\ASDL_test_.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
||||
|
||||
# !!! FIXME: maybe later, but there are probably documentation gaps to fix first.
|
||||
quickrefenabled = 0
|
||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gesture,GameController,Joystick,Haptic,Audio,Timer,Render,LoadSO,Thread,Mutex,Atomic,Filesystem,RWOPS,Pixels,Surface,Blendmode,Rect,Clipboard,Messagebox,Vulkan,Metal,Platform,Power,Sensor,Bits,Endian,Assert,CPUInfo,Locale,System,Misc,GUID,Main,Stdinc
|
||||
quickreftitle = SDL2 API Quick Reference
|
||||
quickrefurl = https://libsdl.org/
|
||||
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL2/QuickReference
|
||||
quickrefmacroregex = \A(SDL_Atomic...Ref|SDL_assert.*?|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast|SDL_Load...)\Z
|
||||
wikipreamble = (This is the legacy documentation for stable SDL2, the current stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current development version.)
|
||||
|
@@ -35,7 +35,6 @@ LOCAL_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
|
||||
|
175
CMakeLists.txt
175
CMakeLists.txt
@@ -6,7 +6,7 @@ endif()
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
|
||||
|
||||
cmake_minimum_required(VERSION 3.0.0...3.10)
|
||||
project(SDL2 C)
|
||||
project(SDL2 C CXX)
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
set(SDL2_SUBPROJECT OFF)
|
||||
@@ -15,15 +15,13 @@ else()
|
||||
endif()
|
||||
|
||||
if (HAIKU)
|
||||
enable_language(CXX)
|
||||
set(LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
set(EXTRA_LIBS)
|
||||
set(EXTRA_LDFLAGS)
|
||||
|
||||
set(CMAKE_LIBS)
|
||||
set(PKGCONFIG_LDFLAGS)
|
||||
set(CMAKE_DEPENDS)
|
||||
set(PKGCONFIG_DEPENDS)
|
||||
|
||||
# This is a virtual "library" that just exists to collect up compiler and
|
||||
@@ -88,8 +86,8 @@ endif()
|
||||
|
||||
# See docs/release_checklist.md
|
||||
set(SDL_MAJOR_VERSION 2)
|
||||
set(SDL_MINOR_VERSION 33)
|
||||
set(SDL_MICRO_VERSION 0)
|
||||
set(SDL_MINOR_VERSION 30)
|
||||
set(SDL_MICRO_VERSION 12)
|
||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||
|
||||
# Set defaults preventing destination file conflicts
|
||||
@@ -142,7 +140,6 @@ check_cpu_architecture(x86 SDL_CPU_X86)
|
||||
check_cpu_architecture(x64 SDL_CPU_X64)
|
||||
check_cpu_architecture(arm32 SDL_CPU_ARM32)
|
||||
check_cpu_architecture(arm64 SDL_CPU_ARM64)
|
||||
check_cpu_architecture(arm64ec SDL_CPU_ARM64EC)
|
||||
check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64)
|
||||
|
||||
# Check for 64 or 32 bit
|
||||
@@ -198,7 +195,7 @@ endif()
|
||||
# so we'll just use libusb when it's available. libusb does not support iOS,
|
||||
# so we default to yes on iOS.
|
||||
# TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
|
||||
if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID)
|
||||
if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR ANDROID)
|
||||
set(HIDAPI_SKIP_LIBUSB TRUE)
|
||||
else()
|
||||
set(HIDAPI_SKIP_LIBUSB FALSE)
|
||||
@@ -241,10 +238,10 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
||||
endif()
|
||||
|
||||
# Default option knobs
|
||||
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS OR SDL_CPU_ARM64EC)
|
||||
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS)
|
||||
set(OPT_DEF_LIBC ON)
|
||||
endif()
|
||||
if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(WINDOWS OR DARWIN OR MACOSX OR IOS OR TVOS)
|
||||
set(SDL_SYSTEM_ICONV_DEFAULT OFF)
|
||||
else()
|
||||
set(SDL_SYSTEM_ICONV_DEFAULT ON)
|
||||
@@ -363,11 +360,6 @@ if(VITA OR PSP OR PS2 OR N3DS)
|
||||
set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
set(SDL_X11_XRANDR_DEFAULT ON)
|
||||
if(SOLARIS)
|
||||
set(SDL_X11_XRANDR_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
# When defined, respect CMake's BUILD_SHARED_LIBS setting:
|
||||
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
|
||||
if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT)
|
||||
@@ -464,19 +456,17 @@ set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
|
||||
set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${SDL_CLOCK_GETTIME_ENABLED_BY_DEFAULT})
|
||||
set_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS})
|
||||
dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF)
|
||||
dep_option(SDL_X11_XCURSOR "Enable Xcursor support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XDBE "Enable Xdbe support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XINPUT "Enable XInput support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XFIXES "Enable Xfixes support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XRANDR "Enable Xrandr support" "${SDL_X11_XRANDR_DEFAULT}" SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSCRNSAVER "Enable Xscrnsaver support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSHAPE "Enable XShape support" ON SDL_X11 OFF)
|
||||
set(SDL_X11_OPTIONS Xcursor Xdbe XInput Xfixes Xrandr Xscrnsaver XShape)
|
||||
foreach(_SUB ${SDL_X11_OPTIONS})
|
||||
string(TOUPPER "SDL_X11_${_SUB}" _OPT)
|
||||
dep_option(${_OPT} "Enable ${_SUB} support" ON "SDL_X11" OFF)
|
||||
endforeach()
|
||||
set_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
|
||||
dep_option(SDL_WAYLAND_SHARED "Dynamically load Wayland support" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR "Use client-side window decorations on Wayland" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR_SHARED "Dynamically load libdecor support" ON "SDL_WAYLAND_LIBDECOR;SDL_WAYLAND_SHARED" OFF)
|
||||
dep_option(SDL_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "SDL_WAYLAND" OFF)
|
||||
set_option(SDL_RPI "Use Raspberry Pi 0-3 video driver" ${UNIX_SYS})
|
||||
set_option(SDL_RPI "Use Raspberry Pi video driver" ${UNIX_SYS})
|
||||
set_option(SDL_COCOA "Use Cocoa video driver" ${APPLE})
|
||||
set_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS})
|
||||
set_option(SDL_XINPUT "Use Xinput for Windows" ${WINDOWS})
|
||||
@@ -755,11 +745,6 @@ if(MSVC)
|
||||
if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")
|
||||
list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT")
|
||||
endif()
|
||||
|
||||
# for VS >= 17.14 targeting ARM64: inline the Interlocked funcs
|
||||
if(MSVC_VERSION GREATER 1943 AND SDL_CPU_ARM64 AND NOT SDL_LIBC)
|
||||
list(APPEND EXTRA_CFLAGS /forceInterlockedFunctions-)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
@@ -1099,7 +1084,6 @@ if(SDL_LIBC)
|
||||
endforeach()
|
||||
|
||||
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
||||
check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT)
|
||||
check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
|
||||
check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP)
|
||||
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
|
||||
@@ -1471,14 +1455,10 @@ elseif(EMSCRIPTEN)
|
||||
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
if(SDL_AUDIO)
|
||||
if(SYSV5 OR SOLARIS OR HPUX)
|
||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
||||
check_include_file(sys/audioio.h HAVE_SYS_AUDIOIO_H)
|
||||
if(HAVE_SYS_AUDIOIO_H)
|
||||
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
||||
file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
|
||||
list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
||||
file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
|
||||
list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
elseif(NETBSD)
|
||||
set(SDL_AUDIO_DRIVER_NETBSD 1)
|
||||
file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c)
|
||||
@@ -1793,7 +1773,6 @@ elseif(WINDOWS)
|
||||
list(APPEND SOURCE_FILES ${CORE_SOURCES})
|
||||
|
||||
if(WINDOWS_STORE)
|
||||
enable_language(CXX)
|
||||
file(GLOB WINRT_SOURCE_FILES ${SDL2_SOURCE_DIR}/src/core/winrt/*.c ${SDL2_SOURCE_DIR}/src/core/winrt/*.cpp)
|
||||
list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES})
|
||||
endif()
|
||||
@@ -1839,10 +1818,8 @@ elseif(WINDOWS)
|
||||
set(HAVE_DIRECTX TRUE)
|
||||
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
|
||||
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
|
||||
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}" SDL2_TMP_DXSDK_LIB_DIR)
|
||||
target_link_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_LIB_DIR}")
|
||||
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\Include" SDL2_TMP_DXSDK_INCLUDE_DIR)
|
||||
target_include_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_INCLUDE_DIR}")
|
||||
target_link_directories(sdl-build-options INTERFACE "$$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}")
|
||||
target_include_directories(sdl-build-options INTERFACE "$ENV{DXSDK_DIR}\\Include")
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||
@@ -2077,7 +2054,6 @@ elseif(WINDOWS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
enable_language(RC)
|
||||
file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
|
||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
|
||||
if(MINGW OR CYGWIN)
|
||||
@@ -2095,7 +2071,7 @@ elseif(APPLE)
|
||||
# !!! FIXME: we need Carbon for some very old API calls in
|
||||
# !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
|
||||
# !!! FIXME: how to dump those.
|
||||
if(MACOS)
|
||||
if(DARWIN OR MACOSX)
|
||||
set(SDL_FRAMEWORK_COCOA 1)
|
||||
set(SDL_FRAMEWORK_CARBON 1)
|
||||
endif()
|
||||
@@ -2109,12 +2085,12 @@ elseif(APPLE)
|
||||
set(HAVE_SDL_FILE TRUE)
|
||||
endif()
|
||||
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c)
|
||||
endif()
|
||||
|
||||
if(SDL_MISC)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m)
|
||||
else()
|
||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m)
|
||||
@@ -2139,10 +2115,10 @@ elseif(APPLE)
|
||||
|
||||
if(SDL_JOYSTICK)
|
||||
file(GLOB MFI_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
|
||||
set(SDL_JOYSTICK_MFI 1)
|
||||
if(IOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS)
|
||||
set(SDL_FRAMEWORK_COREMOTION 1)
|
||||
endif()
|
||||
set(SDL_FRAMEWORK_GAMECONTROLLER 1)
|
||||
@@ -2183,7 +2159,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_HAPTIC)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if (IOS OR TVOS)
|
||||
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
|
||||
set(SDL_HAPTIC_DUMMY 1)
|
||||
else()
|
||||
@@ -2197,7 +2173,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_POWER)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if (IOS OR TVOS)
|
||||
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
|
||||
set(SDL_POWER_UIKIT 1)
|
||||
else()
|
||||
@@ -2230,7 +2206,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_SENSOR)
|
||||
if(IOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS)
|
||||
set(SDL_SENSOR_COREMOTION 1)
|
||||
set(HAVE_SDL_SENSORS TRUE)
|
||||
file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/coremotion/*.m)
|
||||
@@ -2240,7 +2216,7 @@ elseif(APPLE)
|
||||
|
||||
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
|
||||
if(SDL_VIDEO)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if (IOS OR TVOS)
|
||||
set(SDL_VIDEO_DRIVER_UIKIT 1)
|
||||
set(SDL_FRAMEWORK_COREGRAPHICS 1)
|
||||
set(SDL_FRAMEWORK_QUARTZCORE 1)
|
||||
@@ -2261,7 +2237,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(SDL_OPENGLES)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
if(IOS OR TVOS)
|
||||
set(SDL_FRAMEWORK_OPENGLES 1)
|
||||
set(SDL_VIDEO_OPENGL_ES 1)
|
||||
set(SDL_VIDEO_RENDER_OGL_ES 1)
|
||||
@@ -2304,96 +2280,73 @@ elseif(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Minimum version for $<LINK_LIBRARY:feature,library-list>
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
# Actually load the frameworks at the end so we don't duplicate include.
|
||||
if(SDL_FRAMEWORK_COREVIDEO)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreVideo>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COCOA)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Cocoa")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Cocoa>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Cocoa")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_IOKIT)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,IOKit")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,IOKit>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,IOKit")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_FF)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,ForceFeedback>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_CARBON)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Carbon")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Carbon>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Carbon")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREAUDIO)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreAudio>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_AUDIOTOOLBOX)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,AudioToolbox>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_AVFOUNDATION)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,AVFoundation>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREBLUETOOTH)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreBluetooth>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREGRAPHICS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,CoreGraphics>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREMOTION)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Coremotion>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_FOUNDATION)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Foundation")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Foundation>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Foundation")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_GAMECONTROLLER)
|
||||
find_library(GAMECONTROLLER GameController)
|
||||
if(GAMECONTROLLER)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,GameController>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_METAL)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Metal")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,Metal>")
|
||||
if(IOS OR TVOS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Metal")
|
||||
else()
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,Metal>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_OPENGLES)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,OpenGLES>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_QUARTZCORE)
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,QuartzCore>")
|
||||
if(IOS OR TVOS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||
else()
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,QuartzCore>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_UIKIT)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,UIKit")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:FRAMEWORK,UIKit>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,UIKit")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREHAPTICS)
|
||||
find_library(COREHAPTICS CoreHaptics)
|
||||
if(COREHAPTICS)
|
||||
list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||
list(APPEND CMAKE_LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,CoreHaptics>")
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -3199,7 +3152,7 @@ endif()
|
||||
|
||||
# Clean up the different lists
|
||||
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
||||
set(SDL_STATIC_LIBS ${EXTRA_LDFLAGS} ${_EXTRA_LIBS} ${PKGCONFIG_LDFLAGS})
|
||||
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
|
||||
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
|
||||
listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
|
||||
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
||||
@@ -3233,11 +3186,9 @@ macro(check_add_debug_flag FLAG SUFFIX)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER)
|
||||
check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX})
|
||||
if (HAS_CXX_${SUFFIX})
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX})
|
||||
if (HAS_CXX_${SUFFIX})
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -3256,20 +3207,18 @@ macro(asan_check_add_debug_flag2 ASAN_FLAG)
|
||||
|
||||
set (STORED_REQLIBS ${CMAKE_REQUIRED_LIBRARIES})
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${FLAG};asan")
|
||||
|
||||
check_c_compiler_flag (${FLAG} HAS_C_FLAG_${ASAN_FLAG})
|
||||
check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS})
|
||||
|
||||
if (HAS_C_FLAG_${ASAN_FLAG})
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER)
|
||||
check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG})
|
||||
if (HAS_CXX_${ASAN_FLAG})
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
if (HAS_CXX_${ASAN_FLAG})
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
|
||||
endif()
|
||||
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS})
|
||||
if(HAS_C_${ASAN_FLAG} OR HAS_CXX_${ASAN_FLAG})
|
||||
set(HAVE_ASAN ON)
|
||||
endif()
|
||||
@@ -3493,7 +3442,7 @@ if(SDL_SHARED)
|
||||
set_property(TARGET SDL2 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS " /NODEFAULTLIB")
|
||||
endif()
|
||||
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
|
||||
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD} ${CMAKE_LIBS})
|
||||
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD} ${CMAKE_DEPENDS})
|
||||
target_include_directories(SDL2 PUBLIC
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||
@@ -3529,7 +3478,7 @@ if(SDL_STATIC)
|
||||
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
|
||||
# TODO: Win32 platforms keep the same suffix .lib for import and static
|
||||
# libraries - do we need to consider this?
|
||||
target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_LIBS})
|
||||
target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_DEPENDS})
|
||||
target_include_directories(SDL2-static PUBLIC
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||
|
@@ -14,8 +14,8 @@
|
||||
|
||||
LIBNAME = SDL2
|
||||
MAJOR_VERSION = 2
|
||||
MINOR_VERSION = 33
|
||||
MICRO_VERSION = 0
|
||||
MINOR_VERSION = 30
|
||||
MICRO_VERSION = 12
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
DESCRIPTION = Simple DirectMedia Layer 2
|
||||
|
||||
|
@@ -5,8 +5,8 @@
|
||||
|
||||
LIBNAME = SDL2
|
||||
MAJOR_VERSION = 2
|
||||
MINOR_VERSION = 33
|
||||
MICRO_VERSION = 0
|
||||
MINOR_VERSION = 30
|
||||
MICRO_VERSION = 12
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
|
||||
LIBHOME = .
|
||||
|
@@ -371,7 +371,6 @@
|
||||
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.0.0</WindowsTargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
@@ -392,7 +391,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
|
@@ -188,12 +188,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -216,12 +216,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -188,12 +188,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -194,12 +194,6 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
|
||||
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
|
||||
<Private>false</Private>
|
||||
|
@@ -456,10 +456,7 @@ main(int argc, char *argv[])
|
||||
while (!done) {
|
||||
SDL_Event event;
|
||||
double deltaTime = updateDeltaTime();
|
||||
SDL_bool hasEvents = SDL_FALSE;
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
hasEvents = SDL_TRUE;
|
||||
if (event.type == SDL_QUIT) {
|
||||
done = 1;
|
||||
}
|
||||
@@ -469,17 +466,10 @@ main(int argc, char *argv[])
|
||||
spawnEmitterParticle(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
/* Only update and render if we have active particles or just received events */
|
||||
if (num_active_particles > 0 || hasEvents) {
|
||||
stepParticles(deltaTime);
|
||||
drawParticles();
|
||||
SDL_GL_SwapWindow(window);
|
||||
SDL_Delay(16); // Target 60 FPS when active
|
||||
} else {
|
||||
/* Idle state - wait for events with longer delay to save CPU */
|
||||
SDL_Delay(100); // Much longer delay when idle
|
||||
}
|
||||
stepParticles(deltaTime);
|
||||
drawParticles();
|
||||
SDL_GL_SwapWindow(window);
|
||||
SDL_Delay(1);
|
||||
}
|
||||
|
||||
/* delete textures */
|
||||
|
@@ -19,10 +19,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.33.0</string>
|
||||
<string>2.30.12</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SDLX</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.33.0</string>
|
||||
<string>2.30.12</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@@ -9728,8 +9728,8 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.12.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||
@@ -9770,7 +9770,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
MARKETING_VERSION = 2.33.0;
|
||||
MARKETING_VERSION = 2.30.12;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
};
|
||||
name = Release;
|
||||
@@ -9813,8 +9813,8 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.12.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@@ -9856,7 +9856,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
MARKETING_VERSION = 2.33.0;
|
||||
MARKETING_VERSION = 2.30.12;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -10062,8 +10062,8 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.12.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
@@ -10114,8 +10114,8 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 3301.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3301.0.0;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||
DYLIB_CURRENT_VERSION = 3001.12.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Title SDL 2.33.0
|
||||
Title SDL 2.30.12
|
||||
Version 1
|
||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||
DefaultLocation /Library/Frameworks
|
||||
|
44
acinclude/libtool.m4
vendored
44
acinclude/libtool.m4
vendored
@@ -1023,21 +1023,6 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
|
||||
rm -f conftest.*
|
||||
fi])
|
||||
|
||||
# Feature test to disable chained fixups since it is not
|
||||
# compatible with '-undefined dynamic_lookup'
|
||||
AC_CACHE_CHECK([for -no_fixup_chains linker flag],
|
||||
[lt_cv_support_no_fixup_chains],
|
||||
[ save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([],[])],
|
||||
lt_cv_support_no_fixup_chains=yes,
|
||||
lt_cv_support_no_fixup_chains=no
|
||||
)
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
]
|
||||
)
|
||||
|
||||
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
|
||||
[lt_cv_ld_exported_symbols_list],
|
||||
[lt_cv_ld_exported_symbols_list=no
|
||||
@@ -1062,7 +1047,7 @@ _LT_EOF
|
||||
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
||||
cat > conftest.c << _LT_EOF
|
||||
int main(void) { return 0;}
|
||||
int main() { return 0;}
|
||||
_LT_EOF
|
||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
||||
@@ -1087,12 +1072,7 @@ _LT_EOF
|
||||
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
*)
|
||||
if test yes = "$lt_cv_support_no_fixup_chains"; then
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains'
|
||||
else
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
|
||||
fi
|
||||
;;
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -1882,11 +1862,11 @@ else
|
||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||
correspondingly for the symbols needed. */
|
||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||
int fnord (void) __attribute__((visibility("default")));
|
||||
int fnord () __attribute__((visibility("default")));
|
||||
#endif
|
||||
|
||||
int fnord (void) { return 42; }
|
||||
int main (void)
|
||||
int fnord () { return 42; }
|
||||
int main ()
|
||||
{
|
||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||
int status = $lt_dlunknown;
|
||||
@@ -2567,14 +2547,14 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
#soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
m4_if([$1], [],[
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
||||
;;
|
||||
mingw* | windows* | cegcc*)
|
||||
# MinGW DLLs use traditional 'lib' prefix
|
||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
@@ -3486,7 +3466,7 @@ cygwin*)
|
||||
# func_win32_libid is a shell function defined in ltmain.sh
|
||||
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
mingw* | windows* | pw32*)
|
||||
@@ -3498,10 +3478,10 @@ mingw* | windows* | pw32*)
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
else
|
||||
# Keep this pattern in sync with the one in func_win32_libid.
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
|
||||
lt_cv_file_magic_cmd='$OBJDUMP -f'
|
||||
fi
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
cegcc*)
|
||||
@@ -4072,7 +4052,7 @@ void nm_test_func(void){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(void){nm_test_var='a';nm_test_func();return(0);}
|
||||
int main(){nm_test_var='a';nm_test_func();return(0);}
|
||||
_LT_EOF
|
||||
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
@@ -6238,7 +6218,7 @@ _LT_TAGVAR(objext, $1)=$objext
|
||||
lt_simple_compile_test_code="int some_variable = 0;"
|
||||
|
||||
# Code to be used in simple link tests
|
||||
lt_simple_link_test_code='int main(void){return(0);}'
|
||||
lt_simple_link_test_code='int main(){return(0);}'
|
||||
|
||||
_LT_TAG_COMPILER
|
||||
# Save the default compiler, since it gets overwritten when the other
|
||||
|
81
android-project/app/proguard-rules.pro
vendored
81
android-project/app/proguard-rules.pro
vendored
@@ -15,84 +15,3 @@
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLInputConnection {
|
||||
void nativeCommitText(java.lang.String, int);
|
||||
void nativeGenerateScancodeForUnichar(char);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses class org.libsdl.app.SDLActivity {
|
||||
# for some reason these aren't compatible with allowoptimization modifier
|
||||
boolean supportsRelativeMouse();
|
||||
void setWindowStyle(boolean);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLActivity {
|
||||
java.lang.String nativeGetHint(java.lang.String); # Java-side doesn't use this, so it gets minified, but C-side still tries to register it
|
||||
boolean onNativeSoftReturnKey();
|
||||
void onNativeKeyboardFocusLost();
|
||||
boolean isScreenKeyboardShown();
|
||||
android.util.DisplayMetrics getDisplayDPI();
|
||||
java.lang.String clipboardGetText();
|
||||
boolean clipboardHasText();
|
||||
void clipboardSetText(java.lang.String);
|
||||
int createCustomCursor(int[], int, int, int, int);
|
||||
void destroyCustomCursor(int);
|
||||
android.content.Context getContext();
|
||||
boolean getManifestEnvironmentVariables();
|
||||
android.view.Surface getNativeSurface();
|
||||
void initTouch();
|
||||
boolean isAndroidTV();
|
||||
boolean isChromebook();
|
||||
boolean isDeXMode();
|
||||
boolean isTablet();
|
||||
void manualBackButton();
|
||||
int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]);
|
||||
void minimizeWindow();
|
||||
int openURL(java.lang.String);
|
||||
void requestPermission(java.lang.String, int);
|
||||
int showToast(java.lang.String, int, int, int, int);
|
||||
boolean sendMessage(int, int);
|
||||
boolean setActivityTitle(java.lang.String);
|
||||
boolean setCustomCursor(int);
|
||||
void setOrientation(int, int, boolean, java.lang.String);
|
||||
boolean setRelativeMouseEnabled(boolean);
|
||||
boolean setSystemCursor(int);
|
||||
boolean shouldMinimizeOnFocusLoss();
|
||||
boolean showTextInput(int, int, int, int);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager {
|
||||
boolean initialize(boolean, boolean);
|
||||
boolean openDevice(int);
|
||||
int sendOutputReport(int, byte[]);
|
||||
int sendFeatureReport(int, byte[]);
|
||||
boolean getFeatureReport(int, byte[]);
|
||||
void closeDevice(int);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLAudioManager {
|
||||
int[] getAudioOutputDevices();
|
||||
int[] getAudioInputDevices();
|
||||
int[] audioOpen(int, int, int, int, int);
|
||||
void audioWriteFloatBuffer(float[]);
|
||||
void audioWriteShortBuffer(short[]);
|
||||
void audioWriteByteBuffer(byte[]);
|
||||
void audioClose();
|
||||
int[] captureOpen(int, int, int, int, int);
|
||||
int captureReadFloatBuffer(float[], boolean);
|
||||
int captureReadShortBuffer(short[], boolean);
|
||||
int captureReadByteBuffer(byte[], boolean);
|
||||
void captureClose();
|
||||
void audioSetThreadPriority(boolean, int);
|
||||
native int nativeSetupJNI();
|
||||
native void removeAudioDevice(boolean, int);
|
||||
native void addAudioDevice(boolean, int);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager {
|
||||
void pollInputDevices();
|
||||
void pollHapticDevices();
|
||||
void hapticRun(int, float, int);
|
||||
void hapticStop(int);
|
||||
}
|
||||
|
@@ -60,8 +60,8 @@ import java.util.Locale;
|
||||
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 2;
|
||||
private static final int SDL_MINOR_VERSION = 33;
|
||||
private static final int SDL_MICRO_VERSION = 0;
|
||||
private static final int SDL_MINOR_VERSION = 30;
|
||||
private static final int SDL_MICRO_VERSION = 12;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
@@ -790,9 +790,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
SDLActivity.mFullscreenModeActive = false;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
|
||||
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "error handling message, getContext() returned no Activity");
|
||||
|
@@ -80,8 +80,7 @@ do
|
||||
cd $folder
|
||||
done
|
||||
|
||||
# Uppercase the first char in the activity class name because it's Java
|
||||
ACTIVITY="$(echo $folder | awk '{$1=toupper(substr($1,0,1))substr($1,2)}1')Activity"
|
||||
ACTIVITY="${folder}Activity"
|
||||
sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml
|
||||
|
||||
# Fill in a default Activity
|
||||
|
@@ -542,7 +542,9 @@ class AndroidApiVersion:
|
||||
def __repr__(self) -> str:
|
||||
return f"<{self.name} ({'.'.join(str(v) for v in self.ints)})>"
|
||||
|
||||
ANDROID_ABI_EXTRA_LINK_OPTIONS = {}
|
||||
ANDROID_ABI_EXTRA_LINK_OPTIONS = {
|
||||
"arm64-v8a": "-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384",
|
||||
}
|
||||
|
||||
class Releaser:
|
||||
def __init__(self, release_info: dict, commit: str, revision: str, root: Path, dist_path: Path, section_printer: SectionPrinter, executer: Executer, cmake_generator: str, deps_path: Path, overwrite: bool, github: bool, fast: bool):
|
||||
|
26
build-scripts/config.guess
vendored
26
build-scripts/config.guess
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright 1992-2025 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2025-07-10'
|
||||
timestamp='2024-01-01'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -60,7 +60,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright 1992-2025 Free Software Foundation, Inc.
|
||||
Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -123,7 +123,7 @@ set_cc_for_build() {
|
||||
dummy=$tmp/dummy
|
||||
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
|
||||
,,) echo "int x;" > "$dummy.c"
|
||||
for driver in cc gcc c17 c99 c89 ; do
|
||||
for driver in cc gcc c89 c99 ; do
|
||||
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD=$driver
|
||||
break
|
||||
@@ -634,8 +634,7 @@ EOF
|
||||
sed 's/^ //' << EOF > "$dummy.c"
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
@@ -719,8 +718,7 @@ EOF
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
@@ -1597,11 +1595,8 @@ EOF
|
||||
*:Unleashed:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
||||
;;
|
||||
x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
|
||||
;;
|
||||
*:[Ii]ronclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
|
||||
*:Ironclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1626,7 +1621,6 @@ cat > "$dummy.c" <<EOF
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
@@ -1811,8 +1805,8 @@ fi
|
||||
exit 1
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "timestamp='"
|
||||
# time-stamp-format: "%Y-%02m-%02d"
|
||||
# time-stamp-format: "%:y-%02m-%02d"
|
||||
# time-stamp-end: "'"
|
||||
# End:
|
||||
|
751
build-scripts/config.sub
vendored
751
build-scripts/config.sub
vendored
File diff suppressed because it is too large
Load Diff
@@ -2415,10 +2415,10 @@ libtool_validate_options ()
|
||||
# preserve --debug
|
||||
test : = "$debug_cmd" || func_append preserve_args " --debug"
|
||||
|
||||
case $host_os in
|
||||
case $host in
|
||||
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
|
||||
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
|
||||
cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*)
|
||||
*cygwin* | *mingw* | *windows* | *pw32* | *cegcc* | *solaris2* | *os2*)
|
||||
# don't eliminate duplications in $postdeps and $predeps
|
||||
opt_duplicate_compiler_generated_deps=:
|
||||
;;
|
||||
@@ -4935,7 +4935,7 @@ func_win32_libid ()
|
||||
*ar\ archive*) # could be an import, or static
|
||||
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
|
||||
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
|
||||
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then
|
||||
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
|
||||
case $nm_interface in
|
||||
"MS dumpbin")
|
||||
if func_cygming_ms_implib_p "$1" ||
|
||||
@@ -5534,7 +5534,7 @@ EOF
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined _WIN32 && !defined __GNUC__
|
||||
#ifdef _MSC_VER
|
||||
# include <direct.h>
|
||||
# include <process.h>
|
||||
# include <io.h>
|
||||
@@ -6501,7 +6501,7 @@ func_mode_link ()
|
||||
# we shouldn't force the makefile maintainer to figure out
|
||||
# what system we are compiling for in order to pass an extra
|
||||
# flag for every libtool invocation.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols
|
||||
allow_undefined=no
|
||||
|
||||
# FIXME: Unfortunately, there are problems with the above when trying
|
||||
@@ -6509,7 +6509,7 @@ func_mode_link ()
|
||||
# even a static library is built. For now, we need to specify
|
||||
# -no-undefined on the libtool link line when we can be certain
|
||||
# that all symbols are satisfied, otherwise we get a static library.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols.
|
||||
# SDL customization: SDL code doesn't have any undefined symbols
|
||||
# allow_undefined=yes
|
||||
;;
|
||||
*)
|
||||
@@ -7096,7 +7096,7 @@ func_mode_link ()
|
||||
continue
|
||||
;;
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|
||||
|-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
func_append compiler_flags " $arg"
|
||||
func_append compile_command " $arg"
|
||||
func_append finalize_command " $arg"
|
||||
@@ -7310,10 +7310,7 @@ func_mode_link ()
|
||||
# -fno-sanitize* Clang/GCC memory and address sanitizer
|
||||
# -shared-libsan Link with shared sanitizer runtimes (Clang)
|
||||
# -static-libsan Link with static sanitizer runtimes (Clang)
|
||||
# -no-canonical-prefixes Do not expand any symbolic links
|
||||
# -fuse-ld=* Linker select flags for GCC
|
||||
# -static-* direct GCC to link specific libraries statically
|
||||
# -fcilkplus Cilk Plus language extension features for C/C++
|
||||
# -rtlib=* select c runtime lib with clang
|
||||
# --unwindlib=* select unwinder library with clang
|
||||
# -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
|
||||
@@ -7321,12 +7318,12 @@ func_mode_link ()
|
||||
# -Werror, -Werror=* Report (specified) warnings as errors
|
||||
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
|
||||
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
|
||||
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \
|
||||
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*| \
|
||||
-stdlib=*|-rtlib=*|--unwindlib=*| \
|
||||
-specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
|
||||
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
|
||||
-fdiagnostics-color*|-frecord-gcc-switches| \
|
||||
-fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
|
||||
-fuse-ld=*|-Wa,*|-Werror|-Werror=*)
|
||||
func_quote_for_eval "$arg"
|
||||
arg=$func_quote_for_eval_result
|
||||
func_append compile_command " $arg"
|
||||
@@ -7656,7 +7653,7 @@ func_mode_link ()
|
||||
found=false
|
||||
case $deplib in
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
||||
|-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
if test prog,link = "$linkmode,$pass"; then
|
||||
compile_deplibs="$deplib $compile_deplibs"
|
||||
finalize_deplibs="$deplib $finalize_deplibs"
|
||||
@@ -8182,8 +8179,8 @@ func_mode_link ()
|
||||
fi
|
||||
if test -n "$library_names" &&
|
||||
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
|
||||
case $host_os in
|
||||
cygwin* | mingw* | windows* | cegcc* | os2*)
|
||||
case $host in
|
||||
*cygwin* | *mingw* | *windows* | *cegcc* | *os2*)
|
||||
# No point in relinking DLLs because paths are not encoded
|
||||
func_append notinst_deplibs " $lib"
|
||||
need_relink=no
|
||||
@@ -8252,8 +8249,8 @@ func_mode_link ()
|
||||
soname=$dlname
|
||||
elif test -n "$soname_spec"; then
|
||||
# bleh windows
|
||||
case $host_os in
|
||||
cygwin* | mingw* | windows* | cegcc*) # | os2* # SDL customization: removed OS/2 versioning support.
|
||||
case $host in
|
||||
*cygwin* | mingw* | *windows* | *cegcc*) # | *os2* # SDL customization: removed OS/2 versioning support.
|
||||
func_arith $current - $age
|
||||
major=$func_arith_result
|
||||
versuffix=-$major
|
||||
@@ -8395,7 +8392,7 @@ func_mode_link ()
|
||||
test no = "$hardcode_direct_absolute"; then
|
||||
add=$libdir/$linklib
|
||||
elif test yes = "$hardcode_minus_L"; then
|
||||
add_dir=-L$lt_sysroot$libdir
|
||||
add_dir=-L$libdir
|
||||
add=-l$name
|
||||
elif test yes = "$hardcode_shlibpath_var"; then
|
||||
case :$finalize_shlibpath: in
|
||||
@@ -8412,7 +8409,7 @@ func_mode_link ()
|
||||
fi
|
||||
else
|
||||
# We cannot seem to hardcode it, guess we'll fake it.
|
||||
add_dir=-L$lt_sysroot$libdir
|
||||
add_dir=-L$libdir
|
||||
# Try looking first in the location we're being installed to.
|
||||
if test -n "$inst_prefix_dir"; then
|
||||
case $libdir in
|
||||
@@ -8683,7 +8680,7 @@ func_mode_link ()
|
||||
test CXX = "$tagname" && {
|
||||
case $host_os in
|
||||
linux*)
|
||||
case `$CC -V 2>&1 | $SED 5q` in
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ C*) # Sun C++ 5.9
|
||||
func_suncc_cstd_abi
|
||||
|
||||
@@ -8856,13 +8853,13 @@ func_mode_link ()
|
||||
#
|
||||
case $version_type in
|
||||
# correct linux to gnu/linux during the next big refactor
|
||||
darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none)
|
||||
darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
|
||||
func_arith $number_major + $number_minor
|
||||
current=$func_arith_result
|
||||
age=$number_minor
|
||||
revision=$number_revision
|
||||
;;
|
||||
freebsd-aout|sco|sunos)
|
||||
freebsd-aout|qnx|sco|sunos)
|
||||
current=$number_major
|
||||
revision=$number_minor
|
||||
age=0
|
||||
@@ -9009,9 +9006,8 @@ func_mode_link ()
|
||||
;;
|
||||
|
||||
qnx)
|
||||
func_arith $current - $age
|
||||
major=.$func_arith_result
|
||||
versuffix=$major.$age.$revision
|
||||
major=.$current
|
||||
versuffix=.$current
|
||||
;;
|
||||
|
||||
sco)
|
||||
|
0
build-scripts/setup-gdk-desktop.py
Normal file → Executable file
0
build-scripts/setup-gdk-desktop.py
Normal file → Executable file
@@ -5,8 +5,8 @@
|
||||
SDL_ROOT=$(dirname $0)/..
|
||||
cd $SDL_ROOT
|
||||
|
||||
if [ -e ./REVISION.txt ]; then
|
||||
cat ./REVISION.txt
|
||||
if [ -e ./VERSION.txt ]; then
|
||||
cat ./VERSION.txt
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@@ -29,7 +29,7 @@ done
|
||||
rev=`sh showrev.sh 2>/dev/null`
|
||||
if [ "$rev" != "" ]; then
|
||||
if [ -n "$dist" ]; then
|
||||
echo "$rev" > "$outdir/REVISION.txt"
|
||||
echo "$rev" > "$outdir/VERSION.txt"
|
||||
fi
|
||||
echo "/* Generated by updaterev.sh, do not edit */" >"$header.new"
|
||||
if [ -n "$vendor" ]; then
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -27,13 +27,11 @@ function(check_cpu_architecture ARCH VARIABLE)
|
||||
if(ARCH STREQUAL "x86")
|
||||
_internal_check_cpu_architecture("defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)" x86 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "x64")
|
||||
_internal_check_cpu_architecture("(defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)" x64 ${VARIABLE})
|
||||
_internal_check_cpu_architecture("defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)" x64 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "arm32")
|
||||
_internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "arm64")
|
||||
_internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "arm64ec")
|
||||
_internal_check_cpu_architecture("defined(_M_ARM64EC)" arm64ec ${VARIABLE})
|
||||
elseif(ARCH STREQUAL "loongarch64")
|
||||
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
|
||||
else()
|
||||
|
@@ -119,7 +119,7 @@ macro(CheckALSA)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_ALSA_SHARED)
|
||||
list(APPEND CMAKE_LIBS ALSA::ALSA)
|
||||
list(APPEND CMAKE_DEPENDS ALSA::ALSA)
|
||||
list(APPEND PKGCONFIG_DEPENDS alsa)
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
@@ -947,7 +947,7 @@ macro(CheckPTHREAD)
|
||||
elseif(BSDI)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
||||
set(PTHREAD_LDFLAGS "")
|
||||
elseif(MACOS)
|
||||
elseif(DARWIN)
|
||||
set(PTHREAD_CFLAGS "-D_THREAD_SAFE")
|
||||
# causes Carbon.p complaints?
|
||||
# set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
|
||||
@@ -963,11 +963,7 @@ macro(CheckPTHREAD)
|
||||
set(PTHREAD_LDFLAGS "-lpthread")
|
||||
elseif(SOLARIS)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
||||
else()
|
||||
set(PTHREAD_LDFLAGS "-pthread")
|
||||
endif()
|
||||
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
||||
elseif(SYSV5)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
||||
set(PTHREAD_LDFLAGS "")
|
||||
@@ -1253,7 +1249,6 @@ macro(CheckHIDAPI)
|
||||
|
||||
if(HAVE_HIDAPI)
|
||||
if(ANDROID)
|
||||
enable_language(CXX)
|
||||
list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp)
|
||||
endif()
|
||||
if(IOS OR TVOS)
|
||||
@@ -1281,18 +1276,13 @@ endmacro()
|
||||
# - n/a
|
||||
macro(CheckRPI)
|
||||
if(SDL_RPI)
|
||||
pkg_check_modules(VIDEO_RPI bcm_host)
|
||||
pkg_check_modules(VIDEO_RPI bcm_host brcmegl)
|
||||
if (NOT VIDEO_RPI_FOUND)
|
||||
set(VIDEO_RPI_INCLUDE_DIRS "/opt/vc/include" "/opt/vc/include/interface/vcos/pthreads" "/opt/vc/include/interface/vmcs_host/linux/" )
|
||||
set(VIDEO_RPI_LIBRARY_DIRS "/opt/vc/lib" )
|
||||
set(VIDEO_RPI_LIBRARIES bcm_host )
|
||||
set(VIDEO_RPI_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
|
||||
endif()
|
||||
|
||||
pkg_check_modules(VIDEO_RPI_EGL brcmegl)
|
||||
if (NOT VIDEO_RPI_EGL_FOUND)
|
||||
set(VIDEO_RPI_EGL_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
|
||||
endif()
|
||||
|
||||
listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I")
|
||||
listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
|
||||
|
||||
@@ -1301,7 +1291,9 @@ macro(CheckRPI)
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBRARIES}")
|
||||
check_c_source_compiles("
|
||||
#include <bcm_host.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
int main(int argc, char **argv) {
|
||||
EGL_DISPMANX_WINDOW_T window;
|
||||
bcm_host_init();
|
||||
}" HAVE_RPI)
|
||||
set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
|
||||
@@ -1315,7 +1307,7 @@ macro(CheckRPI)
|
||||
list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
|
||||
# !!! FIXME: shouldn't be using CMAKE_C_FLAGS, right?
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
|
||||
list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS} ${VIDEO_RPI_EGL_LDFLAGS})
|
||||
list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -32,8 +32,10 @@ macro(SDL_DetectCMakePlatform)
|
||||
set(SDL_CMAKE_PLATFORM QNX)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
|
||||
set(SDL_CMAKE_PLATFORM MACOS)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
||||
set(SDL_CMAKE_PLATFORM DARWIN)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
|
||||
set(SDL_CMAKE_PLATFORM MACOSX)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
|
||||
set(SDL_CMAKE_PLATFORM TVOS)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
|
||||
@@ -41,10 +43,6 @@ macro(SDL_DetectCMakePlatform)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.14)
|
||||
set(SDL_CMAKE_PLATFORM IOS)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*watchOS.*")
|
||||
set(SDL_CMAKE_PLATFORM WATCHOS)
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "visionOS")
|
||||
set(SDL_CMAKE_PLATFORM VISIONOS)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
||||
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
||||
|
@@ -3,8 +3,6 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(sdl_test LANGUAGES C)
|
||||
|
||||
include(CheckLanguage)
|
||||
include(FeatureSummary)
|
||||
include(GenerateExportHeader)
|
||||
|
||||
if(ANDROID)
|
||||
@@ -21,6 +19,8 @@ cmake_policy(SET CMP0074 NEW)
|
||||
# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL2 outside of sysroot
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
option(TEST_SHARED "Test linking to shared SDL2 library" ON)
|
||||
add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library")
|
||||
|
||||
@@ -33,19 +33,6 @@ add_feature_info("TEST_TEST" TEST_STATIC "Test linking to SDL test library")
|
||||
option(TEST_FULL "Run complete SDL test suite" OFF)
|
||||
add_feature_info("TEST_FULL" TEST_FULL "Build full SDL testsuite")
|
||||
|
||||
# FIXME: how to target ios/tvos with Swift?
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/20104
|
||||
if(APPLE AND CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
|
||||
# multiple values for CMAKE_OSX_ARCHITECTURES not supported with Swift
|
||||
list(LENGTH CMAKE_OSX_ARCHITECTURES count_osx_archs)
|
||||
if(count_osx_archs LESS_EQUAL 1)
|
||||
check_language(Swift)
|
||||
if(CMAKE_Swift_COMPILER)
|
||||
enable_language(Swift)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TEST_SHARED)
|
||||
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2)
|
||||
if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE))
|
||||
@@ -99,12 +86,6 @@ if(TEST_SHARED)
|
||||
add_executable(sdltest-shared sdltest.c)
|
||||
target_link_libraries(sdltest-shared PRIVATE SDL2::SDL2main SDL2::SDL2test SDL2::SDL2)
|
||||
endif()
|
||||
|
||||
if(CMAKE_Swift_COMPILER)
|
||||
add_executable(swift-shared main.swift)
|
||||
target_include_directories(swift-shared PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift")
|
||||
target_link_libraries(swift-shared PRIVATE SDL2::SDL2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TEST_STATIC)
|
||||
@@ -142,11 +123,6 @@ if(TEST_STATIC)
|
||||
target_include_directories(cli-static-vars PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(TEST_TEST)
|
||||
add_executable(sdltest-static sdltest.c)
|
||||
target_link_libraries(sdltest-static PRIVATE SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static)
|
||||
endif()
|
||||
|
||||
if(CMAKE_Swift_COMPILER)
|
||||
add_executable(swift-static main.swift)
|
||||
target_include_directories(swift-static PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift")
|
||||
|
@@ -1,12 +0,0 @@
|
||||
/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */
|
||||
|
||||
import SDL2
|
||||
|
||||
guard SDL_Init(Uint32(SDL_INIT_VIDEO)) == 0 else {
|
||||
fatalError("SDL_Init error: \(String(cString: SDL_GetError()))")
|
||||
}
|
||||
|
||||
var sdlVersion = SDL_version()
|
||||
SDL_GetVersion(&sdlVersion)
|
||||
|
||||
print("SDL version: \(sdlVersion.major).\(sdlVersion.minor).\(sdlVersion.patch)")
|
@@ -1,4 +0,0 @@
|
||||
module SDL2 [extern_c] {
|
||||
header "shim.h"
|
||||
export *
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */
|
||||
|
||||
#include "SDL.h"
|
233
configure
vendored
233
configure
vendored
@@ -703,8 +703,6 @@ X_LIBS
|
||||
X_PRE_LIBS
|
||||
X_CFLAGS
|
||||
XMKMF
|
||||
RPI_EGL_LIBS
|
||||
RPI_EGL_CFLAGS
|
||||
RPI_LIBS
|
||||
RPI_CFLAGS
|
||||
DECOR_LIBS
|
||||
@@ -993,8 +991,6 @@ DECOR_CFLAGS
|
||||
DECOR_LIBS
|
||||
RPI_CFLAGS
|
||||
RPI_LIBS
|
||||
RPI_EGL_CFLAGS
|
||||
RPI_EGL_LIBS
|
||||
XMKMF
|
||||
DIRECTFB_CFLAGS
|
||||
DIRECTFB_LIBS
|
||||
@@ -1722,7 +1718,7 @@ Optional Features:
|
||||
[default=yes]
|
||||
--enable-libdecor-shared
|
||||
dynamically load libdecor [default=yes]
|
||||
--enable-video-rpi use Raspberry Pi 0-3 video driver [default=yes]
|
||||
--enable-video-rpi use Raspberry Pi 2/3 video driver [default=yes]
|
||||
--enable-video-x11 use X11 video driver [default=maybe]
|
||||
--enable-x11-shared dynamically load X11 support [default=maybe]
|
||||
--enable-video-x11-xcursor
|
||||
@@ -1852,10 +1848,6 @@ Some influential environment variables:
|
||||
DECOR_LIBS linker flags for DECOR, overriding pkg-config
|
||||
RPI_CFLAGS C compiler flags for RPI, overriding pkg-config
|
||||
RPI_LIBS linker flags for RPI, overriding pkg-config
|
||||
RPI_EGL_CFLAGS
|
||||
C compiler flags for RPI_EGL, overriding pkg-config
|
||||
RPI_EGL_LIBS
|
||||
linker flags for RPI_EGL, overriding pkg-config
|
||||
XMKMF Path to xmkmf, Makefile generator for X Window System
|
||||
DIRECTFB_CFLAGS
|
||||
C compiler flags for DIRECTFB, overriding pkg-config
|
||||
@@ -3515,8 +3507,8 @@ orig_CFLAGS="$CFLAGS"
|
||||
|
||||
# See docs/release_checklist.md
|
||||
SDL_MAJOR_VERSION=2
|
||||
SDL_MINOR_VERSION=33
|
||||
SDL_MICRO_VERSION=0
|
||||
SDL_MINOR_VERSION=30
|
||||
SDL_MICRO_VERSION=12
|
||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||
|
||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||
@@ -5815,7 +5807,7 @@ cygwin*)
|
||||
# func_win32_libid is a shell function defined in ltmain.sh
|
||||
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
mingw* | windows* | pw32*)
|
||||
@@ -5827,10 +5819,10 @@ mingw* | windows* | pw32*)
|
||||
lt_cv_file_magic_cmd='func_win32_libid'
|
||||
else
|
||||
# Keep this pattern in sync with the one in func_win32_libid.
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
|
||||
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
|
||||
lt_cv_file_magic_cmd='$OBJDUMP -f'
|
||||
fi
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization.
|
||||
lt_cv_deplibs_check_method=pass_all # SDL customization
|
||||
;;
|
||||
|
||||
cegcc*)
|
||||
@@ -6836,7 +6828,7 @@ void nm_test_func(void){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(void){nm_test_var='a';nm_test_func();return(0);}
|
||||
int main(){nm_test_var='a';nm_test_func();return(0);}
|
||||
_LT_EOF
|
||||
|
||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||
@@ -8098,43 +8090,6 @@ fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
|
||||
printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
|
||||
|
||||
# Feature test to disable chained fixups since it is not
|
||||
# compatible with '-undefined dynamic_lookup'
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5
|
||||
printf %s "checking for -no_fixup_chains linker flag... " >&6; }
|
||||
if test ${lt_cv_support_no_fixup_chains+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"
|
||||
then :
|
||||
lt_cv_support_no_fixup_chains=yes
|
||||
else $as_nop
|
||||
lt_cv_support_no_fixup_chains=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
|
||||
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5
|
||||
printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; }
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
|
||||
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
|
||||
if test ${lt_cv_ld_exported_symbols_list+y}
|
||||
@@ -8187,7 +8142,7 @@ _LT_EOF
|
||||
echo "$RANLIB libconftest.a" >&5
|
||||
$RANLIB libconftest.a 2>&5
|
||||
cat > conftest.c << _LT_EOF
|
||||
int main(void) { return 0;}
|
||||
int main() { return 0;}
|
||||
_LT_EOF
|
||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
|
||||
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
||||
@@ -8215,12 +8170,7 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; }
|
||||
10.[012],*|,*powerpc*-darwin[5-8]*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
*)
|
||||
if test yes = "$lt_cv_support_no_fixup_chains"; then
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains'
|
||||
else
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
|
||||
fi
|
||||
;;
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -9120,7 +9070,7 @@ objext=$objext
|
||||
lt_simple_compile_test_code="int some_variable = 0;"
|
||||
|
||||
# Code to be used in simple link tests
|
||||
lt_simple_link_test_code='int main(void){return(0);}'
|
||||
lt_simple_link_test_code='int main(){return(0);}'
|
||||
|
||||
|
||||
|
||||
@@ -11600,14 +11550,14 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
#soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
|
||||
;;
|
||||
mingw* | windows* | cegcc*)
|
||||
# MinGW DLLs use traditional 'lib' prefix
|
||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
@@ -12671,11 +12621,11 @@ else
|
||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||
correspondingly for the symbols needed. */
|
||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||
int fnord (void) __attribute__((visibility("default")));
|
||||
int fnord () __attribute__((visibility("default")));
|
||||
#endif
|
||||
|
||||
int fnord (void) { return 42; }
|
||||
int main (void)
|
||||
int fnord () { return 42; }
|
||||
int main ()
|
||||
{
|
||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||
int status = $lt_dlunknown;
|
||||
@@ -12778,11 +12728,11 @@ else
|
||||
/* When -fvisibility=hidden is used, assume the code has been annotated
|
||||
correspondingly for the symbols needed. */
|
||||
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
|
||||
int fnord (void) __attribute__((visibility("default")));
|
||||
int fnord () __attribute__((visibility("default")));
|
||||
#endif
|
||||
|
||||
int fnord (void) { return 42; }
|
||||
int main (void)
|
||||
int fnord () { return 42; }
|
||||
int main ()
|
||||
{
|
||||
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
|
||||
int status = $lt_dlunknown;
|
||||
@@ -16984,13 +16934,13 @@ cygwin* | mingw* | windows* | pw32* | cegcc*)
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
#soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
|
||||
;;
|
||||
mingw* | windows* | cegcc*)
|
||||
# MinGW DLLs use traditional 'lib' prefix
|
||||
#soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization.
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
@@ -19755,12 +19705,6 @@ if test "x$ac_cv_func_sigaction" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
ac_fn_c_check_func "$LINENO" "sigtimedwait" "ac_cv_func_sigtimedwait"
|
||||
if test "x$ac_cv_func_sigtimedwait" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
ac_fn_c_check_func "$LINENO" "setjmp" "ac_cv_func_setjmp"
|
||||
if test "x$ac_cv_func_setjmp" = xyes
|
||||
@@ -22428,6 +22372,7 @@ printf %s "checking for NAS audio support... " >&6; }
|
||||
have_nas=yes
|
||||
NAS_CFLAGS="-I/usr/X11R6/include/"
|
||||
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
||||
|
||||
fi
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5
|
||||
@@ -23675,19 +23620,19 @@ fi
|
||||
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
|
||||
|
||||
pkg_failed=no
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host" >&5
|
||||
printf %s "checking for bcm_host... " >&6; }
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host brcmegl" >&5
|
||||
printf %s "checking for bcm_host brcmegl... " >&6; }
|
||||
|
||||
if test -n "$RPI_CFLAGS"; then
|
||||
pkg_cv_RPI_CFLAGS="$RPI_CFLAGS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_CFLAGS=`$PKG_CONFIG --cflags "bcm_host" 2>/dev/null`
|
||||
pkg_cv_RPI_CFLAGS=`$PKG_CONFIG --cflags "bcm_host brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
@@ -23699,12 +23644,12 @@ if test -n "$RPI_LIBS"; then
|
||||
pkg_cv_RPI_LIBS="$RPI_LIBS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_LIBS=`$PKG_CONFIG --libs "bcm_host" 2>/dev/null`
|
||||
pkg_cv_RPI_LIBS=`$PKG_CONFIG --libs "bcm_host brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
@@ -23725,9 +23670,9 @@ else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host" 2>&1`
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host brcmegl" 2>&1`
|
||||
else
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host" 2>&1`
|
||||
RPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host brcmegl" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$RPI_PKG_ERRORS" >&5
|
||||
@@ -23745,92 +23690,13 @@ printf "%s\n" "yes" >&6; }
|
||||
video_rpi=yes
|
||||
fi
|
||||
|
||||
pkg_failed=no
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for brcmegl" >&5
|
||||
printf %s "checking for brcmegl... " >&6; }
|
||||
|
||||
if test -n "$RPI_EGL_CFLAGS"; then
|
||||
pkg_cv_RPI_EGL_CFLAGS="$RPI_EGL_CFLAGS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_EGL_CFLAGS=`$PKG_CONFIG --cflags "brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
if test -n "$RPI_EGL_LIBS"; then
|
||||
pkg_cv_RPI_EGL_LIBS="$RPI_EGL_LIBS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"brcmegl\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "brcmegl") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_RPI_EGL_LIBS=`$PKG_CONFIG --libs "brcmegl" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
RPI_EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "brcmegl" 2>&1`
|
||||
else
|
||||
RPI_EGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "brcmegl" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$RPI_EGL_PKG_ERRORS" >&5
|
||||
|
||||
video_rpi_egl=no
|
||||
elif test $pkg_failed = untried; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
video_rpi_egl=no
|
||||
else
|
||||
RPI_EGL_CFLAGS=$pkg_cv_RPI_EGL_CFLAGS
|
||||
RPI_EGL_LIBS=$pkg_cv_RPI_EGL_LIBS
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
printf "%s\n" "yes" >&6; }
|
||||
video_rpi_egl=yes
|
||||
fi
|
||||
|
||||
if test x$video_rpi = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/usr/pkg/lib -lbcm_host"
|
||||
RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
|
||||
else
|
||||
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$video_rpi_egl = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_EGL_LIBS="-Wl,-R/usr/pkg/lib"
|
||||
else
|
||||
RPI_EGL_LIBS="-Wl,-rpath,/opt/vc/lib"
|
||||
RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -23838,20 +23704,22 @@ fi
|
||||
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
||||
|
||||
# Add the Raspberry Pi compiler flags and libraries
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 0-3" >&5
|
||||
printf %s "checking for Raspberry Pi 0-3... " >&6; }
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 2/3" >&5
|
||||
printf %s "checking for Raspberry Pi 2/3... " >&6; }
|
||||
have_video_rpi=no
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <bcm_host.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
EGL_DISPMANX_WINDOW_T window;
|
||||
bcm_host_init();
|
||||
|
||||
;
|
||||
@@ -23874,7 +23742,7 @@ printf "%s\n" "$have_video_rpi" >&6; }
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
||||
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
|
||||
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
|
||||
|
||||
printf "%s\n" "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
|
||||
@@ -26458,9 +26326,6 @@ else $as_nop
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
;;
|
||||
*-*-solaris*)
|
||||
enable_video_vulkan=no
|
||||
;;
|
||||
*-*-darwin*)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -x objective-c"
|
||||
@@ -28399,8 +28264,7 @@ fi
|
||||
|
||||
if test x$hidapi_support = xyes; then
|
||||
if test x$have_libusb_h = xyes; then
|
||||
|
||||
printf "%s\n" "#define HAVE_LIBUSB 1" >>confdefs.h
|
||||
printf "%s\n" "#define HAVE_LIBUSB 1" >>confdefs.h
|
||||
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
|
||||
if test x$require_hidapi_libusb = xyes; then
|
||||
@@ -28747,23 +28611,12 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
|
||||
if test x$enable_audio = xyes; then
|
||||
case $ARCH in
|
||||
sysv5|solaris|hpux)
|
||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
||||
ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_audioio_h" = xyes
|
||||
then :
|
||||
have_sys_audioio_h=yes
|
||||
else $as_nop
|
||||
have_sys_audioio_h=no
|
||||
fi
|
||||
|
||||
if test x$have_sys_audioio_h = xyes; then
|
||||
|
||||
printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||
have_audio=yes
|
||||
fi
|
||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||
have_audio=yes
|
||||
;;
|
||||
netbsd) # Don't use this on OpenBSD, it's busted.
|
||||
|
||||
|
50
configure.ac
50
configure.ac
@@ -12,8 +12,8 @@ orig_CFLAGS="$CFLAGS"
|
||||
dnl Set various version strings - taken gratefully from the GTk sources
|
||||
# See docs/release_checklist.md
|
||||
SDL_MAJOR_VERSION=2
|
||||
SDL_MINOR_VERSION=33
|
||||
SDL_MICRO_VERSION=0
|
||||
SDL_MINOR_VERSION=30
|
||||
SDL_MICRO_VERSION=12
|
||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||
|
||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||
@@ -359,7 +359,7 @@ dnl Checks for library functions.
|
||||
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
|
||||
],[]),
|
||||
)
|
||||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction sigtimedwait setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit)
|
||||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit)
|
||||
|
||||
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
|
||||
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
|
||||
@@ -1247,6 +1247,7 @@ CheckNAS()
|
||||
have_nas=yes
|
||||
NAS_CFLAGS="-I/usr/X11R6/include/"
|
||||
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
|
||||
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($have_nas)
|
||||
@@ -1847,27 +1848,18 @@ CheckNativeClient()
|
||||
CheckRPI()
|
||||
{
|
||||
AC_ARG_ENABLE(video-rpi,
|
||||
[AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi 0-3 video driver [default=yes]])],
|
||||
[AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi 2/3 video driver [default=yes]])],
|
||||
, enable_video_rpi=yes)
|
||||
if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
|
||||
PKG_CHECK_MODULES([RPI], [bcm_host], video_rpi=yes, video_rpi=no)
|
||||
PKG_CHECK_MODULES([RPI_EGL], [brcmegl], video_rpi_egl=yes, video_rpi_egl=no)
|
||||
PKG_CHECK_MODULES([RPI], [bcm_host brcmegl], video_rpi=yes, video_rpi=no)
|
||||
|
||||
if test x$video_rpi = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/usr/pkg/lib -lbcm_host"
|
||||
RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
|
||||
else
|
||||
RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
|
||||
RPI_LIBS="-L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$video_rpi_egl = xno; then
|
||||
if test x$ARCH = xnetbsd; then
|
||||
RPI_EGL_LIBS="-Wl,-R/usr/pkg/lib"
|
||||
else
|
||||
RPI_EGL_LIBS="-Wl,-rpath,/opt/vc/lib"
|
||||
RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1875,13 +1867,15 @@ CheckRPI()
|
||||
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
|
||||
|
||||
# Add the Raspberry Pi compiler flags and libraries
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
|
||||
|
||||
AC_MSG_CHECKING(for Raspberry Pi 0-3)
|
||||
AC_MSG_CHECKING(for Raspberry Pi 2/3)
|
||||
have_video_rpi=no
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <bcm_host.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
]], [[
|
||||
EGL_DISPMANX_WINDOW_T window;
|
||||
bcm_host_init();
|
||||
]])], [have_video_rpi=yes],[])
|
||||
AC_MSG_RESULT($have_video_rpi)
|
||||
@@ -1893,7 +1887,7 @@ CheckRPI()
|
||||
CFLAGS="$CFLAGS $RPI_CFLAGS"
|
||||
SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_EGL_LIBS $RPI_LIBS"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
|
||||
SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
|
||||
AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
|
||||
SUMMARY_video="${SUMMARY_video} rpi"
|
||||
@@ -2742,10 +2736,6 @@ CheckVulkan()
|
||||
#endif
|
||||
]],[])], [],[enable_video_vulkan=no])
|
||||
;;
|
||||
*-*-solaris*)
|
||||
dnl Strictly speaking, what's missing here is libxcb. Even without Vulkan support at the OS level, it should still compile if we had that.
|
||||
enable_video_vulkan=no
|
||||
;;
|
||||
*-*-darwin*)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
dnl Work around that we don't have Objective-C support in autoconf
|
||||
@@ -3635,7 +3625,7 @@ CheckHIDAPI()
|
||||
|
||||
if test x$hidapi_support = xyes; then
|
||||
if test x$have_libusb_h = xyes; then
|
||||
AC_DEFINE(HAVE_LIBUSB, 1, [ ])
|
||||
AC_DEFINE(HAVE_LIBUSB)
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
|
||||
if test x$require_hidapi_libusb = xyes; then
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
|
||||
@@ -3868,14 +3858,10 @@ case "$host" in
|
||||
if test x$enable_audio = xyes; then
|
||||
case $ARCH in
|
||||
sysv5|solaris|hpux)
|
||||
# Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
|
||||
AC_CHECK_HEADER(sys/audioio.h, have_sys_audioio_h=yes, have_sys_audioio_h=no)
|
||||
if test x$have_sys_audioio_h = xyes; then
|
||||
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
|
||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||
have_audio=yes
|
||||
fi
|
||||
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
|
||||
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
|
||||
SUMMARY_audio="${SUMMARY_audio} sun"
|
||||
have_audio=yes
|
||||
;;
|
||||
netbsd) # Don't use this on OpenBSD, it's busted.
|
||||
AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
|
||||
|
@@ -257,7 +257,7 @@ Game Center
|
||||
|
||||
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
|
||||
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
|
||||
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
|
||||
|
||||
|
@@ -29,7 +29,7 @@ cmake --install build
|
||||
|
||||
|
||||
## Compiling a HelloWorld
|
||||
[PSP Hello World](https://pspdev.github.io/basic_programs.html#hello-world)
|
||||
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
|
||||
|
||||
## To Do
|
||||
- PSP Screen Keyboard
|
||||
|
@@ -14,6 +14,7 @@ Works out of box.
|
||||
Windows:
|
||||
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
|
||||
|
||||
===========================================================================
|
||||
Events
|
||||
===========================================================================
|
||||
SDL_FINGERDOWN:
|
||||
@@ -38,6 +39,7 @@ Fields:
|
||||
Same as SDL_FINGERDOWN.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Functions
|
||||
===========================================================================
|
||||
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||
@@ -74,6 +76,7 @@ A SDL_Finger has the following fields:
|
||||
The pressure of the touch.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Notes
|
||||
===========================================================================
|
||||
For a complete example see test/testgesture.c
|
||||
|
@@ -25,6 +25,7 @@
|
||||
* Main include header for the SDL library
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_h_
|
||||
#define SDL_h_
|
||||
|
||||
@@ -69,8 +70,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* WIKI CATEGORY: Init */
|
||||
|
||||
/* As of version 0.5, SDL is loaded dynamically into the application */
|
||||
|
||||
/**
|
||||
@@ -131,7 +130,7 @@ extern "C" {
|
||||
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
|
||||
* this call will increase the ref-count and return.
|
||||
*
|
||||
* \param flags subsystem initialization flags.
|
||||
* \param flags subsystem initialization flags
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -61,8 +61,6 @@ assert can have unique static variables associated with it.
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
||||
#elif defined(__APPLE__) && defined(__arm__)
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
||||
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
|
||||
#elif defined(__386__) && defined(__WATCOMC__)
|
||||
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
||||
@@ -153,7 +151,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||
#define SDL_enabled_assert(condition) \
|
||||
do { \
|
||||
while ( !(condition) ) { \
|
||||
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, NULL, 0, NULL, NULL }; \
|
||||
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
|
||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||
continue; /* go again. */ \
|
||||
@@ -193,8 +191,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||
* A callback that fires when an SDL assertion fails.
|
||||
*
|
||||
* \param data a pointer to the SDL_AssertData structure corresponding to the
|
||||
* current assertion.
|
||||
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
|
||||
* current assertion
|
||||
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
|
||||
* \returns an SDL_AssertState value indicating how to handle the failure.
|
||||
*/
|
||||
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||
@@ -214,8 +212,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
||||
*
|
||||
* \param handler the SDL_AssertionHandler function to call when an assertion
|
||||
* fails or NULL for the default handler.
|
||||
* \param userdata a pointer that is passed to `handler`.
|
||||
* fails or NULL for the default handler
|
||||
* \param userdata a pointer that is passed to `handler`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -256,7 +254,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
|
||||
* data, it is safe to pass a NULL pointer to this function to ignore it.
|
||||
*
|
||||
* \param puserdata pointer which is filled with the "userdata" pointer that
|
||||
* was passed to SDL_SetAssertionHandler().
|
||||
* was passed to SDL_SetAssertionHandler()
|
||||
* \returns the SDL_AssertionHandler that is called when an assert triggers.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
|
@@ -20,29 +20,38 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryAtomic
|
||||
* \file SDL_atomic.h
|
||||
*
|
||||
* Atomic operations.
|
||||
*
|
||||
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
|
||||
* should not be using any functions in this file. You should be protecting
|
||||
* your data structures with full mutexes instead.
|
||||
* IMPORTANT:
|
||||
* If you are not an expert in concurrent lockless programming, you should
|
||||
* only be using the atomic lock and reference counting functions in this
|
||||
* file. In all other cases you should be protecting your data structures
|
||||
* with full mutexes.
|
||||
*
|
||||
* ***Seriously, here be dragons!***
|
||||
* The list of "safe" functions to use are:
|
||||
* SDL_AtomicLock()
|
||||
* SDL_AtomicUnlock()
|
||||
* SDL_AtomicIncRef()
|
||||
* SDL_AtomicDecRef()
|
||||
*
|
||||
* You can find out a little more about lockless programming and the subtle
|
||||
* issues that can arise here:
|
||||
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
|
||||
* Seriously, here be dragons!
|
||||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
*
|
||||
* You can find out a little more about lockless programming and the
|
||||
* subtle issues that can arise here:
|
||||
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
|
||||
*
|
||||
* There's also lots of good information here:
|
||||
* http://www.1024cores.net/home/lock-free-algorithms
|
||||
* http://preshing.com/
|
||||
*
|
||||
* - https://www.1024cores.net/home/lock-free-algorithms
|
||||
* - https://preshing.com/
|
||||
*
|
||||
* These operations may or may not actually be implemented using processor
|
||||
* specific atomic operations. When possible they are implemented as true
|
||||
* processor specific atomic operations. When that is not possible the are
|
||||
* implemented using locks that *do* use the available atomic operations.
|
||||
* These operations may or may not actually be implemented using
|
||||
* processor specific atomic operations. When possible they are
|
||||
* implemented as true processor specific atomic operations. When that
|
||||
* is not possible the are implemented using locks that *do* use the
|
||||
* available atomic operations.
|
||||
*
|
||||
* All of the atomic operations that modify memory are full memory barriers.
|
||||
*/
|
||||
@@ -85,7 +94,7 @@ typedef int SDL_SpinLock;
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \param lock a pointer to a lock variable
|
||||
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
|
||||
* held.
|
||||
*
|
||||
@@ -102,7 +111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \param lock a pointer to a lock variable
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -119,7 +128,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \param lock a pointer to a lock variable
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -248,13 +257,10 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
||||
|
||||
|
||||
/**
|
||||
* A type representing an atomic integer value.
|
||||
*
|
||||
* It is a struct so people don't accidentally use numeric operations on it.
|
||||
* \brief A type representing an atomic integer value. It is a struct
|
||||
* so people don't accidentally use numeric operations on it.
|
||||
*/
|
||||
typedef struct SDL_atomic_t {
|
||||
int value;
|
||||
} SDL_atomic_t;
|
||||
typedef struct { int value; } SDL_atomic_t;
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a new value if it is currently an old value.
|
||||
@@ -262,9 +268,9 @@ typedef struct SDL_atomic_t {
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
||||
* \param oldval the old value.
|
||||
* \param newval the new value.
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param oldval the old value
|
||||
* \param newval the new value
|
||||
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -283,8 +289,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
||||
* \param v the desired value.
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param v the desired value
|
||||
* \returns the previous value of the atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -299,7 +305,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable.
|
||||
* \param a a pointer to an SDL_atomic_t variable
|
||||
* \returns the current value of an atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -316,8 +322,8 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
||||
* \param v the desired value to add.
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param v the desired value to add
|
||||
* \returns the previous value of the atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -350,9 +356,9 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer.
|
||||
* \param oldval the old pointer value.
|
||||
* \param newval the new pointer value.
|
||||
* \param a a pointer to a pointer
|
||||
* \param oldval the old pointer value
|
||||
* \param newval the new pointer value
|
||||
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -369,8 +375,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer.
|
||||
* \param v the desired pointer value.
|
||||
* \param a a pointer to a pointer
|
||||
* \param v the desired pointer value
|
||||
* \returns the previous value of the pointer.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
@@ -386,7 +392,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer.
|
||||
* \param a a pointer to a pointer
|
||||
* \returns the current value of a pointer.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
|
@@ -22,9 +22,9 @@
|
||||
/* !!! FIXME: several functions in here need Doxygen comments. */
|
||||
|
||||
/**
|
||||
* # CategoryAudio
|
||||
* \file SDL_audio.h
|
||||
*
|
||||
* 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_
|
||||
@@ -44,24 +44,24 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Audio format flags.
|
||||
* \brief Audio format flags.
|
||||
*
|
||||
* These are what the 16 bits in SDL_AudioFormat currently mean...
|
||||
* (Unspecified bits are always zero).
|
||||
* These are what the 16 bits in SDL_AudioFormat currently mean...
|
||||
* (Unspecified bits are always zero).
|
||||
*
|
||||
* ```
|
||||
* ++-----------------------sample is signed if set
|
||||
* ||
|
||||
* || ++-----------sample is bigendian if set
|
||||
* || ||
|
||||
* || || ++---sample is float if set
|
||||
* || || ||
|
||||
* || || || +---sample bit size---+
|
||||
* || || || | |
|
||||
* 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
||||
* ```
|
||||
* \verbatim
|
||||
++-----------------------sample is signed if set
|
||||
||
|
||||
|| ++-----------sample is bigendian if set
|
||||
|| ||
|
||||
|| || ++---sample is float if set
|
||||
|| || ||
|
||||
|| || || +---sample bit size---+
|
||||
|| || || | |
|
||||
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
||||
\endverbatim
|
||||
*
|
||||
* There are macros in SDL 2.0 and later to query these bits.
|
||||
* There are macros in SDL 2.0 and later to query these bits.
|
||||
*/
|
||||
typedef Uint16 SDL_AudioFormat;
|
||||
|
||||
@@ -149,30 +149,33 @@ typedef Uint16 SDL_AudioFormat;
|
||||
/* @} *//* Audio flags */
|
||||
|
||||
/**
|
||||
* This function is called when the audio device needs more data.
|
||||
* This function is called when the audio device needs more data.
|
||||
*
|
||||
* \param userdata An application-specific parameter saved in the
|
||||
* SDL_AudioSpec structure.
|
||||
* \param stream A pointer to the audio data buffer.
|
||||
* \param len Length of **stream** in bytes.
|
||||
* \param userdata An application-specific parameter saved in
|
||||
* the SDL_AudioSpec structure
|
||||
* \param stream A pointer to the audio data buffer.
|
||||
* \param len The length of that buffer in bytes.
|
||||
*
|
||||
* Once the callback returns, the buffer will no longer be valid.
|
||||
* Stereo samples are stored in a LRLRLR ordering.
|
||||
*
|
||||
* You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
|
||||
* you like. Just open your audio device with a NULL callback.
|
||||
*/
|
||||
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* 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 LFE BL BR (4.1 surround)
|
||||
* 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)
|
||||
* ```
|
||||
* 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 LFE BL BR (4.1 surround)
|
||||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
||||
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
||||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
||||
*/
|
||||
typedef struct SDL_AudioSpec
|
||||
{
|
||||
@@ -193,11 +196,11 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
|
||||
SDL_AudioFormat format);
|
||||
|
||||
/**
|
||||
* Upper limit of filters in SDL_AudioCVT
|
||||
* \brief Upper limit of filters in SDL_AudioCVT
|
||||
*
|
||||
* The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
|
||||
* currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, one
|
||||
* of which is the terminating NULL pointer.
|
||||
* 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
|
||||
|
||||
@@ -284,7 +287,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
* meant to be proper names.
|
||||
*
|
||||
* \param index the index of the audio driver; the value ranges from 0 to
|
||||
* SDL_GetNumAudioDrivers() - 1.
|
||||
* SDL_GetNumAudioDrivers() - 1
|
||||
* \returns the name of the audio driver at the requested index, or NULL if an
|
||||
* invalid index was specified.
|
||||
*
|
||||
@@ -311,7 +314,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
* specific need to designate the audio driver you want to use. You should
|
||||
* normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*
|
||||
* \param driver_name the name of the desired audio driver.
|
||||
* \param driver_name the name of the desired audio driver
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -405,13 +408,13 @@ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
|
||||
SDL_AudioSpec * obtained);
|
||||
|
||||
/**
|
||||
* SDL Audio Device IDs.
|
||||
* SDL Audio Device IDs.
|
||||
*
|
||||
* A successful call to SDL_OpenAudio() is always device id 1, and legacy SDL
|
||||
* audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
|
||||
* always returns devices >= 2 on success. The legacy calls are good both for
|
||||
* backwards compatibility and when you don't care about multiple, specific,
|
||||
* or capture devices.
|
||||
* A successful call to SDL_OpenAudio() is always device id 1, and legacy
|
||||
* SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
|
||||
* always returns devices >= 2 on success. The legacy calls are good both
|
||||
* for backwards compatibility and when you don't care about multiple,
|
||||
* specific, or capture devices.
|
||||
*/
|
||||
typedef Uint32 SDL_AudioDeviceID;
|
||||
|
||||
@@ -449,7 +452,7 @@ typedef Uint32 SDL_AudioDeviceID;
|
||||
* ```
|
||||
*
|
||||
* \param iscapture zero to request playback devices, non-zero to request
|
||||
* recording devices.
|
||||
* recording devices
|
||||
* \returns the number of available devices exposed by the current driver or
|
||||
* -1 if an explicit list of devices can't be determined. A return
|
||||
* value of -1 does not necessarily mean an error condition.
|
||||
@@ -475,7 +478,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
|
||||
* invalid next time any of several other SDL functions are called.
|
||||
*
|
||||
* \param index the index of the audio device; valid values range from 0 to
|
||||
* SDL_GetNumAudioDevices() - 1.
|
||||
* SDL_GetNumAudioDevices() - 1
|
||||
* \param iscapture non-zero to query the list of recording devices, zero to
|
||||
* query the list of output devices.
|
||||
* \returns the name of the audio device at the requested index, or NULL on
|
||||
@@ -501,11 +504,11 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
||||
* count.
|
||||
*
|
||||
* \param index the index of the audio device; valid values range from 0 to
|
||||
* SDL_GetNumAudioDevices() - 1.
|
||||
* SDL_GetNumAudioDevices() - 1
|
||||
* \param iscapture non-zero to query the list of recording devices, zero to
|
||||
* query the list of output devices.
|
||||
* \param spec The SDL_AudioSpec to be initialized by this function.
|
||||
* \returns 0 on success, nonzero on error.
|
||||
* \returns 0 on success, nonzero on error
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
*
|
||||
@@ -539,7 +542,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
|
||||
* \param spec The SDL_AudioSpec to be initialized by this function.
|
||||
* \param iscapture non-zero to query the default recording device, zero to
|
||||
* query the default output device.
|
||||
* \returns 0 on success, nonzero on error.
|
||||
* \returns 0 on success, nonzero on error
|
||||
*
|
||||
* \since This function is available since SDL 2.24.0.
|
||||
*
|
||||
@@ -642,13 +645,13 @@ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
|
||||
* driver-specific name as appropriate. NULL requests the most
|
||||
* reasonable default device.
|
||||
* \param iscapture non-zero to specify a device should be opened for
|
||||
* recording, not playback.
|
||||
* recording, not playback
|
||||
* \param desired an SDL_AudioSpec structure representing the desired output
|
||||
* format; see SDL_OpenAudio() for more information.
|
||||
* format; see SDL_OpenAudio() for more information
|
||||
* \param obtained an SDL_AudioSpec structure filled in with the actual output
|
||||
* format; see SDL_OpenAudio() for more information.
|
||||
* \param allowed_changes 0, or one or more flags OR'd together.
|
||||
* \returns a valid device ID > 0 on success or 0 on failure; call
|
||||
* format; see SDL_OpenAudio() for more information
|
||||
* \param allowed_changes 0, or one or more flags OR'd together
|
||||
* \returns a valid device ID that is > 0 on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* For compatibility with SDL 1.2, this will never return 1, since
|
||||
@@ -709,7 +712,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
|
||||
* Use this function to get the current audio state of an audio device.
|
||||
*
|
||||
* \param dev the ID of an audio device previously opened with
|
||||
* SDL_OpenAudioDevice().
|
||||
* SDL_OpenAudioDevice()
|
||||
* \returns the SDL_AudioStatus of the specified audio device.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -742,7 +745,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDevice
|
||||
*
|
||||
* ...and is only useful if you used the legacy SDL_OpenAudio() function.
|
||||
*
|
||||
* \param pause_on non-zero to pause, 0 to unpause.
|
||||
* \param pause_on non-zero to pause, 0 to unpause
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -772,8 +775,8 @@ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
|
||||
* callback, you shouldn't pause the audio device, as it will lead to dropouts
|
||||
* in the audio playback. Instead, you should use SDL_LockAudioDevice().
|
||||
*
|
||||
* \param dev a device opened by SDL_OpenAudioDevice().
|
||||
* \param pause_on non-zero to pause, 0 to unpause.
|
||||
* \param dev a device opened by SDL_OpenAudioDevice()
|
||||
* \param pause_on non-zero to pause, 0 to unpause
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -838,14 +841,14 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
|
||||
* SDL_LoadWAV("sample.wav", &spec, &buf, &len);
|
||||
* ```
|
||||
*
|
||||
* \param src The data source for the WAVE data.
|
||||
* \param freesrc If non-zero, SDL will _always_ free the data source.
|
||||
* \param src The data source for the WAVE data
|
||||
* \param freesrc If non-zero, SDL will _always_ free the data source
|
||||
* \param spec An SDL_AudioSpec that will be filled in with the wave file's
|
||||
* format details.
|
||||
* format details
|
||||
* \param audio_buf A pointer filled with the audio data, allocated by the
|
||||
* function.
|
||||
* \param audio_len A pointer filled with the length of the audio data buffer
|
||||
* in bytes.
|
||||
* in bytes
|
||||
* \returns This function, if successfully called, returns `spec`, which will
|
||||
* be filled with the audio data format of the wave source data.
|
||||
* `audio_buf` will be filled with a pointer to an allocated buffer
|
||||
@@ -871,9 +874,8 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
|
||||
Uint32 * audio_len);
|
||||
|
||||
/**
|
||||
* Loads a WAV from a file.
|
||||
*
|
||||
* Compatibility convenience function.
|
||||
* Loads a WAV from a file.
|
||||
* Compatibility convenience function.
|
||||
*/
|
||||
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
|
||||
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
|
||||
@@ -886,7 +888,7 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
|
||||
* this function with a NULL pointer.
|
||||
*
|
||||
* \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or
|
||||
* SDL_LoadWAV_RW().
|
||||
* SDL_LoadWAV_RW()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -910,16 +912,15 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
|
||||
* and then can call SDL_ConvertAudio() to complete the conversion.
|
||||
*
|
||||
* \param cvt an SDL_AudioCVT structure filled in with audio conversion
|
||||
* information.
|
||||
* information
|
||||
* \param src_format the source format of the audio data; for more info see
|
||||
* SDL_AudioFormat.
|
||||
* \param src_channels the number of channels in the source.
|
||||
* \param src_rate the frequency (sample-frames-per-second) of the source.
|
||||
* SDL_AudioFormat
|
||||
* \param src_channels the number of channels in the source
|
||||
* \param src_rate the frequency (sample-frames-per-second) of the source
|
||||
* \param dst_format the destination format of the audio data; for more info
|
||||
* see SDL_AudioFormat.
|
||||
* \param dst_channels the number of channels in the destination.
|
||||
* \param dst_rate the frequency (sample-frames-per-second) of the
|
||||
* destination.
|
||||
* see SDL_AudioFormat
|
||||
* \param dst_channels the number of channels in the destination
|
||||
* \param dst_rate the frequency (sample-frames-per-second) of the destination
|
||||
* \returns 1 if the audio filter is prepared, 0 if no conversion is needed,
|
||||
* or a negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
@@ -990,12 +991,12 @@ typedef struct _SDL_AudioStream SDL_AudioStream;
|
||||
/**
|
||||
* Create a new audio stream.
|
||||
*
|
||||
* \param src_format The format of the source audio.
|
||||
* \param src_channels The number of channels of the source audio.
|
||||
* \param src_rate The sampling rate of the source audio.
|
||||
* \param dst_format The format of the desired audio output.
|
||||
* \param dst_channels The number of channels of the desired audio output.
|
||||
* \param dst_rate The sampling rate of the desired audio output.
|
||||
* \param src_format The format of the source audio
|
||||
* \param src_channels The number of channels of the source audio
|
||||
* \param src_rate The sampling rate of the source audio
|
||||
* \param dst_format The format of the desired audio output
|
||||
* \param dst_channels The number of channels of the desired audio output
|
||||
* \param dst_rate The sampling rate of the desired audio output
|
||||
* \returns 0 on success, or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
@@ -1017,9 +1018,9 @@ extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioForm
|
||||
/**
|
||||
* Add data to be converted/resampled to the stream.
|
||||
*
|
||||
* \param stream The stream the audio data is being added to.
|
||||
* \param buf A pointer to the audio data to add.
|
||||
* \param len The number of bytes to write to the stream.
|
||||
* \param stream The stream the audio data is being added to
|
||||
* \param buf A pointer to the audio data to add
|
||||
* \param len The number of bytes to write to the stream
|
||||
* \returns 0 on success, or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
@@ -1036,10 +1037,10 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const vo
|
||||
/**
|
||||
* Get converted/resampled data from the stream
|
||||
*
|
||||
* \param stream The stream the audio is being requested from.
|
||||
* \param buf A buffer to fill with audio data.
|
||||
* \param len The maximum number of bytes to fill.
|
||||
* \returns the number of bytes read from the stream, or -1 on error.
|
||||
* \param stream The stream the audio is being requested from
|
||||
* \param buf A buffer to fill with audio data
|
||||
* \param len The maximum number of bytes to fill
|
||||
* \returns the number of bytes read from the stream, or -1 on error
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
*
|
||||
@@ -1117,9 +1118,6 @@ extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Maximum volume allowed in calls to SDL_MixAudio and SDL_MixAudioFormat.
|
||||
*/
|
||||
#define SDL_MIX_MAXVOLUME 128
|
||||
|
||||
/**
|
||||
@@ -1134,11 +1132,11 @@ extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
|
||||
* ...where `format` is the obtained format of the audio device from the
|
||||
* legacy SDL_OpenAudio() function.
|
||||
*
|
||||
* \param dst the destination for the mixed audio.
|
||||
* \param src the source audio buffer to be mixed.
|
||||
* \param len the length of the audio buffer in bytes.
|
||||
* \param dst the destination for the mixed audio
|
||||
* \param src the source audio buffer to be mixed
|
||||
* \param len the length of the audio buffer in bytes
|
||||
* \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume.
|
||||
* for full audio volume
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1167,13 +1165,13 @@ extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
|
||||
* SDL_MixAudioFormat() is really only needed when you're mixing a single
|
||||
* audio stream with a volume adjustment.
|
||||
*
|
||||
* \param dst the destination for the mixed audio.
|
||||
* \param src the source audio buffer to be mixed.
|
||||
* \param dst the destination for the mixed audio
|
||||
* \param src the source audio buffer to be mixed
|
||||
* \param format the SDL_AudioFormat structure representing the desired audio
|
||||
* format.
|
||||
* \param len the length of the audio buffer in bytes.
|
||||
* format
|
||||
* \param len the length of the audio buffer in bytes
|
||||
* \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume.
|
||||
* for full audio volume
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
@@ -1217,9 +1215,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||
* from planar audio formats into a non-planar one (see SDL_AudioFormat)
|
||||
* before queuing audio.
|
||||
*
|
||||
* \param dev the device ID to which we will queue audio.
|
||||
* \param data the data to queue to the device for later playback.
|
||||
* \param len the number of bytes (not samples!) to which `data` points.
|
||||
* \param dev the device ID to which we will queue audio
|
||||
* \param data the data to queue to the device for later playback
|
||||
* \param len the number of bytes (not samples!) to which `data` points
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -1265,9 +1263,9 @@ extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *da
|
||||
* You should not call SDL_LockAudio() on the device before dequeueing; SDL
|
||||
* handles locking internally for this function.
|
||||
*
|
||||
* \param dev the device ID from which we will dequeue audio.
|
||||
* \param data a pointer into where audio data should be copied.
|
||||
* \param len the number of bytes (not samples!) to which (data) points.
|
||||
* \param dev the device ID from which we will dequeue audio
|
||||
* \param data a pointer into where audio data should be copied
|
||||
* \param len the number of bytes (not samples!) to which (data) points
|
||||
* \returns the number of bytes dequeued, which could be less than requested;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -1301,7 +1299,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *dat
|
||||
* You should not call SDL_LockAudio() on the device before querying; SDL
|
||||
* handles locking internally for this function.
|
||||
*
|
||||
* \param dev the device ID of which we will query queued audio size.
|
||||
* \param dev the device ID of which we will query queued audio size
|
||||
* \returns the number of bytes (not samples!) of queued audio.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
@@ -1336,7 +1334,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
||||
*
|
||||
* This function always succeeds and thus returns void.
|
||||
*
|
||||
* \param dev the device ID of which to clear the audio queue.
|
||||
* \param dev the device ID of which to clear the audio queue
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*
|
||||
@@ -1408,7 +1406,7 @@ extern DECLSPEC void SDLCALL SDL_LockAudio(void);
|
||||
* at once, not only will you block the audio callback, you'll block the other
|
||||
* thread.
|
||||
*
|
||||
* \param dev the ID of the device to be locked.
|
||||
* \param dev the ID of the device to be locked
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1441,7 +1439,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
|
||||
*
|
||||
* This function should be paired with a previous SDL_LockAudioDevice() call.
|
||||
*
|
||||
* \param dev the ID of the device to be unlocked.
|
||||
* \param dev the ID of the device to be unlocked
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1483,7 +1481,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
|
||||
* The device ID is invalid as soon as the device is closed, and is eligible
|
||||
* for reuse in a new SDL_OpenAudioDevice() call immediately.
|
||||
*
|
||||
* \param dev an audio device previously opened with SDL_OpenAudioDevice().
|
||||
* \param dev an audio device previously opened with SDL_OpenAudioDevice()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryBits
|
||||
* \file SDL_bits.h
|
||||
*
|
||||
* Functions for fiddling with bits and bitmasks.
|
||||
* Functions for fiddling with bits and bitmasks.
|
||||
*/
|
||||
|
||||
#ifndef SDL_bits_h_
|
||||
@@ -56,12 +56,6 @@ extern __inline int _SDL_bsr_watcom(Uint32);
|
||||
modify exact [eax] nomemory;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Use this function to get the index of the most significant (set) bit in a
|
||||
*
|
||||
* \param x the number to find the MSB of.
|
||||
* \returns the index of the most significant bit of x, or -1 if x is 0.
|
||||
*/
|
||||
SDL_FORCE_INLINE int
|
||||
SDL_MostSignificantBitIndex32(Uint32 x)
|
||||
{
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryBlendmode
|
||||
* \file SDL_blendmode.h
|
||||
*
|
||||
* Header file declaring the SDL_BlendMode enumeration
|
||||
* Header file declaring the SDL_BlendMode enumeration
|
||||
*/
|
||||
|
||||
#ifndef SDL_blendmode_h_
|
||||
@@ -35,9 +35,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The blend mode used in SDL_RenderCopy() and drawing operations.
|
||||
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
|
||||
*/
|
||||
typedef enum SDL_BlendMode
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
|
||||
dstRGBA = srcRGBA */
|
||||
@@ -60,10 +60,9 @@ typedef enum SDL_BlendMode
|
||||
} SDL_BlendMode;
|
||||
|
||||
/**
|
||||
* The blend operation used when combining source and destination pixel
|
||||
* components
|
||||
* \brief The blend operation used when combining source and destination pixel components
|
||||
*/
|
||||
typedef enum SDL_BlendOperation
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||
@@ -73,9 +72,9 @@ typedef enum SDL_BlendOperation
|
||||
} SDL_BlendOperation;
|
||||
|
||||
/**
|
||||
* The normalized factor used to multiply pixel components
|
||||
* \brief The normalized factor used to multiply pixel components
|
||||
*/
|
||||
typedef enum SDL_BlendFactor
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */
|
||||
SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */
|
||||
@@ -159,18 +158,18 @@ typedef enum SDL_BlendFactor
|
||||
* case.
|
||||
*
|
||||
* \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
|
||||
* blue components of the source pixels.
|
||||
* blue components of the source pixels
|
||||
* \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
|
||||
* blue components of the destination pixels.
|
||||
* blue components of the destination pixels
|
||||
* \param colorOperation the SDL_BlendOperation used to combine the red,
|
||||
* green, and blue components of the source and
|
||||
* destination pixels.
|
||||
* destination pixels
|
||||
* \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
|
||||
* the source pixels.
|
||||
* the source pixels
|
||||
* \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
|
||||
* the destination pixels.
|
||||
* the destination pixels
|
||||
* \param alphaOperation the SDL_BlendOperation used to combine the alpha
|
||||
* component of the source and destination pixels.
|
||||
* component of the source and destination pixels
|
||||
* \returns an SDL_BlendMode that represents the chosen factors and
|
||||
* operations.
|
||||
*
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryClipboard
|
||||
* \file SDL_clipboard.h
|
||||
*
|
||||
* Include file for SDL clipboard handling
|
||||
*/
|
||||
@@ -41,7 +41,7 @@ extern "C" {
|
||||
/**
|
||||
* Put UTF-8 text into the clipboard.
|
||||
*
|
||||
* \param text the text to store in the clipboard.
|
||||
* \param text the text to store in the clipboard
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -85,7 +85,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
/**
|
||||
* Put UTF-8 text into the primary selection.
|
||||
*
|
||||
* \param text the text to store in the primary selection.
|
||||
* \param text the text to store in the primary selection
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -24,7 +24,9 @@
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* WIKI CATEGORY: - */
|
||||
/**
|
||||
* \file SDL_config.h
|
||||
*/
|
||||
|
||||
/* Add any platform that doesn't build using the configure system. */
|
||||
#if defined(__WIN32__)
|
||||
|
@@ -193,7 +193,6 @@
|
||||
#cmakedefine HAVE_MEMFD_CREATE 1
|
||||
#cmakedefine HAVE_POSIX_FALLOCATE 1
|
||||
#cmakedefine HAVE_SIGACTION 1
|
||||
#cmakedefine HAVE_SIGTIMEDWAIT 1
|
||||
#cmakedefine HAVE_SA_SIGACTION 1
|
||||
#cmakedefine HAVE_SETJMP 1
|
||||
#cmakedefine HAVE_NANOSLEEP 1
|
||||
|
@@ -195,7 +195,6 @@
|
||||
#undef HAVE_FSEEKO
|
||||
#undef HAVE_FSEEKO64
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SIGTIMEDWAIT
|
||||
#undef HAVE_SA_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
@@ -217,7 +216,6 @@
|
||||
#undef HAVE__EXIT
|
||||
|
||||
#else
|
||||
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
|
@@ -19,16 +19,10 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: CPUInfo */
|
||||
|
||||
/**
|
||||
* # CategoryCPUInfo
|
||||
* \file SDL_cpuinfo.h
|
||||
*
|
||||
* CPU feature detection for SDL.
|
||||
*
|
||||
* These functions are largely concerned with reporting if the system has
|
||||
* access to various SIMD instruction sets, but also has other important info
|
||||
* to share, such as number of logical CPU cores.
|
||||
* CPU feature detection for SDL.
|
||||
*/
|
||||
|
||||
#ifndef SDL_cpuinfo_h_
|
||||
@@ -115,8 +109,7 @@ _m_prefetch(void *__P)
|
||||
#include <lasxintrin.h>
|
||||
#define __LASX__
|
||||
#endif
|
||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) && \
|
||||
(defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86))
|
||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
||||
#include <immintrin.h>
|
||||
#else
|
||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
||||
|
@@ -19,10 +19,11 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a simple file to encapsulate the EGL API headers.
|
||||
/**
|
||||
* \file SDL_egl.h
|
||||
*
|
||||
* This is a simple file to encapsulate the EGL API headers.
|
||||
*/
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
|
||||
#if defined(__vita__) || defined(__psp2__)
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryEndian
|
||||
* \file SDL_endian.h
|
||||
*
|
||||
* Functions for reading and writing endian-specific values
|
||||
* Functions for reading and writing endian-specific values
|
||||
*/
|
||||
|
||||
#ifndef SDL_endian_h_
|
||||
@@ -59,15 +59,6 @@ _m_prefetch(void *__P)
|
||||
#ifdef __linux__
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#elif defined(__sun) && defined(__SVR4) /* Solaris */
|
||||
#include <sys/byteorder.h>
|
||||
#if defined(_LITTLE_ENDIAN)
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#elif defined(_BIG_ENDIAN)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#error Unsupported endianness
|
||||
#endif
|
||||
#elif defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
@@ -88,7 +79,7 @@ _m_prefetch(void *__P)
|
||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
||||
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
|
||||
defined(__sparc__) || defined(__sparc)
|
||||
defined(__sparc__)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
@@ -189,16 +180,6 @@ extern __inline Uint16 SDL_Swap16(Uint16);
|
||||
parm [ax] \
|
||||
modify [ax];
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a 16-bit value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapBE16
|
||||
* \sa SDL_SwapLE16
|
||||
*/
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
@@ -250,16 +231,6 @@ extern __inline Uint32 SDL_Swap32(Uint32);
|
||||
parm [eax] \
|
||||
modify [eax];
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a 32-bit value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapBE32
|
||||
* \sa SDL_SwapLE32
|
||||
*/
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
@@ -305,16 +276,6 @@ extern __inline Uint64 SDL_Swap64(Uint64);
|
||||
parm [eax edx] \
|
||||
modify [eax edx];
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a 64-bit value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapBE64
|
||||
* \sa SDL_SwapLE64
|
||||
*/
|
||||
SDL_FORCE_INLINE Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
@@ -332,15 +293,6 @@ SDL_Swap64(Uint64 x)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Use this function to swap the byte order of a floating point value.
|
||||
*
|
||||
* \param x the value to be swapped.
|
||||
* \returns the swapped value.
|
||||
*
|
||||
* \sa SDL_SwapFloatBE
|
||||
* \sa SDL_SwapFloatLE
|
||||
*/
|
||||
SDL_FORCE_INLINE float
|
||||
SDL_SwapFloat(float x)
|
||||
{
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryError
|
||||
* \file SDL_error.h
|
||||
*
|
||||
* Simple error message routines for SDL.
|
||||
* Simple error message routines for SDL.
|
||||
*/
|
||||
|
||||
#ifndef SDL_error_h_
|
||||
@@ -53,9 +53,9 @@ extern "C" {
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* \param fmt a printf()-style message format string.
|
||||
* \param fmt a printf()-style message format string
|
||||
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
||||
* any.
|
||||
* any
|
||||
* \returns always -1.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -109,8 +109,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
||||
* otherwise operates exactly the same as SDL_GetError().
|
||||
*
|
||||
* \param errstr A buffer to fill with the last error message that was set for
|
||||
* the current thread.
|
||||
* \param maxlen The size of the buffer pointed to by the errstr parameter.
|
||||
* the current thread
|
||||
* \param maxlen The size of the buffer pointed to by the errstr parameter
|
||||
* \returns the pointer passed in as the `errstr` parameter.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryEvents
|
||||
* \file SDL_events.h
|
||||
*
|
||||
* Include file for SDL event handling.
|
||||
* Include file for SDL event handling.
|
||||
*/
|
||||
|
||||
#ifndef SDL_events_h_
|
||||
@@ -52,7 +52,7 @@ extern "C" {
|
||||
/**
|
||||
* The types of events that can be delivered.
|
||||
*/
|
||||
typedef enum SDL_EventType
|
||||
typedef enum
|
||||
{
|
||||
SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
|
||||
|
||||
@@ -167,7 +167,7 @@ typedef enum SDL_EventType
|
||||
/* Internal events */
|
||||
SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
|
||||
|
||||
/** Events SDL_USEREVENT through SDL_LASTEVENT are for your use,
|
||||
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
|
||||
* and should be allocated with SDL_RegisterEvents()
|
||||
*/
|
||||
SDL_USEREVENT = 0x8000,
|
||||
@@ -179,7 +179,7 @@ typedef enum SDL_EventType
|
||||
} SDL_EventType;
|
||||
|
||||
/**
|
||||
* Fields shared by every event
|
||||
* \brief Fields shared by every event
|
||||
*/
|
||||
typedef struct SDL_CommonEvent
|
||||
{
|
||||
@@ -188,14 +188,14 @@ typedef struct SDL_CommonEvent
|
||||
} SDL_CommonEvent;
|
||||
|
||||
/**
|
||||
* Display state change event data (event.display.*)
|
||||
* \brief Display state change event data (event.display.*)
|
||||
*/
|
||||
typedef struct SDL_DisplayEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_DISPLAYEVENT */
|
||||
Uint32 type; /**< ::SDL_DISPLAYEVENT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 display; /**< The associated display index */
|
||||
Uint8 event; /**< SDL_DisplayEventID */
|
||||
Uint8 event; /**< ::SDL_DisplayEventID */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@@ -203,14 +203,14 @@ typedef struct SDL_DisplayEvent
|
||||
} SDL_DisplayEvent;
|
||||
|
||||
/**
|
||||
* Window state change event data (event.window.*)
|
||||
* \brief Window state change event data (event.window.*)
|
||||
*/
|
||||
typedef struct SDL_WindowEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_WINDOWEVENT */
|
||||
Uint32 type; /**< ::SDL_WINDOWEVENT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The associated window */
|
||||
Uint8 event; /**< SDL_WindowEventID */
|
||||
Uint8 event; /**< ::SDL_WindowEventID */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@@ -219,14 +219,14 @@ typedef struct SDL_WindowEvent
|
||||
} SDL_WindowEvent;
|
||||
|
||||
/**
|
||||
* Keyboard button event structure (event.key.*)
|
||||
* \brief Keyboard button event structure (event.key.*)
|
||||
*/
|
||||
typedef struct SDL_KeyboardEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_KEYDOWN or SDL_KEYUP */
|
||||
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 repeat; /**< Non-zero if this is a key repeat */
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@@ -234,13 +234,12 @@ typedef struct SDL_KeyboardEvent
|
||||
} SDL_KeyboardEvent;
|
||||
|
||||
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
|
||||
|
||||
/**
|
||||
* Keyboard text editing event structure (event.edit.*)
|
||||
* \brief Keyboard text editing event structure (event.edit.*)
|
||||
*/
|
||||
typedef struct SDL_TextEditingEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_TEXTEDITING */
|
||||
Uint32 type; /**< ::SDL_TEXTEDITING */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
|
||||
@@ -249,12 +248,12 @@ typedef struct SDL_TextEditingEvent
|
||||
} SDL_TextEditingEvent;
|
||||
|
||||
/**
|
||||
* Extended keyboard text editing event structure (event.editExt.*) when text
|
||||
* would be truncated if stored in the text buffer SDL_TextEditingEvent
|
||||
* \brief Extended keyboard text editing event structure (event.editExt.*) when text would be
|
||||
* truncated if stored in the text buffer SDL_TextEditingEvent
|
||||
*/
|
||||
typedef struct SDL_TextEditingExtEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_TEXTEDITING_EXT */
|
||||
Uint32 type; /**< ::SDL_TEXTEDITING_EXT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */
|
||||
@@ -262,43 +261,24 @@ typedef struct SDL_TextEditingExtEvent
|
||||
Sint32 length; /**< The length of selected editing text */
|
||||
} SDL_TextEditingExtEvent;
|
||||
|
||||
/**
|
||||
* The maximum bytes of text that can be supplied in an SDL_TextInputEvent.
|
||||
*/
|
||||
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
|
||||
|
||||
/**
|
||||
* Keyboard text input event structure (event.text.*)
|
||||
*
|
||||
* `text` is limited to SDL_TEXTINPUTEVENT_TEXT_SIZE bytes. If the incoming
|
||||
* string is larger than this, SDL will split it and send it in pieces, across
|
||||
* multiple events. The string is in UTF-8 format, and if split, SDL
|
||||
* guarantees that it will not split in the middle of a UTF-8 sequence, so any
|
||||
* event will only contain complete codepoints. However, if there are several
|
||||
* codepoints that go together into a single glyph (like an emoji "thumbs up"
|
||||
* followed by a skin color), they may be split between events.
|
||||
*
|
||||
* This event will never be delivered unless text input is enabled by calling
|
||||
* SDL_StartTextInput(). Text input is enabled by default on desktop
|
||||
* platforms, and disabled by default on mobile platforms!
|
||||
*
|
||||
* \sa SDL_StartTextInput
|
||||
* \sa SDL_StopTextInput
|
||||
* \brief Keyboard text input event structure (event.text.*)
|
||||
*/
|
||||
typedef struct SDL_TextInputEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_TEXTINPUT */
|
||||
Uint32 type; /**< ::SDL_TEXTINPUT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text; UTF-8 encoded. */
|
||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
|
||||
} SDL_TextInputEvent;
|
||||
|
||||
/**
|
||||
* Mouse motion event structure (event.motion.*)
|
||||
* \brief Mouse motion event structure (event.motion.*)
|
||||
*/
|
||||
typedef struct SDL_MouseMotionEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MOUSEMOTION */
|
||||
Uint32 type; /**< ::SDL_MOUSEMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||
@@ -310,16 +290,16 @@ typedef struct SDL_MouseMotionEvent
|
||||
} SDL_MouseMotionEvent;
|
||||
|
||||
/**
|
||||
* Mouse button event structure (event.button.*)
|
||||
* \brief Mouse button event structure (event.button.*)
|
||||
*/
|
||||
typedef struct SDL_MouseButtonEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
|
||||
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||
Uint8 button; /**< The mouse button index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
|
||||
Uint8 padding1;
|
||||
Sint32 x; /**< X coordinate, relative to window */
|
||||
@@ -327,11 +307,11 @@ typedef struct SDL_MouseButtonEvent
|
||||
} SDL_MouseButtonEvent;
|
||||
|
||||
/**
|
||||
* Mouse wheel event structure (event.wheel.*)
|
||||
* \brief Mouse wheel event structure (event.wheel.*)
|
||||
*/
|
||||
typedef struct SDL_MouseWheelEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MOUSEWHEEL */
|
||||
Uint32 type; /**< ::SDL_MOUSEWHEEL */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
||||
@@ -345,11 +325,11 @@ typedef struct SDL_MouseWheelEvent
|
||||
} SDL_MouseWheelEvent;
|
||||
|
||||
/**
|
||||
* Joystick axis motion event structure (event.jaxis.*)
|
||||
* \brief Joystick axis motion event structure (event.jaxis.*)
|
||||
*/
|
||||
typedef struct SDL_JoyAxisEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYAXISMOTION */
|
||||
Uint32 type; /**< ::SDL_JOYAXISMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 axis; /**< The joystick axis index */
|
||||
@@ -361,11 +341,11 @@ typedef struct SDL_JoyAxisEvent
|
||||
} SDL_JoyAxisEvent;
|
||||
|
||||
/**
|
||||
* Joystick trackball motion event structure (event.jball.*)
|
||||
* \brief Joystick trackball motion event structure (event.jball.*)
|
||||
*/
|
||||
typedef struct SDL_JoyBallEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYBALLMOTION */
|
||||
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 ball; /**< The joystick trackball index */
|
||||
@@ -377,18 +357,18 @@ typedef struct SDL_JoyBallEvent
|
||||
} SDL_JoyBallEvent;
|
||||
|
||||
/**
|
||||
* Joystick hat position change event structure (event.jhat.*)
|
||||
* \brief Joystick hat position change event structure (event.jhat.*)
|
||||
*/
|
||||
typedef struct SDL_JoyHatEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYHATMOTION */
|
||||
Uint32 type; /**< ::SDL_JOYHATMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 hat; /**< The joystick hat index */
|
||||
Uint8 value; /**< The hat position value.
|
||||
* \sa SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
|
||||
* \sa SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
|
||||
* \sa SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
|
||||
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
|
||||
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
|
||||
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
|
||||
*
|
||||
* Note that zero means the POV is centered.
|
||||
*/
|
||||
@@ -397,51 +377,46 @@ typedef struct SDL_JoyHatEvent
|
||||
} SDL_JoyHatEvent;
|
||||
|
||||
/**
|
||||
* Joystick button event structure (event.jbutton.*)
|
||||
* \brief Joystick button event structure (event.jbutton.*)
|
||||
*/
|
||||
typedef struct SDL_JoyButtonEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
|
||||
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The joystick button index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_JoyButtonEvent;
|
||||
|
||||
/**
|
||||
* Joystick device event structure (event.jdevice.*)
|
||||
*
|
||||
* SDL will send JOYSTICK_ADDED events for devices that are already plugged in
|
||||
* during SDL_Init.
|
||||
*
|
||||
* \sa SDL_ControllerDeviceEvent
|
||||
* \brief Joystick device event structure (event.jdevice.*)
|
||||
*/
|
||||
typedef struct SDL_JoyDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYDEVICEADDED or SDL_JOYDEVICEREMOVED */
|
||||
Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
||||
} SDL_JoyDeviceEvent;
|
||||
|
||||
/**
|
||||
* Joysick battery level change event structure (event.jbattery.*)
|
||||
* \brief Joysick battery level change event structure (event.jbattery.*)
|
||||
*/
|
||||
typedef struct SDL_JoyBatteryEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_JOYBATTERYUPDATED */
|
||||
Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
SDL_JoystickPowerLevel level; /**< The joystick battery level */
|
||||
} SDL_JoyBatteryEvent;
|
||||
|
||||
/**
|
||||
* Game controller axis motion event structure (event.caxis.*)
|
||||
* \brief Game controller axis motion event structure (event.caxis.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerAxisEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERAXISMOTION */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
|
||||
@@ -454,42 +429,36 @@ typedef struct SDL_ControllerAxisEvent
|
||||
|
||||
|
||||
/**
|
||||
* Game controller button event structure (event.cbutton.*)
|
||||
* \brief Game controller button event structure (event.cbutton.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerButtonEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERBUTTONDOWN or SDL_CONTROLLERBUTTONUP */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The controller button (SDL_GameControllerButton) */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_ControllerButtonEvent;
|
||||
|
||||
|
||||
/**
|
||||
* Controller device event structure (event.cdevice.*)
|
||||
*
|
||||
* Joysticks that are supported game controllers receive both an
|
||||
* SDL_JoyDeviceEvent and an SDL_ControllerDeviceEvent.
|
||||
*
|
||||
* SDL will send CONTROLLERDEVICEADDED events for joysticks that are already
|
||||
* plugged in during SDL_Init() and are recognized as game controllers.
|
||||
* \brief Controller device event structure (event.cdevice.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, or SDL_CONTROLLERSTEAMHANDLEUPDATED */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
|
||||
} SDL_ControllerDeviceEvent;
|
||||
|
||||
/**
|
||||
* Game controller touchpad event structure (event.ctouchpad.*)
|
||||
* \brief Game controller touchpad event structure (event.ctouchpad.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerTouchpadEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERTOUCHPADDOWN or SDL_CONTROLLERTOUCHPADMOTION or SDL_CONTROLLERTOUCHPADUP */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Sint32 touchpad; /**< The index of the touchpad */
|
||||
@@ -500,24 +469,24 @@ typedef struct SDL_ControllerTouchpadEvent
|
||||
} SDL_ControllerTouchpadEvent;
|
||||
|
||||
/**
|
||||
* Game controller sensor event structure (event.csensor.*)
|
||||
* \brief Game controller sensor event structure (event.csensor.*)
|
||||
*/
|
||||
typedef struct SDL_ControllerSensorEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_CONTROLLERSENSORUPDATE */
|
||||
Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Sint32 sensor; /**< The type of the sensor, one of the values of SDL_SensorType */
|
||||
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
||||
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
||||
Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
|
||||
} SDL_ControllerSensorEvent;
|
||||
|
||||
/**
|
||||
* Audio device event structure (event.adevice.*)
|
||||
* \brief Audio device event structure (event.adevice.*)
|
||||
*/
|
||||
typedef struct SDL_AudioDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_AUDIODEVICEADDED, or SDL_AUDIODEVICEREMOVED */
|
||||
Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
||||
@@ -528,11 +497,11 @@ typedef struct SDL_AudioDeviceEvent
|
||||
|
||||
|
||||
/**
|
||||
* Touch finger event structure (event.tfinger.*)
|
||||
* \brief Touch finger event structure (event.tfinger.*)
|
||||
*/
|
||||
typedef struct SDL_TouchFingerEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_FINGERMOTION or SDL_FINGERDOWN or SDL_FINGERUP */
|
||||
Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_TouchID touchId; /**< The touch device id */
|
||||
SDL_FingerID fingerId;
|
||||
@@ -546,11 +515,11 @@ typedef struct SDL_TouchFingerEvent
|
||||
|
||||
|
||||
/**
|
||||
* Multiple Finger Gesture Event (event.mgesture.*)
|
||||
* \brief Multiple Finger Gesture Event (event.mgesture.*)
|
||||
*/
|
||||
typedef struct SDL_MultiGestureEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_MULTIGESTURE */
|
||||
Uint32 type; /**< ::SDL_MULTIGESTURE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_TouchID touchId; /**< The touch device id */
|
||||
float dTheta;
|
||||
@@ -563,11 +532,11 @@ typedef struct SDL_MultiGestureEvent
|
||||
|
||||
|
||||
/**
|
||||
* Dollar Gesture Event (event.dgesture.*)
|
||||
* \brief Dollar Gesture Event (event.dgesture.*)
|
||||
*/
|
||||
typedef struct SDL_DollarGestureEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_DOLLARGESTURE or SDL_DOLLARRECORD */
|
||||
Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_TouchID touchId; /**< The touch device id */
|
||||
SDL_GestureID gestureId;
|
||||
@@ -579,15 +548,13 @@ typedef struct SDL_DollarGestureEvent
|
||||
|
||||
|
||||
/**
|
||||
* An event used to request a file open by the system (event.drop.*)
|
||||
*
|
||||
* This event is enabled by default, you can disable it with SDL_EventState().
|
||||
*
|
||||
* If this event is enabled, you must free the filename in the event.
|
||||
* \brief An event used to request a file open by the system (event.drop.*)
|
||||
* This event is enabled by default, you can disable it with SDL_EventState().
|
||||
* \note If this event is enabled, you must free the filename in the event.
|
||||
*/
|
||||
typedef struct SDL_DropEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_DROPBEGIN or SDL_DROPFILE or SDL_DROPTEXT or SDL_DROPCOMPLETE */
|
||||
Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
|
||||
Uint32 windowID; /**< The window that was dropped on, if any */
|
||||
@@ -595,11 +562,11 @@ typedef struct SDL_DropEvent
|
||||
|
||||
|
||||
/**
|
||||
* Sensor event structure (event.sensor.*)
|
||||
* \brief Sensor event structure (event.sensor.*)
|
||||
*/
|
||||
typedef struct SDL_SensorEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_SENSORUPDATE */
|
||||
Uint32 type; /**< ::SDL_SENSORUPDATE */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Sint32 which; /**< The instance ID of the sensor */
|
||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
|
||||
@@ -607,20 +574,20 @@ typedef struct SDL_SensorEvent
|
||||
} SDL_SensorEvent;
|
||||
|
||||
/**
|
||||
* The "quit requested" event
|
||||
* \brief The "quit requested" event
|
||||
*/
|
||||
typedef struct SDL_QuitEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_QUIT */
|
||||
Uint32 type; /**< ::SDL_QUIT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
} SDL_QuitEvent;
|
||||
|
||||
/**
|
||||
* A user-defined event type (event.user.*)
|
||||
* \brief A user-defined event type (event.user.*)
|
||||
*/
|
||||
typedef struct SDL_UserEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_USEREVENT through SDL_LASTEVENT-1 */
|
||||
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
Uint32 windowID; /**< The associated window if any */
|
||||
Sint32 code; /**< User defined event code */
|
||||
@@ -633,24 +600,20 @@ struct SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
||||
|
||||
/**
|
||||
* A video driver dependent system event (event.syswm.*)
|
||||
* \brief A video driver dependent system event (event.syswm.*)
|
||||
* This event is disabled by default, you can enable it with SDL_EventState()
|
||||
*
|
||||
* This event is disabled by default, you can enable it with SDL_EventState()
|
||||
*
|
||||
* If you want to use this event, you should include SDL_syswm.h.
|
||||
* \note If you want to use this event, you should include SDL_syswm.h.
|
||||
*/
|
||||
typedef struct SDL_SysWMEvent
|
||||
{
|
||||
Uint32 type; /**< SDL_SYSWMEVENT */
|
||||
Uint32 type; /**< ::SDL_SYSWMEVENT */
|
||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
||||
} SDL_SysWMEvent;
|
||||
|
||||
/**
|
||||
* General event structure
|
||||
*
|
||||
* The SDL_Event structure is the core of all event handling in SDL. SDL_Event
|
||||
* is a union of all event structures used in SDL.
|
||||
* \brief General event structure
|
||||
*/
|
||||
typedef union SDL_Event
|
||||
{
|
||||
@@ -733,7 +696,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NUL
|
||||
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
|
||||
/* @{ */
|
||||
typedef enum SDL_eventaction
|
||||
typedef enum
|
||||
{
|
||||
SDL_ADDEVENT,
|
||||
SDL_PEEKEVENT,
|
||||
@@ -760,15 +723,15 @@ typedef enum SDL_eventaction
|
||||
*
|
||||
* This function is thread-safe.
|
||||
*
|
||||
* \param events destination buffer for the retrieved events.
|
||||
* \param events destination buffer for the retrieved events
|
||||
* \param numevents if action is SDL_ADDEVENT, the number of events to add
|
||||
* back to the event queue; if action is SDL_PEEKEVENT or
|
||||
* SDL_GETEVENT, the maximum number of events to retrieve.
|
||||
* \param action action to take; see [[#action|Remarks]] for details.
|
||||
* SDL_GETEVENT, the maximum number of events to retrieve
|
||||
* \param action action to take; see [[#action|Remarks]] for details
|
||||
* \param minType minimum value of the event type to be considered;
|
||||
* SDL_FIRSTEVENT is a safe choice.
|
||||
* SDL_FIRSTEVENT is a safe choice
|
||||
* \param maxType maximum value of the event type to be considered;
|
||||
* SDL_LASTEVENT is a safe choice.
|
||||
* SDL_LASTEVENT is a safe choice
|
||||
* \returns the number of events actually stored or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -789,7 +752,7 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
||||
* If you need to check for a range of event types, use SDL_HasEvents()
|
||||
* instead.
|
||||
*
|
||||
* \param type the type of event to be queried; see SDL_EventType for details.
|
||||
* \param type the type of event to be queried; see SDL_EventType for details
|
||||
* \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
|
||||
* events matching `type` are not present.
|
||||
*
|
||||
@@ -806,9 +769,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
* If you need to check for a single event type, use SDL_HasEvent() instead.
|
||||
*
|
||||
* \param minType the low end of event type to be queried, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
* \param maxType the high end of event type to be queried, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
* \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
|
||||
* present, or SDL_FALSE if not.
|
||||
*
|
||||
@@ -832,7 +795,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
||||
* on the main thread immediately before the flush call.
|
||||
*
|
||||
* \param type the type of event to be cleared; see SDL_EventType for details.
|
||||
* \param type the type of event to be cleared; see SDL_EventType for details
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -855,9 +818,9 @@ extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
||||
* on the main thread immediately before the flush call.
|
||||
*
|
||||
* \param minType the low end of event type to be cleared, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
* \param maxType the high end of event type to be cleared, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* SDL_EventType for details
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -898,7 +861,7 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
||||
* ```
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled with the next event from
|
||||
* the queue, or NULL.
|
||||
* the queue, or NULL
|
||||
* \returns 1 if there is a pending event or 0 if there are none available.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -922,7 +885,7 @@ extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
|
||||
* this function in the thread that initialized the video subsystem.
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled in with the next event
|
||||
* from the queue, or NULL.
|
||||
* from the queue, or NULL
|
||||
* \returns 1 on success or 0 if there was an error while waiting for events;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -945,9 +908,9 @@ extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
|
||||
* this function in the thread that initialized the video subsystem.
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled in with the next event
|
||||
* from the queue, or NULL.
|
||||
* from the queue, or NULL
|
||||
* \param timeout the maximum number of milliseconds to wait for the next
|
||||
* available event.
|
||||
* available event
|
||||
* \returns 1 on success or 0 if there was an error while waiting for events;
|
||||
* call SDL_GetError() for more information. This also returns 0 if
|
||||
* the timeout elapsed without an event arriving.
|
||||
@@ -982,7 +945,7 @@ extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
|
||||
* get an event type that does not conflict with other code that also wants
|
||||
* its own custom event types.
|
||||
*
|
||||
* \param event the SDL_Event to be added to the queue.
|
||||
* \param event the SDL_Event to be added to the queue
|
||||
* \returns 1 on success, 0 if the event was filtered, or a negative error
|
||||
* code on failure; call SDL_GetError() for more information. A
|
||||
* common reason for error is the event queue being full.
|
||||
@@ -998,11 +961,11 @@ extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
|
||||
/**
|
||||
* A function pointer used for callbacks that watch the event queue.
|
||||
*
|
||||
* \param userdata what was passed as `userdata` to SDL_SetEventFilter() or
|
||||
* SDL_AddEventWatch, etc.
|
||||
* \param event the event that triggered the callback.
|
||||
* \returns 1 to permit event to be added to the queue, and 0 to disallow it.
|
||||
* When used with SDL_AddEventWatch, the return value is ignored.
|
||||
* \param userdata what was passed as `userdata` to SDL_SetEventFilter()
|
||||
* or SDL_AddEventWatch, etc
|
||||
* \param event the event that triggered the callback
|
||||
* \returns 1 to permit event to be added to the queue, and 0 to disallow
|
||||
* it. When used with SDL_AddEventWatch, the return value is ignored.
|
||||
*
|
||||
* \sa SDL_SetEventFilter
|
||||
* \sa SDL_AddEventWatch
|
||||
@@ -1025,7 +988,7 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
||||
* interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
|
||||
* application at the next event poll.
|
||||
*
|
||||
* There is one caveat when dealing with the SDL_QuitEvent event type. The
|
||||
* There is one caveat when dealing with the ::SDL_QuitEvent event type. The
|
||||
* event filter is only called when the window manager desires to close the
|
||||
* application window. If the event filter returns 1, then the window will be
|
||||
* closed, otherwise the window will remain open if possible.
|
||||
@@ -1040,8 +1003,8 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
||||
* the event filter, but events pushed onto the queue with SDL_PeepEvents() do
|
||||
* not.
|
||||
*
|
||||
* \param filter An SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \param filter An SDL_EventFilter function to call when an event happens
|
||||
* \param userdata a pointer that is passed to `filter`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1060,9 +1023,9 @@ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
|
||||
* This function can be used to "chain" filters, by saving the existing filter
|
||||
* before replacing it with a function that will call that saved filter.
|
||||
*
|
||||
* \param filter the current callback function will be stored here.
|
||||
* \param filter the current callback function will be stored here
|
||||
* \param userdata the pointer that is passed to the current event filter will
|
||||
* be stored here.
|
||||
* be stored here
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -1091,7 +1054,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
|
||||
* through SDL_PeepEvents().
|
||||
*
|
||||
* \param filter an SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \param userdata a pointer that is passed to `filter`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1107,8 +1070,8 @@ extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
|
||||
* This function takes the same input as SDL_AddEventWatch() to identify and
|
||||
* delete the corresponding callback.
|
||||
*
|
||||
* \param filter the function originally passed to SDL_AddEventWatch().
|
||||
* \param userdata the pointer originally passed to SDL_AddEventWatch().
|
||||
* \param filter the function originally passed to SDL_AddEventWatch()
|
||||
* \param userdata the pointer originally passed to SDL_AddEventWatch()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1125,8 +1088,8 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
|
||||
* this function does not change the filter permanently, it only uses the
|
||||
* supplied filter until this function returns.
|
||||
*
|
||||
* \param filter the SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \param filter the SDL_EventFilter function to call when an event happens
|
||||
* \param userdata a pointer that is passed to `filter`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1152,8 +1115,8 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
||||
* from the event queue and will not be filtered
|
||||
* - `SDL_ENABLE`: the event will be processed normally
|
||||
*
|
||||
* \param type the type of event; see SDL_EventType for details.
|
||||
* \param state how to process the event.
|
||||
* \param type the type of event; see SDL_EventType for details
|
||||
* \param state how to process the event
|
||||
* \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state
|
||||
* of the event before this function makes any changes to it.
|
||||
*
|
||||
@@ -1175,7 +1138,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
|
||||
* Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
|
||||
* 0xFFFFFFFF), but is clearer to write.
|
||||
*
|
||||
* \param numevents the number of events to be allocated.
|
||||
* \param numevents the number of events to be allocated
|
||||
* \returns the beginning event number, or (Uint32)-1 if there are not enough
|
||||
* user-defined events left.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryFilesystem
|
||||
* \file SDL_filesystem.h
|
||||
*
|
||||
* Include file for filesystem SDL API functions
|
||||
* \brief Include file for filesystem SDL API functions
|
||||
*/
|
||||
|
||||
#ifndef SDL_filesystem_h_
|
||||
@@ -126,8 +126,8 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
||||
* The pointer returned is owned by the caller. Please call SDL_free() on the
|
||||
* pointer when done with it.
|
||||
*
|
||||
* \param org the name of your organization.
|
||||
* \param app the name of your application.
|
||||
* \param org the name of your organization
|
||||
* \param app the name of your application
|
||||
* \returns a UTF-8 string of the user directory in platform-dependent
|
||||
* notation. NULL if there's a problem (creating directory failed,
|
||||
* etc.).
|
||||
|
@@ -19,12 +19,10 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: GameController */
|
||||
|
||||
/**
|
||||
* # CategoryGameController
|
||||
* \file SDL_gamecontroller.h
|
||||
*
|
||||
* Include file for SDL game controller event handling
|
||||
* Include file for SDL game controller event handling
|
||||
*/
|
||||
|
||||
#ifndef SDL_gamecontroller_h_
|
||||
@@ -46,7 +44,7 @@ extern "C" {
|
||||
* \file SDL_gamecontroller.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system
|
||||
* with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system
|
||||
* for game controllers, and load appropriate drivers.
|
||||
*
|
||||
* If you would like to receive controller updates while the application
|
||||
@@ -60,7 +58,7 @@ extern "C" {
|
||||
struct _SDL_GameController;
|
||||
typedef struct _SDL_GameController SDL_GameController;
|
||||
|
||||
typedef enum SDL_GameControllerType
|
||||
typedef enum
|
||||
{
|
||||
SDL_CONTROLLER_TYPE_UNKNOWN = 0,
|
||||
SDL_CONTROLLER_TYPE_XBOX360,
|
||||
@@ -79,7 +77,7 @@ typedef enum SDL_GameControllerType
|
||||
SDL_CONTROLLER_TYPE_MAX
|
||||
} SDL_GameControllerType;
|
||||
|
||||
typedef enum SDL_GameControllerBindType
|
||||
typedef enum
|
||||
{
|
||||
SDL_CONTROLLER_BINDTYPE_NONE = 0,
|
||||
SDL_CONTROLLER_BINDTYPE_BUTTON,
|
||||
@@ -88,7 +86,7 @@ typedef enum SDL_GameControllerBindType
|
||||
} SDL_GameControllerBindType;
|
||||
|
||||
/**
|
||||
* Get the SDL joystick layer binding for this controller button/axis mapping
|
||||
* Get the SDL joystick layer binding for this controller button/axis mapping
|
||||
*/
|
||||
typedef struct SDL_GameControllerButtonBind
|
||||
{
|
||||
@@ -146,10 +144,6 @@ typedef struct SDL_GameControllerButtonBind
|
||||
* If a new mapping is loaded for an already known controller GUID, the later
|
||||
* version will overwrite the one currently loaded.
|
||||
*
|
||||
* If this function is called before SDL_Init, SDL will generate an
|
||||
* SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged
|
||||
* in at the time that SDL_Init is called.
|
||||
*
|
||||
* Mappings not belonging to the current platform or with no platform field
|
||||
* specified will be ignored (i.e. mappings for Linux will be ignored in
|
||||
* Windows, etc).
|
||||
@@ -158,8 +152,8 @@ typedef struct SDL_GameControllerButtonBind
|
||||
* processing it, so take this into consideration if you are in a memory
|
||||
* constrained environment.
|
||||
*
|
||||
* \param rw the data stream for the mappings to be added.
|
||||
* \param freerw non-zero to close the stream after being read.
|
||||
* \param rw the data stream for the mappings to be added
|
||||
* \param freerw non-zero to close the stream after being read
|
||||
* \returns the number of mappings added or -1 on error; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@@ -168,15 +162,13 @@ typedef struct SDL_GameControllerButtonBind
|
||||
* \sa SDL_GameControllerAddMapping
|
||||
* \sa SDL_GameControllerAddMappingsFromFile
|
||||
* \sa SDL_GameControllerMappingForGUID
|
||||
* \sa SDL_CONTROLLERDEVICEADDED
|
||||
*/
|
||||
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()
|
||||
*
|
||||
* Convenience macro.
|
||||
* Convenience macro.
|
||||
*/
|
||||
#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
|
||||
|
||||
@@ -198,11 +190,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
|
||||
* "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"
|
||||
* ```
|
||||
*
|
||||
* If this function is called before SDL_Init, SDL will generate an
|
||||
* SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged
|
||||
* in at the time that SDL_Init is called.
|
||||
*
|
||||
* \param mappingString the mapping string.
|
||||
* \param mappingString the mapping string
|
||||
* \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
|
||||
* -1 on error; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -210,7 +198,6 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
|
||||
*
|
||||
* \sa SDL_GameControllerMapping
|
||||
* \sa SDL_GameControllerMappingForGUID
|
||||
* \sa SDL_CONTROLLERDEVICEADDED
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
|
||||
|
||||
@@ -238,7 +225,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_ind
|
||||
*
|
||||
* The returned string must be freed with SDL_free().
|
||||
*
|
||||
* \param guid a structure containing the GUID for which a mapping is desired.
|
||||
* \param guid a structure containing the GUID for which a mapping is desired
|
||||
* \returns a mapping string or NULL on error; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
@@ -257,7 +244,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID
|
||||
* Details about mappings are discussed with SDL_GameControllerAddMapping().
|
||||
*
|
||||
* \param gamecontroller the game controller you want to get the current
|
||||
* mapping for.
|
||||
* mapping for
|
||||
* \returns a string that has the controller's mapping or NULL if no mapping
|
||||
* is available; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -275,7 +262,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gam
|
||||
* SDL_JoystickOpen().
|
||||
*
|
||||
* \param joystick_index the device_index of a device, up to
|
||||
* SDL_NumJoysticks().
|
||||
* SDL_NumJoysticks()
|
||||
* \returns SDL_TRUE if the given joystick is supported by the game controller
|
||||
* interface, SDL_FALSE if it isn't or it's an invalid index.
|
||||
*
|
||||
@@ -295,7 +282,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
||||
* SDL_JoystickOpen().
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1.
|
||||
* SDL_NumJoysticks()-1
|
||||
* \returns the implementation-dependent name for the game controller, or NULL
|
||||
* if there is no name or the index is invalid.
|
||||
*
|
||||
@@ -316,7 +303,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_
|
||||
* SDL_JoystickOpen().
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1.
|
||||
* SDL_NumJoysticks()-1
|
||||
* \returns the implementation-dependent path for the game controller, or NULL
|
||||
* if there is no path or the index is invalid.
|
||||
*
|
||||
@@ -332,7 +319,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_
|
||||
* This can be called before any controllers are opened.
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1.
|
||||
* SDL_NumJoysticks()-1
|
||||
* \returns the controller type.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.12.
|
||||
@@ -345,7 +332,7 @@ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(in
|
||||
* This can be called before any controllers are opened.
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1.
|
||||
* SDL_NumJoysticks()-1
|
||||
* \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
|
||||
* no mapping is available.
|
||||
*
|
||||
@@ -365,7 +352,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
|
||||
* be used there instead.
|
||||
*
|
||||
* \param joystick_index the device_index of a device, up to
|
||||
* SDL_NumJoysticks().
|
||||
* SDL_NumJoysticks()
|
||||
* \returns a gamecontroller identifier or NULL if an error occurred; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -380,7 +367,7 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_
|
||||
/**
|
||||
* Get the SDL_GameController associated with an instance id.
|
||||
*
|
||||
* \param joyid the instance id to get the SDL_GameController for.
|
||||
* \param joyid the instance id to get the SDL_GameController for
|
||||
* \returns an SDL_GameController on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -412,7 +399,7 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in
|
||||
* it takes a controller identifier instead of the (unstable) device index.
|
||||
*
|
||||
* \param gamecontroller a game controller identifier previously returned by
|
||||
* SDL_GameControllerOpen().
|
||||
* SDL_GameControllerOpen()
|
||||
* \returns the implementation dependent name for the game controller, or NULL
|
||||
* if there is no name or the identifier passed is invalid.
|
||||
*
|
||||
@@ -430,7 +417,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *g
|
||||
* it takes a controller identifier instead of the (unstable) device index.
|
||||
*
|
||||
* \param gamecontroller a game controller identifier previously returned by
|
||||
* SDL_GameControllerOpen().
|
||||
* SDL_GameControllerOpen()
|
||||
* \returns the implementation dependent path for the game controller, or NULL
|
||||
* if there is no path or the identifier passed is invalid.
|
||||
*
|
||||
@@ -540,8 +527,8 @@ extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameControl
|
||||
/**
|
||||
* Get the Steam Input handle of an opened controller, if available.
|
||||
*
|
||||
* Returns an InputHandle_t for the controller that can be used with Steam
|
||||
* Input API: https://partner.steamgames.com/doc/api/ISteamInput
|
||||
* Returns an InputHandle_t for the controller that can be used with Steam Input API:
|
||||
* https://partner.steamgames.com/doc/api/ISteamInput
|
||||
*
|
||||
* \param gamecontroller the game controller object to query.
|
||||
* \returns the gamepad handle, or 0 if unavailable.
|
||||
@@ -555,7 +542,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameControll
|
||||
* Check if a controller has been opened and is currently connected.
|
||||
*
|
||||
* \param gamecontroller a game controller identifier previously returned by
|
||||
* SDL_GameControllerOpen().
|
||||
* SDL_GameControllerOpen()
|
||||
* \returns SDL_TRUE if the controller has been opened and is currently
|
||||
* connected, or SDL_FALSE if not.
|
||||
*
|
||||
@@ -580,7 +567,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameControlle
|
||||
* cause SDL to crash.
|
||||
*
|
||||
* \param gamecontroller the game controller object that you want to get a
|
||||
* joystick from.
|
||||
* joystick from
|
||||
* \returns a SDL_Joystick object; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -597,7 +584,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameCont
|
||||
* Any number can be passed to SDL_GameControllerEventState(), but only -1, 0,
|
||||
* and 1 will have any effect. Other numbers will just be returned.
|
||||
*
|
||||
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`.
|
||||
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
|
||||
* \returns the same value passed to the function, with exception to -1
|
||||
* (SDL_QUERY), which will return the current state.
|
||||
*
|
||||
@@ -620,19 +607,17 @@ 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.
|
||||
* 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 (released) to SDL_JOYSTICK_AXIS_MAX (fully
|
||||
* pressed) when reported by SDL_GameControllerGetAxis(). Note that this is
|
||||
* not the same range that will be reported by the lower-level
|
||||
* SDL_GetJoystickAxis().
|
||||
* Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX
|
||||
* (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the
|
||||
* same range that will be reported by the lower-level SDL_GetJoystickAxis().
|
||||
*/
|
||||
typedef enum SDL_GameControllerAxis
|
||||
typedef enum
|
||||
{
|
||||
SDL_CONTROLLER_AXIS_INVALID = -1,
|
||||
SDL_CONTROLLER_AXIS_LEFTX,
|
||||
@@ -656,7 +641,7 @@ typedef enum SDL_GameControllerAxis
|
||||
* `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`,
|
||||
* respectively.
|
||||
*
|
||||
* \param str string representing a SDL_GameController axis.
|
||||
* \param str string representing a SDL_GameController axis
|
||||
* \returns the SDL_GameControllerAxis enum corresponding to the input string,
|
||||
* or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
|
||||
*
|
||||
@@ -671,7 +656,7 @@ extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromStri
|
||||
*
|
||||
* The caller should not SDL_free() the returned string.
|
||||
*
|
||||
* \param axis an enum value for a given SDL_GameControllerAxis.
|
||||
* \param axis an enum value for a given SDL_GameControllerAxis
|
||||
* \returns a string for the given axis, or NULL if an invalid axis is
|
||||
* specified. The string returned is of the format used by
|
||||
* SDL_GameController mapping strings.
|
||||
@@ -685,8 +670,8 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameC
|
||||
/**
|
||||
* Get the SDL joystick layer binding for a controller axis mapping.
|
||||
*
|
||||
* \param gamecontroller a game controller.
|
||||
* \param axis an axis enum value (one of the SDL_GameControllerAxis values).
|
||||
* \param gamecontroller a game controller
|
||||
* \param axis an axis enum value (one of the SDL_GameControllerAxis values)
|
||||
* \returns a SDL_GameControllerButtonBind describing the bind. On failure
|
||||
* (like the given Controller axis doesn't exist on the device), its
|
||||
* `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
|
||||
@@ -705,8 +690,8 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
|
||||
* This merely reports whether the controller's mapping defined this axis, as
|
||||
* that is all the information SDL has about the physical device.
|
||||
*
|
||||
* \param gamecontroller a game controller.
|
||||
* \param axis an axis enum value (an SDL_GameControllerAxis value).
|
||||
* \param gamecontroller a game controller
|
||||
* \param axis an axis enum value (an SDL_GameControllerAxis value)
|
||||
* \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -719,15 +704,16 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController
|
||||
*
|
||||
* The axis indices start at index 0.
|
||||
*
|
||||
* For thumbsticks, the state is a value ranging from -32768 (up/left) to
|
||||
* 32767 (down/right).
|
||||
* For thumbsticks, the state is a value ranging from -32768 (up/left)
|
||||
* to 32767 (down/right).
|
||||
*
|
||||
* Triggers range from 0 when released to 32767 when fully pressed, and never
|
||||
* return a negative value. Note that this differs from the value reported by
|
||||
* the lower-level SDL_JoystickGetAxis(), which normally uses the full range.
|
||||
* Triggers range from 0 when released to 32767 when fully pressed, and
|
||||
* never return a negative value. Note that this differs from the value
|
||||
* reported by the lower-level SDL_GetJoystickAxis(), which normally uses
|
||||
* the full range.
|
||||
*
|
||||
* \param gamecontroller a game controller.
|
||||
* \param axis an axis index (one of the SDL_GameControllerAxis values).
|
||||
* \param gamecontroller a game controller
|
||||
* \param axis an axis index (one of the SDL_GameControllerAxis values)
|
||||
* \returns axis state (including 0) on success or 0 (also) on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -739,9 +725,9 @@ extern DECLSPEC Sint16 SDLCALL
|
||||
SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
|
||||
|
||||
/**
|
||||
* The list of buttons available from a controller
|
||||
* The list of buttons available from a controller
|
||||
*/
|
||||
typedef enum SDL_GameControllerButton
|
||||
typedef enum
|
||||
{
|
||||
SDL_CONTROLLER_BUTTON_INVALID = -1,
|
||||
SDL_CONTROLLER_BUTTON_A,
|
||||
@@ -776,7 +762,7 @@ typedef enum SDL_GameControllerButton
|
||||
* SDL_GameController mapping. You do not normally need to call this function
|
||||
* unless you are parsing SDL_GameController mappings in your own code.
|
||||
*
|
||||
* \param str string representing a SDL_GameController axis.
|
||||
* \param str string representing a SDL_GameController axis
|
||||
* \returns the SDL_GameControllerButton enum corresponding to the input
|
||||
* string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
|
||||
*
|
||||
@@ -789,7 +775,7 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom
|
||||
*
|
||||
* The caller should not SDL_free() the returned string.
|
||||
*
|
||||
* \param button an enum value for a given SDL_GameControllerButton.
|
||||
* \param button an enum value for a given SDL_GameControllerButton
|
||||
* \returns a string for the given button, or NULL if an invalid button is
|
||||
* specified. The string returned is of the format used by
|
||||
* SDL_GameController mapping strings.
|
||||
@@ -803,8 +789,8 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_Gam
|
||||
/**
|
||||
* Get the SDL joystick layer binding for a controller button mapping.
|
||||
*
|
||||
* \param gamecontroller a game controller.
|
||||
* \param button an button enum value (an SDL_GameControllerButton value).
|
||||
* \param gamecontroller a game controller
|
||||
* \param button an button enum value (an SDL_GameControllerButton value)
|
||||
* \returns a SDL_GameControllerButtonBind describing the bind. On failure
|
||||
* (like the given Controller button doesn't exist on the device),
|
||||
* its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
|
||||
@@ -823,8 +809,8 @@ SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
|
||||
* This merely reports whether the controller's mapping defined this button,
|
||||
* as that is all the information SDL has about the physical device.
|
||||
*
|
||||
* \param gamecontroller a game controller.
|
||||
* \param button a button enum value (an SDL_GameControllerButton value).
|
||||
* \param gamecontroller a game controller
|
||||
* \param button a button enum value (an SDL_GameControllerButton value)
|
||||
* \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -835,8 +821,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController
|
||||
/**
|
||||
* Get the current state of a button on a game controller.
|
||||
*
|
||||
* \param gamecontroller a game controller.
|
||||
* \param button a button index (one of the SDL_GameControllerButton values).
|
||||
* \param gamecontroller a game controller
|
||||
* \param button a button index (one of the SDL_GameControllerButton values)
|
||||
* \returns 1 for pressed state or 0 for not pressed state or error; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -872,8 +858,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameControll
|
||||
/**
|
||||
* Return whether a game controller has a particular sensor.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param type The type of sensor to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \param type The type of sensor to query
|
||||
* \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -883,9 +869,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController
|
||||
/**
|
||||
* Set whether data reporting for a game controller sensor is enabled.
|
||||
*
|
||||
* \param gamecontroller The controller to update.
|
||||
* \param type The type of sensor to enable/disable.
|
||||
* \param enabled Whether data reporting should be enabled.
|
||||
* \param gamecontroller The controller to update
|
||||
* \param type The type of sensor to enable/disable
|
||||
* \param enabled Whether data reporting should be enabled
|
||||
* \returns 0 or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -895,8 +881,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameControlle
|
||||
/**
|
||||
* Query whether sensor data reporting is enabled for a game controller.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param type The type of sensor to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \param type The type of sensor to query
|
||||
* \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -907,8 +893,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameContr
|
||||
* Get the data rate (number of events per second) of a game controller
|
||||
* sensor.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param type The type of sensor to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \param type The type of sensor to query
|
||||
* \return the data rate, or 0.0f if the data rate is not available.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
@@ -921,10 +907,10 @@ extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameContro
|
||||
* The number of values and interpretation of the data is sensor dependent.
|
||||
* See SDL_sensor.h for the details for each type of sensor.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param type The type of sensor to query.
|
||||
* \param data A pointer filled with the current sensor state.
|
||||
* \param num_values The number of values to write to data.
|
||||
* \param gamecontroller The controller to query
|
||||
* \param type The type of sensor to query
|
||||
* \param data A pointer filled with the current sensor state
|
||||
* \param num_values The number of values to write to data
|
||||
* \return 0 or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -938,12 +924,12 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *
|
||||
* The number of values and interpretation of the data is sensor dependent.
|
||||
* See SDL_sensor.h for the details for each type of sensor.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param type The type of sensor to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \param type The type of sensor to query
|
||||
* \param timestamp A pointer filled with the timestamp in microseconds of the
|
||||
* current sensor reading if available, or 0 if not.
|
||||
* \param data A pointer filled with the current sensor state.
|
||||
* \param num_values The number of values to write to data.
|
||||
* current sensor reading if available, or 0 if not
|
||||
* \param data A pointer filled with the current sensor state
|
||||
* \param num_values The number of values to write to data
|
||||
* \return 0 or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.26.0.
|
||||
@@ -956,13 +942,13 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_Gam
|
||||
* Each call to this function cancels any previous rumble effect, and calling
|
||||
* it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* \param gamecontroller The controller to vibrate.
|
||||
* \param gamecontroller The controller to vibrate
|
||||
* \param low_frequency_rumble The intensity of the low frequency (left)
|
||||
* rumble motor, from 0 to 0xFFFF.
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
* \param high_frequency_rumble The intensity of the high frequency (right)
|
||||
* rumble motor, from 0 to 0xFFFF.
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds.
|
||||
* \returns 0, or -1 if rumble isn't supported on this controller.
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
||||
* \returns 0, or -1 if rumble isn't supported on this controller
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*
|
||||
@@ -981,13 +967,13 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecon
|
||||
* want the (more common) whole-controller rumble, use
|
||||
* SDL_GameControllerRumble() instead.
|
||||
*
|
||||
* \param gamecontroller The controller to vibrate.
|
||||
* \param gamecontroller The controller to vibrate
|
||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||
* to 0xFFFF.
|
||||
* to 0xFFFF
|
||||
* \param right_rumble The intensity of the right trigger rumble motor, from 0
|
||||
* to 0xFFFF.
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds.
|
||||
* \returns 0, or -1 if trigger rumble isn't supported on this controller.
|
||||
* to 0xFFFF
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
||||
* \returns 0, or -1 if trigger rumble isn't supported on this controller
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*
|
||||
@@ -998,9 +984,9 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController
|
||||
/**
|
||||
* Query whether a game controller has an LED.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this controller does not have a
|
||||
* modifiable LED.
|
||||
* modifiable LED
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
@@ -1009,9 +995,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *ga
|
||||
/**
|
||||
* Query whether a game controller has rumble support.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble
|
||||
* support.
|
||||
* support
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
@@ -1022,9 +1008,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController
|
||||
/**
|
||||
* Query whether a game controller has rumble support on triggers.
|
||||
*
|
||||
* \param gamecontroller The controller to query.
|
||||
* \param gamecontroller The controller to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger
|
||||
* rumble support.
|
||||
* rumble support
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
@@ -1035,11 +1021,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameCon
|
||||
/**
|
||||
* Update a game controller's LED color.
|
||||
*
|
||||
* \param gamecontroller The controller to update.
|
||||
* \param red The intensity of the red LED.
|
||||
* \param green The intensity of the green LED.
|
||||
* \param blue The intensity of the blue LED.
|
||||
* \returns 0, or -1 if this controller does not have a modifiable LED.
|
||||
* \param gamecontroller The controller to update
|
||||
* \param red The intensity of the red LED
|
||||
* \param green The intensity of the green LED
|
||||
* \param blue The intensity of the blue LED
|
||||
* \returns 0, or -1 if this controller does not have a modifiable LED
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
@@ -1048,11 +1034,11 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecon
|
||||
/**
|
||||
* Send a controller specific effect packet
|
||||
*
|
||||
* \param gamecontroller The controller to affect.
|
||||
* \param data The data to send to the controller.
|
||||
* \param size The size of the data to send to the controller.
|
||||
* \param gamecontroller The controller to affect
|
||||
* \param data The data to send to the controller
|
||||
* \param size The size of the data to send to the controller
|
||||
* \returns 0, or -1 if this controller or driver doesn't support effect
|
||||
* packets.
|
||||
* packets
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
*/
|
||||
@@ -1062,7 +1048,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gam
|
||||
* Close a game controller previously opened with SDL_GameControllerOpen().
|
||||
*
|
||||
* \param gamecontroller a game controller identifier previously returned by
|
||||
* SDL_GameControllerOpen().
|
||||
* SDL_GameControllerOpen()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1074,9 +1060,9 @@ extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecon
|
||||
* Return the sfSymbolsName for a given button on a game controller on Apple
|
||||
* platforms.
|
||||
*
|
||||
* \param gamecontroller the controller to query.
|
||||
* \param button a button on the game controller.
|
||||
* \returns the sfSymbolsName or NULL if the name can't be found.
|
||||
* \param gamecontroller the controller to query
|
||||
* \param button a button on the game controller
|
||||
* \returns the sfSymbolsName or NULL if the name can't be found
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
@@ -1088,9 +1074,9 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForBu
|
||||
* Return the sfSymbolsName for a given axis on a game controller on Apple
|
||||
* platforms.
|
||||
*
|
||||
* \param gamecontroller the controller to query.
|
||||
* \param axis an axis on the game controller.
|
||||
* \returns the sfSymbolsName or NULL if the name can't be found.
|
||||
* \param gamecontroller the controller to query
|
||||
* \param axis an axis on the game controller
|
||||
* \returns the sfSymbolsName or NULL if the name can't be found
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryGesture
|
||||
* \file SDL_gesture.h
|
||||
*
|
||||
* Include file for SDL gesture event handling.
|
||||
* Include file for SDL gesture event handling.
|
||||
*/
|
||||
|
||||
#ifndef SDL_gesture_h_
|
||||
@@ -51,7 +51,7 @@ typedef Sint64 SDL_GestureID;
|
||||
* If the parameter `touchId` is -1 (i.e., all devices), this function will
|
||||
* always return 1, regardless of whether there actually are any devices.
|
||||
*
|
||||
* \param touchId the touch device id, or -1 for all touch devices.
|
||||
* \param touchId the touch device id, or -1 for all touch devices
|
||||
* \returns 1 on success or 0 if the specified device could not be found.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -64,7 +64,7 @@ extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
|
||||
/**
|
||||
* Save all currently loaded Dollar Gesture templates.
|
||||
*
|
||||
* \param dst a SDL_RWops to save to.
|
||||
* \param dst a SDL_RWops to save to
|
||||
* \returns the number of saved templates on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -78,8 +78,8 @@ extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
|
||||
/**
|
||||
* Save a currently loaded Dollar Gesture template.
|
||||
*
|
||||
* \param gestureId a gesture id.
|
||||
* \param dst a SDL_RWops to save to.
|
||||
* \param gestureId a gesture id
|
||||
* \param dst a SDL_RWops to save to
|
||||
* \returns 1 on success or 0 on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
@@ -94,8 +94,8 @@ extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_R
|
||||
/**
|
||||
* Load Dollar Gesture templates from a file.
|
||||
*
|
||||
* \param touchId a touch id.
|
||||
* \param src a SDL_RWops to load from.
|
||||
* \param touchId a touch id
|
||||
* \param src a SDL_RWops to load from
|
||||
* \returns the number of loaded templates on success or a negative error code
|
||||
* (or 0) on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -19,13 +19,10 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: GUID */
|
||||
|
||||
/**
|
||||
* # CategoryGUID
|
||||
* \file SDL_guid.h
|
||||
*
|
||||
* A GUID is a 128-bit value that represents something that is uniquely
|
||||
* identifiable by this value: "globally unique."
|
||||
* Include file for handling ::SDL_GUID values.
|
||||
*/
|
||||
|
||||
#ifndef SDL_guid_h_
|
||||
@@ -41,38 +38,34 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* An SDL_GUID is a 128-bit identifier.
|
||||
* An SDL_GUID is a 128-bit identifier for an input device that
|
||||
* identifies that device across runs of SDL programs on the same
|
||||
* platform. If the device is detached and then re-attached to a
|
||||
* different port, or if the base system is rebooted, the device
|
||||
* should still report the same GUID.
|
||||
*
|
||||
* This is an acronym for "Globally Unique ID."
|
||||
* GUIDs are as precise as possible but are not guaranteed to
|
||||
* distinguish physically distinct but equivalent devices. For
|
||||
* example, two game controllers from the same vendor with the same
|
||||
* product ID and revision may have the same GUID.
|
||||
*
|
||||
* While a GUID can be used to assign a unique value to almost anything, in
|
||||
* SDL these are largely used to identify input devices across runs of SDL
|
||||
* programs on the same platform.If the device is detached and then
|
||||
* re-attached to a different port, or if the base system is rebooted, the
|
||||
* device should still report the same GUID.
|
||||
*
|
||||
* GUIDs are as precise as possible but are not guaranteed to distinguish
|
||||
* physically distinct but equivalent devices. For example, two game
|
||||
* controllers from the same vendor with the same product ID and revision may
|
||||
* have the same GUID.
|
||||
*
|
||||
* GUIDs may be platform-dependent (i.e., the same device may report different
|
||||
* GUIDs on different operating systems).
|
||||
* GUIDs may be platform-dependent (i.e., the same device may report
|
||||
* different GUIDs on different operating systems).
|
||||
*/
|
||||
typedef struct SDL_GUID {
|
||||
typedef struct {
|
||||
Uint8 data[16];
|
||||
} SDL_GUID;
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Get an ASCII string representation for a given SDL_GUID.
|
||||
* Get an ASCII string representation for a given ::SDL_GUID.
|
||||
*
|
||||
* You should supply at least 33 bytes for pszGUID.
|
||||
*
|
||||
* \param guid the SDL_GUID you wish to convert to string.
|
||||
* \param pszGUID buffer in which to write the ASCII string.
|
||||
* \param cbGUID the size of pszGUID.
|
||||
* \param guid the ::SDL_GUID you wish to convert to string
|
||||
* \param pszGUID buffer in which to write the ASCII string
|
||||
* \param cbGUID the size of pszGUID
|
||||
*
|
||||
* \since This function is available since SDL 2.24.0.
|
||||
*
|
||||
@@ -81,14 +74,14 @@ typedef struct SDL_GUID {
|
||||
extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
||||
|
||||
/**
|
||||
* Convert a GUID string into a SDL_GUID structure.
|
||||
* Convert a GUID string into a ::SDL_GUID structure.
|
||||
*
|
||||
* Performs no error checking. If this function is given a string containing
|
||||
* an invalid GUID, the function will silently succeed, but the GUID generated
|
||||
* will not be useful.
|
||||
*
|
||||
* \param pchGUID string containing an ASCII representation of a GUID.
|
||||
* \returns a SDL_GUID structure.
|
||||
* \param pchGUID string containing an ASCII representation of a GUID
|
||||
* \returns a ::SDL_GUID structure.
|
||||
*
|
||||
* \since This function is available since SDL 2.24.0.
|
||||
*
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -19,35 +19,44 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: HIDAPI */
|
||||
|
||||
/**
|
||||
* # CategoryHIDAPI
|
||||
* \file SDL_hidapi.h
|
||||
*
|
||||
* Header file for SDL HIDAPI functions.
|
||||
* Header file for SDL HIDAPI functions.
|
||||
*
|
||||
* This is an adaptation of the original HIDAPI interface by Alan Ott, and
|
||||
* includes source code licensed under the following license:
|
||||
* This is an adaptation of the original HIDAPI interface by Alan Ott,
|
||||
* and includes source code licensed under the following BSD license:
|
||||
*
|
||||
* ```
|
||||
* HIDAPI - Multi-Platform library for
|
||||
* communication with HID devices.
|
||||
*
|
||||
* Copyright 2009, Alan Ott, Signal 11 Software.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This software may be used by anyone for any reason so
|
||||
* long as the copyright notice in the source files
|
||||
* remains intact.
|
||||
* ```
|
||||
*
|
||||
* (Note that this license is the same as item three of SDL's zlib license, so
|
||||
* it adds no new requirements on the user.)
|
||||
Copyright (c) 2010, Alan Ott, Signal 11 Software
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Signal 11 Software nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* If you would like a version of SDL without this code, you can build SDL
|
||||
* with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for
|
||||
* example on iOS or tvOS to avoid a dependency on the CoreBluetooth
|
||||
* framework.
|
||||
* with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example
|
||||
* on iOS or tvOS to avoid a dependency on the CoreBluetooth framework.
|
||||
*/
|
||||
|
||||
#ifndef SDL_hidapi_h_
|
||||
@@ -62,15 +71,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A handle representing an open HID device
|
||||
* \brief A handle representing an open HID device
|
||||
*/
|
||||
struct SDL_hid_device_;
|
||||
typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
|
||||
|
||||
/** hidapi info structure */
|
||||
|
||||
/**
|
||||
* Information about a connected HID device
|
||||
* \brief Information about a connected HID device
|
||||
*/
|
||||
typedef struct SDL_hid_device_info
|
||||
{
|
||||
@@ -226,13 +234,13 @@ extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id,
|
||||
* The path name be determined by calling SDL_hid_enumerate(), or a
|
||||
* platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
|
||||
*
|
||||
* \param path The path name of the device to open.
|
||||
* \param path The path name of the device to open
|
||||
* \returns a pointer to a SDL_hid_device object on success or NULL on
|
||||
* failure.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive);
|
||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
|
||||
|
||||
/**
|
||||
* Write an Output report to a HID device.
|
||||
@@ -426,7 +434,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int
|
||||
/**
|
||||
* Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers
|
||||
*
|
||||
* \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan.
|
||||
* \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
|
3110
include/SDL_hints.h
3110
include/SDL_hints.h
File diff suppressed because it is too large
Load Diff
@@ -20,26 +20,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryJoystick
|
||||
* \file SDL_joystick.h
|
||||
*
|
||||
* 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 behind a
|
||||
* device_index changing as joysticks are plugged and unplugged.
|
||||
* 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.
|
||||
*
|
||||
* The term "instance_id" is the current instantiation of a joystick device in
|
||||
* the system, if the joystick is removed and then re-inserted then it will
|
||||
* get a new instance_id, instance_id's are monotonically increasing
|
||||
* identifiers of a joystick plugged in.
|
||||
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
||||
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
|
||||
*
|
||||
* The term "player_index" is the number assigned to a player on a specific
|
||||
* controller. For XInput controllers this returns the XInput user index. Many
|
||||
* joysticks will not be able to supply this information.
|
||||
* controller. For XInput controllers this returns the XInput user index.
|
||||
* Many joysticks will not be able to supply this information.
|
||||
*
|
||||
* The term JoystickGUID is a stable 128-bit identifier for a joystick device
|
||||
* that does not change over time, it identifies class of the device (a X360
|
||||
* wired controller for example). This identifier is platform dependent.
|
||||
* The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
|
||||
* the device (a X360 wired controller for example). This identifier is platform dependent.
|
||||
*/
|
||||
|
||||
#ifndef SDL_joystick_h_
|
||||
@@ -60,7 +56,7 @@ extern "C" {
|
||||
* \file SDL_joystick.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* for joysticks, and load appropriate drivers.
|
||||
*
|
||||
* If you would like to receive joystick updates while the application
|
||||
@@ -77,21 +73,15 @@ extern SDL_mutex *SDL_joystick_lock;
|
||||
struct _SDL_Joystick;
|
||||
typedef struct _SDL_Joystick SDL_Joystick;
|
||||
|
||||
/**
|
||||
* A structure that encodes the stable unique id for a joystick device.
|
||||
*
|
||||
* This is just a standard SDL_GUID by a different name.
|
||||
*/
|
||||
/* A structure that encodes the stable unique id for a joystick device */
|
||||
typedef SDL_GUID 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.
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
||||
*/
|
||||
typedef Sint32 SDL_JoystickID;
|
||||
|
||||
@@ -182,7 +172,7 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system).
|
||||
* on the system)
|
||||
* \returns the name of the selected joystick. If no name can be found, this
|
||||
* function returns NULL; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -199,7 +189,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system).
|
||||
* on the system)
|
||||
* \returns the path of the selected joystick. If no path can be found, this
|
||||
* function returns NULL; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -225,9 +215,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
|
||||
* This function can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system.
|
||||
* on the system
|
||||
* \returns the GUID of the selected joystick. If called on an invalid index,
|
||||
* this function returns a zero GUID.
|
||||
* this function returns a zero GUID
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -243,9 +233,9 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_in
|
||||
* available this function returns 0.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system.
|
||||
* on the system
|
||||
* \returns the USB vendor ID of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero.
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
@@ -258,9 +248,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
|
||||
* available this function returns 0.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system.
|
||||
* on the system
|
||||
* \returns the USB product ID of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero.
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
@@ -273,9 +263,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
|
||||
* isn't available this function returns 0.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system.
|
||||
* on the system
|
||||
* \returns the product version of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero.
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
@@ -287,9 +277,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_in
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system.
|
||||
* on the system
|
||||
* \returns the SDL_JoystickType of the selected joystick. If called on an
|
||||
* invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`.
|
||||
* invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
@@ -301,7 +291,7 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system.
|
||||
* on the system
|
||||
* \returns the instance id of the selected joystick. If called on an invalid
|
||||
* index, this function returns -1.
|
||||
*
|
||||
@@ -320,7 +310,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic
|
||||
* The joystick subsystem must be initialized before a joystick can be opened
|
||||
* for use.
|
||||
*
|
||||
* \param device_index the index of the joystick to query.
|
||||
* \param device_index the index of the joystick to query
|
||||
* \returns a joystick identifier or NULL if an error occurred; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -334,7 +324,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
|
||||
/**
|
||||
* Get the SDL_Joystick associated with an instance id.
|
||||
*
|
||||
* \param instance_id the instance id to get the SDL_Joystick for.
|
||||
* \param instance_id the instance id to get the SDL_Joystick for
|
||||
* \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@@ -345,7 +335,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
|
||||
/**
|
||||
* Get the SDL_Joystick associated with a player index.
|
||||
*
|
||||
* \param player_index the player index to get the SDL_Joystick for.
|
||||
* \param player_index the player index to get the SDL_Joystick for
|
||||
* \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@@ -368,10 +358,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
|
||||
/**
|
||||
* The structure that defines an extended virtual joystick description
|
||||
*
|
||||
* The caller must zero the structure and then initialize the version with
|
||||
* `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to
|
||||
* SDL_JoystickAttachVirtualEx() All other elements of this structure are
|
||||
* optional and can be left 0.
|
||||
* The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx()
|
||||
* All other elements of this structure are optional and can be left 0.
|
||||
*
|
||||
* \sa SDL_JoystickAttachVirtualEx
|
||||
*/
|
||||
@@ -402,7 +390,7 @@ typedef struct SDL_VirtualJoystickDesc
|
||||
} SDL_VirtualJoystickDesc;
|
||||
|
||||
/**
|
||||
* The current version of the SDL_VirtualJoystickDesc structure
|
||||
* \brief The current version of the SDL_VirtualJoystickDesc structure
|
||||
*/
|
||||
#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1
|
||||
|
||||
@@ -419,7 +407,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystic
|
||||
* Detach a virtual joystick.
|
||||
*
|
||||
* \param device_index a value previously returned from
|
||||
* SDL_JoystickAttachVirtual().
|
||||
* SDL_JoystickAttachVirtual()
|
||||
* \returns 0 on success, or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -497,7 +485,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the name of the selected joystick. If no name can be found, this
|
||||
* function returns NULL; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -511,7 +499,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Get the implementation dependent path of a joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the path of the selected joystick. If no path can be found, this
|
||||
* function returns NULL; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -527,7 +515,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick);
|
||||
* For XInput controllers this returns the XInput user index. Many joysticks
|
||||
* will not be able to supply this information.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the player index, or -1 if it's not available.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -537,7 +525,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Set the player index of an opened joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \param player_index Player index to assign to this joystick, or -1 to clear
|
||||
* the player index and turn off player LEDs.
|
||||
*
|
||||
@@ -550,7 +538,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick,
|
||||
*
|
||||
* This function requires an open joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the GUID of the given joystick. If called on an invalid index,
|
||||
* this function returns a zero GUID; call SDL_GetError() for more
|
||||
* information.
|
||||
@@ -567,7 +555,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joyst
|
||||
*
|
||||
* If the vendor ID isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
@@ -579,7 +567,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
|
||||
*
|
||||
* If the product ID isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the USB product ID of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
@@ -591,7 +579,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
|
||||
*
|
||||
* If the product version isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the product version of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
@@ -603,7 +591,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joyst
|
||||
*
|
||||
* If the firmware version isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the firmware version of the selected joystick, or 0 if
|
||||
* unavailable.
|
||||
*
|
||||
@@ -616,7 +604,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joys
|
||||
*
|
||||
* Returns the serial number of the joystick, or NULL if it is not available.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the serial number of the selected joystick, or NULL if
|
||||
* unavailable.
|
||||
*
|
||||
@@ -627,7 +615,7 @@ extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystic
|
||||
/**
|
||||
* Get the type of an opened joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the SDL_JoystickType of the selected joystick.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
@@ -639,9 +627,9 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joyst
|
||||
*
|
||||
* You should supply at least 33 bytes for pszGUID.
|
||||
*
|
||||
* \param guid the SDL_JoystickGUID you wish to convert to string.
|
||||
* \param pszGUID buffer in which to write the ASCII string.
|
||||
* \param cbGUID the size of pszGUID.
|
||||
* \param guid the SDL_JoystickGUID you wish to convert to string
|
||||
* \param pszGUID buffer in which to write the ASCII string
|
||||
* \param cbGUID the size of pszGUID
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -658,7 +646,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
|
||||
* an invalid GUID, the function will silently succeed, but the GUID generated
|
||||
* will not be useful.
|
||||
*
|
||||
* \param pchGUID string containing an ASCII representation of a GUID.
|
||||
* \param pchGUID string containing an ASCII representation of a GUID
|
||||
* \returns a SDL_JoystickGUID structure.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -670,15 +658,15 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha
|
||||
/**
|
||||
* Get the device information encoded in a SDL_JoystickGUID structure
|
||||
*
|
||||
* \param guid the SDL_JoystickGUID you wish to get info about.
|
||||
* \param guid the SDL_JoystickGUID you wish to get info about
|
||||
* \param vendor A pointer filled in with the device VID, or 0 if not
|
||||
* available.
|
||||
* available
|
||||
* \param product A pointer filled in with the device PID, or 0 if not
|
||||
* available.
|
||||
* available
|
||||
* \param version A pointer filled in with the device version, or 0 if not
|
||||
* available.
|
||||
* available
|
||||
* \param crc16 A pointer filled in with a CRC used to distinguish different
|
||||
* products with the same VID/PID, or 0 if not available.
|
||||
* products with the same VID/PID, or 0 if not available
|
||||
*
|
||||
* \since This function is available since SDL 2.26.0.
|
||||
*
|
||||
@@ -689,7 +677,7 @@ extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint
|
||||
/**
|
||||
* Get the status of a specified joystick.
|
||||
*
|
||||
* \param joystick the joystick to query.
|
||||
* \param joystick the joystick to query
|
||||
* \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -703,7 +691,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick)
|
||||
/**
|
||||
* Get the instance ID of an opened joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the instance ID of the specified joystick on success or a negative
|
||||
* error code on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -720,7 +708,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joys
|
||||
* separate buttons or a POV hat, and not axes, but all of this is up to the
|
||||
* device and platform.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of axis controls/number of axes on success or a
|
||||
* negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
@@ -740,7 +728,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
|
||||
*
|
||||
* Most joysticks do not have trackballs.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of trackballs on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -753,7 +741,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Get the number of POV hats on a joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of POV hats on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -767,7 +755,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Get the number of buttons on a joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of buttons on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -806,10 +794,10 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
||||
* `SDL_ENABLE`, this function accepts any value, with any non-zero value that
|
||||
* isn't `SDL_QUERY` being treated as `SDL_ENABLE`.
|
||||
*
|
||||
* If SDL was built with events disabled (extremely uncommon!), this will do
|
||||
* nothing and always return `SDL_IGNORE`.
|
||||
* If SDL was built with events disabled (extremely uncommon!), this will
|
||||
* do nothing and always return `SDL_IGNORE`.
|
||||
*
|
||||
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`.
|
||||
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
|
||||
* \returns If `state` is `SDL_QUERY` then the current state is returned,
|
||||
* otherwise `state` is returned (even if it was not one of the
|
||||
* allowed values).
|
||||
@@ -820,7 +808,6 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||
|
||||
/* Limits for joystick axes... */
|
||||
#define SDL_JOYSTICK_AXIS_MAX 32767
|
||||
#define SDL_JOYSTICK_AXIS_MIN -32768
|
||||
|
||||
@@ -837,8 +824,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||
* 32767) representing the current position of the axis. It may be necessary
|
||||
* to impose certain tolerances on these values to account for jitter.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param axis the axis to query; the axis indices start at index 0.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param axis the axis to query; the axis indices start at index 0
|
||||
* \returns a 16-bit signed integer representing the current position of the
|
||||
* axis or 0 on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -856,8 +843,8 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
|
||||
*
|
||||
* The axis indices start at index 0.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param axis the axis to query; the axis indices start at index 0.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param axis the axis to query; the axis indices start at index 0
|
||||
* \param state Upon return, the initial value is supplied here.
|
||||
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
|
||||
*
|
||||
@@ -896,8 +883,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j
|
||||
* - `SDL_HAT_LEFTUP`
|
||||
* - `SDL_HAT_LEFTDOWN`
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param hat the hat index to get the state from; indices start at index 0.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param hat the hat index to get the state from; indices start at index 0
|
||||
* \returns the current hat position.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -915,10 +902,10 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
|
||||
*
|
||||
* Most joysticks do not have trackballs.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to query.
|
||||
* \param ball the ball index to query; ball indices start at index 0.
|
||||
* \param dx stores the difference in the x axis position since the last poll.
|
||||
* \param dy stores the difference in the y axis position since the last poll.
|
||||
* \param joystick the SDL_Joystick to query
|
||||
* \param ball the ball index to query; ball indices start at index 0
|
||||
* \param dx stores the difference in the x axis position since the last poll
|
||||
* \param dy stores the difference in the y axis position since the last poll
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -932,9 +919,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
|
||||
/**
|
||||
* Get the current state of a button on a joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param button the button index to get the state from; indices start at
|
||||
* index 0.
|
||||
* index 0
|
||||
* \returns 1 if the specified button is pressed, 0 otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -950,13 +937,13 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
|
||||
* Each call to this function cancels any previous rumble effect, and calling
|
||||
* it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* \param joystick The joystick to vibrate.
|
||||
* \param joystick The joystick to vibrate
|
||||
* \param low_frequency_rumble The intensity of the low frequency (left)
|
||||
* rumble motor, from 0 to 0xFFFF.
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
* \param high_frequency_rumble The intensity of the high frequency (right)
|
||||
* rumble motor, from 0 to 0xFFFF.
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds.
|
||||
* \returns 0, or -1 if rumble isn't supported on this joystick.
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
||||
* \returns 0, or -1 if rumble isn't supported on this joystick
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*
|
||||
@@ -975,13 +962,13 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo
|
||||
* want the (more common) whole-controller rumble, use SDL_JoystickRumble()
|
||||
* instead.
|
||||
*
|
||||
* \param joystick The joystick to vibrate.
|
||||
* \param joystick The joystick to vibrate
|
||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||
* to 0xFFFF.
|
||||
* to 0xFFFF
|
||||
* \param right_rumble The intensity of the right trigger rumble motor, from 0
|
||||
* to 0xFFFF.
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds.
|
||||
* \returns 0, or -1 if trigger rumble isn't supported on this joystick.
|
||||
* to 0xFFFF
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
||||
* \returns 0, or -1 if trigger rumble isn't supported on this joystick
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*
|
||||
@@ -995,7 +982,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, U
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* \param joystick The joystick to query.
|
||||
* \param joystick The joystick to query
|
||||
* \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -1005,7 +992,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Query whether a joystick has rumble support.
|
||||
*
|
||||
* \param joystick The joystick to query.
|
||||
* \param joystick The joystick to query
|
||||
* \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
@@ -1017,7 +1004,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Query whether a joystick has rumble support on triggers.
|
||||
*
|
||||
* \param joystick The joystick to query.
|
||||
* \param joystick The joystick to query
|
||||
* \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
@@ -1032,11 +1019,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joy
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* \param joystick The joystick to update.
|
||||
* \param red The intensity of the red LED.
|
||||
* \param green The intensity of the green LED.
|
||||
* \param blue The intensity of the blue LED.
|
||||
* \returns 0 on success, -1 if this joystick does not have a modifiable LED.
|
||||
* \param joystick The joystick to update
|
||||
* \param red The intensity of the red LED
|
||||
* \param green The intensity of the green LED
|
||||
* \param blue The intensity of the blue LED
|
||||
* \returns 0 on success, -1 if this joystick does not have a modifiable LED
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
@@ -1045,11 +1032,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red
|
||||
/**
|
||||
* Send a joystick specific effect packet
|
||||
*
|
||||
* \param joystick The joystick to affect.
|
||||
* \param data The data to send to the joystick.
|
||||
* \param size The size of the data to send to the joystick.
|
||||
* \returns 0, or -1 if this joystick or driver doesn't support effect
|
||||
* packets.
|
||||
* \param joystick The joystick to affect
|
||||
* \param data The data to send to the joystick
|
||||
* \param size The size of the data to send to the joystick
|
||||
* \returns 0, or -1 if this joystick or driver doesn't support effect packets
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
*/
|
||||
@@ -1058,7 +1044,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const
|
||||
/**
|
||||
* Close a joystick previously opened with SDL_JoystickOpen().
|
||||
*
|
||||
* \param joystick The joystick device to close.
|
||||
* \param joystick The joystick device to close
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -1069,9 +1055,9 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
|
||||
/**
|
||||
* Get the battery level of a joystick as SDL_JoystickPowerLevel.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to query.
|
||||
* \param joystick the SDL_Joystick to query
|
||||
* \returns the current battery level as SDL_JoystickPowerLevel on success or
|
||||
* `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown.
|
||||
* `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*/
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryKeyboard
|
||||
* \file SDL_keyboard.h
|
||||
*
|
||||
* Include file for SDL keyboard event handling
|
||||
* Include file for SDL keyboard event handling
|
||||
*/
|
||||
|
||||
#ifndef SDL_keyboard_h_
|
||||
@@ -40,16 +40,15 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The SDL keysym structure, used in key events.
|
||||
* \brief The SDL keysym structure, used in key events.
|
||||
*
|
||||
* If you are looking for translated character input, see the SDL_TEXTINPUT
|
||||
* event.
|
||||
* \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
|
||||
*/
|
||||
typedef struct SDL_Keysym
|
||||
{
|
||||
SDL_Scancode scancode; /**< SDL physical key code - see SDL_Scancode for details */
|
||||
SDL_Keycode sym; /**< SDL virtual key code - see SDL_Keycode for details */
|
||||
Uint16 mod; /**< current key modifiers - see SDL_Keymod for details */
|
||||
SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
|
||||
SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */
|
||||
Uint16 mod; /**< current key modifiers */
|
||||
Uint32 unused;
|
||||
} SDL_Keysym;
|
||||
|
||||
@@ -85,7 +84,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
||||
* Note: This function doesn't take into account whether shift has been
|
||||
* pressed or not.
|
||||
*
|
||||
* \param numkeys if non-NULL, receives the length of the returned array.
|
||||
* \param numkeys if non-NULL, receives the length of the returned array
|
||||
* \returns a pointer to an array of key states.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -130,7 +129,7 @@ extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
||||
* This does not change the keyboard state, only the key modifier flags that
|
||||
* SDL reports.
|
||||
*
|
||||
* \param modstate the desired SDL_Keymod for the keyboard.
|
||||
* \param modstate the desired SDL_Keymod for the keyboard
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -144,7 +143,7 @@ extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
||||
*
|
||||
* See SDL_Keycode for details.
|
||||
*
|
||||
* \param scancode the desired SDL_Scancode to query.
|
||||
* \param scancode the desired SDL_Scancode to query
|
||||
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -160,7 +159,7 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode
|
||||
*
|
||||
* See SDL_Scancode for details.
|
||||
*
|
||||
* \param key the desired SDL_Keycode to query.
|
||||
* \param key the desired SDL_Keycode to query
|
||||
* \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -184,7 +183,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
||||
* unsuitable for creating a stable cross-platform two-way mapping between
|
||||
* strings and scancodes.
|
||||
*
|
||||
* \param scancode the desired SDL_Scancode to query.
|
||||
* \param scancode the desired SDL_Scancode to query
|
||||
* \returns a pointer to the name for the scancode. If the scancode doesn't
|
||||
* have a name this function returns an empty string ("").
|
||||
*
|
||||
@@ -198,7 +197,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
||||
/**
|
||||
* Get a scancode from a human-readable name.
|
||||
*
|
||||
* \param name the human-readable scancode name.
|
||||
* \param name the human-readable scancode name
|
||||
* \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
|
||||
* recognized; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -215,7 +214,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
||||
*
|
||||
* See SDL_Scancode and SDL_Keycode for details.
|
||||
*
|
||||
* \param key the desired SDL_Keycode to query.
|
||||
* \param key the desired SDL_Keycode to query
|
||||
* \returns a pointer to a UTF-8 string that stays valid at least until the
|
||||
* next call to this function. If you need it around any longer, you
|
||||
* must copy it. If the key doesn't have a name, this function
|
||||
@@ -232,7 +231,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
||||
/**
|
||||
* Get a key code from a human-readable name.
|
||||
*
|
||||
* \param name the human-readable key name.
|
||||
* \param name the human-readable key name
|
||||
* \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -254,10 +253,6 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
||||
*
|
||||
* On some platforms using this function activates the screen keyboard.
|
||||
*
|
||||
* On desktop platforms, SDL_StartTextInput() is implicitly called on SDL
|
||||
* video subsystem initialization which will cause SDL_TextInputEvent and
|
||||
* SDL_TextEditingEvent to begin emitting.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_SetTextInputRect
|
||||
@@ -303,10 +298,9 @@ extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
|
||||
|
||||
/**
|
||||
* Set the rectangle used to type Unicode text inputs.
|
||||
*
|
||||
* Native input methods will place a window with word suggestions near it,
|
||||
* without covering the text being inputted.
|
||||
* Set the rectangle used to type Unicode text inputs. Native input methods
|
||||
* will place a window with word suggestions near it, without covering the
|
||||
* text being inputted.
|
||||
*
|
||||
* To start text input in a given location, this function is intended to be
|
||||
* called before SDL_StartTextInput, although some platforms support moving
|
||||
@@ -317,7 +311,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
|
||||
* any feedback.
|
||||
*
|
||||
* \param rect the SDL_Rect structure representing the rectangle to receive
|
||||
* text (ignored if NULL).
|
||||
* text (ignored if NULL)
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -341,7 +335,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
||||
/**
|
||||
* Check whether the screen keyboard is shown for given window.
|
||||
*
|
||||
* \param window the window for which screen keyboard should be queried.
|
||||
* \param window the window for which screen keyboard should be queried
|
||||
* \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryKeycode
|
||||
* \file SDL_keycode.h
|
||||
*
|
||||
* Defines constants which identify keyboard keys and modifiers.
|
||||
* Defines constants which identify keyboard keys and modifiers.
|
||||
*/
|
||||
|
||||
#ifndef SDL_keycode_h_
|
||||
@@ -32,28 +32,22 @@
|
||||
#include "SDL_scancode.h"
|
||||
|
||||
/**
|
||||
* The SDL virtual key representation.
|
||||
* \brief The SDL virtual key representation.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys using the current
|
||||
* layout of the keyboard. These values include Unicode values representing
|
||||
* the unmodified character that would be generated by pressing the key, or an
|
||||
* SDLK_* constant for those keys that do not generate characters.
|
||||
* Values of this type are used to represent keyboard keys using the current
|
||||
* layout of the keyboard. These values include Unicode values representing
|
||||
* the unmodified character that would be generated by pressing the key, or
|
||||
* 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 map
|
||||
* to SDLK_0...SDLK_9 on AZERTY layouts.
|
||||
*
|
||||
* The actual values that might be set for this type are listed in the
|
||||
* SDL_KeyCode (capital C) enumeration.
|
||||
* A special exception is the number keys at the top of the keyboard which
|
||||
* map to SDLK_0...SDLK_9 on AZERTY layouts.
|
||||
*/
|
||||
typedef Sint32 SDL_Keycode;
|
||||
|
||||
#define SDLK_SCANCODE_MASK (1<<30)
|
||||
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
|
||||
|
||||
/**
|
||||
* The possible values for keycodes.
|
||||
*/
|
||||
typedef enum SDL_KeyCode
|
||||
typedef enum
|
||||
{
|
||||
SDLK_UNKNOWN = 0,
|
||||
|
||||
@@ -333,9 +327,9 @@ typedef enum SDL_KeyCode
|
||||
} SDL_KeyCode;
|
||||
|
||||
/**
|
||||
* Enumeration of valid key mods (possibly OR'd together).
|
||||
* \brief Enumeration of valid key mods (possibly OR'd together).
|
||||
*/
|
||||
typedef enum SDL_Keymod
|
||||
typedef enum
|
||||
{
|
||||
KMOD_NONE = 0x0000,
|
||||
KMOD_LSHIFT = 0x0001,
|
||||
|
@@ -19,25 +19,23 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: LoadSO */
|
||||
|
||||
/**
|
||||
* # CategoryLoadSO
|
||||
* \file SDL_loadso.h
|
||||
*
|
||||
* System-dependent library loading routines.
|
||||
* System dependent library loading routines
|
||||
*
|
||||
* Some things to keep in mind:
|
||||
*
|
||||
* - These functions only work on C function names. Other languages may have
|
||||
* name mangling and intrinsic language support that varies from compiler to
|
||||
* compiler.
|
||||
* - Make sure you declare your function pointers with the same calling
|
||||
* convention as the actual library function. Your code will crash
|
||||
* mysteriously if you do not do this.
|
||||
* - Avoid namespace collisions. If you load a symbol from the library, it is
|
||||
* not defined whether or not it goes into the global symbol namespace for
|
||||
* the application. If it does and it conflicts with symbols in your code or
|
||||
* other shared libraries, you will not get the results you expect. :)
|
||||
* Some things to keep in mind:
|
||||
* \li These functions only work on C function names. Other languages may
|
||||
* have name mangling and intrinsic language support that varies from
|
||||
* compiler to compiler.
|
||||
* \li Make sure you declare your function pointers with the same calling
|
||||
* convention as the actual library function. Your code will crash
|
||||
* mysteriously if you do not do this.
|
||||
* \li Avoid namespace collisions. If you load a symbol from the library,
|
||||
* it is not defined whether or not it goes into the global symbol
|
||||
* namespace for the application. If it does and it conflicts with
|
||||
* symbols in your code or other shared libraries, you will not get
|
||||
* the results you expect. :)
|
||||
*/
|
||||
|
||||
#ifndef SDL_loadso_h_
|
||||
@@ -55,7 +53,7 @@ extern "C" {
|
||||
/**
|
||||
* Dynamically load a shared object.
|
||||
*
|
||||
* \param sofile a system-dependent name of the object file.
|
||||
* \param sofile a system-dependent name of the object file
|
||||
* \returns an opaque pointer to the object handle or NULL if there was an
|
||||
* error; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -81,8 +79,8 @@ extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
||||
*
|
||||
* If the requested function doesn't exist, NULL is returned.
|
||||
*
|
||||
* \param handle a valid shared object handle returned by SDL_LoadObject().
|
||||
* \param name the name of the function to look up.
|
||||
* \param handle a valid shared object handle returned by SDL_LoadObject()
|
||||
* \param name the name of the function to look up
|
||||
* \returns a pointer to the function or NULL if there was an error; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -97,7 +95,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
|
||||
/**
|
||||
* Unload a shared object from memory.
|
||||
*
|
||||
* \param handle a valid shared object handle returned by SDL_LoadObject().
|
||||
* \param handle a valid shared object handle returned by SDL_LoadObject()
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryLocale
|
||||
* \file SDL_locale.h
|
||||
*
|
||||
* Include file for SDL locale services
|
||||
* Include file for SDL locale services
|
||||
*/
|
||||
|
||||
#ifndef _SDL_locale_h
|
||||
|
@@ -20,19 +20,18 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryLog
|
||||
* \file SDL_log.h
|
||||
*
|
||||
* Simple log messages with categories and priorities.
|
||||
* Simple log messages with categories and priorities.
|
||||
*
|
||||
* By default logs are quiet, but if you're debugging SDL you might want:
|
||||
* By default logs are quiet, but if you're debugging SDL you might want:
|
||||
*
|
||||
* SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
||||
* SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
||||
*
|
||||
* Here's where the messages go on different platforms:
|
||||
*
|
||||
* - Windows: debug output stream
|
||||
* - Android: log output
|
||||
* - Others: standard error output (stderr)
|
||||
* Here's where the messages go on different platforms:
|
||||
* Windows: debug output stream
|
||||
* Android: log output
|
||||
* Others: standard error output (stderr)
|
||||
*/
|
||||
|
||||
#ifndef SDL_log_h_
|
||||
@@ -48,20 +47,21 @@ extern "C" {
|
||||
|
||||
|
||||
/**
|
||||
* The maximum size of a log message prior to SDL 2.0.24
|
||||
* \brief The maximum size of a log message prior to SDL 2.0.24
|
||||
*
|
||||
* As of 2.0.24 there is no limit to the length of SDL log messages.
|
||||
* As of 2.0.24 there is no limit to the length of SDL log messages.
|
||||
*/
|
||||
#define SDL_MAX_LOG_MESSAGE 4096
|
||||
|
||||
/**
|
||||
* The predefined log categories
|
||||
* \brief The predefined log categories
|
||||
*
|
||||
* By default the application category is enabled at the INFO level, the
|
||||
* assert category is enabled at the WARN level, test is enabled at the
|
||||
* VERBOSE level and all other categories are enabled at the ERROR level.
|
||||
* By default the application category is enabled at the INFO level,
|
||||
* the assert category is enabled at the WARN level, test is enabled
|
||||
* at the VERBOSE level and all other categories are enabled at the
|
||||
* ERROR level.
|
||||
*/
|
||||
typedef enum SDL_LogCategory
|
||||
typedef enum
|
||||
{
|
||||
SDL_LOG_CATEGORY_APPLICATION,
|
||||
SDL_LOG_CATEGORY_ERROR,
|
||||
@@ -97,9 +97,9 @@ typedef enum SDL_LogCategory
|
||||
} SDL_LogCategory;
|
||||
|
||||
/**
|
||||
* The predefined log priorities
|
||||
* \brief The predefined log priorities
|
||||
*/
|
||||
typedef enum SDL_LogPriority
|
||||
typedef enum
|
||||
{
|
||||
SDL_LOG_PRIORITY_VERBOSE = 1,
|
||||
SDL_LOG_PRIORITY_DEBUG,
|
||||
@@ -114,7 +114,7 @@ typedef enum SDL_LogPriority
|
||||
/**
|
||||
* Set the priority of all log categories.
|
||||
*
|
||||
* \param priority the SDL_LogPriority to assign.
|
||||
* \param priority the SDL_LogPriority to assign
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -125,8 +125,8 @@ extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
||||
/**
|
||||
* Set the priority of a particular log category.
|
||||
*
|
||||
* \param category the category to assign a priority to.
|
||||
* \param priority the SDL_LogPriority to assign.
|
||||
* \param category the category to assign a priority to
|
||||
* \param priority the SDL_LogPriority to assign
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -139,8 +139,8 @@ extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
||||
/**
|
||||
* Get the priority of a particular log category.
|
||||
*
|
||||
* \param category the category to query.
|
||||
* \returns the SDL_LogPriority for the requested category.
|
||||
* \param category the category to query
|
||||
* \returns the SDL_LogPriority for the requested category
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -166,7 +166,7 @@ extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
|
||||
* = * \param fmt a printf() style message format string
|
||||
*
|
||||
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
||||
* any.
|
||||
* any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -184,10 +184,10 @@ extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, .
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_VERBOSE.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -205,10 +205,10 @@ extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRI
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_DEBUG.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -226,10 +226,10 @@ extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_INFO.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -247,10 +247,10 @@ extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_WARN.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -268,10 +268,10 @@ extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_ERROR.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -289,10 +289,10 @@ extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_CRITICAL.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -310,11 +310,11 @@ extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STR
|
||||
/**
|
||||
* Log a message with the specified category and priority.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param priority the priority of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param category the category of the message
|
||||
* \param priority the priority of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
||||
* if any.
|
||||
* if any
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -334,10 +334,10 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
||||
/**
|
||||
* Log a message with the specified category and priority.
|
||||
*
|
||||
* \param category the category of the message.
|
||||
* \param priority the priority of the message.
|
||||
* \param fmt a printf() style message format string.
|
||||
* \param ap a variable argument list.
|
||||
* \param category the category of the message
|
||||
* \param priority the priority of the message
|
||||
* \param fmt a printf() style message format string
|
||||
* \param ap a variable argument list
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -359,11 +359,10 @@ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
||||
*
|
||||
* This function is called by SDL when there is new text to be logged.
|
||||
*
|
||||
* \param userdata what was passed as `userdata` to
|
||||
* SDL_LogSetOutputFunction().
|
||||
* \param category the category of the message.
|
||||
* \param priority the priority of the message.
|
||||
* \param message the message being output.
|
||||
* \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction()
|
||||
* \param category the category of the message
|
||||
* \param priority the priority of the message
|
||||
* \param message the message being output
|
||||
*/
|
||||
typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
||||
|
||||
@@ -371,9 +370,9 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
|
||||
* Get the current log output function.
|
||||
*
|
||||
* \param callback an SDL_LogOutputFunction filled in with the current log
|
||||
* callback.
|
||||
* callback
|
||||
* \param userdata a pointer filled in with the pointer that is passed to
|
||||
* `callback`.
|
||||
* `callback`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -384,8 +383,8 @@ extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *cal
|
||||
/**
|
||||
* Replace the default log output function with one of your own.
|
||||
*
|
||||
* \param callback an SDL_LogOutputFunction to call instead of the default.
|
||||
* \param userdata a pointer that is passed to `callback`.
|
||||
* \param callback an SDL_LogOutputFunction to call instead of the default
|
||||
* \param userdata a pointer that is passed to `callback`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
|
@@ -25,9 +25,9 @@
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/**
|
||||
* # CategoryMain
|
||||
* \file SDL_main.h
|
||||
*
|
||||
* Redefine main() on some platforms so that it is called by SDL.
|
||||
* Redefine main() on some platforms so that it is called by SDL.
|
||||
*/
|
||||
|
||||
#ifndef SDL_MAIN_HANDLED
|
||||
@@ -129,14 +129,14 @@
|
||||
*
|
||||
* The application's main() function must be called with C linkage,
|
||||
* and should be declared like this:
|
||||
* ```c
|
||||
* \code
|
||||
* #ifdef __cplusplus
|
||||
* extern "C"
|
||||
* #endif
|
||||
* int main(int argc, char *argv[])
|
||||
* {
|
||||
* }
|
||||
* ```
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
|
||||
@@ -149,7 +149,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The prototype for the application's main() function
|
||||
* The prototype for the application's main() function
|
||||
*/
|
||||
typedef int (*SDL_main_func)(int argc, char *argv[]);
|
||||
extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
||||
@@ -187,8 +187,8 @@ extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
||||
* \param name the window class name, in UTF-8 encoding. If NULL, SDL
|
||||
* currently uses "SDL_app" but this isn't guaranteed.
|
||||
* \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
|
||||
* currently uses `(CS_BYTEALIGNCLIENT \| CS_OWNDC)` regardless
|
||||
* of what is specified here.
|
||||
* currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
|
||||
* what is specified here.
|
||||
* \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
|
||||
* will use `GetModuleHandle(NULL)` instead.
|
||||
* \returns 0 on success, -1 on error. SDL_GetError() may have details.
|
||||
@@ -222,8 +222,8 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
/**
|
||||
* Initialize and launch an SDL/WinRT application.
|
||||
*
|
||||
* \param mainFunction the SDL app's C-style main(), an SDL_main_func.
|
||||
* \param reserved reserved for future use; should be NULL.
|
||||
* \param mainFunction the SDL app's C-style main(), an SDL_main_func
|
||||
* \param reserved reserved for future use; should be NULL
|
||||
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
|
||||
* more information on the failure.
|
||||
*
|
||||
@@ -238,10 +238,10 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r
|
||||
/**
|
||||
* Initializes and launches an SDL application.
|
||||
*
|
||||
* \param argc The argc parameter from the application's main() function.
|
||||
* \param argv The argv parameter from the application's main() function.
|
||||
* \param mainFunction The SDL app's C-style main(), an SDL_main_func.
|
||||
* \return the return value from mainFunction.
|
||||
* \param argc The argc parameter from the application's main() function
|
||||
* \param argv The argv parameter from the application's main() function
|
||||
* \param mainFunction The SDL app's C-style main(), an SDL_main_func
|
||||
* \return the return value from mainFunction
|
||||
*
|
||||
* \since This function is available since SDL 2.0.10.
|
||||
*/
|
||||
@@ -254,8 +254,8 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
|
||||
/**
|
||||
* Initialize and launch an SDL GDK application.
|
||||
*
|
||||
* \param mainFunction the SDL app's C-style main(), an SDL_main_func.
|
||||
* \param reserved reserved for future use; should be NULL.
|
||||
* \param mainFunction the SDL app's C-style main(), an SDL_main_func
|
||||
* \param reserved reserved for future use; should be NULL
|
||||
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
|
||||
* more information on the failure.
|
||||
*
|
||||
|
@@ -32,11 +32,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SDL_MessageBox flags.
|
||||
*
|
||||
* If supported will display warning icon, etc.
|
||||
* SDL_MessageBox flags. If supported will display warning icon, etc.
|
||||
*/
|
||||
typedef enum SDL_MessageBoxFlags
|
||||
typedef enum
|
||||
{
|
||||
SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */
|
||||
SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */
|
||||
@@ -48,7 +46,7 @@ typedef enum SDL_MessageBoxFlags
|
||||
/**
|
||||
* Flags for SDL_MessageBoxButtonData.
|
||||
*/
|
||||
typedef enum SDL_MessageBoxButtonFlags
|
||||
typedef enum
|
||||
{
|
||||
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */
|
||||
SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */
|
||||
@@ -57,9 +55,9 @@ typedef enum SDL_MessageBoxButtonFlags
|
||||
/**
|
||||
* Individual button data.
|
||||
*/
|
||||
typedef struct SDL_MessageBoxButtonData
|
||||
typedef struct
|
||||
{
|
||||
Uint32 flags; /**< SDL_MessageBoxButtonFlags */
|
||||
Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */
|
||||
int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */
|
||||
const char * text; /**< The UTF-8 button text */
|
||||
} SDL_MessageBoxButtonData;
|
||||
@@ -67,12 +65,12 @@ typedef struct SDL_MessageBoxButtonData
|
||||
/**
|
||||
* RGB value used in a message box color scheme
|
||||
*/
|
||||
typedef struct SDL_MessageBoxColor
|
||||
typedef struct
|
||||
{
|
||||
Uint8 r, g, b;
|
||||
} SDL_MessageBoxColor;
|
||||
|
||||
typedef enum SDL_MessageBoxColorType
|
||||
typedef enum
|
||||
{
|
||||
SDL_MESSAGEBOX_COLOR_BACKGROUND,
|
||||
SDL_MESSAGEBOX_COLOR_TEXT,
|
||||
@@ -85,7 +83,7 @@ typedef enum SDL_MessageBoxColorType
|
||||
/**
|
||||
* A set of colors to use for message box dialogs
|
||||
*/
|
||||
typedef struct SDL_MessageBoxColorScheme
|
||||
typedef struct
|
||||
{
|
||||
SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
|
||||
} SDL_MessageBoxColorScheme;
|
||||
@@ -93,9 +91,9 @@ typedef struct SDL_MessageBoxColorScheme
|
||||
/**
|
||||
* MessageBox structure containing title, text, window, etc.
|
||||
*/
|
||||
typedef struct SDL_MessageBoxData
|
||||
typedef struct
|
||||
{
|
||||
Uint32 flags; /**< SDL_MessageBoxFlags */
|
||||
Uint32 flags; /**< ::SDL_MessageBoxFlags */
|
||||
SDL_Window *window; /**< Parent window, can be NULL */
|
||||
const char *title; /**< UTF-8 title */
|
||||
const char *message; /**< UTF-8 message text */
|
||||
@@ -103,7 +101,7 @@ typedef struct SDL_MessageBoxData
|
||||
int numbuttons;
|
||||
const SDL_MessageBoxButtonData *buttons;
|
||||
|
||||
const SDL_MessageBoxColorScheme *colorScheme; /**< SDL_MessageBoxColorScheme, can be NULL to use system settings */
|
||||
const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
|
||||
} SDL_MessageBoxData;
|
||||
|
||||
/**
|
||||
@@ -130,9 +128,8 @@ typedef struct SDL_MessageBoxData
|
||||
* to stderr if you can.
|
||||
*
|
||||
* \param messageboxdata the SDL_MessageBoxData structure with title, text and
|
||||
* other options.
|
||||
* \param buttonid the pointer to which user id of hit button should be
|
||||
* copied.
|
||||
* other options
|
||||
* \param buttonid the pointer to which user id of hit button should be copied
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -171,10 +168,10 @@ extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *message
|
||||
* concern, check the return value from this function and fall back to writing
|
||||
* to stderr if you can.
|
||||
*
|
||||
* \param flags an SDL_MessageBoxFlags value.
|
||||
* \param title UTF-8 title text.
|
||||
* \param message UTF-8 message text.
|
||||
* \param window the parent window, or NULL for no parent.
|
||||
* \param flags an SDL_MessageBoxFlags value
|
||||
* \param title UTF-8 title text
|
||||
* \param message UTF-8 message text
|
||||
* \param window the parent window, or NULL for no parent
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -20,10 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryMetal
|
||||
* \file SDL_metal.h
|
||||
*
|
||||
* Header file for functions to creating Metal layers and views on SDL
|
||||
* windows.
|
||||
* Header file for functions to creating Metal layers and views on SDL windows.
|
||||
*/
|
||||
|
||||
#ifndef SDL_metal_h_
|
||||
@@ -38,9 +37,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
|
||||
* \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
|
||||
*
|
||||
* This can be cast directly to an NSView or UIView.
|
||||
* \note This can be cast directly to an NSView or UIView.
|
||||
*/
|
||||
typedef void *SDL_MetalView;
|
||||
|
||||
@@ -91,9 +90,9 @@ extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
||||
* Get the size of a window's underlying drawable in pixels (for use with
|
||||
* setting viewport, scissor & etc).
|
||||
*
|
||||
* \param window SDL_Window from which the drawable size should be queried.
|
||||
* \param w Pointer to variable for storing the width in pixels, may be NULL.
|
||||
* \param h Pointer to variable for storing the height in pixels, may be NULL.
|
||||
* \param window SDL_Window from which the drawable size should be queried
|
||||
* \param w Pointer to variable for storing the width in pixels, may be NULL
|
||||
* \param h Pointer to variable for storing the height in pixels, may be NULL
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryMisc
|
||||
* \file SDL_misc.h
|
||||
*
|
||||
* Include file for SDL API functions that don't fit elsewhere.
|
||||
* \brief Include file for SDL API functions that don't fit elsewhere.
|
||||
*/
|
||||
|
||||
#ifndef SDL_misc_h_
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryMouse
|
||||
* \file SDL_mouse.h
|
||||
*
|
||||
* Include file for SDL mouse event handling.
|
||||
* Include file for SDL mouse event handling.
|
||||
*/
|
||||
|
||||
#ifndef SDL_mouse_h_
|
||||
@@ -41,9 +41,9 @@ extern "C" {
|
||||
typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */
|
||||
|
||||
/**
|
||||
* Cursor types for SDL_CreateSystemCursor().
|
||||
* \brief Cursor types for SDL_CreateSystemCursor().
|
||||
*/
|
||||
typedef enum SDL_SystemCursor
|
||||
typedef enum
|
||||
{
|
||||
SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */
|
||||
SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */
|
||||
@@ -61,9 +61,9 @@ typedef enum SDL_SystemCursor
|
||||
} SDL_SystemCursor;
|
||||
|
||||
/**
|
||||
* Scroll direction types for the Scroll event
|
||||
* \brief Scroll direction types for the Scroll event
|
||||
*/
|
||||
typedef enum SDL_MouseWheelDirection
|
||||
typedef enum
|
||||
{
|
||||
SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */
|
||||
SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */
|
||||
@@ -90,9 +90,9 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
||||
* either `x` or `y`.
|
||||
*
|
||||
* \param x the x coordinate of the mouse cursor position relative to the
|
||||
* focus window.
|
||||
* focus window
|
||||
* \param y the y coordinate of the mouse cursor position relative to the
|
||||
* focus window.
|
||||
* focus window
|
||||
* \returns a 32-bit button bitmask of the current button state.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -120,9 +120,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
|
||||
* reason to use this function, you probably want SDL_GetMouseState() instead.
|
||||
*
|
||||
* \param x filled in with the current X coord relative to the desktop; can be
|
||||
* NULL.
|
||||
* NULL
|
||||
* \param y filled in with the current Y coord relative to the desktop; can be
|
||||
* NULL.
|
||||
* NULL
|
||||
* \returns the current button state as a bitmask which can be tested using
|
||||
* the SDL_BUTTON(X) macros.
|
||||
*
|
||||
@@ -141,8 +141,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
|
||||
* mouse deltas since the last call to SDL_GetRelativeMouseState() or since
|
||||
* event initialization. You can pass NULL for either `x` or `y`.
|
||||
*
|
||||
* \param x a pointer filled with the last recorded x coordinate of the mouse.
|
||||
* \param y a pointer filled with the last recorded y coordinate of the mouse.
|
||||
* \param x a pointer filled with the last recorded x coordinate of the mouse
|
||||
* \param y a pointer filled with the last recorded y coordinate of the mouse
|
||||
* \returns a 32-bit button bitmask of the relative button state.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -162,9 +162,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
|
||||
* mouse when used over Microsoft Remote Desktop.
|
||||
*
|
||||
* \param window the window to move the mouse into, or NULL for the current
|
||||
* mouse focus.
|
||||
* \param x the x coordinate within the window.
|
||||
* \param y the y coordinate within the window.
|
||||
* mouse focus
|
||||
* \param x the x coordinate within the window
|
||||
* \param y the y coordinate within the window
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -184,8 +184,8 @@ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
||||
* Note that this function will appear to succeed, but not actually move the
|
||||
* mouse when used over Microsoft Remote Desktop.
|
||||
*
|
||||
* \param x the x coordinate.
|
||||
* \param y the y coordinate.
|
||||
* \param x the x coordinate
|
||||
* \param y the y coordinate
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -297,14 +297,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
||||
* Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which
|
||||
* provides twelve readily available system cursors to pick from.
|
||||
*
|
||||
* \param data the color value for each pixel of the cursor.
|
||||
* \param mask the mask value for each pixel of the cursor.
|
||||
* \param w the width of the cursor.
|
||||
* \param h the height of the cursor.
|
||||
* \param data the color value for each pixel of the cursor
|
||||
* \param mask the mask value for each pixel of the cursor
|
||||
* \param w the width of the cursor
|
||||
* \param h the height of the cursor
|
||||
* \param hot_x the X-axis location of the upper left corner of the cursor
|
||||
* relative to the actual mouse position.
|
||||
* relative to the actual mouse position
|
||||
* \param hot_y the Y-axis location of the upper left corner of the cursor
|
||||
* relative to the actual mouse position.
|
||||
* relative to the actual mouse position
|
||||
* \returns a new cursor with the specified parameters on success or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -322,9 +322,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
||||
/**
|
||||
* Create a color cursor.
|
||||
*
|
||||
* \param surface an SDL_Surface structure representing the cursor image.
|
||||
* \param hot_x the x position of the cursor hot spot.
|
||||
* \param hot_y the y position of the cursor hot spot.
|
||||
* \param surface an SDL_Surface structure representing the cursor image
|
||||
* \param hot_x the x position of the cursor hot spot
|
||||
* \param hot_y the y position of the cursor hot spot
|
||||
* \returns the new cursor on success or NULL on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@@ -340,7 +340,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
||||
/**
|
||||
* Create a system cursor.
|
||||
*
|
||||
* \param id an SDL_SystemCursor enum value.
|
||||
* \param id an SDL_SystemCursor enum value
|
||||
* \returns a cursor on success or NULL on failure; call SDL_GetError() for
|
||||
* more information.
|
||||
*
|
||||
@@ -358,7 +358,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
||||
* the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if
|
||||
* this is desired for any reason.
|
||||
*
|
||||
* \param cursor a cursor to make active.
|
||||
* \param cursor a cursor to make active
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -402,7 +402,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
||||
* Use this function to free cursor resources created with SDL_CreateCursor(),
|
||||
* SDL_CreateColorCursor() or SDL_CreateSystemCursor().
|
||||
*
|
||||
* \param cursor the cursor to free.
|
||||
* \param cursor the cursor to free
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -437,9 +437,9 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
|
||||
/**
|
||||
* Used as a mask when testing buttons in buttonstate.
|
||||
*
|
||||
* - Button 1: Left mouse button
|
||||
* - Button 2: Middle mouse button
|
||||
* - Button 3: Right mouse button
|
||||
* - Button 1: Left mouse button
|
||||
* - Button 2: Middle mouse button
|
||||
* - Button 3: Right mouse button
|
||||
*/
|
||||
#define SDL_BUTTON(X) (1 << ((X)-1))
|
||||
#define SDL_BUTTON_LEFT 1
|
||||
|
@@ -23,9 +23,9 @@
|
||||
#define SDL_mutex_h_
|
||||
|
||||
/**
|
||||
* # CategoryMutex
|
||||
* \file SDL_mutex.h
|
||||
*
|
||||
* Functions to provide thread synchronization primitives.
|
||||
* Functions to provide thread synchronization primitives.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -112,13 +112,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Synchronization functions which can time out return this value if they time
|
||||
* out.
|
||||
* Synchronization functions which can time out return this value
|
||||
* if they time out.
|
||||
*/
|
||||
#define SDL_MUTEX_TIMEDOUT 1
|
||||
|
||||
/**
|
||||
* This is the timeout value which corresponds to never time out.
|
||||
* This is the timeout value which corresponds to never time out.
|
||||
*/
|
||||
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
|
||||
|
||||
@@ -165,7 +165,7 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
|
||||
* unlock it the same number of times before it is actually made available for
|
||||
* other threads in the system (this is known as a "recursive mutex").
|
||||
*
|
||||
* \param mutex the mutex to lock.
|
||||
* \param mutex the mutex to lock
|
||||
* \return 0, or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -182,7 +182,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex);
|
||||
* This technique is useful if you need exclusive access to a resource but
|
||||
* don't want to wait for it, and will return to it to try again later.
|
||||
*
|
||||
* \param mutex the mutex to try to lock.
|
||||
* \param mutex the mutex to try to lock
|
||||
* \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for
|
||||
* more information.
|
||||
*
|
||||
@@ -224,7 +224,7 @@ extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex
|
||||
* to destroy a locked mutex, and may result in undefined behavior depending
|
||||
* on the platform.
|
||||
*
|
||||
* \param mutex the mutex to destroy.
|
||||
* \param mutex the mutex to destroy
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -256,7 +256,7 @@ typedef struct SDL_semaphore SDL_sem;
|
||||
* is 0. Each post operation will atomically increment the semaphore value and
|
||||
* wake waiting threads and allow them to retry the wait operation.
|
||||
*
|
||||
* \param initial_value the starting value of the semaphore.
|
||||
* \param initial_value the starting value of the semaphore
|
||||
* \returns a new semaphore or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
@@ -277,7 +277,7 @@ extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
||||
* It is not safe to destroy a semaphore if there are threads currently
|
||||
* waiting on it.
|
||||
*
|
||||
* \param sem the semaphore to destroy.
|
||||
* \param sem the semaphore to destroy
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -301,7 +301,7 @@ extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
|
||||
* This function is the equivalent of calling SDL_SemWaitTimeout() with a time
|
||||
* length of `SDL_MUTEX_MAXWAIT`.
|
||||
*
|
||||
* \param sem the semaphore wait on.
|
||||
* \param sem the semaphore wait on
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -325,7 +325,7 @@ extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
|
||||
* the semaphore doesn't have a positive value, the function immediately
|
||||
* returns SDL_MUTEX_TIMEDOUT.
|
||||
*
|
||||
* \param sem the semaphore to wait on.
|
||||
* \param sem the semaphore to wait on
|
||||
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would
|
||||
* block, or a negative error code on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
@@ -349,8 +349,8 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
||||
* signal or error, or the specified time has elapsed. If the call is
|
||||
* successful it will atomically decrement the semaphore value.
|
||||
*
|
||||
* \param sem the semaphore to wait on.
|
||||
* \param timeout the length of the timeout, in milliseconds.
|
||||
* \param sem the semaphore to wait on
|
||||
* \param timeout the length of the timeout, in milliseconds
|
||||
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
|
||||
* succeed in the allotted time, or a negative error code on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
@@ -369,7 +369,7 @@ extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);
|
||||
/**
|
||||
* Atomically increment a semaphore's value and wake waiting threads.
|
||||
*
|
||||
* \param sem the semaphore to increment.
|
||||
* \param sem the semaphore to increment
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -387,7 +387,7 @@ extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
|
||||
/**
|
||||
* Get the current value of a semaphore.
|
||||
*
|
||||
* \param sem the semaphore to query.
|
||||
* \param sem the semaphore to query
|
||||
* \returns the current value of the semaphore.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -427,7 +427,7 @@ extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
|
||||
/**
|
||||
* Destroy a condition variable.
|
||||
*
|
||||
* \param cond the condition variable to destroy.
|
||||
* \param cond the condition variable to destroy
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -442,7 +442,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
|
||||
/**
|
||||
* Restart one of the threads that are waiting on the condition variable.
|
||||
*
|
||||
* \param cond the condition variable to signal.
|
||||
* \param cond the condition variable to signal
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -459,7 +459,7 @@ extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
|
||||
/**
|
||||
* Restart all threads that are waiting on the condition variable.
|
||||
*
|
||||
* \param cond the condition variable to signal.
|
||||
* \param cond the condition variable to signal
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -486,8 +486,8 @@ extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
|
||||
* This function is the equivalent of calling SDL_CondWaitTimeout() with a
|
||||
* time length of `SDL_MUTEX_MAXWAIT`.
|
||||
*
|
||||
* \param cond the condition variable to wait on.
|
||||
* \param mutex the mutex used to coordinate thread access.
|
||||
* \param cond the condition variable to wait on
|
||||
* \param mutex the mutex used to coordinate thread access
|
||||
* \returns 0 when it is signaled or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -512,10 +512,10 @@ extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
|
||||
*
|
||||
* The mutex must be locked before calling this function.
|
||||
*
|
||||
* \param cond the condition variable to wait on.
|
||||
* \param mutex the mutex used to coordinate thread access.
|
||||
* \param cond the condition variable to wait on
|
||||
* \param mutex the mutex used to coordinate thread access
|
||||
* \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT`
|
||||
* to wait indefinitely.
|
||||
* to wait indefinitely
|
||||
* \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if
|
||||
* the condition is not signaled in the allotted time, or a negative
|
||||
* error code on failure; call SDL_GetError() for more information.
|
||||
|
@@ -19,11 +19,17 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a simple file to encapsulate the OpenGL API headers.
|
||||
/**
|
||||
* \file SDL_opengl.h
|
||||
*
|
||||
* Define NO_SDL_GLEXT if you have your own version of glext.h and want
|
||||
* to disable the version included in SDL_opengl.h.
|
||||
* This is a simple file to encapsulate the OpenGL API headers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def NO_SDL_GLEXT
|
||||
*
|
||||
* Define this if you have your own version of glext.h and want to disable the
|
||||
* version included in SDL_opengl.h.
|
||||
*/
|
||||
|
||||
#ifndef SDL_opengl_h_
|
||||
|
@@ -19,10 +19,11 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
||||
/**
|
||||
* \file SDL_opengles.h
|
||||
*
|
||||
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
||||
*/
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef __IPHONEOS__
|
||||
|
@@ -19,10 +19,11 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
||||
/**
|
||||
* \file SDL_opengles2.h
|
||||
*
|
||||
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
||||
*/
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryPixels
|
||||
* \file SDL_pixels.h
|
||||
*
|
||||
* Header for the enumerated pixel format definitions.
|
||||
* Header for the enumerated pixel format definitions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_pixels_h_
|
||||
@@ -320,10 +320,9 @@ typedef enum
|
||||
} SDL_PixelFormatEnum;
|
||||
|
||||
/**
|
||||
* The bits of this structure can be directly reinterpreted as an
|
||||
* integer-packed color which uses the SDL_PIXELFORMAT_RGBA32 format
|
||||
* (SDL_PIXELFORMAT_ABGR8888 on little-endian systems and
|
||||
* SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
|
||||
* The bits of this structure can be directly reinterpreted as an integer-packed
|
||||
* color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
|
||||
* on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
|
||||
*/
|
||||
typedef struct SDL_Color
|
||||
{
|
||||
@@ -343,30 +342,7 @@ typedef struct SDL_Palette
|
||||
} SDL_Palette;
|
||||
|
||||
/**
|
||||
* A structure that contains pixel format information.
|
||||
*
|
||||
* Everything in the pixel format structure is read-only.
|
||||
*
|
||||
* A pixel format has either a palette or masks. If a palette is used `Rmask`,
|
||||
* `Gmask`, `Bmask`, and `Amask` will be 0.
|
||||
*
|
||||
* An SDL_PixelFormat describes the format of the pixel data stored at the
|
||||
* `pixels` field of an SDL_Surface. Every surface stores an SDL_PixelFormat
|
||||
* in the `format` field.
|
||||
*
|
||||
* If you wish to do pixel level modifications on a surface, then
|
||||
* understanding how SDL stores its color information is essential.
|
||||
*
|
||||
* For information on modern pixel color spaces, see the following Wikipedia
|
||||
* article: http://en.wikipedia.org/wiki/RGBA_color_space
|
||||
*
|
||||
* \sa SDL_ConvertSurface
|
||||
* \sa SDL_GetRGB
|
||||
* \sa SDL_GetRGBA
|
||||
* \sa SDL_MapRGB
|
||||
* \sa SDL_MapRGBA
|
||||
* \sa SDL_AllocFormat
|
||||
* \sa SDL_FreeFormat
|
||||
* \note Everything in the pixel format structure is read-only.
|
||||
*/
|
||||
typedef struct SDL_PixelFormat
|
||||
{
|
||||
@@ -394,7 +370,7 @@ typedef struct SDL_PixelFormat
|
||||
/**
|
||||
* Get the human readable name of a pixel format.
|
||||
*
|
||||
* \param format the pixel format to query.
|
||||
* \param format the pixel format to query
|
||||
* \returns the human readable name of the specified pixel format or
|
||||
* `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
|
||||
*
|
||||
@@ -405,12 +381,12 @@ extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
||||
/**
|
||||
* Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
|
||||
*
|
||||
* \param format one of the SDL_PixelFormatEnum values.
|
||||
* \param bpp a bits per pixel value; usually 15, 16, or 32.
|
||||
* \param Rmask a pointer filled in with the red mask for the format.
|
||||
* \param Gmask a pointer filled in with the green mask for the format.
|
||||
* \param Bmask a pointer filled in with the blue mask for the format.
|
||||
* \param Amask a pointer filled in with the alpha mask for the format.
|
||||
* \param format one of the SDL_PixelFormatEnum values
|
||||
* \param bpp a bits per pixel value; usually 15, 16, or 32
|
||||
* \param Rmask a pointer filled in with the red mask for the format
|
||||
* \param Gmask a pointer filled in with the green mask for the format
|
||||
* \param Bmask a pointer filled in with the blue mask for the format
|
||||
* \param Amask a pointer filled in with the alpha mask for the format
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
|
||||
* possible; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -431,12 +407,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
||||
* This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
|
||||
* possible.
|
||||
*
|
||||
* \param bpp a bits per pixel value; usually 15, 16, or 32.
|
||||
* \param Rmask the red mask for the format.
|
||||
* \param Gmask the green mask for the format.
|
||||
* \param Bmask the blue mask for the format.
|
||||
* \param Amask the alpha mask for the format.
|
||||
* \returns one of the SDL_PixelFormatEnum values.
|
||||
* \param bpp a bits per pixel value; usually 15, 16, or 32
|
||||
* \param Rmask the red mask for the format
|
||||
* \param Gmask the green mask for the format
|
||||
* \param Bmask the blue mask for the format
|
||||
* \param Amask the alpha mask for the format
|
||||
* \returns one of the SDL_PixelFormatEnum values
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -455,7 +431,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
||||
* allocated), and hence should not be modified, especially the palette. Weird
|
||||
* errors such as `Blit combination not supported` may occur.
|
||||
*
|
||||
* \param pixel_format one of the SDL_PixelFormatEnum values.
|
||||
* \param pixel_format one of the SDL_PixelFormatEnum values
|
||||
* \returns the new SDL_PixelFormat structure or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -468,7 +444,7 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
|
||||
/**
|
||||
* Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
|
||||
*
|
||||
* \param format the SDL_PixelFormat structure to free.
|
||||
* \param format the SDL_PixelFormat structure to free
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -481,7 +457,7 @@ extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
|
||||
*
|
||||
* The palette entries are initialized to white.
|
||||
*
|
||||
* \param ncolors represents the number of color entries in the color palette.
|
||||
* \param ncolors represents the number of color entries in the color palette
|
||||
* \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
|
||||
* there wasn't enough memory); call SDL_GetError() for more
|
||||
* information.
|
||||
@@ -495,8 +471,8 @@ extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
||||
/**
|
||||
* Set the palette for a pixel format structure.
|
||||
*
|
||||
* \param format the SDL_PixelFormat structure that will use the palette.
|
||||
* \param palette the SDL_Palette structure that will be used.
|
||||
* \param format the SDL_PixelFormat structure that will use the palette
|
||||
* \param palette the SDL_Palette structure that will be used
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -511,10 +487,10 @@ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
||||
/**
|
||||
* Set a range of colors in a palette.
|
||||
*
|
||||
* \param palette the SDL_Palette structure to modify.
|
||||
* \param colors an array of SDL_Color structures to copy into the palette.
|
||||
* \param firstcolor the index of the first palette entry to modify.
|
||||
* \param ncolors the number of entries to modify.
|
||||
* \param palette the SDL_Palette structure to modify
|
||||
* \param colors an array of SDL_Color structures to copy into the palette
|
||||
* \param firstcolor the index of the first palette entry to modify
|
||||
* \param ncolors the number of entries to modify
|
||||
* \returns 0 on success or a negative error code if not all of the colors
|
||||
* could be set; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -530,7 +506,7 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
/**
|
||||
* Free a palette created with SDL_AllocPalette().
|
||||
*
|
||||
* \param palette the SDL_Palette structure to be freed.
|
||||
* \param palette the SDL_Palette structure to be freed
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -556,11 +532,11 @@ extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
||||
* format the return value can be assigned to a Uint16, and similarly a Uint8
|
||||
* for an 8-bpp format).
|
||||
*
|
||||
* \param format an SDL_PixelFormat structure describing the pixel format.
|
||||
* \param r the red component of the pixel in the range 0-255.
|
||||
* \param g the green component of the pixel in the range 0-255.
|
||||
* \param b the blue component of the pixel in the range 0-255.
|
||||
* \returns a pixel value.
|
||||
* \param format an SDL_PixelFormat structure describing the pixel format
|
||||
* \param r the red component of the pixel in the range 0-255
|
||||
* \param g the green component of the pixel in the range 0-255
|
||||
* \param b the blue component of the pixel in the range 0-255
|
||||
* \returns a pixel value
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -590,12 +566,12 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
||||
* for an 8-bpp format).
|
||||
*
|
||||
* \param format an SDL_PixelFormat structure describing the format of the
|
||||
* pixel.
|
||||
* \param r the red component of the pixel in the range 0-255.
|
||||
* \param g the green component of the pixel in the range 0-255.
|
||||
* \param b the blue component of the pixel in the range 0-255.
|
||||
* \param a the alpha component of the pixel in the range 0-255.
|
||||
* \returns a pixel value.
|
||||
* pixel
|
||||
* \param r the red component of the pixel in the range 0-255
|
||||
* \param g the green component of the pixel in the range 0-255
|
||||
* \param b the blue component of the pixel in the range 0-255
|
||||
* \param a the alpha component of the pixel in the range 0-255
|
||||
* \returns a pixel value
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -615,12 +591,12 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
||||
* (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
|
||||
* 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
|
||||
*
|
||||
* \param pixel a pixel value.
|
||||
* \param pixel a pixel value
|
||||
* \param format an SDL_PixelFormat structure describing the format of the
|
||||
* pixel.
|
||||
* \param r a pointer filled in with the red component.
|
||||
* \param g a pointer filled in with the green component.
|
||||
* \param b a pointer filled in with the blue component.
|
||||
* pixel
|
||||
* \param r a pointer filled in with the red component
|
||||
* \param g a pointer filled in with the green component
|
||||
* \param b a pointer filled in with the blue component
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -643,13 +619,13 @@ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
||||
* If the surface has no alpha component, the alpha will be returned as 0xff
|
||||
* (100% opaque).
|
||||
*
|
||||
* \param pixel a pixel value.
|
||||
* \param pixel a pixel value
|
||||
* \param format an SDL_PixelFormat structure describing the format of the
|
||||
* pixel.
|
||||
* \param r a pointer filled in with the red component.
|
||||
* \param g a pointer filled in with the green component.
|
||||
* \param b a pointer filled in with the blue component.
|
||||
* \param a a pointer filled in with the alpha component.
|
||||
* pixel
|
||||
* \param r a pointer filled in with the red component
|
||||
* \param g a pointer filled in with the green component
|
||||
* \param b a pointer filled in with the blue component
|
||||
* \param a a pointer filled in with the alpha component
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -665,8 +641,8 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
||||
/**
|
||||
* Calculate a 256 entry gamma ramp for a gamma value.
|
||||
*
|
||||
* \param gamma a gamma value where 0.0 is black and 1.0 is identity.
|
||||
* \param ramp an array of 256 values filled in with the gamma ramp.
|
||||
* \param gamma a gamma value where 0.0 is black and 1.0 is identity
|
||||
* \param ramp an array of 256 values filled in with the gamma ramp
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryPlatform
|
||||
* \file SDL_platform.h
|
||||
*
|
||||
* Try to get a standard set of platform defines.
|
||||
* Try to get a standard set of platform defines.
|
||||
*/
|
||||
|
||||
#ifndef SDL_platform_h_
|
||||
|
@@ -23,9 +23,9 @@
|
||||
#define SDL_power_h_
|
||||
|
||||
/**
|
||||
* # CategoryPower
|
||||
* \file SDL_power.h
|
||||
*
|
||||
* Header for the SDL power management routines.
|
||||
* Header for the SDL power management routines.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -37,9 +37,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The basic state for the system's power supply.
|
||||
* The basic state for the system's power supply.
|
||||
*/
|
||||
typedef enum SDL_PowerState
|
||||
typedef enum
|
||||
{
|
||||
SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
|
||||
SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
|
||||
@@ -66,10 +66,10 @@ typedef enum SDL_PowerState
|
||||
*
|
||||
* \param seconds seconds of battery life left, you can pass a NULL here if
|
||||
* you don't care, will return -1 if we can't determine a
|
||||
* value, or we're not running on a battery.
|
||||
* value, or we're not running on a battery
|
||||
* \param percent percentage of battery life left, between 0 and 100, you can
|
||||
* pass a NULL here if you don't care, will return -1 if we
|
||||
* can't determine a value, or we're not running on a battery.
|
||||
* can't determine a value, or we're not running on a battery
|
||||
* \returns an SDL_PowerState enum representing the current battery state.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
|
@@ -20,20 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryQuit
|
||||
* \file SDL_quit.h
|
||||
*
|
||||
* An SDL_QUIT event is generated when the user tries to close the application
|
||||
* window. If it is ignored or filtered out, the window will remain open. If
|
||||
* it is not ignored or filtered, it is queued normally and the window is
|
||||
* allowed to close. When the window is closed, screen updates will complete,
|
||||
* but have no effect.
|
||||
*
|
||||
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) and
|
||||
* SIGTERM (system termination request), if handlers do not already exist,
|
||||
* that generate SDL_QUIT events as well. There is no way to determine the
|
||||
* cause of an SDL_QUIT event, but setting a signal handler in your
|
||||
* application will override the default generation of quit events for that
|
||||
* signal.
|
||||
* Include file for SDL quit event handling.
|
||||
*/
|
||||
|
||||
#ifndef SDL_quit_h_
|
||||
@@ -42,6 +31,25 @@
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
/**
|
||||
* \file SDL_quit.h
|
||||
*
|
||||
* An ::SDL_QUIT event is generated when the user tries to close the application
|
||||
* window. If it is ignored or filtered out, the window will remain open.
|
||||
* If it is not ignored or filtered, it is queued normally and the window
|
||||
* is allowed to close. When the window is closed, screen updates will
|
||||
* complete, but have no effect.
|
||||
*
|
||||
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
|
||||
* and SIGTERM (system termination request), if handlers do not already
|
||||
* exist, that generate ::SDL_QUIT events as well. There is no way
|
||||
* to determine the cause of an ::SDL_QUIT event, but setting a signal
|
||||
* handler in your application will override the default generation of
|
||||
* quit events for that signal.
|
||||
*
|
||||
* \sa SDL_Quit()
|
||||
*/
|
||||
|
||||
/* There are no functions directly affecting the quit event */
|
||||
|
||||
#define SDL_QuitRequested() \
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryRect
|
||||
* \file SDL_rect.h
|
||||
*
|
||||
* Header file for SDL_rect definition and management functions.
|
||||
* Header file for SDL_rect definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_rect_h_
|
||||
@@ -135,8 +135,8 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
|
||||
*
|
||||
* If either pointer is NULL the function will return SDL_FALSE.
|
||||
*
|
||||
* \param A an SDL_Rect structure representing the first rectangle.
|
||||
* \param B an SDL_Rect structure representing the second rectangle.
|
||||
* \param A an SDL_Rect structure representing the first rectangle
|
||||
* \param B an SDL_Rect structure representing the second rectangle
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -151,10 +151,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
|
||||
*
|
||||
* If `result` is NULL then this function will return SDL_FALSE.
|
||||
*
|
||||
* \param A an SDL_Rect structure representing the first rectangle.
|
||||
* \param B an SDL_Rect structure representing the second rectangle.
|
||||
* \param A an SDL_Rect structure representing the first rectangle
|
||||
* \param B an SDL_Rect structure representing the second rectangle
|
||||
* \param result an SDL_Rect structure filled in with the intersection of
|
||||
* rectangles `A` and `B`.
|
||||
* rectangles `A` and `B`
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -168,10 +168,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
|
||||
/**
|
||||
* Calculate the union of two rectangles.
|
||||
*
|
||||
* \param A an SDL_Rect structure representing the first rectangle.
|
||||
* \param B an SDL_Rect structure representing the second rectangle.
|
||||
* \param A an SDL_Rect structure representing the first rectangle
|
||||
* \param B an SDL_Rect structure representing the second rectangle
|
||||
* \param result an SDL_Rect structure filled in with the union of rectangles
|
||||
* `A` and `B`.
|
||||
* `A` and `B`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
@@ -186,11 +186,11 @@ extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
|
||||
* considered.
|
||||
*
|
||||
* \param points an array of SDL_Point structures representing points to be
|
||||
* enclosed.
|
||||
* \param count the number of structures in the `points` array.
|
||||
* \param clip an SDL_Rect used for clipping or NULL to enclose all points.
|
||||
* enclosed
|
||||
* \param count the number of structures in the `points` array
|
||||
* \param clip an SDL_Rect used for clipping or NULL to enclose all points
|
||||
* \param result an SDL_Rect structure filled in with the minimal enclosing
|
||||
* rectangle.
|
||||
* rectangle
|
||||
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
||||
* points were outside of the clipping rectangle.
|
||||
*
|
||||
@@ -210,11 +210,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
|
||||
* both ends will be clipped to the boundary of the rectangle and the new
|
||||
* coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
|
||||
*
|
||||
* \param rect an SDL_Rect structure representing the rectangle to intersect.
|
||||
* \param X1 a pointer to the starting X-coordinate of the line.
|
||||
* \param Y1 a pointer to the starting Y-coordinate of the line.
|
||||
* \param X2 a pointer to the ending X-coordinate of the line.
|
||||
* \param Y2 a pointer to the ending Y-coordinate of the line.
|
||||
* \param rect an SDL_Rect structure representing the rectangle to intersect
|
||||
* \param X1 a pointer to the starting X-coordinate of the line
|
||||
* \param Y1 a pointer to the starting Y-coordinate of the line
|
||||
* \param X2 a pointer to the ending X-coordinate of the line
|
||||
* \param Y2 a pointer to the ending Y-coordinate of the line
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -274,8 +274,8 @@ SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b
|
||||
*
|
||||
* If either pointer is NULL the function will return SDL_FALSE.
|
||||
*
|
||||
* \param A an SDL_FRect structure representing the first rectangle.
|
||||
* \param B an SDL_FRect structure representing the second rectangle.
|
||||
* \param A an SDL_FRect structure representing the first rectangle
|
||||
* \param B an SDL_FRect structure representing the second rectangle
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.22.
|
||||
@@ -290,10 +290,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A,
|
||||
*
|
||||
* If `result` is NULL then this function will return SDL_FALSE.
|
||||
*
|
||||
* \param A an SDL_FRect structure representing the first rectangle.
|
||||
* \param B an SDL_FRect structure representing the second rectangle.
|
||||
* \param A an SDL_FRect structure representing the first rectangle
|
||||
* \param B an SDL_FRect structure representing the second rectangle
|
||||
* \param result an SDL_FRect structure filled in with the intersection of
|
||||
* rectangles `A` and `B`.
|
||||
* rectangles `A` and `B`
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.22.
|
||||
@@ -307,10 +307,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A,
|
||||
/**
|
||||
* Calculate the union of two rectangles with float precision.
|
||||
*
|
||||
* \param A an SDL_FRect structure representing the first rectangle.
|
||||
* \param B an SDL_FRect structure representing the second rectangle.
|
||||
* \param A an SDL_FRect structure representing the first rectangle
|
||||
* \param B an SDL_FRect structure representing the second rectangle
|
||||
* \param result an SDL_FRect structure filled in with the union of rectangles
|
||||
* `A` and `B`.
|
||||
* `A` and `B`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.22.
|
||||
*/
|
||||
@@ -326,11 +326,11 @@ extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A,
|
||||
* considered.
|
||||
*
|
||||
* \param points an array of SDL_FPoint structures representing points to be
|
||||
* enclosed.
|
||||
* \param count the number of structures in the `points` array.
|
||||
* \param clip an SDL_FRect used for clipping or NULL to enclose all points.
|
||||
* enclosed
|
||||
* \param count the number of structures in the `points` array
|
||||
* \param clip an SDL_FRect used for clipping or NULL to enclose all points
|
||||
* \param result an SDL_FRect structure filled in with the minimal enclosing
|
||||
* rectangle.
|
||||
* rectangle
|
||||
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
||||
* points were outside of the clipping rectangle.
|
||||
*
|
||||
@@ -351,11 +351,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points,
|
||||
* both ends will be clipped to the boundary of the rectangle and the new
|
||||
* coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
|
||||
*
|
||||
* \param rect an SDL_FRect structure representing the rectangle to intersect.
|
||||
* \param X1 a pointer to the starting X-coordinate of the line.
|
||||
* \param Y1 a pointer to the starting Y-coordinate of the line.
|
||||
* \param X2 a pointer to the ending X-coordinate of the line.
|
||||
* \param Y2 a pointer to the ending Y-coordinate of the line.
|
||||
* \param rect an SDL_FRect structure representing the rectangle to intersect
|
||||
* \param X1 a pointer to the starting X-coordinate of the line
|
||||
* \param Y1 a pointer to the starting Y-coordinate of the line
|
||||
* \param X2 a pointer to the ending X-coordinate of the line
|
||||
* \param Y2 a pointer to the ending Y-coordinate of the line
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.22.
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -19,13 +19,11 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: RWOPS */
|
||||
|
||||
/**
|
||||
* # CategoryRWOPS
|
||||
* \file SDL_rwops.h
|
||||
*
|
||||
* This file provides a general interface for SDL to read and write data
|
||||
* streams. It can easily be extended to files, memory, etc.
|
||||
* This file provides a general interface for SDL to read and write
|
||||
* data streams. It can easily be extended to files, memory, etc.
|
||||
*/
|
||||
|
||||
#ifndef SDL_rwops_h_
|
||||
@@ -59,7 +57,7 @@ typedef struct SDL_RWops
|
||||
Sint64 (SDLCALL * size) (struct SDL_RWops * context);
|
||||
|
||||
/**
|
||||
* Seek to `offset` relative to `whence`, one of stdio's whence values:
|
||||
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
||||
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
||||
*
|
||||
* \return the final offset in the data stream, or -1 on error.
|
||||
@@ -68,8 +66,8 @@ typedef struct SDL_RWops
|
||||
int whence);
|
||||
|
||||
/**
|
||||
* Read up to `maxnum` objects each of size `size` from the data
|
||||
* stream to the area pointed at by `ptr`.
|
||||
* Read up to \c maxnum objects each of size \c size from the data
|
||||
* stream to the area pointed at by \c ptr.
|
||||
*
|
||||
* \return the number of objects read, or 0 at error or end of file.
|
||||
*/
|
||||
@@ -77,8 +75,8 @@ typedef struct SDL_RWops
|
||||
size_t size, size_t maxnum);
|
||||
|
||||
/**
|
||||
* Write exactly `num` objects each of size `size` from the area
|
||||
* pointed at by `ptr` to data stream.
|
||||
* Write exactly \c num objects each of size \c size from the area
|
||||
* pointed at by \c ptr to data stream.
|
||||
*
|
||||
* \return the number of objects written, or 0 at error or end of file.
|
||||
*/
|
||||
@@ -188,7 +186,7 @@ typedef struct SDL_RWops
|
||||
*
|
||||
* Closing the SDL_RWops will close the file handle SDL is holding internally.
|
||||
*
|
||||
* \param file a UTF-8 string representing the filename to open.
|
||||
* \param file a UTF-8 string representing the filename to open
|
||||
* \param mode an ASCII string representing the mode to be used for opening
|
||||
* the file.
|
||||
* \returns a pointer to the SDL_RWops structure that is created, or NULL on
|
||||
@@ -226,10 +224,10 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
|
||||
* `FILE*`, depending on what system headers are available to SDL. It is
|
||||
* always intended to be the `FILE*` type from the C runtime's stdio.h.
|
||||
*
|
||||
* \param fp the `FILE*` that feeds the SDL_RWops stream.
|
||||
* \param fp the `FILE*` that feeds the SDL_RWops stream
|
||||
* \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
|
||||
* SDL_FALSE to leave the `FILE*` open when the RWops is
|
||||
* closed.
|
||||
* closed
|
||||
* \returns a pointer to the SDL_RWops structure that is created, or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -262,8 +260,8 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
|
||||
* If you need to make sure the RWops never writes to the memory buffer, you
|
||||
* should use SDL_RWFromConstMem() with a read-only buffer of memory instead.
|
||||
*
|
||||
* \param mem a pointer to a buffer to feed an SDL_RWops stream.
|
||||
* \param size the buffer size, in bytes.
|
||||
* \param mem a pointer to a buffer to feed an SDL_RWops stream
|
||||
* \param size the buffer size, in bytes
|
||||
* \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -297,8 +295,8 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
|
||||
* If you need to write to a memory buffer, you should use SDL_RWFromMem()
|
||||
* with a writable buffer of memory instead.
|
||||
*
|
||||
* \param mem a pointer to a read-only buffer to feed an SDL_RWops stream.
|
||||
* \param size the buffer size, in bytes.
|
||||
* \param mem a pointer to a read-only buffer to feed an SDL_RWops stream
|
||||
* \param size the buffer size, in bytes
|
||||
* \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -360,7 +358,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
||||
* creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must
|
||||
* be responsible for managing that memory in their **close** method.
|
||||
*
|
||||
* \param area the SDL_RWops structure to be freed.
|
||||
* \param area the SDL_RWops structure to be freed
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -368,7 +366,6 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
||||
|
||||
/* Possible `whence` values for SDL_RWops seeking... */
|
||||
#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
||||
#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
||||
#define RW_SEEK_END 2 /**< Seek relative to the end of data */
|
||||
@@ -378,7 +375,7 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context the SDL_RWops to get the size of the data stream from.
|
||||
* \param context the SDL_RWops to get the size of the data stream from
|
||||
* \returns the size of the data stream in the SDL_RWops on success, -1 if
|
||||
* unknown or a negative error code on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
@@ -405,10 +402,10 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context a pointer to an SDL_RWops structure.
|
||||
* \param context a pointer to an SDL_RWops structure
|
||||
* \param offset an offset in bytes, relative to **whence** location; can be
|
||||
* negative.
|
||||
* \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`.
|
||||
* negative
|
||||
* \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`
|
||||
* \returns the final offset in the data stream after the seek or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.10.
|
||||
@@ -435,7 +432,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context a SDL_RWops data stream object from which to get the current
|
||||
* offset.
|
||||
* offset
|
||||
* \returns the current offset in the stream, or -1 if the information can not
|
||||
* be determined.
|
||||
*
|
||||
@@ -465,10 +462,10 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context a pointer to an SDL_RWops structure.
|
||||
* \param ptr a pointer to a buffer to read data into.
|
||||
* \param size the size of each object to read, in bytes.
|
||||
* \param maxnum the maximum number of objects to be read.
|
||||
* \param context a pointer to an SDL_RWops structure
|
||||
* \param ptr a pointer to a buffer to read data into
|
||||
* \param size the size of each object to read, in bytes
|
||||
* \param maxnum the maximum number of objects to be read
|
||||
* \returns the number of objects read, or 0 at error or end of file; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -499,10 +496,10 @@ extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context a pointer to an SDL_RWops structure.
|
||||
* \param ptr a pointer to a buffer containing data to write.
|
||||
* \param size the size of an object to write, in bytes.
|
||||
* \param num the number of objects to write.
|
||||
* \param context a pointer to an SDL_RWops structure
|
||||
* \param ptr a pointer to a buffer containing data to write
|
||||
* \param size the size of an object to write, in bytes
|
||||
* \param num the number of objects to write
|
||||
* \returns the number of objects written, which will be less than **num** on
|
||||
* error; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -533,7 +530,7 @@ extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context SDL_RWops structure to close.
|
||||
* \param context SDL_RWops structure to close
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -558,9 +555,9 @@ extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
|
||||
*
|
||||
* The data should be freed with SDL_free().
|
||||
*
|
||||
* \param src the SDL_RWops to read all available data from.
|
||||
* \param datasize if not NULL, will store the number of bytes read.
|
||||
* \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning.
|
||||
* \param src the SDL_RWops to read all available data from
|
||||
* \param datasize if not NULL, will store the number of bytes read
|
||||
* \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning
|
||||
* \returns the data, or NULL if there was an error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
@@ -581,8 +578,8 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
|
||||
* Prior to SDL 2.0.10, this function was a macro wrapping around
|
||||
* SDL_LoadFile_RW.
|
||||
*
|
||||
* \param file the path to read all available data from.
|
||||
* \param datasize if not NULL, will store the number of bytes read.
|
||||
* \param file the path to read all available data from
|
||||
* \param datasize if not NULL, will store the number of bytes read
|
||||
* \returns the data, or NULL if there was an error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.10.
|
||||
@@ -599,7 +596,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
||||
/**
|
||||
* Use this function to read a byte from an SDL_RWops.
|
||||
*
|
||||
* \param src the SDL_RWops to read from.
|
||||
* \param src the SDL_RWops to read from
|
||||
* \returns the read byte on success or 0 on failure; call SDL_GetError() for
|
||||
* more information.
|
||||
*
|
||||
@@ -616,7 +613,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param src the stream from which to read data
|
||||
* \returns 16 bits of data in the native byte order of the platform.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -632,7 +629,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param src the stream from which to read data
|
||||
* \returns 16 bits of data in the native byte order of the platform.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -648,7 +645,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param src the stream from which to read data
|
||||
* \returns 32 bits of data in the native byte order of the platform.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -664,7 +661,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param src the stream from which to read data
|
||||
* \returns 32 bits of data in the native byte order of the platform.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -680,7 +677,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param src the stream from which to read data
|
||||
* \returns 64 bits of data in the native byte order of the platform.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -696,7 +693,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param src the stream from which to read data
|
||||
* \returns 64 bits of data in the native byte order of the platform.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -716,8 +713,8 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
||||
/**
|
||||
* Use this function to write a byte to an SDL_RWops.
|
||||
*
|
||||
* \param dst the SDL_RWops to write to.
|
||||
* \param value the byte value to write.
|
||||
* \param dst the SDL_RWops to write to
|
||||
* \param value the byte value to write
|
||||
* \returns 1 on success or 0 on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
@@ -735,8 +732,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
||||
* specifies native format, and the data written will be in little-endian
|
||||
* format.
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -752,8 +749,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -770,8 +767,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
||||
* specifies native format, and the data written will be in little-endian
|
||||
* format.
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -787,8 +784,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -805,8 +802,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
||||
* specifies native format, and the data written will be in little-endian
|
||||
* format.
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
@@ -822,8 +819,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryScancode
|
||||
* \file SDL_scancode.h
|
||||
*
|
||||
* Defines keyboard scancodes.
|
||||
* Defines keyboard scancodes.
|
||||
*/
|
||||
|
||||
#ifndef SDL_scancode_h_
|
||||
@@ -31,16 +31,16 @@
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/**
|
||||
* The SDL keyboard scancode representation.
|
||||
* \brief The SDL keyboard scancode representation.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys, among other places
|
||||
* in the SDL_Keysym::scancode key.keysym.scancode field of the SDL_Event
|
||||
* structure.
|
||||
* Values of this type are used to represent keyboard keys, among other places
|
||||
* in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
|
||||
* SDL_Event structure.
|
||||
*
|
||||
* The values in this enumeration are based on the USB usage page standard:
|
||||
* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
|
||||
* The values in this enumeration are based on the USB usage page standard:
|
||||
* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
|
||||
*/
|
||||
typedef enum SDL_Scancode
|
||||
typedef enum
|
||||
{
|
||||
SDL_SCANCODE_UNKNOWN = 0,
|
||||
|
||||
|
@@ -20,9 +20,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategorySensor
|
||||
* \file SDL_sensor.h
|
||||
*
|
||||
* Include file for SDL sensor event handling
|
||||
*
|
||||
* Include file for SDL sensor event handling
|
||||
*/
|
||||
|
||||
#ifndef SDL_sensor_h_
|
||||
@@ -43,7 +44,7 @@ extern "C" {
|
||||
* \brief SDL_sensor.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the SDL_INIT_SENSOR flag. This causes SDL to scan the system
|
||||
* with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
|
||||
* for sensors, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
@@ -51,67 +52,21 @@ struct _SDL_Sensor;
|
||||
typedef struct _SDL_Sensor SDL_Sensor;
|
||||
|
||||
/**
|
||||
* This is a unique ID for a sensor for the time it is connected to the
|
||||
* system, and is never reused for the lifetime of the application.
|
||||
* This is a unique ID for a sensor for the time it is connected to the system,
|
||||
* and is never reused for the lifetime of the application.
|
||||
*
|
||||
* The ID value starts at 0 and increments from there. The value -1 is an
|
||||
* invalid ID.
|
||||
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
||||
*/
|
||||
typedef Sint32 SDL_SensorID;
|
||||
|
||||
/**
|
||||
* The different sensors defined by SDL.
|
||||
/* The different sensors defined by SDL
|
||||
*
|
||||
* Additional sensors may be available, using platform dependent semantics.
|
||||
*
|
||||
* Here are the additional Android sensors:
|
||||
*
|
||||
* Hare are the additional Android sensors:
|
||||
* https://developer.android.com/reference/android/hardware/SensorEvent.html#values
|
||||
*
|
||||
* Accelerometer sensor notes:
|
||||
*
|
||||
* The accelerometer returns the current acceleration in SI meters per second
|
||||
* squared. This measurement includes the force of gravity, so a device at
|
||||
* rest will have an value of SDL_STANDARD_GRAVITY away from the center of the
|
||||
* earth, which is a positive Y value.
|
||||
*
|
||||
* - `values[0]`: Acceleration on the x axis
|
||||
* - `values[1]`: Acceleration on the y axis
|
||||
* - `values[2]`: Acceleration on the z axis
|
||||
*
|
||||
* For phones and tablets held in natural orientation and game controllers
|
||||
* held in front of you, the axes are defined as follows:
|
||||
*
|
||||
* - -X ... +X : left ... right
|
||||
* - -Y ... +Y : bottom ... top
|
||||
* - -Z ... +Z : farther ... closer
|
||||
*
|
||||
* The accelerometer axis data is not changed when the device is rotated.
|
||||
*
|
||||
* Gyroscope sensor notes:
|
||||
*
|
||||
* The gyroscope returns the current rate of rotation in radians per second.
|
||||
* The rotation is positive in the counter-clockwise direction. That is, an
|
||||
* observer looking from a positive location on one of the axes would see
|
||||
* positive rotation on that axis when it appeared to be rotating
|
||||
* counter-clockwise.
|
||||
*
|
||||
* - `values[0]`: Angular speed around the x axis (pitch)
|
||||
* - `values[1]`: Angular speed around the y axis (yaw)
|
||||
* - `values[2]`: Angular speed around the z axis (roll)
|
||||
*
|
||||
* For phones and tablets held in natural orientation and game controllers
|
||||
* held in front of you, the axes are defined as follows:
|
||||
*
|
||||
* - -X ... +X : left ... right
|
||||
* - -Y ... +Y : bottom ... top
|
||||
* - -Z ... +Z : farther ... closer
|
||||
*
|
||||
* The gyroscope axis data is not changed when the device is rotated.
|
||||
*
|
||||
* \sa SDL_GetDisplayOrientation
|
||||
*/
|
||||
typedef enum SDL_SensorType
|
||||
typedef enum
|
||||
{
|
||||
SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */
|
||||
SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */
|
||||
@@ -124,15 +79,53 @@ typedef enum SDL_SensorType
|
||||
} SDL_SensorType;
|
||||
|
||||
/**
|
||||
* A constant to represent standard gravity for accelerometer sensors.
|
||||
* Accelerometer sensor
|
||||
*
|
||||
* The accelerometer returns the current acceleration in SI meters per second
|
||||
* squared. This measurement includes the force of gravity, so a device at
|
||||
* rest will have an value of SDL_STANDARD_GRAVITY away from the center of the
|
||||
* earth, which is a positive Y value.
|
||||
* The accelerometer returns the current acceleration in SI meters per
|
||||
* second squared. This measurement includes the force of gravity, so
|
||||
* a device at rest will have an value of SDL_STANDARD_GRAVITY away
|
||||
* from the center of the earth, which is a positive Y value.
|
||||
*
|
||||
* values[0]: Acceleration on the x axis
|
||||
* values[1]: Acceleration on the y axis
|
||||
* values[2]: Acceleration on the z axis
|
||||
*
|
||||
* For phones held in portrait mode and game controllers held in front of you,
|
||||
* the axes are defined as follows:
|
||||
* -X ... +X : left ... right
|
||||
* -Y ... +Y : bottom ... top
|
||||
* -Z ... +Z : farther ... closer
|
||||
*
|
||||
* The axis data is not changed when the phone is rotated.
|
||||
*
|
||||
* \sa SDL_GetDisplayOrientation()
|
||||
*/
|
||||
#define SDL_STANDARD_GRAVITY 9.80665f
|
||||
|
||||
/**
|
||||
* Gyroscope sensor
|
||||
*
|
||||
* The gyroscope returns the current rate of rotation in radians per second.
|
||||
* The rotation is positive in the counter-clockwise direction. That is,
|
||||
* an observer looking from a positive location on one of the axes would
|
||||
* see positive rotation on that axis when it appeared to be rotating
|
||||
* counter-clockwise.
|
||||
*
|
||||
* values[0]: Angular speed around the x axis (pitch)
|
||||
* values[1]: Angular speed around the y axis (yaw)
|
||||
* values[2]: Angular speed around the z axis (roll)
|
||||
*
|
||||
* For phones held in portrait mode and game controllers held in front of you,
|
||||
* the axes are defined as follows:
|
||||
* -X ... +X : left ... right
|
||||
* -Y ... +Y : bottom ... top
|
||||
* -Z ... +Z : farther ... closer
|
||||
*
|
||||
* The axis data is not changed when the phone or controller is rotated.
|
||||
*
|
||||
* \sa SDL_GetDisplayOrientation()
|
||||
*/
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
@@ -162,7 +155,7 @@ extern DECLSPEC int SDLCALL SDL_NumSensors(void);
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor.
|
||||
*
|
||||
* \param device_index The sensor to obtain name from.
|
||||
* \param device_index The sensor to obtain name from
|
||||
* \returns the sensor name, or NULL if `device_index` is out of range.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -172,7 +165,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
*
|
||||
* \param device_index The sensor to get the type from.
|
||||
* \param device_index The sensor to get the type from
|
||||
* \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is
|
||||
* out of range.
|
||||
*
|
||||
@@ -183,7 +176,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index)
|
||||
/**
|
||||
* Get the platform dependent type of a sensor.
|
||||
*
|
||||
* \param device_index The sensor to check.
|
||||
* \param device_index The sensor to check
|
||||
* \returns the sensor platform dependent type, or -1 if `device_index` is out
|
||||
* of range.
|
||||
*
|
||||
@@ -194,7 +187,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index)
|
||||
/**
|
||||
* Get the instance ID of a sensor.
|
||||
*
|
||||
* \param device_index The sensor to get instance id from.
|
||||
* \param device_index The sensor to get instance id from
|
||||
* \returns the sensor instance ID, or -1 if `device_index` is out of range.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -204,7 +197,7 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_in
|
||||
/**
|
||||
* Open a sensor for use.
|
||||
*
|
||||
* \param device_index The sensor to open.
|
||||
* \param device_index The sensor to open
|
||||
* \returns an SDL_Sensor sensor object, or NULL if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -214,7 +207,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
|
||||
/**
|
||||
* Return the SDL_Sensor associated with an instance id.
|
||||
*
|
||||
* \param instance_id The sensor from instance id.
|
||||
* \param instance_id The sensor from instance id
|
||||
* \returns an SDL_Sensor object.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -224,7 +217,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instan
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor
|
||||
*
|
||||
* \param sensor The SDL_Sensor object.
|
||||
* \param sensor The SDL_Sensor object
|
||||
* \returns the sensor name, or NULL if `sensor` is NULL.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -234,7 +227,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to inspect.
|
||||
* \param sensor The SDL_Sensor object to inspect
|
||||
* \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is
|
||||
* NULL.
|
||||
*
|
||||
@@ -245,7 +238,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
|
||||
/**
|
||||
* Get the platform dependent type of a sensor.
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to inspect.
|
||||
* \param sensor The SDL_Sensor object to inspect
|
||||
* \returns the sensor platform dependent type, or -1 if `sensor` is NULL.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -255,7 +248,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
|
||||
/**
|
||||
* Get the instance ID of a sensor.
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to inspect.
|
||||
* \param sensor The SDL_Sensor object to inspect
|
||||
* \returns the sensor instance ID, or -1 if `sensor` is NULL.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -267,9 +260,9 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor)
|
||||
*
|
||||
* The number of values and interpretation of the data is sensor dependent.
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to query.
|
||||
* \param data A pointer filled with the current sensor state.
|
||||
* \param num_values The number of values to write to data.
|
||||
* \param sensor The SDL_Sensor object to query
|
||||
* \param data A pointer filled with the current sensor state
|
||||
* \param num_values The number of values to write to data
|
||||
* \returns 0 or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -282,11 +275,11 @@ extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, i
|
||||
*
|
||||
* The number of values and interpretation of the data is sensor dependent.
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to query.
|
||||
* \param sensor The SDL_Sensor object to query
|
||||
* \param timestamp A pointer filled with the timestamp in microseconds of the
|
||||
* current sensor reading if available, or 0 if not.
|
||||
* \param data A pointer filled with the current sensor state.
|
||||
* \param num_values The number of values to write to data.
|
||||
* current sensor reading if available, or 0 if not
|
||||
* \param data A pointer filled with the current sensor state
|
||||
* \param num_values The number of values to write to data
|
||||
* \returns 0 or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.26.0.
|
||||
@@ -296,7 +289,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, U
|
||||
/**
|
||||
* Close a sensor previously opened with SDL_SensorOpen().
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to close.
|
||||
* \param sensor The SDL_Sensor object to close
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*/
|
||||
|
@@ -48,18 +48,18 @@ extern "C" {
|
||||
* and flags.
|
||||
*
|
||||
* \param title The title of the window, in UTF-8 encoding.
|
||||
* \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or
|
||||
* SDL_WINDOWPOS_UNDEFINED.
|
||||
* \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or
|
||||
* SDL_WINDOWPOS_UNDEFINED.
|
||||
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
||||
* ::SDL_WINDOWPOS_UNDEFINED.
|
||||
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
||||
* ::SDL_WINDOWPOS_UNDEFINED.
|
||||
* \param w The width of the window.
|
||||
* \param h The height of the window.
|
||||
* \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
|
||||
* any of the following: SDL_WINDOW_OPENGL,
|
||||
* SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_HIDDEN,
|
||||
* SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED,
|
||||
* SDL_WINDOW_MINIMIZED, SDL_WINDOW_BORDERLESS is always set, and
|
||||
* SDL_WINDOW_FULLSCREEN is always unset.
|
||||
* any of the following: ::SDL_WINDOW_OPENGL,
|
||||
* ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN,
|
||||
* ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
|
||||
* ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set,
|
||||
* and ::SDL_WINDOW_FULLSCREEN is always unset.
|
||||
* \return the window created, or NULL if window creation failed.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
|
@@ -19,12 +19,10 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: StdInc */
|
||||
|
||||
/**
|
||||
* # CategoryStdInc
|
||||
* \file SDL_stdinc.h
|
||||
*
|
||||
* This is a general header that includes C language support.
|
||||
* This is a general header that includes C language support.
|
||||
*/
|
||||
|
||||
#ifndef SDL_stdinc_h_
|
||||
@@ -131,19 +129,15 @@ void *alloca(size_t);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The number of elements in an array.
|
||||
* The number of elements in an array.
|
||||
*/
|
||||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
||||
#define SDL_TABLESIZE(table) SDL_arraysize(table)
|
||||
|
||||
/**
|
||||
* Macro useful for building other macros with strings in them
|
||||
* Macro useful for building other macros with strings in them
|
||||
*
|
||||
* e.g:
|
||||
*
|
||||
* ```c
|
||||
* #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
|
||||
* ```
|
||||
* e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
|
||||
*/
|
||||
#define SDL_STRINGIFY_ARG(arg) #arg
|
||||
|
||||
@@ -191,61 +185,54 @@ typedef enum
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A signed 8-bit integer type.
|
||||
* \brief A signed 8-bit integer type.
|
||||
*/
|
||||
typedef int8_t Sint8;
|
||||
#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */
|
||||
#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */
|
||||
|
||||
typedef int8_t Sint8;
|
||||
/**
|
||||
* An unsigned 8-bit integer type.
|
||||
* \brief An unsigned 8-bit integer type.
|
||||
*/
|
||||
typedef uint8_t Uint8;
|
||||
#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */
|
||||
#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */
|
||||
|
||||
typedef uint8_t Uint8;
|
||||
/**
|
||||
* A signed 16-bit integer type.
|
||||
* \brief A signed 16-bit integer type.
|
||||
*/
|
||||
typedef int16_t Sint16;
|
||||
#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */
|
||||
#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */
|
||||
|
||||
typedef int16_t Sint16;
|
||||
/**
|
||||
* An unsigned 16-bit integer type.
|
||||
* \brief An unsigned 16-bit integer type.
|
||||
*/
|
||||
typedef uint16_t Uint16;
|
||||
#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */
|
||||
#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */
|
||||
|
||||
typedef uint16_t Uint16;
|
||||
/**
|
||||
* A signed 32-bit integer type.
|
||||
* \brief A signed 32-bit integer type.
|
||||
*/
|
||||
typedef int32_t Sint32;
|
||||
#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */
|
||||
#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
|
||||
|
||||
typedef int32_t Sint32;
|
||||
/**
|
||||
* An unsigned 32-bit integer type.
|
||||
* \brief An unsigned 32-bit integer type.
|
||||
*/
|
||||
typedef uint32_t Uint32;
|
||||
#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */
|
||||
#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */
|
||||
typedef uint32_t Uint32;
|
||||
|
||||
/**
|
||||
* A signed 64-bit integer type.
|
||||
* \brief A signed 64-bit integer type.
|
||||
*/
|
||||
typedef int64_t Sint64;
|
||||
#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */
|
||||
#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */
|
||||
|
||||
typedef int64_t Sint64;
|
||||
/**
|
||||
* An unsigned 64-bit integer type.
|
||||
* \brief An unsigned 64-bit integer type.
|
||||
*/
|
||||
typedef uint64_t Uint64;
|
||||
#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */
|
||||
#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
|
||||
|
||||
typedef uint64_t Uint64;
|
||||
|
||||
/* @} *//* Basic data types */
|
||||
|
||||
@@ -428,8 +415,8 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
||||
|
||||
/** \cond */
|
||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||
#if !defined(__VITA__) && !defined(__3DS__)
|
||||
/* TODO: include/SDL_stdinc.h:422: error: size of array 'SDL_dummy_enum' is negative */
|
||||
#if !defined(__ANDROID__) && !defined(__VITA__) && !defined(__3DS__)
|
||||
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
||||
typedef enum
|
||||
{
|
||||
DUMMY_ENUM_VALUE
|
||||
@@ -504,9 +491,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
||||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
typedef int (SDLCALL *SDL_CompareCallback)(const void *, const void *);
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare);
|
||||
extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback compare);
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
||||
|
||||
@@ -535,7 +521,6 @@ extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t le
|
||||
|
||||
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
||||
|
||||
/* Some safe(r) macros for zero'ing structures... */
|
||||
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
||||
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
||||
@@ -721,8 +706,6 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
||||
const char *fromcode,
|
||||
const char *inbuf,
|
||||
size_t inbytesleft);
|
||||
|
||||
/* Some helper macros for common cases... */
|
||||
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
|
||||
@@ -750,13 +733,6 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
|
||||
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
|
||||
/* not for windows: might conflict with string.h where strdup may have
|
||||
* dllimport attribute: https://github.com/libsdl-org/SDL/issues/12948 */
|
||||
char *strdup(const char *str);
|
||||
#endif
|
||||
|
||||
/* Starting LLVM 16, the analyser errors out if these functions do not have
|
||||
their prototype defined (clang-diagnostic-implicit-function-declaration) */
|
||||
#include <stdlib.h>
|
||||
@@ -802,9 +778,8 @@ SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_B
|
||||
}
|
||||
|
||||
/**
|
||||
* If a * b would overflow, return -1.
|
||||
*
|
||||
* Otherwise store a * b via ret and return 0.
|
||||
* If a * b would overflow, return -1. Otherwise store a * b via ret
|
||||
* and return 0.
|
||||
*
|
||||
* \since This function is available since SDL 2.24.0.
|
||||
*/
|
||||
@@ -833,9 +808,8 @@ SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a,
|
||||
#endif
|
||||
|
||||
/**
|
||||
* If a + b would overflow, return -1.
|
||||
*
|
||||
* Otherwise store a + b via ret and return 0.
|
||||
* If a + b would overflow, return -1. Otherwise store a + b via ret
|
||||
* and return 0.
|
||||
*
|
||||
* \since This function is available since SDL 2.24.0.
|
||||
*/
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategorySurface
|
||||
* \file SDL_surface.h
|
||||
*
|
||||
* Header file for SDL_Surface definition and management functions.
|
||||
* Header file for ::SDL_Surface definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_surface_h_
|
||||
@@ -43,7 +43,7 @@ extern "C" {
|
||||
/**
|
||||
* \name Surface flags
|
||||
*
|
||||
* These are the currently supported flags for the SDL_Surface.
|
||||
* These are the currently supported flags for the ::SDL_Surface.
|
||||
*
|
||||
* \internal
|
||||
* Used internally (read-only).
|
||||
@@ -57,17 +57,17 @@ extern "C" {
|
||||
/* @} *//* Surface flags */
|
||||
|
||||
/**
|
||||
* Evaluates to true if the surface needs to be locked before access.
|
||||
* Evaluates to true if the surface needs to be locked before access.
|
||||
*/
|
||||
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
||||
|
||||
typedef struct SDL_BlitMap SDL_BlitMap; /* this is an opaque type. */
|
||||
|
||||
/**
|
||||
* A collection of pixels used in software blitting.
|
||||
* \brief A collection of pixels used in software blitting.
|
||||
*
|
||||
* This structure should be treated as read-only, except for `pixels`, which,
|
||||
* if not NULL, contains the raw pixel data for the surface.
|
||||
* \note This structure should be treated as read-only, except for \c pixels,
|
||||
* which, if not NULL, contains the raw pixel data for the surface.
|
||||
*/
|
||||
typedef struct SDL_Surface
|
||||
{
|
||||
@@ -97,15 +97,15 @@ typedef struct SDL_Surface
|
||||
} SDL_Surface;
|
||||
|
||||
/**
|
||||
* The type of function used for surface blitting functions.
|
||||
* \brief The type of function used for surface blitting functions.
|
||||
*/
|
||||
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
||||
struct SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
/**
|
||||
* The formula used for converting between YUV and RGB
|
||||
* \brief The formula used for converting between YUV and RGB
|
||||
*/
|
||||
typedef enum SDL_YUV_CONVERSION_MODE
|
||||
typedef enum
|
||||
{
|
||||
SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
|
||||
SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
|
||||
@@ -140,14 +140,14 @@ typedef enum SDL_YUV_CONVERSION_MODE
|
||||
* You can change this by calling SDL_SetSurfaceBlendMode() and selecting a
|
||||
* different `blendMode`.
|
||||
*
|
||||
* \param flags the flags are unused and should be set to 0.
|
||||
* \param width the width of the surface.
|
||||
* \param height the height of the surface.
|
||||
* \param depth the depth of the surface in bits.
|
||||
* \param Rmask the red mask for the pixels.
|
||||
* \param Gmask the green mask for the pixels.
|
||||
* \param Bmask the blue mask for the pixels.
|
||||
* \param Amask the alpha mask for the pixels.
|
||||
* \param flags the flags are unused and should be set to 0
|
||||
* \param width the width of the surface
|
||||
* \param height the height of the surface
|
||||
* \param depth the depth of the surface in bits
|
||||
* \param Rmask the red mask for the pixels
|
||||
* \param Gmask the green mask for the pixels
|
||||
* \param Bmask the blue mask for the pixels
|
||||
* \param Amask the alpha mask for the pixels
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -171,10 +171,10 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
||||
* of providing pixel color masks, you provide it with a predefined format
|
||||
* from SDL_PixelFormatEnum.
|
||||
*
|
||||
* \param flags the flags are unused and should be set to 0.
|
||||
* \param width the width of the surface.
|
||||
* \param height the height of the surface.
|
||||
* \param depth the depth of the surface in bits.
|
||||
* \param flags the flags are unused and should be set to 0
|
||||
* \param width the width of the surface
|
||||
* \param height the height of the surface
|
||||
* \param depth the depth of the surface in bits
|
||||
* \param format the SDL_PixelFormatEnum for the new surface's pixel format.
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
@@ -198,15 +198,15 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
|
||||
* No copy is made of the pixel data. Pixel data is not managed automatically;
|
||||
* you must free the surface before you free the pixel data.
|
||||
*
|
||||
* \param pixels a pointer to existing pixel data.
|
||||
* \param width the width of the surface.
|
||||
* \param height the height of the surface.
|
||||
* \param depth the depth of the surface in bits.
|
||||
* \param pitch the pitch of the surface in bytes.
|
||||
* \param Rmask the red mask for the pixels.
|
||||
* \param Gmask the green mask for the pixels.
|
||||
* \param Bmask the blue mask for the pixels.
|
||||
* \param Amask the alpha mask for the pixels.
|
||||
* \param pixels a pointer to existing pixel data
|
||||
* \param width the width of the surface
|
||||
* \param height the height of the surface
|
||||
* \param depth the depth of the surface in bits
|
||||
* \param pitch the pitch of the surface in bytes
|
||||
* \param Rmask the red mask for the pixels
|
||||
* \param Gmask the green mask for the pixels
|
||||
* \param Bmask the blue mask for the pixels
|
||||
* \param Amask the alpha mask for the pixels
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -214,7 +214,6 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
|
||||
*
|
||||
* \sa SDL_CreateRGBSurface
|
||||
* \sa SDL_CreateRGBSurfaceWithFormat
|
||||
* \sa SDL_CreateRGBSurfaceWithFormatFrom
|
||||
* \sa SDL_FreeSurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
@@ -240,11 +239,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
* No copy is made of the pixel data. Pixel data is not managed automatically;
|
||||
* you must free the surface before you free the pixel data.
|
||||
*
|
||||
* \param pixels a pointer to existing pixel data.
|
||||
* \param width the width of the surface.
|
||||
* \param height the height of the surface.
|
||||
* \param depth the depth of the surface in bits.
|
||||
* \param pitch the pitch of the surface in bytes.
|
||||
* \param pixels a pointer to existing pixel data
|
||||
* \param width the width of the surface
|
||||
* \param height the height of the surface
|
||||
* \param depth the depth of the surface in bits
|
||||
* \param pitch the pitch of the surface in bytes
|
||||
* \param format the SDL_PixelFormatEnum for the new surface's pixel format.
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
@@ -279,8 +278,8 @@ extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
||||
*
|
||||
* A single palette can be shared with many surfaces.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to update.
|
||||
* \param palette the SDL_Palette structure to use.
|
||||
* \param surface the SDL_Surface structure to update
|
||||
* \param palette the SDL_Palette structure to use
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -301,7 +300,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
|
||||
* 0, then you can read and write to the surface at any time, and the pixel
|
||||
* format of the surface will not change.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to be locked.
|
||||
* \param surface the SDL_Surface structure to be locked
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -315,7 +314,7 @@ extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
|
||||
/**
|
||||
* Release a surface after directly accessing the pixels.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to be unlocked.
|
||||
* \param surface the SDL_Surface structure to be unlocked
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -330,11 +329,11 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
|
||||
* result in a memory leak.
|
||||
*
|
||||
* src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile.
|
||||
* Alternatively, you might also use the macro SDL_LoadBMP to load a bitmap
|
||||
* Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap
|
||||
* from a file, convert it to an SDL_Surface and then close the file.
|
||||
*
|
||||
* \param src the data stream for the surface.
|
||||
* \param freesrc non-zero to close the stream after being read.
|
||||
* \param src the data stream for the surface
|
||||
* \param freesrc non-zero to close the stream after being read
|
||||
* \returns a pointer to a new SDL_Surface structure or NULL if there was an
|
||||
* error; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -364,9 +363,9 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
||||
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
|
||||
* not supported.
|
||||
*
|
||||
* \param surface the SDL_Surface structure containing the image to be saved.
|
||||
* \param dst a data stream to save to.
|
||||
* \param freedst non-zero to close the stream after being written.
|
||||
* \param surface the SDL_Surface structure containing the image to be saved
|
||||
* \param dst a data stream to save to
|
||||
* \param freedst non-zero to close the stream after being written
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -379,9 +378,9 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
||||
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
|
||||
|
||||
/**
|
||||
* Save a surface to a file.
|
||||
* Save a surface to a file.
|
||||
*
|
||||
* Convenience macro.
|
||||
* Convenience macro.
|
||||
*/
|
||||
#define SDL_SaveBMP(surface, file) \
|
||||
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
||||
@@ -392,8 +391,8 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
||||
* If RLE is enabled, color key and alpha blending blits are much faster, but
|
||||
* the surface must be locked before directly accessing the pixels.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to optimize.
|
||||
* \param flag 0 to disable, non-zero to enable RLE acceleration.
|
||||
* \param surface the SDL_Surface structure to optimize
|
||||
* \param flag 0 to disable, non-zero to enable RLE acceleration
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -411,7 +410,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
|
||||
*
|
||||
* It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query.
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
@@ -433,9 +432,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
|
||||
* RLE acceleration can substantially speed up blitting of images with large
|
||||
* horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to update.
|
||||
* \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key.
|
||||
* \param key the transparent pixel.
|
||||
* \param surface the SDL_Surface structure to update
|
||||
* \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key
|
||||
* \param key the transparent pixel
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -452,7 +451,7 @@ extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
|
||||
*
|
||||
* It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query.
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
@@ -470,8 +469,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
|
||||
*
|
||||
* If the surface doesn't have color key enabled this function returns -1.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query.
|
||||
* \param key a pointer filled in with the transparent pixel.
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \param key a pointer filled in with the transparent pixel
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -492,10 +491,10 @@ extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
|
||||
*
|
||||
* `srcC = srcC * (color / 255)`
|
||||
*
|
||||
* \param surface the SDL_Surface structure to update.
|
||||
* \param r the red color value multiplied into blit operations.
|
||||
* \param g the green color value multiplied into blit operations.
|
||||
* \param b the blue color value multiplied into blit operations.
|
||||
* \param surface the SDL_Surface structure to update
|
||||
* \param r the red color value multiplied into blit operations
|
||||
* \param g the green color value multiplied into blit operations
|
||||
* \param b the blue color value multiplied into blit operations
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -511,10 +510,10 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
|
||||
/**
|
||||
* Get the additional color value multiplied into blit operations.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query.
|
||||
* \param r a pointer filled in with the current red color value.
|
||||
* \param g a pointer filled in with the current green color value.
|
||||
* \param b a pointer filled in with the current blue color value.
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \param r a pointer filled in with the current red color value
|
||||
* \param g a pointer filled in with the current green color value
|
||||
* \param b a pointer filled in with the current blue color value
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -535,8 +534,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
|
||||
*
|
||||
* `srcA = srcA * (alpha / 255)`
|
||||
*
|
||||
* \param surface the SDL_Surface structure to update.
|
||||
* \param alpha the alpha value multiplied into blit operations.
|
||||
* \param surface the SDL_Surface structure to update
|
||||
* \param alpha the alpha value multiplied into blit operations
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -551,8 +550,8 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
|
||||
/**
|
||||
* Get the additional alpha value used in blit operations.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query.
|
||||
* \param alpha a pointer filled in with the current alpha value.
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \param alpha a pointer filled in with the current alpha value
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -571,8 +570,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
|
||||
* existing data, the blendmode of the SOURCE surface should be set to
|
||||
* `SDL_BLENDMODE_NONE`.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to update.
|
||||
* \param blendMode the SDL_BlendMode to use for blit blending.
|
||||
* \param surface the SDL_Surface structure to update
|
||||
* \param blendMode the SDL_BlendMode to use for blit blending
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -586,8 +585,8 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
||||
/**
|
||||
* Get the blend mode used for blit operations.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query.
|
||||
* \param blendMode a pointer filled in with the current SDL_BlendMode.
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \param blendMode a pointer filled in with the current SDL_BlendMode
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -607,9 +606,9 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
||||
* Note that blits are automatically clipped to the edges of the source and
|
||||
* destination surfaces.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to be clipped.
|
||||
* \param surface the SDL_Surface structure to be clipped
|
||||
* \param rect the SDL_Rect structure representing the clipping rectangle, or
|
||||
* NULL to disable clipping.
|
||||
* NULL to disable clipping
|
||||
* \returns SDL_TRUE if the rectangle intersects the surface, otherwise
|
||||
* SDL_FALSE and blits will be completely clipped.
|
||||
*
|
||||
@@ -628,9 +627,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
|
||||
* rectangle is drawn into.
|
||||
*
|
||||
* \param surface the SDL_Surface structure representing the surface to be
|
||||
* clipped.
|
||||
* clipped
|
||||
* \param rect an SDL_Rect structure filled in with the clipping rectangle for
|
||||
* the surface.
|
||||
* the surface
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -659,11 +658,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface)
|
||||
* surface. The new, optimized surface can then be used as the source for
|
||||
* future blits, making them faster.
|
||||
*
|
||||
* \param src the existing SDL_Surface structure to convert.
|
||||
* \param src the existing SDL_Surface structure to convert
|
||||
* \param fmt the SDL_PixelFormat structure that the new surface is optimized
|
||||
* for.
|
||||
* for
|
||||
* \param flags the flags are unused and should be set to 0; this is a
|
||||
* leftover from SDL 1.2's API.
|
||||
* leftover from SDL 1.2's API
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -684,11 +683,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
|
||||
* it might be easier to call but it doesn't have access to palette
|
||||
* information for the destination surface, in case that would be important.
|
||||
*
|
||||
* \param src the existing SDL_Surface structure to convert.
|
||||
* \param src the existing SDL_Surface structure to convert
|
||||
* \param pixel_format the SDL_PixelFormatEnum that the new surface is
|
||||
* optimized for.
|
||||
* optimized for
|
||||
* \param flags the flags are unused and should be set to 0; this is a
|
||||
* leftover from SDL 1.2's API.
|
||||
* leftover from SDL 1.2's API
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -704,14 +703,14 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
|
||||
/**
|
||||
* Copy a block of pixels of one format to another format.
|
||||
*
|
||||
* \param width the width of the block to copy, in pixels.
|
||||
* \param height the height of the block to copy, in pixels.
|
||||
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format.
|
||||
* \param src a pointer to the source pixels.
|
||||
* \param src_pitch the pitch of the source pixels, in bytes.
|
||||
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format.
|
||||
* \param dst a pointer to be filled in with new pixel data.
|
||||
* \param dst_pitch the pitch of the destination pixels, in bytes.
|
||||
* \param width the width of the block to copy, in pixels
|
||||
* \param height the height of the block to copy, in pixels
|
||||
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
|
||||
* \param src a pointer to the source pixels
|
||||
* \param src_pitch the pitch of the source pixels, in bytes
|
||||
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
|
||||
* \param dst a pointer to be filled in with new pixel data
|
||||
* \param dst_pitch the pitch of the destination pixels, in bytes
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -730,14 +729,14 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
||||
*
|
||||
* This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
|
||||
*
|
||||
* \param width the width of the block to convert, in pixels.
|
||||
* \param height the height of the block to convert, in pixels.
|
||||
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format.
|
||||
* \param src a pointer to the source pixels.
|
||||
* \param src_pitch the pitch of the source pixels, in bytes.
|
||||
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format.
|
||||
* \param dst a pointer to be filled in with premultiplied pixel data.
|
||||
* \param dst_pitch the pitch of the destination pixels, in bytes.
|
||||
* \param width the width of the block to convert, in pixels
|
||||
* \param height the height of the block to convert, in pixels
|
||||
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
|
||||
* \param src a pointer to the source pixels
|
||||
* \param src_pitch the pitch of the source pixels, in bytes
|
||||
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
|
||||
* \param dst a pointer to be filled in with premultiplied pixel data
|
||||
* \param dst_pitch the pitch of the destination pixels, in bytes
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -761,10 +760,10 @@ extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
|
||||
* SDL_SetClipRect()), then this function will fill based on the intersection
|
||||
* of the clip rectangle and `rect`.
|
||||
*
|
||||
* \param dst the SDL_Surface structure that is the drawing target.
|
||||
* \param dst the SDL_Surface structure that is the drawing target
|
||||
* \param rect the SDL_Rect structure representing the rectangle to fill, or
|
||||
* NULL to fill the entire surface.
|
||||
* \param color the color to fill with.
|
||||
* NULL to fill the entire surface
|
||||
* \param color the color to fill with
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -787,10 +786,10 @@ extern DECLSPEC int SDLCALL SDL_FillRect
|
||||
* SDL_SetClipRect()), then this function will fill based on the intersection
|
||||
* of the clip rectangle and `rect`.
|
||||
*
|
||||
* \param dst the SDL_Surface structure that is the drawing target.
|
||||
* \param rects an array of SDL_Rect representing the rectangles to fill.
|
||||
* \param count the number of rectangles in the array.
|
||||
* \param color the color to fill with.
|
||||
* \param dst the SDL_Surface structure that is the drawing target
|
||||
* \param rects an array of SDL_Rects representing the rectangles to fill.
|
||||
* \param count the number of rectangles in the array
|
||||
* \param color the color to fill with
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -802,64 +801,62 @@ extern DECLSPEC int SDLCALL SDL_FillRects
|
||||
(SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
|
||||
|
||||
/* !!! FIXME: merge this documentation with the wiki */
|
||||
|
||||
/**
|
||||
* Performs a fast blit from the source surface to the destination surface.
|
||||
* Performs a fast blit from the source surface to the destination surface.
|
||||
*
|
||||
* This assumes that the source and destination rectangles are the same size.
|
||||
* If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
|
||||
* `dst`) is copied. The final blit rectangle is saved in `dstrect` after all
|
||||
* clipping is performed.
|
||||
* This assumes that the source and destination rectangles are
|
||||
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
|
||||
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
|
||||
* in \c srcrect and \c dstrect after all clipping is performed.
|
||||
*
|
||||
* The blit function should not be called on a locked surface.
|
||||
* \returns 0 if the blit is successful, otherwise it returns -1.
|
||||
*
|
||||
* The blit semantics for surfaces with and without blending and colorkey are
|
||||
* defined as follows:
|
||||
* The blit function should not be called on a locked surface.
|
||||
*
|
||||
* ```
|
||||
* RGBA->RGB:
|
||||
* Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
* alpha-blend (using the source alpha-channel and per-surface alpha)
|
||||
* SDL_SRCCOLORKEY ignored.
|
||||
* Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
* copy RGB.
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* RGB values of the source color key, ignoring alpha in the
|
||||
* comparison.
|
||||
* The blit semantics for surfaces with and without blending and colorkey
|
||||
* are defined as follows:
|
||||
* \verbatim
|
||||
RGBA->RGB:
|
||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
alpha-blend (using the source alpha-channel and per-surface alpha)
|
||||
SDL_SRCCOLORKEY ignored.
|
||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
copy RGB.
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
RGB values of the source color key, ignoring alpha in the
|
||||
comparison.
|
||||
|
||||
RGB->RGBA:
|
||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
alpha-blend (using the source per-surface alpha)
|
||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
copy RGB, set destination alpha to source per-surface alpha value.
|
||||
both:
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
source color key.
|
||||
|
||||
RGBA->RGBA:
|
||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
alpha-blend (using the source alpha-channel and per-surface alpha)
|
||||
SDL_SRCCOLORKEY ignored.
|
||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
copy all of RGBA to the destination.
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
RGB values of the source color key, ignoring alpha in the
|
||||
comparison.
|
||||
|
||||
RGB->RGB:
|
||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
alpha-blend (using the source per-surface alpha)
|
||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
copy RGB.
|
||||
both:
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
source color key.
|
||||
\endverbatim
|
||||
*
|
||||
* RGB->RGBA:
|
||||
* Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
* alpha-blend (using the source per-surface alpha)
|
||||
* Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
* copy RGB, set destination alpha to source per-surface alpha value.
|
||||
* both:
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* source color key.
|
||||
*
|
||||
* RGBA->RGBA:
|
||||
* Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
* alpha-blend (using the source alpha-channel and per-surface alpha)
|
||||
* SDL_SRCCOLORKEY ignored.
|
||||
* Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
* copy all of RGBA to the destination.
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* RGB values of the source color key, ignoring alpha in the
|
||||
* comparison.
|
||||
*
|
||||
* RGB->RGB:
|
||||
* Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
||||
* alpha-blend (using the source per-surface alpha)
|
||||
* Source surface blend mode set to SDL_BLENDMODE_NONE:
|
||||
* copy RGB.
|
||||
* both:
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* source color key.
|
||||
* ```
|
||||
*
|
||||
* You should call SDL_BlitSurface() unless you know exactly how SDL blitting
|
||||
* works internally and how to use the other blit functions.
|
||||
*
|
||||
* \returns 0 if the blit is successful, otherwise it returns -1.
|
||||
* You should call SDL_BlitSurface() unless you know exactly how SDL
|
||||
* blitting works internally and how to use the other blit functions.
|
||||
*/
|
||||
#define SDL_BlitSurface SDL_UpperBlit
|
||||
|
||||
@@ -886,12 +883,12 @@ extern DECLSPEC int SDLCALL SDL_UpperBlit
|
||||
* Unless you know what you're doing, you should be using SDL_BlitSurface()
|
||||
* instead.
|
||||
*
|
||||
* \param src the SDL_Surface structure to be copied from.
|
||||
* \param src the SDL_Surface structure to be copied from
|
||||
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
||||
* copied, or NULL to copy the entire surface.
|
||||
* \param dst the SDL_Surface structure that is the blit target.
|
||||
* copied, or NULL to copy the entire surface
|
||||
* \param dst the SDL_Surface structure that is the blit target
|
||||
* \param dstrect the SDL_Rect structure representing the rectangle that is
|
||||
* copied into.
|
||||
* copied into
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -928,6 +925,8 @@ extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
|
||||
const SDL_Rect * dstrect);
|
||||
|
||||
|
||||
#define SDL_BlitScaled SDL_UpperBlitScaled
|
||||
|
||||
/**
|
||||
* Perform a scaled surface copy to a destination surface.
|
||||
*
|
||||
@@ -942,21 +941,18 @@ extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
|
||||
(SDL_Surface * src, const SDL_Rect * srcrect,
|
||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
#define SDL_BlitScaled SDL_UpperBlitScaled
|
||||
|
||||
|
||||
/**
|
||||
* Perform low-level surface scaled blitting only.
|
||||
*
|
||||
* This is a semi-private function and it performs low-level surface blitting,
|
||||
* assuming the input rectangles have already been clipped.
|
||||
*
|
||||
* \param src the SDL_Surface structure to be copied from.
|
||||
* \param src the SDL_Surface structure to be copied from
|
||||
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
||||
* copied.
|
||||
* \param dst the SDL_Surface structure that is the blit target.
|
||||
* copied
|
||||
* \param dst the SDL_Surface structure that is the blit target
|
||||
* \param dstrect the SDL_Rect structure representing the rectangle that is
|
||||
* copied into.
|
||||
* copied into
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategorySystem
|
||||
* \file SDL_system.h
|
||||
*
|
||||
* Include file for platform specific SDL API functions
|
||||
* Include file for platform specific SDL API functions
|
||||
*/
|
||||
|
||||
#ifndef SDL_system_h_
|
||||
@@ -49,7 +49,7 @@ typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsi
|
||||
* Set a callback for every Windows message, run before TranslateMessage().
|
||||
*
|
||||
* \param callback The SDL_WindowsMessageHook function to call.
|
||||
* \param userdata a pointer to pass to every iteration of `callback`.
|
||||
* \param userdata a pointer to pass to every iteration of `callback`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*/
|
||||
@@ -66,7 +66,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook ca
|
||||
* controls on which monitor a full screen application will appear.
|
||||
*
|
||||
* \param displayIndex the display index for which to get the D3D9 adapter
|
||||
* index.
|
||||
* index
|
||||
* \returns the D3D9 adapter index on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -82,7 +82,7 @@ typedef struct IDirect3DDevice9 IDirect3DDevice9;
|
||||
* Once you are done using the device, you should release it to avoid a
|
||||
* resource leak.
|
||||
*
|
||||
* \param renderer the renderer from which to get the associated D3D device.
|
||||
* \param renderer the renderer from which to get the associated D3D device
|
||||
* \returns the D3D9 device associated with given renderer or NULL if it is
|
||||
* not a D3D9 renderer; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -98,7 +98,7 @@ typedef struct ID3D11Device ID3D11Device;
|
||||
* Once you are done using the device, you should release it to avoid a
|
||||
* resource leak.
|
||||
*
|
||||
* \param renderer the renderer from which to get the associated D3D11 device.
|
||||
* \param renderer the renderer from which to get the associated D3D11 device
|
||||
* \returns the D3D11 device associated with given renderer or NULL if it is
|
||||
* not a D3D11 renderer; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -118,7 +118,7 @@ typedef struct ID3D12Device ID3D12Device;
|
||||
* Once you are done using the device, you should release it to avoid a
|
||||
* resource leak.
|
||||
*
|
||||
* \param renderer the renderer from which to get the associated D3D12 device.
|
||||
* \param renderer the renderer from which to get the associated D3D12 device
|
||||
* \returns the D3D12 device associated with given renderer or NULL if it is
|
||||
* not a D3D12 renderer; call SDL_GetError() for more information.
|
||||
*
|
||||
@@ -140,9 +140,9 @@ extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* ren
|
||||
* Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
|
||||
* returns an SDL_bool.
|
||||
*
|
||||
* \param displayIndex the display index for which to get both indices.
|
||||
* \param adapterIndex a pointer to be filled in with the adapter index.
|
||||
* \param outputIndex a pointer to be filled in with the output index.
|
||||
* \param displayIndex the display index for which to get both indices
|
||||
* \param adapterIndex a pointer to be filled in with the adapter index
|
||||
* \param outputIndex a pointer to be filled in with the output index
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@@ -176,7 +176,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
|
||||
* \param threadID The Unix thread ID to change priority of.
|
||||
* \param sdlPriority The new SDL_ThreadPriority value.
|
||||
* \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
|
||||
* SCHED_OTHER, etc...).
|
||||
* SCHED_OTHER, etc...)
|
||||
* \returns 0 on success, or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
@@ -188,7 +188,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
||||
/* Platform specific functions for iOS */
|
||||
#ifdef __IPHONEOS__
|
||||
|
||||
typedef void (SDLCALL *SDL_iOSAnimationCallback)(void*);
|
||||
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
||||
|
||||
/**
|
||||
* Use this function to set the animation callback on Apple iOS.
|
||||
@@ -210,9 +210,9 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void*);
|
||||
* This functions is also accessible using the macro
|
||||
* SDL_iOSSetAnimationCallback() since SDL 2.0.4.
|
||||
*
|
||||
* \param window the window for which the animation callback should be set.
|
||||
* \param window the window for which the animation callback should be set
|
||||
* \param interval the number of frames after which **callback** will be
|
||||
* called.
|
||||
* called
|
||||
* \param callback the function to call for every frame.
|
||||
* \param callbackParam a pointer that is passed to `callback`.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
@@ -222,10 +222,9 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void*);
|
||||
*
|
||||
* \sa SDL_iPhoneSetEventPump
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
||||
|
||||
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
|
||||
|
||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
||||
|
||||
/**
|
||||
* Use this function to enable or disable the SDL event pump on Apple iOS.
|
||||
@@ -235,7 +234,7 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window,
|
||||
* This functions is also accessible using the macro SDL_iOSSetEventPump()
|
||||
* since SDL 2.0.4.
|
||||
*
|
||||
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it.
|
||||
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
@@ -243,9 +242,6 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window,
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
||||
|
||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
||||
|
||||
/* end of iOS-specific functions. */
|
||||
#endif /* __IPHONEOS__ */
|
||||
|
||||
|
||||
@@ -360,9 +356,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
||||
extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
||||
|
||||
/**
|
||||
* See the official Android developer guide for more information:
|
||||
* http://developer.android.com/guide/topics/data/data-storage.html
|
||||
*/
|
||||
See the official Android developer guide for more information:
|
||||
http://developer.android.com/guide/topics/data/data-storage.html
|
||||
*/
|
||||
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
|
||||
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
|
||||
|
||||
@@ -445,11 +441,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permis
|
||||
*
|
||||
* https://developer.android.com/reference/android/view/Gravity
|
||||
*
|
||||
* \param message text message to be shown.
|
||||
* \param duration 0=short, 1=long.
|
||||
* \param message text message to be shown
|
||||
* \param duration 0=short, 1=long
|
||||
* \param gravity where the notification should appear on the screen.
|
||||
* \param xoffset set this parameter only when gravity >=0.
|
||||
* \param yoffset set this parameter only when gravity >=0.
|
||||
* \param xoffset set this parameter only when gravity >=0
|
||||
* \param yoffset set this parameter only when gravity >=0
|
||||
* \returns 0 if success, -1 if any error occurs.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
@@ -461,8 +457,8 @@ extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int durati
|
||||
*
|
||||
* Override "boolean onUnhandledMessage(Message msg)" to handle the message.
|
||||
*
|
||||
* \param command user command that must be greater or equal to 0x8000.
|
||||
* \param param user parameter.
|
||||
* \param command user command that must be greater or equal to 0x8000
|
||||
* \param param user parameter
|
||||
*
|
||||
* \since This function is available since SDL 2.0.22.
|
||||
*/
|
||||
@@ -474,9 +470,9 @@ extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
#ifdef __WINRT__
|
||||
|
||||
/**
|
||||
* WinRT / Windows Phone path types
|
||||
* \brief WinRT / Windows Phone path types
|
||||
*/
|
||||
typedef enum SDL_WinRT_Path
|
||||
typedef enum
|
||||
{
|
||||
/** \brief The installed app's root directory.
|
||||
Files here are likely to be read-only. */
|
||||
@@ -498,9 +494,9 @@ typedef enum SDL_WinRT_Path
|
||||
|
||||
|
||||
/**
|
||||
* WinRT Device Family
|
||||
* \brief WinRT Device Family
|
||||
*/
|
||||
typedef enum SDL_WinRT_DeviceFamily
|
||||
typedef enum
|
||||
{
|
||||
/** \brief Unknown family */
|
||||
SDL_WINRT_DEVICEFAMILY_UNKNOWN,
|
||||
@@ -528,7 +524,7 @@ typedef enum SDL_WinRT_DeviceFamily
|
||||
*
|
||||
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
||||
*
|
||||
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
|
||||
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path
|
||||
* \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
|
||||
* the path is not available for any reason; call SDL_GetError() for
|
||||
* more information.
|
||||
@@ -551,7 +547,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path
|
||||
*
|
||||
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
||||
*
|
||||
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
|
||||
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path
|
||||
* \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
|
||||
* the path is not available for any reason; call SDL_GetError() for
|
||||
* more information.
|
||||
|
@@ -19,17 +19,10 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: SYSWM */
|
||||
|
||||
/*
|
||||
* # CategorySYSWM
|
||||
/**
|
||||
* \file SDL_syswm.h
|
||||
*
|
||||
* Include file for SDL custom system window manager hooks.
|
||||
*
|
||||
* Your application has access to a special type of event SDL_SYSWMEVENT,
|
||||
* which contains window-manager specific information and arrives whenever
|
||||
* an unhandled window event occurs. This event is ignored by default, but
|
||||
* you can enable it with SDL_EventState().
|
||||
* Include file for SDL custom system window manager hooks.
|
||||
*/
|
||||
|
||||
#ifndef SDL_syswm_h_
|
||||
@@ -40,6 +33,14 @@
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_version.h"
|
||||
|
||||
/**
|
||||
* \brief SDL_syswm.h
|
||||
*
|
||||
* Your application has access to a special type of event ::SDL_SYSWMEVENT,
|
||||
* which contains window-manager specific information and arrives whenever
|
||||
* an unhandled window event occurs. This event is ignored by default, but
|
||||
* you can enable it with SDL_EventState().
|
||||
*/
|
||||
struct SDL_SysWMinfo;
|
||||
|
||||
#if !defined(SDL_PROTOTYPES_ONLY)
|
||||
@@ -128,11 +129,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(SDL_PROTOTYPES_ONLY)
|
||||
|
||||
/**
|
||||
* These are the various supported windowing subsystems
|
||||
* These are the various supported windowing subsystems
|
||||
*/
|
||||
typedef enum SDL_SYSWM_TYPE
|
||||
typedef enum
|
||||
{
|
||||
SDL_SYSWM_UNKNOWN,
|
||||
SDL_SYSWM_WINDOWS,
|
||||
@@ -152,7 +152,7 @@ typedef enum SDL_SYSWM_TYPE
|
||||
} SDL_SYSWM_TYPE;
|
||||
|
||||
/**
|
||||
* The custom event structure.
|
||||
* The custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
@@ -218,10 +218,10 @@ struct SDL_SysWMmsg
|
||||
};
|
||||
|
||||
/**
|
||||
* The custom window manager information structure.
|
||||
* The custom window manager information structure.
|
||||
*
|
||||
* When this structure is returned, it holds information about which low level
|
||||
* system it is using, and will be one of SDL_SYSWM_TYPE.
|
||||
* When this structure is returned, it holds information about which
|
||||
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
|
||||
*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
@@ -363,8 +363,8 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
||||
* `SDL_VERSION(&info.version)`, and then this function will fill in the rest
|
||||
* of the structure with information about the given window.
|
||||
*
|
||||
* \param window the window about which information is being requested.
|
||||
* \param info an SDL_SysWMinfo structure filled in with window information.
|
||||
* \param window the window about which information is being requested
|
||||
* \param info an SDL_SysWMinfo structure filled in with window information
|
||||
* \returns SDL_TRUE if the function is implemented and the `version` member
|
||||
* of the `info` struct is valid, or SDL_FALSE if the information
|
||||
* could not be retrieved; call SDL_GetError() for more information.
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test_assert.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
@@ -42,17 +42,17 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Fails the assert.
|
||||
*/
|
||||
#define ASSERT_FAIL 0
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Passes the assert.
|
||||
*/
|
||||
#define ASSERT_PASS 1
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Assert that logs and break execution flow on failures.
|
||||
*
|
||||
* \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
|
||||
@@ -60,7 +60,7 @@ extern "C" {
|
||||
*/
|
||||
void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
|
||||
*
|
||||
* \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
|
||||
@@ -70,25 +70,25 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as
|
||||
*/
|
||||
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
|
||||
*
|
||||
* \param assertDescription Message to log with the assert describing it.
|
||||
*/
|
||||
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Resets the assert summary counters to zero.
|
||||
*/
|
||||
void SDLTest_ResetAssertSummary(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
|
||||
*/
|
||||
void SDLTest_LogAssertSummary(void);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Converts the current assert summary state to a test result.
|
||||
*
|
||||
* \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test_common.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
@@ -129,7 +129,7 @@ extern "C" {
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Parse command line parameters and create common state.
|
||||
*
|
||||
* \param argv Array of command line parameters
|
||||
@@ -139,7 +139,7 @@ extern "C" {
|
||||
*/
|
||||
SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Process one common argument.
|
||||
*
|
||||
* \param state The common state describing the test window to create.
|
||||
@@ -150,7 +150,7 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
|
||||
int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Logs command line usage info.
|
||||
*
|
||||
* This logs the appropriate command line options for the subsystems in use
|
||||
@@ -164,7 +164,7 @@ int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
|
||||
*/
|
||||
void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Returns common usage information
|
||||
*
|
||||
* You should (probably) be using SDLTest_CommonLogUsage() instead, but this
|
||||
@@ -177,7 +177,7 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, cons
|
||||
*/
|
||||
const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Open test window.
|
||||
*
|
||||
* \param state The common state describing the test window to create.
|
||||
@@ -186,7 +186,7 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
|
||||
*/
|
||||
SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Easy argument handling when test app doesn't need any custom args.
|
||||
*
|
||||
* \param state The common state describing the test window to create.
|
||||
@@ -197,7 +197,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
|
||||
*/
|
||||
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Common event handler for test windows.
|
||||
*
|
||||
* \param state The common state used to create test window.
|
||||
@@ -207,7 +207,7 @@ SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc,
|
||||
*/
|
||||
void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Close test window.
|
||||
*
|
||||
* \param state The common state used to create test window.
|
||||
@@ -215,7 +215,7 @@ void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *do
|
||||
*/
|
||||
void SDLTest_CommonQuit(SDLTest_CommonState * state);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Draws various window information (position, size, etc.) to the renderer.
|
||||
*
|
||||
* \param renderer The renderer to draw to.
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test_compare.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
@@ -46,7 +46,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Compares a surface and with reference image data for equality
|
||||
*
|
||||
* \param surface Surface used in comparison
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test_crc32.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
@@ -60,7 +60,7 @@ extern "C" {
|
||||
#define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */
|
||||
#endif
|
||||
|
||||
/*
|
||||
/**
|
||||
* Data structure for CRC32 (checksum) computation
|
||||
*/
|
||||
typedef struct {
|
||||
@@ -69,7 +69,7 @@ extern "C" {
|
||||
|
||||
/* ---------- Function Prototypes ------------- */
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Initialize the CRC context
|
||||
*
|
||||
* Note: The function initializes the crc table required for all crc calculations.
|
||||
@@ -82,7 +82,7 @@ extern "C" {
|
||||
int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief calculate a crc32 from a data block
|
||||
*
|
||||
* \param crcContext pointer to context variable
|
||||
@@ -101,7 +101,7 @@ int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
|
||||
int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief clean up CRC context
|
||||
*
|
||||
* \param crcContext pointer to context variable
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test_font.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
@@ -41,7 +41,7 @@ extern "C" {
|
||||
#define FONT_CHARACTER_SIZE 8
|
||||
#define FONT_LINE_HEIGHT (FONT_CHARACTER_SIZE + 2)
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Draw a string in the currently set font.
|
||||
*
|
||||
* \param renderer The renderer to draw on.
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
*/
|
||||
int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Draw a UTF-8 string in the currently set font.
|
||||
*
|
||||
* The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets.
|
||||
@@ -67,7 +67,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c);
|
||||
*/
|
||||
int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Data used for multi-line text output
|
||||
*/
|
||||
typedef struct SDLTest_TextWindow
|
||||
@@ -78,7 +78,7 @@ typedef struct SDLTest_TextWindow
|
||||
char **lines;
|
||||
} SDLTest_TextWindow;
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Create a multi-line text output window
|
||||
*
|
||||
* \param x The X coordinate of the upper left corner of the window.
|
||||
@@ -92,7 +92,7 @@ typedef struct SDLTest_TextWindow
|
||||
*/
|
||||
SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Display a multi-line text output window
|
||||
*
|
||||
* This function should be called every frame to display the text
|
||||
@@ -104,7 +104,7 @@ SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h);
|
||||
*/
|
||||
void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Add text to a multi-line text output window
|
||||
*
|
||||
* Adds UTF-8 text to the end of the current text. The newline character starts a
|
||||
@@ -119,7 +119,7 @@ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *render
|
||||
*/
|
||||
void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Add text to a multi-line text output window
|
||||
*
|
||||
* Adds UTF-8 text to the end of the current text. The newline character starts a
|
||||
@@ -134,7 +134,7 @@ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_ST
|
||||
*/
|
||||
void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Clear the text in a multi-line text output window
|
||||
*
|
||||
* \param textwin The text output window
|
||||
@@ -143,7 +143,7 @@ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char
|
||||
*/
|
||||
void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Free the storage associated with a multi-line text output window
|
||||
*
|
||||
* \param textwin The text output window
|
||||
@@ -152,7 +152,7 @@ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
|
||||
*/
|
||||
void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Cleanup textures used by font drawing functions.
|
||||
*/
|
||||
void SDLTest_CleanupTextDrawing(void);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file SDL_test_fuzzer.h
|
||||
*
|
||||
* Include file for SDL test framework.
|
||||
@@ -48,13 +48,13 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \file
|
||||
* Note: The fuzzer implementation uses a static instance of random context
|
||||
* internally which makes it thread-UNsafe.
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* Initializes the fuzzer for a test
|
||||
*
|
||||
* \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
|
||||
@@ -63,14 +63,14 @@ extern "C" {
|
||||
void SDLTest_FuzzerInit(Uint64 execKey);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random Uint8
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Uint8 SDLTest_RandomUint8(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random Sint8
|
||||
*
|
||||
* \returns a generated signed integer
|
||||
@@ -78,14 +78,14 @@ Uint8 SDLTest_RandomUint8(void);
|
||||
Sint8 SDLTest_RandomSint8(void);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random Uint16
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Uint16 SDLTest_RandomUint16(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random Sint16
|
||||
*
|
||||
* \returns a generated signed integer
|
||||
@@ -93,7 +93,7 @@ Uint16 SDLTest_RandomUint16(void);
|
||||
Sint16 SDLTest_RandomSint16(void);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random integer
|
||||
*
|
||||
* \returns a generated integer
|
||||
@@ -101,14 +101,14 @@ Sint16 SDLTest_RandomSint16(void);
|
||||
Sint32 SDLTest_RandomSint32(void);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random positive integer
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Uint32 SDLTest_RandomUint32(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns random Uint64.
|
||||
*
|
||||
* \returns a generated integer
|
||||
@@ -116,36 +116,36 @@ Uint32 SDLTest_RandomUint32(void);
|
||||
Uint64 SDLTest_RandomUint64(void);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns random Sint64.
|
||||
*
|
||||
* \returns a generated signed integer
|
||||
*/
|
||||
Sint64 SDLTest_RandomSint64(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \returns a random float in range [0.0 - 1.0]
|
||||
*/
|
||||
float SDLTest_RandomUnitFloat(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \returns a random double in range [0.0 - 1.0]
|
||||
*/
|
||||
double SDLTest_RandomUnitDouble(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \returns a random float.
|
||||
*
|
||||
*/
|
||||
float SDLTest_RandomFloat(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \returns a random double.
|
||||
*
|
||||
*/
|
||||
double SDLTest_RandomDouble(void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Uint8 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -166,7 +166,7 @@ double SDLTest_RandomDouble(void);
|
||||
*/
|
||||
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Uint16 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -187,7 +187,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
|
||||
*/
|
||||
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Uint32 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -208,7 +208,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL
|
||||
*/
|
||||
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Uint64 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -229,7 +229,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL
|
||||
*/
|
||||
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Sint8 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -251,7 +251,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL
|
||||
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Sint16 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -272,7 +272,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
|
||||
*/
|
||||
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Sint32 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -293,7 +293,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL
|
||||
*/
|
||||
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns a random boundary value for Sint64 within the given boundaries.
|
||||
* Boundaries are inclusive, see the usage examples below. If validDomain
|
||||
* is true, the function will only return valid boundaries, otherwise non-valid
|
||||
@@ -315,7 +315,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL
|
||||
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns integer in range [min, max] (inclusive).
|
||||
* Min and max values can be negative values.
|
||||
* If Max in smaller than min, then the values are swapped.
|
||||
@@ -329,7 +329,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
|
||||
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Generates random null-terminated string. The minimum length for
|
||||
* the string is 1 character, maximum length for the string is 255
|
||||
* characters and it can contain ASCII characters from 32 to 126.
|
||||
@@ -341,7 +341,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
|
||||
char * SDLTest_RandomAsciiString(void);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Generates random null-terminated string. The maximum length for
|
||||
* the string is defined by the maxLength parameter.
|
||||
* String can contain ASCII characters from 32 to 126.
|
||||
@@ -355,7 +355,7 @@ char * SDLTest_RandomAsciiString(void);
|
||||
char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Generates random null-terminated string. The length for
|
||||
* the string is defined by the size parameter.
|
||||
* String can contain ASCII characters from 32 to 126.
|
||||
@@ -368,8 +368,7 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
|
||||
*/
|
||||
char * SDLTest_RandomAsciiStringOfSize(int size);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Get the invocation count for the fuzzer since last ...FuzzerInit.
|
||||
*
|
||||
* \returns the invocation count.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user