mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 03:48:14 +00:00
Compare commits
457 Commits
release-3.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ffa78e6bea | ||
![]() |
4ce5c3a694 | ||
![]() |
a3d4fd71c3 | ||
![]() |
d97423ebab | ||
![]() |
333a03f1ec | ||
![]() |
5b8fc907df | ||
![]() |
76392f4fe1 | ||
![]() |
3a5abee512 | ||
![]() |
e7ee375f22 | ||
![]() |
4aec54988c | ||
![]() |
271e03f0d7 | ||
![]() |
d4f9be4416 | ||
![]() |
1f5b21ead5 | ||
![]() |
35c7884929 | ||
![]() |
3f6c4ec6d0 | ||
![]() |
fc72f12e7f | ||
![]() |
681f67d353 | ||
![]() |
d2372c8538 | ||
![]() |
7db23f4ef1 | ||
![]() |
36ff6327b0 | ||
![]() |
26a38a0b20 | ||
![]() |
b3e1fd97b8 | ||
![]() |
c77aaa5d99 | ||
![]() |
e4e0a12901 | ||
![]() |
2afb49ba9a | ||
![]() |
154ad6faa9 | ||
![]() |
2aa8525ecb | ||
![]() |
36033e3832 | ||
![]() |
320f3fffbe | ||
![]() |
30b4d90f1c | ||
![]() |
1cdd6dc829 | ||
![]() |
f5b3247aae | ||
![]() |
aa536217b3 | ||
![]() |
14f4fd3f11 | ||
![]() |
b1324fbc9f | ||
![]() |
4700fbcbdf | ||
![]() |
2660da6f5c | ||
![]() |
7c86d96e86 | ||
![]() |
a1dea11d32 | ||
![]() |
bfef7c302c | ||
![]() |
b9d1c483b9 | ||
![]() |
dc94cca8dd | ||
![]() |
97fe777ab4 | ||
![]() |
f1bad83a21 | ||
![]() |
7aa28ce279 | ||
![]() |
c89a460672 | ||
![]() |
e3bfacde3e | ||
![]() |
9c05098ed9 | ||
![]() |
c395240425 | ||
![]() |
68e3e99087 | ||
![]() |
7f7ea909bc | ||
![]() |
379a6f4dab | ||
![]() |
d275851dfb | ||
![]() |
a9ded76dff | ||
![]() |
5007b96363 | ||
![]() |
b2e88ecfeb | ||
![]() |
d6cd450624 | ||
![]() |
e875775940 | ||
![]() |
72606d97e6 | ||
![]() |
48e71ae87b | ||
![]() |
7308325559 | ||
![]() |
9dea06f5b5 | ||
![]() |
c68976360d | ||
![]() |
a535cc62a0 | ||
![]() |
63b8af3558 | ||
![]() |
3f1fd5abff | ||
![]() |
92f72682e7 | ||
![]() |
891c89eeb8 | ||
![]() |
e2b8d96529 | ||
![]() |
78a92b4f9d | ||
![]() |
7b2b99a996 | ||
![]() |
b6d051e226 | ||
![]() |
0ad0347acb | ||
![]() |
a2f4783e75 | ||
![]() |
2001a891c4 | ||
![]() |
1ee9a437f9 | ||
![]() |
69644346ac | ||
![]() |
00b87f1ded | ||
![]() |
beca41480d | ||
![]() |
43b12fd9bc | ||
![]() |
e8ec8ba1d4 | ||
![]() |
feeec90873 | ||
![]() |
d361acdd4e | ||
![]() |
92a487f2e4 | ||
![]() |
df9d0fb332 | ||
![]() |
4a0b9522b6 | ||
![]() |
32999798e0 | ||
![]() |
424bc4bcf7 | ||
![]() |
0eea92c8fc | ||
![]() |
d42c303b24 | ||
![]() |
237348c772 | ||
![]() |
86786ed544 | ||
![]() |
de93728674 | ||
![]() |
5e74365e55 | ||
![]() |
3e64fec9f4 | ||
![]() |
707e9397ca | ||
![]() |
f72213c4ac | ||
![]() |
132b88749c | ||
![]() |
8b39eb9b1f | ||
![]() |
0f2322acfc | ||
![]() |
5f344c17c2 | ||
![]() |
a688ecd6fa | ||
![]() |
120bc77e91 | ||
![]() |
535ec1a921 | ||
![]() |
7ec9a4385a | ||
![]() |
6d7269815b | ||
![]() |
cb0cf14155 | ||
![]() |
7914234b26 | ||
![]() |
51dcc3bb0b | ||
![]() |
f6363fde9a | ||
![]() |
f633915443 | ||
![]() |
57043825ba | ||
![]() |
22685556e5 | ||
![]() |
f444eac557 | ||
![]() |
eb0d214c17 | ||
![]() |
55f74c3285 | ||
![]() |
2aeac8de51 | ||
![]() |
6d01ffcd94 | ||
![]() |
c2ee45f5ff | ||
![]() |
0bf63175ab | ||
![]() |
d043c8535b | ||
![]() |
d2a2787783 | ||
![]() |
85fecbb10b | ||
![]() |
ec3e333fb8 | ||
![]() |
1402d13556 | ||
![]() |
03c239ded9 | ||
![]() |
16c9bad786 | ||
![]() |
6574e5eb57 | ||
![]() |
4fa21ee5ed | ||
![]() |
8bfbda1eab | ||
![]() |
93c289b475 | ||
![]() |
ed5a343d25 | ||
![]() |
0081174689 | ||
![]() |
cd64e0b6e3 | ||
![]() |
51c10bef0b | ||
![]() |
d1dc195208 | ||
![]() |
5e5b029d6c | ||
![]() |
b58285b7ed | ||
![]() |
e5ebbdafd4 | ||
![]() |
977781d3f4 | ||
![]() |
984af1a725 | ||
![]() |
5aa76de35f | ||
![]() |
1158cff9ea | ||
![]() |
ae3a34a388 | ||
![]() |
c0824cd49a | ||
![]() |
6ed29f47c9 | ||
![]() |
9ed1b778ed | ||
![]() |
b970dd1beb | ||
![]() |
576df87240 | ||
![]() |
2dddaa7dc9 | ||
![]() |
45a6ad8e57 | ||
![]() |
b57a6a1adf | ||
![]() |
d78072fcd4 | ||
![]() |
446e0943da | ||
![]() |
23bce27b26 | ||
![]() |
c078dfcf6b | ||
![]() |
18c4db678b | ||
![]() |
7d26ba754a | ||
![]() |
bd70ce7f94 | ||
![]() |
ce4c54e2b2 | ||
![]() |
57ae9f466d | ||
![]() |
dca3fd8307 | ||
![]() |
ab1670386f | ||
![]() |
76e9d64b36 | ||
![]() |
e9f9cb29fc | ||
![]() |
3e1d7e6a14 | ||
![]() |
ef347776c2 | ||
![]() |
5e35309913 | ||
![]() |
71dc7169d9 | ||
![]() |
1e6ffc6294 | ||
![]() |
3f00fa16c6 | ||
![]() |
0d76380042 | ||
![]() |
46d143376a | ||
![]() |
22de91a947 | ||
![]() |
1c2f825230 | ||
![]() |
d9c07d9ef7 | ||
![]() |
8f7427c158 | ||
![]() |
6a999d16fa | ||
![]() |
cfd6b34b8f | ||
![]() |
a70964aaf4 | ||
![]() |
35c13196f0 | ||
![]() |
bc87983310 | ||
![]() |
f5c0760c6b | ||
![]() |
63e6c19b7d | ||
![]() |
1bd9ebf533 | ||
![]() |
e0e79419b6 | ||
![]() |
8fc10ac95c | ||
![]() |
91ad208d18 | ||
![]() |
6c495a92f0 | ||
![]() |
96a2a6b945 | ||
![]() |
fd4bb4154b | ||
![]() |
46945354cc | ||
![]() |
f5bb286b76 | ||
![]() |
f47a08ab84 | ||
![]() |
660fc89967 | ||
![]() |
6ff3e49b6f | ||
![]() |
e58a8639e3 | ||
![]() |
5b7b3da701 | ||
![]() |
0a0dfdb2f9 | ||
![]() |
8572e19327 | ||
![]() |
031348d377 | ||
![]() |
462d95ab4d | ||
![]() |
a48bb80ea0 | ||
![]() |
c0fb092425 | ||
![]() |
37de5d4849 | ||
![]() |
715749f578 | ||
![]() |
0c7346ec3e | ||
![]() |
711a458be5 | ||
![]() |
171fba320f | ||
![]() |
ad09976eca | ||
![]() |
7abb748134 | ||
![]() |
858ae9900e | ||
![]() |
f87f0fe781 | ||
![]() |
b3ea81b33f | ||
![]() |
3bf9c70a7c | ||
![]() |
ea7103088f | ||
![]() |
a3a45f6709 | ||
![]() |
5a7ea76ed3 | ||
![]() |
9403c9e95a | ||
![]() |
13969f8567 | ||
![]() |
9be85b846b | ||
![]() |
35c9b1042f | ||
![]() |
31a57c05dc | ||
![]() |
3dff5d3cbe | ||
![]() |
4c9a79dddb | ||
![]() |
7c4f5e1def | ||
![]() |
abe8dbbf1c | ||
![]() |
0efb31ef32 | ||
![]() |
eb22fbc894 | ||
![]() |
479bc2d5ed | ||
![]() |
e6e654e25c | ||
![]() |
7b06007266 | ||
![]() |
7d55ccb8b0 | ||
![]() |
da6bce4f76 | ||
![]() |
74e8a6451b | ||
![]() |
f741adc86c | ||
![]() |
817141c162 | ||
![]() |
e86f494317 | ||
![]() |
d948e6c3c5 | ||
![]() |
e7376b7b74 | ||
![]() |
69b2baec5c | ||
![]() |
2c6995778e | ||
![]() |
22df572979 | ||
![]() |
634705851d | ||
![]() |
1194f52a5c | ||
![]() |
45e5f0f10b | ||
![]() |
a23d1af0ac | ||
![]() |
2b66ef0df4 | ||
![]() |
7285f0d441 | ||
![]() |
ca3468cb55 | ||
![]() |
7d2012af87 | ||
![]() |
17515f4aef | ||
![]() |
f71178a16f | ||
![]() |
d77eb8a8d5 | ||
![]() |
3fb9118cb6 | ||
![]() |
71fb4e3d76 | ||
![]() |
2518e32de8 | ||
![]() |
e8938fc66a | ||
![]() |
fde6323662 | ||
![]() |
7154605982 | ||
![]() |
c68cfcdb2d | ||
![]() |
7bf3e28dc6 | ||
![]() |
3fa5a2f794 | ||
![]() |
af5efadd9f | ||
![]() |
5b5a72e33c | ||
![]() |
58fa43e7c3 | ||
![]() |
4266cf8504 | ||
![]() |
4f7f72c257 | ||
![]() |
c5035d8ffd | ||
![]() |
92779a5bd8 | ||
![]() |
0dc4373aad | ||
![]() |
06b305d232 | ||
![]() |
c4a493de97 | ||
![]() |
4a87abc966 | ||
![]() |
2290d71338 | ||
![]() |
17ecb11ed6 | ||
![]() |
8800d40442 | ||
![]() |
7ac43cfb6b | ||
![]() |
dfc56cfc0e | ||
![]() |
c83428475d | ||
![]() |
d5680c5d20 | ||
![]() |
1069c8931d | ||
![]() |
507fc462db | ||
![]() |
d9d84c8d73 | ||
![]() |
e927e5d440 | ||
![]() |
33ec2a5e94 | ||
![]() |
a8a5bd3d6b | ||
![]() |
038ccd764a | ||
![]() |
c0445c23bf | ||
![]() |
9670f233cc | ||
![]() |
ea179abdb7 | ||
![]() |
eabd88ed28 | ||
![]() |
a44b646105 | ||
![]() |
880ac537a5 | ||
![]() |
7b8f0ba8b7 | ||
![]() |
73a68c6ea5 | ||
![]() |
44dc90dcc8 | ||
![]() |
8efa1f8fc6 | ||
![]() |
5d1e6b28d9 | ||
![]() |
c638b4a682 | ||
![]() |
01a4cf8a10 | ||
![]() |
f51f7fbb94 | ||
![]() |
b47b6e02fd | ||
![]() |
381312a02a | ||
![]() |
f836b465aa | ||
![]() |
a47a045128 | ||
![]() |
e8ae155585 | ||
![]() |
2cb422360c | ||
![]() |
fa934dd4df | ||
![]() |
6a52017724 | ||
![]() |
32fd45cf48 | ||
![]() |
c5a09ca7a9 | ||
![]() |
b425036808 | ||
![]() |
0479df53ca | ||
![]() |
0b0d256a69 | ||
![]() |
d09d0aaab6 | ||
![]() |
460b7b247f | ||
![]() |
ebc2fb411f | ||
![]() |
0d5467a6e9 | ||
![]() |
305e7b55bd | ||
![]() |
ad0d1e2ad5 | ||
![]() |
7bf4319eb2 | ||
![]() |
0ebda87425 | ||
![]() |
a099172754 | ||
![]() |
988866ca4a | ||
![]() |
2cb7a0a0bb | ||
![]() |
b8d5fa4aef | ||
![]() |
0a9f61fbf1 | ||
![]() |
c7f22f0324 | ||
![]() |
d234f7a498 | ||
![]() |
2fd9e63f1a | ||
![]() |
874ebed14d | ||
![]() |
5b904a103a | ||
![]() |
0a8f9777a7 | ||
![]() |
78d3a713de | ||
![]() |
74229d4a41 | ||
![]() |
29a4c5ebc2 | ||
![]() |
903df79b2d | ||
![]() |
d47ff8ae73 | ||
![]() |
738442b82a | ||
![]() |
68073c6276 | ||
![]() |
920acb75c3 | ||
![]() |
3dbc6a40ae | ||
![]() |
af54c82138 | ||
![]() |
232ed540db | ||
![]() |
c542aef600 | ||
![]() |
abffa1194a | ||
![]() |
3b3c141ff9 | ||
![]() |
6969b3be3b | ||
![]() |
311b02f0b5 | ||
![]() |
36c87d9f27 | ||
![]() |
4e3fc0c1dc | ||
![]() |
187708e542 | ||
![]() |
3b0cd44158 | ||
![]() |
741499dea7 | ||
![]() |
a53382e460 | ||
![]() |
e99b9ca9c0 | ||
![]() |
8e72be3117 | ||
![]() |
7a9966af9d | ||
![]() |
d59caffe2c | ||
![]() |
582fb3901a | ||
![]() |
c709741871 | ||
![]() |
817454cfe6 | ||
![]() |
e986c7984b | ||
![]() |
dfd7efaf13 | ||
![]() |
802b5ef7dc | ||
![]() |
e580e087ff | ||
![]() |
b79732b967 | ||
![]() |
faa7e3cc2e | ||
![]() |
5efc9bd194 | ||
![]() |
4bae75387a | ||
![]() |
f57776836f | ||
![]() |
569fa3f57f | ||
![]() |
be3b1cff0b | ||
![]() |
ab479b4961 | ||
![]() |
264da8c127 | ||
![]() |
cfc7cac3c9 | ||
![]() |
8b74be464f | ||
![]() |
fc689a6cb3 | ||
![]() |
b4d547905d | ||
![]() |
4ee36a9474 | ||
![]() |
c2b2f2a71e | ||
![]() |
d1b4810542 | ||
![]() |
bcccbbd894 | ||
![]() |
4e465f25d0 | ||
![]() |
7ac66972b7 | ||
![]() |
3e9ae3ea64 | ||
![]() |
0a91a793cf | ||
![]() |
07d6d116ed | ||
![]() |
b5483f2c68 | ||
![]() |
b990e9145b | ||
![]() |
3bdc62215e | ||
![]() |
423c558e44 | ||
![]() |
42238f88ea | ||
![]() |
d0bbfdbfb8 | ||
![]() |
e29c0661cc | ||
![]() |
e57554ea65 | ||
![]() |
09ee811f4b | ||
![]() |
b067ab9202 | ||
![]() |
6e40c7a9b8 | ||
![]() |
01541bc350 | ||
![]() |
4504c10f3b | ||
![]() |
7b1000013e | ||
![]() |
9e997cc787 | ||
![]() |
d87048fd5a | ||
![]() |
6926d046c0 | ||
![]() |
b8d85c6939 | ||
![]() |
5c4bc807f7 | ||
![]() |
8eeca8c7db | ||
![]() |
d7664a6ef1 | ||
![]() |
5df106603d | ||
![]() |
69f0223474 | ||
![]() |
724845110c | ||
![]() |
84039e2514 | ||
![]() |
2d24baaad4 | ||
![]() |
b7cc4dce70 | ||
![]() |
0b7a9a8e9f | ||
![]() |
8cda5102fc | ||
![]() |
ee13e8c76b | ||
![]() |
fcd7d658dc | ||
![]() |
89e9f7b42b | ||
![]() |
b6c875a923 | ||
![]() |
a65d1bfb14 | ||
![]() |
37d244ea81 | ||
![]() |
a937b5c4ad | ||
![]() |
fb0ce375f0 | ||
![]() |
0739d237ad | ||
![]() |
8145212103 | ||
![]() |
2df39e64ab | ||
![]() |
8fddf146bf | ||
![]() |
3f5593d613 | ||
![]() |
dcd1252368 | ||
![]() |
edb75bc29e | ||
![]() |
660cec69b1 | ||
![]() |
a2611edcf3 | ||
![]() |
e19c532ebf | ||
![]() |
e426617c9c | ||
![]() |
192cdf3d04 | ||
![]() |
64a5e7be98 | ||
![]() |
66bd15555c | ||
![]() |
4c7156c1e6 | ||
![]() |
33e5de31d8 | ||
![]() |
3eaf56894e | ||
![]() |
242ce20cbf | ||
![]() |
f52e7199df | ||
![]() |
e12c831b15 | ||
![]() |
cd399caf6f | ||
![]() |
f6144dfe03 | ||
![]() |
ac2fcfcb62 | ||
![]() |
4ac2d45a06 | ||
![]() |
dce6ed56d7 | ||
![]() |
e3d430b83e | ||
![]() |
511bab5bbf | ||
![]() |
156bf7e6aa | ||
![]() |
938b720a9e | ||
![]() |
44975d40ef | ||
![]() |
ea8f8b6dc3 |
@@ -16,8 +16,8 @@ AllowShortFunctionsOnASingleLine: All
|
|||||||
AllowShortIfStatementsOnASingleLine: Never
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
AllowShortLoopsOnASingleLine: false
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
|
||||||
AlwaysBreakAfterDefinitionReturnType: All
|
AlwaysBreakAfterDefinitionReturnType: None
|
||||||
AlwaysBreakAfterReturnType: AllDefinitions
|
AlwaysBreakAfterReturnType: None
|
||||||
AlwaysBreakBeforeMultilineStrings: false
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
AlwaysBreakTemplateDeclarations: MultiLine
|
AlwaysBreakTemplateDeclarations: MultiLine
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ BraceWrapping:
|
|||||||
AfterUnion: true
|
AfterUnion: true
|
||||||
AfterExternBlock: false
|
AfterExternBlock: false
|
||||||
BeforeElse: false
|
BeforeElse: false
|
||||||
BeforeWhile: true
|
BeforeWhile: false
|
||||||
IndentBraces: false
|
IndentBraces: false
|
||||||
SplitEmptyFunction: true
|
SplitEmptyFunction: true
|
||||||
SplitEmptyRecord: true
|
SplitEmptyRecord: true
|
||||||
@@ -62,7 +62,8 @@ IndentGotoLabels: true
|
|||||||
IndentPPDirectives: None
|
IndentPPDirectives: None
|
||||||
IndentExternBlock: NoIndent
|
IndentExternBlock: NoIndent
|
||||||
|
|
||||||
SpaceAfterCStyleCast: true
|
PointerAlignment: Right
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
SpacesInConditionalStatement: false
|
SpacesInConditionalStatement: false
|
||||||
SpacesInContainerLiterals: true
|
SpacesInContainerLiterals: true
|
||||||
|
@@ -7,6 +7,8 @@ root = true
|
|||||||
[*.{c,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
|
[*.{c,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
|
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
16
.github/cmake/CMakeLists.txt
vendored
Normal file
16
.github/cmake/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
project(ci_utils C CXX)
|
||||||
|
|
||||||
|
set(txt "CC=${CMAKE_C_COMPILER}
|
||||||
|
CXX=${CMAKE_CXX_COMPILER}
|
||||||
|
CFLAGS=${CMAKE_C_FLAGS}
|
||||||
|
CXXFLAGS=${CMAKE_CXX_FLAGS}
|
||||||
|
LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_C_STANDARD_LIBRARIES}
|
||||||
|
")
|
||||||
|
|
||||||
|
message("${txt}")
|
||||||
|
|
||||||
|
set(VAR_PATH "/tmp/env.txt" CACHE PATH "Where to write environment file")
|
||||||
|
message(STATUS "Writing CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS environment to ${VAR_PATH}")
|
||||||
|
|
||||||
|
file(WRITE "${VAR_PATH}" "${txt}")
|
32
.github/workflows/main.yml
vendored
32
.github/workflows/main.yml
vendored
@@ -22,6 +22,11 @@ jobs:
|
|||||||
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
|
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
|
||||||
- { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
|
- { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
|
||||||
- { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
|
- { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
|
||||||
|
- { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
|
||||||
|
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
|
||||||
|
- { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
|
||||||
|
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '}
|
||||||
|
|
||||||
- { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh }
|
- { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh }
|
||||||
- { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
|
- { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
|
||||||
- { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
|
- { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
|
||||||
@@ -59,7 +64,21 @@ jobs:
|
|||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
brew install \
|
brew install \
|
||||||
ninja
|
ninja \
|
||||||
|
pkg-config
|
||||||
|
|
||||||
|
- name: Setup Intel oneAPI
|
||||||
|
if: matrix.platform.intel
|
||||||
|
run: |
|
||||||
|
# Setup oneAPI repo
|
||||||
|
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
|
||||||
|
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
|
||||||
|
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
|
||||||
|
sudo apt-get update -y
|
||||||
|
|
||||||
|
# Install oneAPI
|
||||||
|
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Check that versioning is consistent
|
- name: Check that versioning is consistent
|
||||||
# We only need to run this once: arbitrarily use the Linux/CMake build
|
# We only need to run this once: arbitrarily use the Linux/CMake build
|
||||||
@@ -68,6 +87,7 @@ jobs:
|
|||||||
- name: Configure (CMake)
|
- name: Configure (CMake)
|
||||||
if: "! matrix.platform.autotools"
|
if: "! matrix.platform.autotools"
|
||||||
run: |
|
run: |
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
cmake -S . -B build -G Ninja \
|
cmake -S . -B build -G Ninja \
|
||||||
-DSDL_TESTS=ON \
|
-DSDL_TESTS=ON \
|
||||||
-DSDL_WERROR=ON \
|
-DSDL_WERROR=ON \
|
||||||
@@ -79,11 +99,13 @@ jobs:
|
|||||||
- name: Build (CMake)
|
- name: Build (CMake)
|
||||||
if: "! matrix.platform.autotools"
|
if: "! matrix.platform.autotools"
|
||||||
run: |
|
run: |
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
cmake --build build/ --config Release --verbose --parallel
|
cmake --build build/ --config Release --verbose --parallel
|
||||||
- name: Run build-time tests (CMake)
|
- name: Run build-time tests (CMake)
|
||||||
if: "! matrix.platform.autotools"
|
if: "! matrix.platform.autotools"
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
export SDL_TESTS_QUICK=1
|
export SDL_TESTS_QUICK=1
|
||||||
ctest -VV --test-dir build/
|
ctest -VV --test-dir build/
|
||||||
if test "${{ runner.os }}" = "Linux"; then
|
if test "${{ runner.os }}" = "Linux"; then
|
||||||
@@ -101,6 +123,7 @@ jobs:
|
|||||||
if: matrix.platform.autotools
|
if: matrix.platform.autotools
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
rm -fr build-autotools
|
rm -fr build-autotools
|
||||||
mkdir build-autotools
|
mkdir build-autotools
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
@@ -132,6 +155,7 @@ jobs:
|
|||||||
if: matrix.platform.autotools
|
if: matrix.platform.autotools
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||||
make -j"${parallel}" -C build-autotools V=1
|
make -j"${parallel}" -C build-autotools V=1
|
||||||
if test "${{ runner.os }}" != "macOS" ; then
|
if test "${{ runner.os }}" != "macOS" ; then
|
||||||
@@ -141,6 +165,7 @@ jobs:
|
|||||||
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
|
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
curdir="$(pwd)"
|
curdir="$(pwd)"
|
||||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||||
export SDL_TESTS_QUICK=1
|
export SDL_TESTS_QUICK=1
|
||||||
@@ -153,6 +178,7 @@ jobs:
|
|||||||
if: matrix.platform.autotools
|
if: matrix.platform.autotools
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
curdir="$(pwd)"
|
curdir="$(pwd)"
|
||||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||||
make -j"${parallel}" -C build-autotools install V=1
|
make -j"${parallel}" -C build-autotools install V=1
|
||||||
@@ -163,16 +189,19 @@ jobs:
|
|||||||
echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
|
echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
|
||||||
- name: Verify CMake configuration files
|
- name: Verify CMake configuration files
|
||||||
run: |
|
run: |
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
||||||
cmake --build cmake_config_build --verbose
|
cmake --build cmake_config_build --verbose
|
||||||
- name: Verify sdl2-config
|
- name: Verify sdl2-config
|
||||||
run: |
|
run: |
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||||
cmake/test/test_sdlconfig.sh
|
cmake/test/test_sdlconfig.sh
|
||||||
- name: Verify sdl2.pc
|
- name: Verify sdl2.pc
|
||||||
run: |
|
run: |
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||||
cmake/test/test_pkgconfig.sh
|
cmake/test/test_pkgconfig.sh
|
||||||
- name: Distcheck (Autotools)
|
- name: Distcheck (Autotools)
|
||||||
@@ -191,6 +220,7 @@ jobs:
|
|||||||
if: "runner.os == 'Linux' && matrix.platform.autotools"
|
if: "runner.os == 'Linux' && matrix.platform.autotools"
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
${{ matrix.platform.source_cmd }}
|
||||||
parallel="$(getconf _NPROCESSORS_ONLN)"
|
parallel="$(getconf _NPROCESSORS_ONLN)"
|
||||||
sudo make -j"${parallel}" -C build-autotools install
|
sudo make -j"${parallel}" -C build-autotools install
|
||||||
sudo make -j"${parallel}" -C build-autotools/test install
|
sudo make -j"${parallel}" -C build-autotools/test install
|
||||||
|
17
.github/workflows/n3ds.yml
vendored
17
.github/workflows/n3ds.yml
vendored
@@ -38,5 +38,18 @@ jobs:
|
|||||||
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
cmake --build cmake_config_build --verbose
|
cmake --build cmake_config_build --verbose
|
||||||
# Not running test_pkgconfig.sh and test_sdlconfig.sh
|
- name: Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain
|
||||||
# as invoking the compiler manually is not supported
|
run: |
|
||||||
|
cmake -S .github/cmake -B /tmp/cmake_extract \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DVAR_PATH=/tmp/n3ds_env.txt
|
||||||
|
cat /tmp/n3ds_env.txt >> $GITHUB_ENV
|
||||||
|
- name: Verify sdl2-config
|
||||||
|
run: |
|
||||||
|
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||||
|
cmake/test/test_sdlconfig.sh
|
||||||
|
- name: Verify sdl2.pc
|
||||||
|
run: |
|
||||||
|
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||||
|
cmake/test/test_pkgconfig.sh
|
||||||
|
4
.github/workflows/ps2.yaml
vendored
4
.github/workflows/ps2.yaml
vendored
@@ -50,13 +50,13 @@ jobs:
|
|||||||
- name: Verify sdl2-config
|
- name: Verify sdl2-config
|
||||||
run: |
|
run: |
|
||||||
export CC=mips64r5900el-ps2-elf-gcc
|
export CC=mips64r5900el-ps2-elf-gcc
|
||||||
|
export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
||||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||||
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
|
||||||
cmake/test/test_sdlconfig.sh
|
cmake/test/test_sdlconfig.sh
|
||||||
- name: Verify sdl2.pc
|
- name: Verify sdl2.pc
|
||||||
run: |
|
run: |
|
||||||
export CC=mips64r5900el-ps2-elf-gcc
|
export CC=mips64r5900el-ps2-elf-gcc
|
||||||
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
|
||||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||||
cmake/test/test_pkgconfig.sh
|
cmake/test/test_pkgconfig.sh
|
||||||
|
|
||||||
|
4
.github/workflows/psp.yaml
vendored
4
.github/workflows/psp.yaml
vendored
@@ -39,12 +39,12 @@ jobs:
|
|||||||
- name: Verify sdl2-config
|
- name: Verify sdl2-config
|
||||||
run: |
|
run: |
|
||||||
export CC=psp-gcc
|
export CC=psp-gcc
|
||||||
|
export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
||||||
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
|
||||||
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
|
||||||
cmake/test/test_sdlconfig.sh
|
cmake/test/test_sdlconfig.sh
|
||||||
- name: Verify sdl2.pc
|
- name: Verify sdl2.pc
|
||||||
run: |
|
run: |
|
||||||
export CC=psp-gcc
|
export CC=psp-gcc
|
||||||
|
export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
||||||
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
|
||||||
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
|
||||||
cmake/test/test_pkgconfig.sh
|
cmake/test/test_pkgconfig.sh
|
||||||
|
42
.github/workflows/vita.yaml
vendored
42
.github/workflows/vita.yaml
vendored
@@ -8,19 +8,61 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
vita:
|
vita:
|
||||||
|
name: ${{ matrix.platform.name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: vitasdk/vitasdk:latest
|
image: vitasdk/vitasdk:latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- { name: GLES (pib), os: windows-latest, pib: true }
|
||||||
|
- { name: GLES (PVR_PSP2 + gl4es4vita), os: windows-latest, pvr: true }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install build requirements
|
- name: Install build requirements
|
||||||
run: |
|
run: |
|
||||||
apk update
|
apk update
|
||||||
apk add cmake ninja pkgconf bash
|
apk add cmake ninja pkgconf bash
|
||||||
|
|
||||||
|
- name: Configure PVR_PSP2 (GLES)
|
||||||
|
if: ${{ !!matrix.platform.pvr }}
|
||||||
|
run: |
|
||||||
|
pvr_psp2_version=3.9
|
||||||
|
|
||||||
|
# Configure PVR_PSP2 headers
|
||||||
|
wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
|
||||||
|
unzip /tmp/v$pvr_psp2_version.zip -d/tmp
|
||||||
|
cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* ${VITASDK}/arm-vita-eabi/include
|
||||||
|
rm /tmp/v$pvr_psp2_version.zip
|
||||||
|
|
||||||
|
# Configure PVR_PSP2 stub libraries
|
||||||
|
wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
|
||||||
|
unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
|
||||||
|
find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} ${VITASDK}/arm-vita-eabi/lib \;
|
||||||
|
rm /tmp/vitasdk_stubs.zip
|
||||||
|
rm -rf /tmp/pvr_psp2_stubs
|
||||||
|
|
||||||
|
- name: Configure gl4es4vita (OpenGL)
|
||||||
|
if: ${{ !!matrix.platform.pvr }}
|
||||||
|
run: |
|
||||||
|
gl4es4vita_version=1.1.4
|
||||||
|
|
||||||
|
# Configure gl4es4vita headers
|
||||||
|
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
|
||||||
|
unzip -o /tmp/include.zip -d${VITASDK}/arm-vita-eabi/include
|
||||||
|
rm /tmp/include.zip
|
||||||
|
|
||||||
|
# Configure gl4es4vita stub libraries
|
||||||
|
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
|
||||||
|
unzip /tmp/vitasdk_stubs.zip -d${VITASDK}/arm-vita-eabi/lib
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -G Ninja \
|
cmake -S . -B build -G Ninja \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
|
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
|
||||||
|
-DVIDEO_VITA_PIB=${{ !!matrix.platform.pib }} \
|
||||||
|
-DVIDEO_VITA_PVR=${{ !!matrix.platform.pvr }} \
|
||||||
-DSDL_WERROR=ON \
|
-DSDL_WERROR=ON \
|
||||||
-DSDL_TESTS=ON \
|
-DSDL_TESTS=ON \
|
||||||
-DSDL_INSTALL_TESTS=ON \
|
-DSDL_INSTALL_TESTS=ON \
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@@ -62,6 +62,11 @@ cmake-build-*
|
|||||||
xcuserdata
|
xcuserdata
|
||||||
*.xcworkspace
|
*.xcworkspace
|
||||||
|
|
||||||
|
# for QtCreator
|
||||||
|
CMakeLists.txt.user
|
||||||
|
build*/
|
||||||
|
*.pro.user*
|
||||||
|
|
||||||
# for Visual C++
|
# for Visual C++
|
||||||
.vs
|
.vs
|
||||||
Debug
|
Debug
|
||||||
@@ -173,6 +178,7 @@ test/testyuv
|
|||||||
test/torturethread
|
test/torturethread
|
||||||
|
|
||||||
builddir/
|
builddir/
|
||||||
|
!build-scripts/
|
||||||
debian/*.debhelper.log
|
debian/*.debhelper.log
|
||||||
debian/*.substvars
|
debian/*.substvars
|
||||||
debian/*.tar.gz
|
debian/*.tar.gz
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
projectfullname = SDL_mixer
|
projectfullname = SDL2
|
||||||
projectshortname = SDL_mixer
|
projectshortname = SDL2
|
||||||
incsubdir = include
|
incsubdir = include
|
||||||
wikisubdir =
|
wikisubdir = SDL2
|
||||||
|
readmesubdir = docs
|
||||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
||||||
mainincludefname = SDL.h
|
mainincludefname = SDL.h
|
||||||
versionfname = include/SDL_version.h
|
versionfname = include/SDL_version.h
|
||||||
@@ -10,6 +11,7 @@ versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
|
|||||||
versionpatchregex = \A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z
|
versionpatchregex = \A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z
|
||||||
selectheaderregex = \ASDL.*?\.h\Z
|
selectheaderregex = \ASDL.*?\.h\Z
|
||||||
projecturl = https://libsdl.org/
|
projecturl = https://libsdl.org/
|
||||||
wikiurl = https://wiki.libsdl.org
|
wikiurl = https://wiki.libsdl.org/SDL2
|
||||||
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
||||||
warn_about_missing = 0
|
warn_about_missing = 0
|
||||||
|
wikipreamble = (This is the legacy documentation for stable SDL2, the current stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current development version.)
|
||||||
|
@@ -12,7 +12,7 @@ LOCAL_MODULE := SDL2
|
|||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)/include
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
$(subst $(LOCAL_PATH)/,, \
|
$(subst $(LOCAL_PATH)/,, \
|
||||||
@@ -63,7 +63,6 @@ LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
|
|||||||
LOCAL_CFLAGS += \
|
LOCAL_CFLAGS += \
|
||||||
-Wall -Wextra \
|
-Wall -Wextra \
|
||||||
-Wdocumentation \
|
-Wdocumentation \
|
||||||
-Wdocumentation-unknown-command \
|
|
||||||
-Wmissing-prototypes \
|
-Wmissing-prototypes \
|
||||||
-Wunreachable-code-break \
|
-Wunreachable-code-break \
|
||||||
-Wunneeded-internal-declaration \
|
-Wunneeded-internal-declaration \
|
||||||
@@ -78,6 +77,8 @@ LOCAL_CFLAGS += \
|
|||||||
# Warnings we haven't fixed (yet)
|
# Warnings we haven't fixed (yet)
|
||||||
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
|
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
|
||||||
|
|
||||||
|
LOCAL_CXXFLAGS += -std=gnu++11
|
||||||
|
|
||||||
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
|
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
|
||||||
|
|
||||||
LOCAL_LDFLAGS := -Wl,--no-undefined
|
LOCAL_LDFLAGS := -Wl,--no-undefined
|
||||||
|
375
CMakeLists.txt
375
CMakeLists.txt
@@ -2,7 +2,7 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
|||||||
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there")
|
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0.0)
|
cmake_minimum_required(VERSION 3.0.0...3.5)
|
||||||
project(SDL2 C CXX)
|
project(SDL2 C CXX)
|
||||||
|
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||||
@@ -18,6 +18,9 @@ endif()
|
|||||||
set(EXTRA_LIBS)
|
set(EXTRA_LIBS)
|
||||||
set(EXTRA_LDFLAGS)
|
set(EXTRA_LDFLAGS)
|
||||||
|
|
||||||
|
set(CMAKE_DEPENDS)
|
||||||
|
set(PKGCONFIG_DEPENDS)
|
||||||
|
|
||||||
# This is a virtual "library" that just exists to collect up compiler and
|
# This is a virtual "library" that just exists to collect up compiler and
|
||||||
# linker options that used to be global to this CMake project. When you
|
# linker options that used to be global to this CMake project. When you
|
||||||
# specify it as part of a real library's target_link_libraries(), that
|
# specify it as part of a real library's target_link_libraries(), that
|
||||||
@@ -27,16 +30,10 @@ set(EXTRA_LDFLAGS)
|
|||||||
add_library(sdl-build-options INTERFACE)
|
add_library(sdl-build-options INTERFACE)
|
||||||
|
|
||||||
if(WINDOWS_STORE)
|
if(WINDOWS_STORE)
|
||||||
cmake_minimum_required(VERSION 3.11.0)
|
|
||||||
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
|
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
|
||||||
target_compile_options(sdl-build-options INTERFACE "-ZW")
|
target_compile_options(sdl-build-options INTERFACE "-ZW")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Build in parallel under Visual Studio. Not enabled by default.
|
|
||||||
if(MSVC)
|
|
||||||
target_compile_options(sdl-build-options INTERFACE "/MP")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
|
# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
|
||||||
# CMake 3.24+ emits a warning when not set.
|
# CMake 3.24+ emits a warning when not set.
|
||||||
unset(OFF)
|
unset(OFF)
|
||||||
@@ -74,6 +71,7 @@ find_package(PkgConfig)
|
|||||||
list(APPEND CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake")
|
||||||
include(${SDL2_SOURCE_DIR}/cmake/macros.cmake)
|
include(${SDL2_SOURCE_DIR}/cmake/macros.cmake)
|
||||||
include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
|
include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
|
||||||
|
include(${SDL2_SOURCE_DIR}/cmake/sdlplatform.cmake)
|
||||||
include(${SDL2_SOURCE_DIR}/cmake/CheckCPUArchitecture.cmake)
|
include(${SDL2_SOURCE_DIR}/cmake/CheckCPUArchitecture.cmake)
|
||||||
|
|
||||||
# Enable large file support on 32-bit glibc, so that we can access files
|
# Enable large file support on 32-bit glibc, so that we can access files
|
||||||
@@ -85,7 +83,7 @@ endif()
|
|||||||
|
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
set(SDL_MAJOR_VERSION 2)
|
set(SDL_MAJOR_VERSION 2)
|
||||||
set(SDL_MINOR_VERSION 26)
|
set(SDL_MINOR_VERSION 28)
|
||||||
set(SDL_MICRO_VERSION 0)
|
set(SDL_MICRO_VERSION 0)
|
||||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||||
|
|
||||||
@@ -135,8 +133,12 @@ set(SDL_GENERATED_HEADERS)
|
|||||||
|
|
||||||
#message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
|
#message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
|
||||||
|
|
||||||
# General settings & flags
|
check_cpu_architecture(x86 SDL_CPU_X86)
|
||||||
set(LIBRARY_OUTPUT_DIRECTORY "build")
|
check_cpu_architecture(x64 SDL_CPU_X64)
|
||||||
|
check_cpu_architecture(arm32 SDL_CPU_ARM32)
|
||||||
|
check_cpu_architecture(arm64 SDL_CPU_ARM64)
|
||||||
|
check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64)
|
||||||
|
|
||||||
# Check for 64 or 32 bit
|
# Check for 64 or 32 bit
|
||||||
set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P})
|
set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P})
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
@@ -152,56 +154,7 @@ if(NOT LIBTYPE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Get the platform
|
# Get the platform
|
||||||
if(WIN32)
|
SDL_DetectCMakePlatform()
|
||||||
if(NOT WINDOWS)
|
|
||||||
set(WINDOWS TRUE)
|
|
||||||
endif()
|
|
||||||
elseif(UNIX AND NOT APPLE)
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
|
|
||||||
set(LINUX TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
|
|
||||||
set(FREEBSD TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
|
|
||||||
set(NETBSD TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
|
|
||||||
set(OPENBSD TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
|
|
||||||
set(GNU TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
|
|
||||||
set(BSDI TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
|
|
||||||
set(FREEBSD TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*")
|
|
||||||
set(SYSV5 TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*")
|
|
||||||
set(SOLARIS TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*")
|
|
||||||
set(HPUX TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*")
|
|
||||||
set(AIX TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
|
|
||||||
set(MINIX TRUE)
|
|
||||||
endif()
|
|
||||||
elseif(APPLE)
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
|
||||||
set(DARWIN TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
|
|
||||||
set(MACOSX TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
|
|
||||||
set(TVOS TRUE)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
|
|
||||||
# !!! FIXME: remove the version check when we start requiring >= 3.14.0
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.14)
|
|
||||||
set(IOS TRUE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
|
||||||
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
|
|
||||||
set(HAIKU TRUE)
|
|
||||||
elseif(NINTENDO_3DS)
|
|
||||||
set(N3DS TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Don't mistake osx for unix
|
# Don't mistake osx for unix
|
||||||
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS)
|
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS)
|
||||||
@@ -254,7 +207,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler info
|
# Compiler info
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang|IntelLLVM")
|
||||||
set(USE_CLANG TRUE)
|
set(USE_CLANG TRUE)
|
||||||
set(OPT_DEF_ASM TRUE)
|
set(OPT_DEF_ASM TRUE)
|
||||||
# Visual Studio 2019 v16.2 added support for Clang/LLVM.
|
# Visual Studio 2019 v16.2 added support for Clang/LLVM.
|
||||||
@@ -268,20 +221,18 @@ elseif(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
|
elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
|
||||||
set(OPT_DEF_ASM TRUE)
|
set(OPT_DEF_ASM TRUE)
|
||||||
#set(CMAKE_C_FLAGS "/ZI /WX- /
|
#set(CMAKE_C_FLAGS "/ZI /WX- /
|
||||||
|
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
|
||||||
|
set(OPT_DEF_ASM TRUE)
|
||||||
|
set(USE_INTELCC TRUE)
|
||||||
else()
|
else()
|
||||||
set(OPT_DEF_ASM FALSE)
|
set(OPT_DEF_ASM FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
set(OPT_DEF_GCC_ATOMICS ON)
|
set(OPT_DEF_GCC_ATOMICS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Default option knobs
|
# Default option knobs
|
||||||
if(APPLE OR ARCH_64 OR MSVC_CLANG)
|
|
||||||
if(NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm")
|
|
||||||
set(OPT_DEF_SSEMATH ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS)
|
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS)
|
||||||
set(OPT_DEF_LIBC ON)
|
set(OPT_DEF_LIBC ON)
|
||||||
endif()
|
endif()
|
||||||
@@ -294,6 +245,11 @@ if(NOT ("$ENV{CFLAGS}" STREQUAL ""))
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Build in parallel under Visual Studio. Not enabled by default.
|
||||||
|
if(MSVC AND NOT USE_CLANG)
|
||||||
|
target_compile_options(sdl-build-options INTERFACE "/MP")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
|
option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
|
||||||
if(SDL_FORCE_STATIC_VCRT)
|
if(SDL_FORCE_STATIC_VCRT)
|
||||||
@@ -336,6 +292,8 @@ if(WINDOWS)
|
|||||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1")
|
||||||
|
|
||||||
# Emscripten toolchain has a nonempty default value for this, and the checks
|
# Emscripten toolchain has a nonempty default value for this, and the checks
|
||||||
# in this file need to change that, so remember the original value, and
|
# in this file need to change that, so remember the original value, and
|
||||||
# restore back to that afterwards. For check_function_exists() to work in
|
# restore back to that afterwards. For check_function_exists() to work in
|
||||||
@@ -369,7 +327,6 @@ endif()
|
|||||||
|
|
||||||
# All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
|
# All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
|
||||||
# you only need to have a platform override them if they are disabling.
|
# you only need to have a platform override them if they are disabling.
|
||||||
set(OPT_DEF_ASM TRUE)
|
|
||||||
if(EMSCRIPTEN)
|
if(EMSCRIPTEN)
|
||||||
# Set up default values for the currently supported set of subsystems:
|
# Set up default values for the currently supported set of subsystems:
|
||||||
# Emscripten/Javascript does not have assembly support, a dynamic library
|
# Emscripten/Javascript does not have assembly support, a dynamic library
|
||||||
@@ -433,18 +390,21 @@ set_option(SDL2_DISABLE_UNINSTALL "Disable uninstallation of SDL2" OFF)
|
|||||||
|
|
||||||
option_string(SDL_ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto")
|
option_string(SDL_ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto")
|
||||||
#set_option(SDL_DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON)
|
#set_option(SDL_DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON)
|
||||||
|
set_option(SDL_ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM})
|
||||||
|
dep_option(SDL_SSEMATH "Allow GCC to use SSE floating point math" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||||
|
dep_option(SDL_SSE "Use SSE assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||||
|
dep_option(SDL_SSE2 "Use SSE2 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||||
|
dep_option(SDL_SSE3 "Use SSE3 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||||
|
dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||||
|
dep_option(SDL_3DNOW "Use 3Dnow! MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
|
||||||
|
dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY" OFF)
|
||||||
|
dep_option(SDL_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
|
||||||
|
dep_option(SDL_ARMNEON "Use NEON assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
|
||||||
|
dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)
|
||||||
|
dep_option(SDL_LASX "Use LASX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)
|
||||||
|
|
||||||
set_option(SDL_LIBC "Use the system C library" ${OPT_DEF_LIBC})
|
set_option(SDL_LIBC "Use the system C library" ${OPT_DEF_LIBC})
|
||||||
set_option(SDL_GCC_ATOMICS "Use gcc builtin atomics" ${OPT_DEF_GCC_ATOMICS})
|
set_option(SDL_GCC_ATOMICS "Use gcc builtin atomics" ${OPT_DEF_GCC_ATOMICS})
|
||||||
set_option(SDL_ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM})
|
|
||||||
set_option(SDL_SSEMATH "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
|
|
||||||
set_option(SDL_MMX "Use MMX assembly routines" ${OPT_DEF_ASM})
|
|
||||||
set_option(SDL_3DNOW "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM})
|
|
||||||
set_option(SDL_SSE "Use SSE assembly routines" ${OPT_DEF_ASM})
|
|
||||||
set_option(SDL_SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
|
|
||||||
set_option(SDL_SSE3 "Use SSE3 assembly routines" ${OPT_DEF_SSEMATH})
|
|
||||||
set_option(SDL_ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM})
|
|
||||||
set_option(SDL_ARMSIMD "use SIMD assembly blitters on ARM" OFF)
|
|
||||||
set_option(SDL_ARMNEON "use NEON assembly blitters on ARM" OFF)
|
|
||||||
dep_option(SDL_DBUS "Enable D-Bus support" ON ${UNIX_SYS} OFF)
|
dep_option(SDL_DBUS "Enable D-Bus support" ON ${UNIX_SYS} OFF)
|
||||||
set_option(SDL_DISKAUDIO "Support the disk writer audio driver" ON)
|
set_option(SDL_DISKAUDIO "Support the disk writer audio driver" ON)
|
||||||
set_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON)
|
set_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON)
|
||||||
@@ -511,6 +471,7 @@ set_option(SDL_HIDAPI "Enable the HIDAPI subsystem" ON)
|
|||||||
dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" OFF SDL_HIDAPI OFF)
|
dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" OFF SDL_HIDAPI OFF)
|
||||||
dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF)
|
dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF)
|
||||||
dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF)
|
dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF)
|
||||||
|
set_option(SDL_LIBUDEV "Enable libudev support" ON)
|
||||||
set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF)
|
set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF)
|
||||||
option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "")
|
option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "")
|
||||||
set_option(SDL_CCACHE "Use Ccache to speed up build" ON)
|
set_option(SDL_CCACHE "Use Ccache to speed up build" ON)
|
||||||
@@ -527,26 +488,6 @@ set_option(SDL_INSTALL_TESTS "Install test-cases" OFF)
|
|||||||
|
|
||||||
set(HAVE_STATIC_PIC "${SDL_STATIC_PIC}")
|
set(HAVE_STATIC_PIC "${SDL_STATIC_PIC}")
|
||||||
|
|
||||||
if(SDL_WERROR)
|
|
||||||
if(MSVC)
|
|
||||||
cmake_push_check_state(RESET)
|
|
||||||
check_c_compiler_flag(/WX HAVE_WX)
|
|
||||||
if(HAVE_WX)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
|
||||||
endif()
|
|
||||||
elseif(USE_GCC OR USE_CLANG)
|
|
||||||
cmake_push_check_state(RESET)
|
|
||||||
check_c_compiler_flag(-Werror HAVE_WERROR)
|
|
||||||
if(HAVE_WERROR)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
||||||
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -Werror")
|
|
||||||
endif()
|
|
||||||
cmake_pop_check_state()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(SDL_HIDAPI)
|
if(SDL_HIDAPI)
|
||||||
if(HIDAPI_ONLY_LIBUSB)
|
if(HIDAPI_ONLY_LIBUSB)
|
||||||
set(SDL_HIDAPI_LIBUSB ON CACHE BOOL "" FORCE)
|
set(SDL_HIDAPI_LIBUSB ON CACHE BOOL "" FORCE)
|
||||||
@@ -585,6 +526,15 @@ file(GLOB SOURCE_FILES
|
|||||||
${SDL2_SOURCE_DIR}/src/video/*.c
|
${SDL2_SOURCE_DIR}/src/video/*.c
|
||||||
${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)
|
${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)
|
||||||
|
|
||||||
|
if(USE_INTELCC)
|
||||||
|
# warning #39: division by zero
|
||||||
|
# warning #239: floating point underflow
|
||||||
|
# warning #264: floating-point value does not fit in required floating-point type
|
||||||
|
set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_exp.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd239 -wd264")
|
||||||
|
set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_log.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd39")
|
||||||
|
set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_log10.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd39")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED 1)
|
set(SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED 1)
|
||||||
if(SDL_ASSERTIONS MATCHES "^(auto|)$")
|
if(SDL_ASSERTIONS MATCHES "^(auto|)$")
|
||||||
@@ -613,7 +563,7 @@ if(NOT SDL_FOREGROUNDING_SIGNAL STREQUAL "OFF")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler option evaluation
|
# Compiler option evaluation
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
# Check for -Wall first, so later things can override pieces of it.
|
# Check for -Wall first, so later things can override pieces of it.
|
||||||
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
||||||
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
||||||
@@ -691,6 +641,11 @@ if(USE_GCC OR USE_CLANG)
|
|||||||
list(APPEND EXTRA_CFLAGS "-Wshadow")
|
list(APPEND EXTRA_CFLAGS "-Wshadow")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
check_c_compiler_flag(-Wunused-local-typedefs HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
||||||
|
if(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
||||||
|
list(APPEND EXTRA_CFLAGS "-Wno-unused-local-typedefs")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
cmake_push_check_state(RESET)
|
cmake_push_check_state(RESET)
|
||||||
# FIXME: don't use deprecated declarations
|
# FIXME: don't use deprecated declarations
|
||||||
@@ -751,7 +706,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_ASSEMBLY)
|
if(SDL_ASSEMBLY)
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
# TODO: Those all seem to be quite GCC specific - needs to be
|
# TODO: Those all seem to be quite GCC specific - needs to be
|
||||||
# reworked for better compiler support
|
# reworked for better compiler support
|
||||||
set(HAVE_ASSEMBLY TRUE)
|
set(HAVE_ASSEMBLY TRUE)
|
||||||
@@ -835,8 +790,9 @@ if(SDL_ASSEMBLY)
|
|||||||
#ifndef __SSE2__
|
#ifndef __SSE2__
|
||||||
#error Assembler CPP flag not enabled
|
#error Assembler CPP flag not enabled
|
||||||
#endif
|
#endif
|
||||||
int main(int argc, char **argv) { return 0; }" HAVE_SSE2)
|
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_SSE2)
|
||||||
if(HAVE_SSE2)
|
if(CPU_SUPPORTS_SSE2)
|
||||||
|
set(HAVE_SSE2 TRUE)
|
||||||
list(APPEND EXTRA_CFLAGS "-msse2")
|
list(APPEND EXTRA_CFLAGS "-msse2")
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
@@ -858,8 +814,9 @@ if(SDL_ASSEMBLY)
|
|||||||
#ifndef __SSE3__
|
#ifndef __SSE3__
|
||||||
#error Assembler CPP flag not enabled
|
#error Assembler CPP flag not enabled
|
||||||
#endif
|
#endif
|
||||||
int main(int argc, char **argv) { return 0; }" HAVE_SSE3)
|
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_SSE3)
|
||||||
if(HAVE_SSE3)
|
if(CPU_SUPPORTS_SSE3)
|
||||||
|
set(HAVE_SSE3 TRUE)
|
||||||
list(APPEND EXTRA_CFLAGS "-msse3")
|
list(APPEND EXTRA_CFLAGS "-msse3")
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
@@ -892,9 +849,9 @@ if(SDL_ASSEMBLY)
|
|||||||
vector unsigned int vzero() {
|
vector unsigned int vzero() {
|
||||||
return vec_splat_u32(0);
|
return vec_splat_u32(0);
|
||||||
}
|
}
|
||||||
int main(int argc, char **argv) { return 0; }" HAVE_ALTIVEC)
|
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_ALTIVEC)
|
||||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
if(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
|
if(CPU_SUPPORTS_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
|
||||||
set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set
|
set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set
|
||||||
list(APPEND EXTRA_CFLAGS "-maltivec")
|
list(APPEND EXTRA_CFLAGS "-maltivec")
|
||||||
set(SDL_ALTIVEC_BLITTERS 1)
|
set(SDL_ALTIVEC_BLITTERS 1)
|
||||||
@@ -904,6 +861,39 @@ if(SDL_ASSEMBLY)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SDL_LSX)
|
||||||
|
cmake_push_check_state()
|
||||||
|
list(APPEND CMAKE_REQUIRED_FLAGS "-mlsx")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#ifndef __loongarch_sx
|
||||||
|
#error Assembler CPP flag not enabled
|
||||||
|
#endif
|
||||||
|
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LSX)
|
||||||
|
check_include_file("lsxintrin.h" HAVE_LSXINTRIN_H)
|
||||||
|
cmake_pop_check_state()
|
||||||
|
|
||||||
|
if(CPU_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
|
||||||
|
list(APPEND EXTRA_CFLAGS "-mlsx")
|
||||||
|
set(HAVE_LSX TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(SDL_LASX)
|
||||||
|
cmake_push_check_state()
|
||||||
|
list(APPEND CMAKE_REQUIRED_FLAGS "-mlasx")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#ifndef __loongarch_asx
|
||||||
|
#error Assembler CPP flag not enabled
|
||||||
|
#endif
|
||||||
|
int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LASX)
|
||||||
|
check_include_file("lasxintrin.h" HAVE_LASXINTRIN_H)
|
||||||
|
cmake_pop_check_state()
|
||||||
|
if(CPU_SUPPORTS_LASX AND HAVE_LASXINTRIN_H)
|
||||||
|
list(APPEND EXTRA_CFLAGS "-mlasx")
|
||||||
|
set(HAVE_LASX TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(SDL_ARMSIMD)
|
if(SDL_ARMSIMD)
|
||||||
set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x assembler-with-cpp")
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x assembler-with-cpp")
|
||||||
@@ -962,12 +952,22 @@ if(SDL_ASSEMBLY)
|
|||||||
# TODO: SDL_cpuinfo.h needs to support the user's configuration wish
|
# TODO: SDL_cpuinfo.h needs to support the user's configuration wish
|
||||||
# for MSVC - right now it is always activated
|
# for MSVC - right now it is always activated
|
||||||
if(NOT ARCH_64)
|
if(NOT ARCH_64)
|
||||||
|
if(SDL_MMX)
|
||||||
set(HAVE_MMX TRUE)
|
set(HAVE_MMX TRUE)
|
||||||
|
endif()
|
||||||
|
if(SDL_3DNOW)
|
||||||
set(HAVE_3DNOW TRUE)
|
set(HAVE_3DNOW TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
if(SDL_SSE)
|
||||||
set(HAVE_SSE TRUE)
|
set(HAVE_SSE TRUE)
|
||||||
|
endif()
|
||||||
|
if(SDL_SSE2)
|
||||||
set(HAVE_SSE2 TRUE)
|
set(HAVE_SSE2 TRUE)
|
||||||
|
endif()
|
||||||
|
if(SDL_SSE3)
|
||||||
set(HAVE_SSE3 TRUE)
|
set(HAVE_SSE3 TRUE)
|
||||||
|
endif()
|
||||||
check_include_file("immintrin.h" HAVE_IMMINTRIN_H)
|
check_include_file("immintrin.h" HAVE_IMMINTRIN_H)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -1067,6 +1067,7 @@ if(SDL_LIBC)
|
|||||||
check_library_exists(m pow "" HAVE_LIBM)
|
check_library_exists(m pow "" HAVE_LIBM)
|
||||||
if(HAVE_LIBM)
|
if(HAVE_LIBM)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES m)
|
set(CMAKE_REQUIRED_LIBRARIES m)
|
||||||
|
endif()
|
||||||
foreach(_FN
|
foreach(_FN
|
||||||
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
|
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
|
||||||
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
|
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
|
||||||
@@ -1076,6 +1077,7 @@ if(SDL_LIBC)
|
|||||||
set(_HAVEVAR "HAVE_${_UPPER}")
|
set(_HAVEVAR "HAVE_${_UPPER}")
|
||||||
check_symbol_exists("${_FN}" "math.h" ${_HAVEVAR})
|
check_symbol_exists("${_FN}" "math.h" ${_HAVEVAR})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
if(HAVE_LIBM)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES)
|
set(CMAKE_REQUIRED_LIBRARIES)
|
||||||
if(NOT VITA)
|
if(NOT VITA)
|
||||||
list(APPEND EXTRA_LIBS m)
|
list(APPEND EXTRA_LIBS m)
|
||||||
@@ -1117,6 +1119,10 @@ else()
|
|||||||
set(HAVE_STDARG_H 1)
|
set(HAVE_STDARG_H 1)
|
||||||
set(HAVE_STDDEF_H 1)
|
set(HAVE_STDDEF_H 1)
|
||||||
check_include_file(stdint.h HAVE_STDINT_H)
|
check_include_file(stdint.h HAVE_STDINT_H)
|
||||||
|
|
||||||
|
if(MSVC AND USE_CLANG)
|
||||||
|
check_c_compiler_flag("/Q_no-use-libirc" HAS_Q_NO_USE_LIBIRC )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -1485,6 +1491,18 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||||||
ioctl(0, KDENABIO, 1);
|
ioctl(0, KDENABIO, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}" HAVE_INPUT_KBIO)
|
}" HAVE_INPUT_KBIO)
|
||||||
|
elseif(OPENBSD OR NETBSD)
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <dev/wscons/wsconsio.h>
|
||||||
|
#include <dev/wscons/wsksymdef.h>
|
||||||
|
#include <dev/wscons/wsksymvar.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
struct wskbd_map_data data;
|
||||||
|
ioctl(0, WSKBDIO_GETMAP, &data);
|
||||||
|
return 0;
|
||||||
|
}" HAVE_INPUT_WSCONS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_INPUT_EVENTS)
|
if(HAVE_INPUT_EVENTS)
|
||||||
@@ -1506,7 +1524,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||||||
set(SDL_INPUT_FBSDKBIO 1)
|
set(SDL_INPUT_FBSDKBIO 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_include_file("libudev.h" HAVE_LIBUDEV_H)
|
if(HAVE_INPUT_WSCONS)
|
||||||
|
set(SDL_INPUT_WSCONS 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
CheckLibUDev()
|
||||||
check_include_file("sys/inotify.h" HAVE_SYS_INOTIFY_H)
|
check_include_file("sys/inotify.h" HAVE_SYS_INOTIFY_H)
|
||||||
check_symbol_exists(inotify_init "sys/inotify.h" HAVE_INOTIFY_INIT)
|
check_symbol_exists(inotify_init "sys/inotify.h" HAVE_INOTIFY_INIT)
|
||||||
check_symbol_exists(inotify_init1 "sys/inotify.h" HAVE_INOTIFY_INIT1)
|
check_symbol_exists(inotify_init1 "sys/inotify.h" HAVE_INOTIFY_INIT1)
|
||||||
@@ -1616,14 +1638,14 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||||||
CheckPTHREAD()
|
CheckPTHREAD()
|
||||||
|
|
||||||
if(SDL_CLOCK_GETTIME)
|
if(SDL_CLOCK_GETTIME)
|
||||||
check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT)
|
|
||||||
if(FOUND_CLOCK_GETTIME_LIBRT)
|
|
||||||
list(APPEND EXTRA_LIBS rt)
|
|
||||||
set(HAVE_CLOCK_GETTIME 1)
|
|
||||||
else()
|
|
||||||
check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC)
|
check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC)
|
||||||
if(FOUND_CLOCK_GETTIME_LIBC)
|
if(FOUND_CLOCK_GETTIME_LIBC)
|
||||||
set(HAVE_CLOCK_GETTIME 1)
|
set(HAVE_CLOCK_GETTIME 1)
|
||||||
|
else()
|
||||||
|
check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT)
|
||||||
|
if(FOUND_CLOCK_GETTIME_LIBRT)
|
||||||
|
set(HAVE_CLOCK_GETTIME 1)
|
||||||
|
list(APPEND EXTRA_LIBS rt)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -1703,7 +1725,7 @@ elseif(WINDOWS)
|
|||||||
|
|
||||||
if(MSVC AND NOT SDL_LIBC)
|
if(MSVC AND NOT SDL_LIBC)
|
||||||
# Prevent codegen that would use the VC runtime libraries.
|
# Prevent codegen that would use the VC runtime libraries.
|
||||||
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-")
|
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-;/Gs1048576")
|
||||||
if(NOT ARCH_64 AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
|
if(NOT ARCH_64 AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
|
||||||
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE")
|
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE")
|
||||||
endif()
|
endif()
|
||||||
@@ -2484,6 +2506,9 @@ elseif(VITA)
|
|||||||
set(SDL_VIDEO_OPENGL_ES2 1)
|
set(SDL_VIDEO_OPENGL_ES2 1)
|
||||||
list(APPEND EXTRA_LIBS
|
list(APPEND EXTRA_LIBS
|
||||||
pib
|
pib
|
||||||
|
libScePiglet_stub_weak
|
||||||
|
taihen_stub_weak
|
||||||
|
SceShaccCg_stub_weak
|
||||||
)
|
)
|
||||||
set(HAVE_VIDEO_VITA_PIB ON)
|
set(HAVE_VIDEO_VITA_PIB ON)
|
||||||
set(SDL_VIDEO_VITA_PIB 1)
|
set(SDL_VIDEO_VITA_PIB 1)
|
||||||
@@ -2496,7 +2521,6 @@ elseif(VITA)
|
|||||||
check_include_file(gpu_es4/psp2_pvr_hint.h HAVE_PVR_H)
|
check_include_file(gpu_es4/psp2_pvr_hint.h HAVE_PVR_H)
|
||||||
if(HAVE_PVR_H)
|
if(HAVE_PVR_H)
|
||||||
target_compile_definitions(sdl-build-options INTERFACE "-D__psp2__")
|
target_compile_definitions(sdl-build-options INTERFACE "-D__psp2__")
|
||||||
check_include_file(gl4esinit.h HAVE_GL4ES_H)
|
|
||||||
set(SDL_VIDEO_OPENGL_EGL 1)
|
set(SDL_VIDEO_OPENGL_EGL 1)
|
||||||
set(HAVE_OPENGLES TRUE)
|
set(HAVE_OPENGLES TRUE)
|
||||||
set(SDL_VIDEO_OPENGL_ES 1)
|
set(SDL_VIDEO_OPENGL_ES 1)
|
||||||
@@ -2507,11 +2531,14 @@ elseif(VITA)
|
|||||||
list(APPEND EXTRA_LIBS
|
list(APPEND EXTRA_LIBS
|
||||||
libgpu_es4_ext_stub_weak
|
libgpu_es4_ext_stub_weak
|
||||||
libIMGEGL_stub_weak
|
libIMGEGL_stub_weak
|
||||||
|
SceIme_stub
|
||||||
)
|
)
|
||||||
|
|
||||||
set(HAVE_VIDEO_VITA_PVR ON)
|
set(HAVE_VIDEO_VITA_PVR ON)
|
||||||
set(SDL_VIDEO_VITA_PVR 1)
|
set(SDL_VIDEO_VITA_PVR 1)
|
||||||
|
|
||||||
|
if(SDL_OPENGL)
|
||||||
|
check_include_file(gl4esinit.h HAVE_GL4ES_H)
|
||||||
if(HAVE_GL4ES_H)
|
if(HAVE_GL4ES_H)
|
||||||
set(HAVE_OPENGL TRUE)
|
set(HAVE_OPENGL TRUE)
|
||||||
set(SDL_VIDEO_OPENGL 1)
|
set(SDL_VIDEO_OPENGL 1)
|
||||||
@@ -2519,6 +2546,7 @@ elseif(VITA)
|
|||||||
list(APPEND EXTRA_LIBS libGL_stub)
|
list(APPEND EXTRA_LIBS libGL_stub)
|
||||||
set(SDL_VIDEO_VITA_PVR_OGL 1)
|
set(SDL_VIDEO_VITA_PVR_OGL 1)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
set(HAVE_VIDEO_VITA_PVR OFF)
|
set(HAVE_VIDEO_VITA_PVR OFF)
|
||||||
@@ -2547,19 +2575,6 @@ elseif(VITA)
|
|||||||
SceProcessmgr_stub
|
SceProcessmgr_stub
|
||||||
m
|
m
|
||||||
)
|
)
|
||||||
if(HAVE_VITA_PIB)
|
|
||||||
list(PREPEND EXTRA_LIBS
|
|
||||||
pib
|
|
||||||
libScePiglet_stub
|
|
||||||
SceShaccCg_stub
|
|
||||||
taihen_stub
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(HAVE_VITA_PVR)
|
|
||||||
list(PREPEND EXTRA_LIBS
|
|
||||||
SceIme_stub
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(HAVE_ARMSIMD TRUE)
|
set(HAVE_ARMSIMD TRUE)
|
||||||
@@ -2642,7 +2657,7 @@ elseif(PSP)
|
|||||||
)
|
)
|
||||||
if(NOT SDL2_DISABLE_SDL2MAIN)
|
if(NOT SDL2_DISABLE_SDL2MAIN)
|
||||||
list(INSERT SDL_LIBS 0 "-lSDL2main")
|
list(INSERT SDL_LIBS 0 "-lSDL2main")
|
||||||
endif(NOT SDL2_DISABLE_SDL2MAIN)
|
endif()
|
||||||
|
|
||||||
elseif(PS2)
|
elseif(PS2)
|
||||||
list(APPEND EXTRA_CFLAGS "-DPS2" "-D__PS2__" "-I$ENV{PS2SDK}/ports/include" "-I$ENV{PS2DEV}/gsKit/include")
|
list(APPEND EXTRA_CFLAGS "-DPS2" "-D__PS2__" "-I$ENV{PS2SDK}/ports/include" "-I$ENV{PS2DEV}/gsKit/include")
|
||||||
@@ -2840,6 +2855,17 @@ elseif(N3DS)
|
|||||||
else()
|
else()
|
||||||
message_error("SDL_FILE must be enabled to build on N3DS")
|
message_error("SDL_FILE must be enabled to build on N3DS")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT SDL2_DISABLE_SDL2MAIN)
|
||||||
|
list(INSERT SDL_LIBS 0 "-lSDL2main")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach(lib ${CMAKE_C_STANDARD_LIBRARIES})
|
||||||
|
if(lib MATCHES "^-l")
|
||||||
|
string(SUBSTRING "${lib}" 2 -1 lib)
|
||||||
|
endif()
|
||||||
|
list(APPEND EXTRA_LIBS ${lib})
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_VULKAN AND NOT SDL_LOADSO)
|
if(HAVE_VULKAN AND NOT SDL_LOADSO)
|
||||||
@@ -2926,6 +2952,26 @@ if(NOT SDLMAIN_SOURCES)
|
|||||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c)
|
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SDL_WERROR)
|
||||||
|
if(MSVC)
|
||||||
|
cmake_push_check_state(RESET)
|
||||||
|
check_c_compiler_flag(/WX HAVE_WX)
|
||||||
|
if(HAVE_WX)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||||
|
endif()
|
||||||
|
elseif(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
|
cmake_push_check_state(RESET)
|
||||||
|
check_c_compiler_flag(-Werror HAVE_WERROR)
|
||||||
|
if(HAVE_WERROR)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||||
|
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -Werror")
|
||||||
|
endif()
|
||||||
|
cmake_pop_check_state()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Append the -MMD -MT flags
|
# Append the -MMD -MT flags
|
||||||
# if(DEPENDENCY_TRACKING)
|
# if(DEPENDENCY_TRACKING)
|
||||||
# if(COMPILER_IS_GNUCC)
|
# if(COMPILER_IS_GNUCC)
|
||||||
@@ -2942,7 +2988,7 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" lower_build_type)
|
|||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/include-config-${lower_build_type}")
|
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/include-config-${lower_build_type}")
|
||||||
# 3. generate SDL_config in an build_type-dependent folder (which should be first in the include search path)
|
# 3. generate SDL_config in an build_type-dependent folder (which should be first in the include search path)
|
||||||
file(GENERATE
|
file(GENERATE
|
||||||
OUTPUT "${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL_config.h"
|
OUTPUT "${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL2/SDL_config.h"
|
||||||
INPUT "${SDL2_BINARY_DIR}/SDL_config.h.intermediate")
|
INPUT "${SDL2_BINARY_DIR}/SDL_config.h.intermediate")
|
||||||
|
|
||||||
# Prepare the flags and remove duplicates
|
# Prepare the flags and remove duplicates
|
||||||
@@ -2993,9 +3039,9 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file("${SDL2_SOURCE_DIR}/include/SDL_revision.h.cmake"
|
configure_file("${SDL2_SOURCE_DIR}/include/SDL_revision.h.cmake"
|
||||||
"${SDL2_BINARY_DIR}/include/SDL_revision.h")
|
"${SDL2_BINARY_DIR}/include/SDL2/SDL_revision.h")
|
||||||
|
|
||||||
# Copy all non-generated headers to "${SDL2_BINARY_DIR}/include"
|
# Copy all non-generated headers to "${SDL2_BINARY_DIR}/include/SDL2"
|
||||||
# This is done to avoid the inclusion of a pre-generated SDL_config.h
|
# This is done to avoid the inclusion of a pre-generated SDL_config.h
|
||||||
file(GLOB SDL2_INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
|
file(GLOB SDL2_INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
|
||||||
set(SDL2_COPIED_INCLUDE_FILES)
|
set(SDL2_COPIED_INCLUDE_FILES)
|
||||||
@@ -3004,7 +3050,7 @@ foreach(_hdr IN LISTS SDL2_INCLUDE_FILES)
|
|||||||
list(REMOVE_ITEM SDL2_INCLUDE_FILES "${_hdr}")
|
list(REMOVE_ITEM SDL2_INCLUDE_FILES "${_hdr}")
|
||||||
else()
|
else()
|
||||||
get_filename_component(_name "${_hdr}" NAME)
|
get_filename_component(_name "${_hdr}" NAME)
|
||||||
set(_bin_hdr "${SDL2_BINARY_DIR}/include/${_name}")
|
set(_bin_hdr "${SDL2_BINARY_DIR}/include/SDL2/${_name}")
|
||||||
list(APPEND SDL2_COPIED_INCLUDE_FILES "${_bin_hdr}")
|
list(APPEND SDL2_COPIED_INCLUDE_FILES "${_bin_hdr}")
|
||||||
add_custom_command(OUTPUT "${_bin_hdr}"
|
add_custom_command(OUTPUT "${_bin_hdr}"
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_hdr}" "${_bin_hdr}"
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_hdr}" "${_bin_hdr}"
|
||||||
@@ -3059,6 +3105,7 @@ string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_STATIC_LIBS "$
|
|||||||
if(NOT SDL_SHARED)
|
if(NOT SDL_SHARED)
|
||||||
string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_LIBS "${SDL_LIBS}")
|
string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_LIBS "${SDL_LIBS}")
|
||||||
endif()
|
endif()
|
||||||
|
listtostr(PKGCONFIG_DEPENDS PKGCONFIG_DEPENDS)
|
||||||
|
|
||||||
if(SDL_STATIC AND SDL_SHARED AND NOT sdl_static_libname STREQUAL "SDL2")
|
if(SDL_STATIC AND SDL_SHARED AND NOT sdl_static_libname STREQUAL "SDL2")
|
||||||
message(STATUS "\"pkg-config --static --libs sdl2\" will return invalid information")
|
message(STATUS "\"pkg-config --static --libs sdl2\" will return invalid information")
|
||||||
@@ -3139,7 +3186,7 @@ if (SDL_ASAN)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_CCACHE)
|
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
|
||||||
cmake_minimum_required(VERSION 3.4)
|
cmake_minimum_required(VERSION 3.4)
|
||||||
find_program(CCACHE_BINARY ccache)
|
find_program(CCACHE_BINARY ccache)
|
||||||
if(CCACHE_BINARY)
|
if(CCACHE_BINARY)
|
||||||
@@ -3150,6 +3197,8 @@ if(SDL_CCACHE)
|
|||||||
else()
|
else()
|
||||||
set(HAVE_CCACHE OFF)
|
set(HAVE_CCACHE OFF)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
set(HAVE_CCACHE OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_TESTS)
|
if(SDL_TESTS)
|
||||||
@@ -3235,22 +3284,27 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
|
|||||||
add_dependencies(SDL2main sdl_headers_copy)
|
add_dependencies(SDL2main sdl_headers_copy)
|
||||||
# alias target for in-tree builds
|
# alias target for in-tree builds
|
||||||
add_library(SDL2::SDL2main ALIAS SDL2main)
|
add_library(SDL2::SDL2main ALIAS SDL2main)
|
||||||
target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include" PRIVATE "${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>")
|
target_include_directories(SDL2main BEFORE
|
||||||
|
PRIVATE "${SDL2_BINARY_DIR}/include"
|
||||||
|
PRIVATE "${SDL2_BINARY_DIR}/include/SDL2"
|
||||||
|
PRIVATE "${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL2"
|
||||||
|
)
|
||||||
target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>" $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>)
|
target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>" $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(SDL2main PRIVATE shell32)
|
target_link_libraries(SDL2main PRIVATE shell32)
|
||||||
endif()
|
endif()
|
||||||
if(MINGW OR CYGWIN)
|
if(MINGW OR CYGWIN)
|
||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
|
target_link_libraries(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
|
||||||
else()
|
else()
|
||||||
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
|
target_link_libraries(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (NOT ANDROID)
|
if (NOT ANDROID)
|
||||||
set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
|
set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
set_property(TARGET SDL2main APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||||
|
set_property(TARGET SDL2main PROPERTY INTERFACE_SDL_VERSION "SDL2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
@@ -3268,7 +3322,7 @@ endif()
|
|||||||
if(APPLE)
|
if(APPLE)
|
||||||
foreach(SOURCE_FILE ${SOURCE_FILES})
|
foreach(SOURCE_FILE ${SOURCE_FILES})
|
||||||
get_filename_component(FILE_EXTENSION ${SOURCE_FILE} EXT)
|
get_filename_component(FILE_EXTENSION ${SOURCE_FILE} EXT)
|
||||||
if(FILE_EXTENSION STREQUAL "m")
|
if(FILE_EXTENSION STREQUAL ".m")
|
||||||
set_property(SOURCE ${SOURCE_FILE} APPEND_STRING PROPERTY COMPILE_FLAGS " -x objective-c")
|
set_property(SOURCE ${SOURCE_FILE} APPEND_STRING PROPERTY COMPILE_FLAGS " -x objective-c")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
@@ -3281,11 +3335,13 @@ if(SDL_SHARED)
|
|||||||
add_library(SDL2::SDL2 ALIAS SDL2)
|
add_library(SDL2::SDL2 ALIAS SDL2)
|
||||||
set_target_properties(SDL2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
set_target_properties(SDL2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||||
if(NOT SDL_LIBC)
|
if(NOT SDL_LIBC)
|
||||||
check_cpu_architecture(x86 HAS_X86)
|
if(SDL_CPU_X86)
|
||||||
if(HAS_X86)
|
|
||||||
# FIXME: should be added for all architectures (missing symbols for ARM)
|
# FIXME: should be added for all architectures (missing symbols for ARM)
|
||||||
target_link_libraries(SDL2 PRIVATE "-nodefaultlib:MSVCRT")
|
target_link_libraries(SDL2 PRIVATE "-nodefaultlib:MSVCRT")
|
||||||
endif()
|
endif()
|
||||||
|
if(HAS_Q_NO_USE_LIBIRC)
|
||||||
|
target_compile_options(SDL2 PRIVATE /Q_no-use-libirc)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# FIXME: Remove SOVERSION in SDL3
|
# FIXME: Remove SOVERSION in SDL3
|
||||||
@@ -3315,18 +3371,19 @@ if(SDL_SHARED)
|
|||||||
if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
|
if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
|
||||||
# Don't try to link with the default set of libraries.
|
# Don't try to link with the default set of libraries.
|
||||||
if(NOT WINDOWS_STORE)
|
if(NOT WINDOWS_STORE)
|
||||||
set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
|
set_property(TARGET SDL2 APPEND_STRING PROPERTY LINK_FLAGS " /NODEFAULTLIB")
|
||||||
set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
|
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
|
set_property(TARGET SDL2 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS " /NODEFAULTLIB")
|
||||||
endif()
|
endif()
|
||||||
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
|
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
|
||||||
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD})
|
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD} ${CMAKE_DEPENDS})
|
||||||
target_include_directories(SDL2 PUBLIC
|
target_include_directories(SDL2 PUBLIC
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||||
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL2>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>"
|
||||||
|
)
|
||||||
# This picks up all the compiler options and such we've accumulated up to here.
|
# This picks up all the compiler options and such we've accumulated up to here.
|
||||||
target_link_libraries(SDL2 PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
|
target_link_libraries(SDL2 PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
|
||||||
if(MINGW OR CYGWIN)
|
if(MINGW OR CYGWIN)
|
||||||
@@ -3338,8 +3395,10 @@ if(SDL_SHARED)
|
|||||||
set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
|
set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
|
||||||
endif()
|
endif()
|
||||||
# Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library
|
# Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library
|
||||||
set_property(TARGET SDL2 PROPERTY INTERFACE_SDL2_SHARED TRUE)
|
|
||||||
set_property(TARGET SDL2 APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED)
|
set_property(TARGET SDL2 APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED)
|
||||||
|
set_property(TARGET SDL2 PROPERTY INTERFACE_SDL2_SHARED TRUE)
|
||||||
|
set_property(TARGET SDL2 APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||||
|
set_property(TARGET SDL2 PROPERTY INTERFACE_SDL_VERSION "SDL2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_STATIC)
|
if(SDL_STATIC)
|
||||||
@@ -3353,20 +3412,24 @@ if(SDL_STATIC)
|
|||||||
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
|
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
|
||||||
# TODO: Win32 platforms keep the same suffix .lib for import and static
|
# TODO: Win32 platforms keep the same suffix .lib for import and static
|
||||||
# libraries - do we need to consider this?
|
# libraries - do we need to consider this?
|
||||||
target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
|
target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_DEPENDS})
|
||||||
target_include_directories(SDL2-static PUBLIC
|
target_include_directories(SDL2-static PUBLIC
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||||
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL2>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>"
|
||||||
|
)
|
||||||
# This picks up all the compiler options and such we've accumulated up to here.
|
# This picks up all the compiler options and such we've accumulated up to here.
|
||||||
target_link_libraries(SDL2-static PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
|
target_link_libraries(SDL2-static PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
|
||||||
if(NOT ANDROID)
|
if(NOT ANDROID)
|
||||||
set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
|
set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
|
||||||
endif()
|
endif()
|
||||||
# Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library
|
# Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library
|
||||||
set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL2_SHARED FALSE)
|
|
||||||
set_property(TARGET SDL2-static APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED)
|
set_property(TARGET SDL2-static APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED)
|
||||||
|
set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL2_SHARED FALSE)
|
||||||
|
set_property(TARGET SDL2-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||||
|
set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL_VERSION "SDL2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDL_BUILD_MAJOR_VERSION=${SDL_MAJOR_VERSION}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDL_BUILD_MAJOR_VERSION=${SDL_MAJOR_VERSION}")
|
||||||
@@ -3384,10 +3447,13 @@ if(SDL_TEST)
|
|||||||
EXPORT_NAME SDL2test)
|
EXPORT_NAME SDL2test)
|
||||||
target_include_directories(SDL2_test PUBLIC
|
target_include_directories(SDL2_test PUBLIC
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include>"
|
||||||
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include/SDL2>"
|
||||||
|
"$<BUILD_INTERFACE:${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL2>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
|
||||||
target_link_libraries(SDL2_test PRIVATE ${EXTRA_TEST_LIBS})
|
target_link_libraries(SDL2_test PRIVATE ${EXTRA_TEST_LIBS})
|
||||||
|
set_property(TARGET SDL2_test APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||||
|
set_property(TARGET SDL2_test PROPERTY INTERFACE_SDL_VERSION "SDL2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##### Installation targets #####
|
##### Installation targets #####
|
||||||
@@ -3492,6 +3558,7 @@ if(NOT SDL2_DISABLE_INSTALL)
|
|||||||
FILES
|
FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake
|
||||||
|
${SDL2_SOURCE_DIR}/cmake/sdlfind.cmake
|
||||||
DESTINATION "${SDL_INSTALL_CMAKEDIR}"
|
DESTINATION "${SDL_INSTALL_CMAKEDIR}"
|
||||||
COMPONENT Devel
|
COMPONENT Devel
|
||||||
)
|
)
|
||||||
@@ -3499,8 +3566,8 @@ if(NOT SDL2_DISABLE_INSTALL)
|
|||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
${SDL2_INCLUDE_FILES}
|
${SDL2_INCLUDE_FILES}
|
||||||
"${SDL2_BINARY_DIR}/include/SDL_revision.h"
|
"${SDL2_BINARY_DIR}/include/SDL2/SDL_revision.h"
|
||||||
"${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL_config.h"
|
"${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL2/SDL_config.h"
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
|
||||||
|
|
||||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -27,6 +27,7 @@ LDFLAGS = @BUILD_LDFLAGS@
|
|||||||
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
||||||
LIBTOOL = @LIBTOOL@
|
LIBTOOL = @LIBTOOL@
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
|
FGREP = @FGREP@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
RC = @RC@
|
RC = @RC@
|
||||||
@@ -130,7 +131,7 @@ HDRS = \
|
|||||||
begin_code.h \
|
begin_code.h \
|
||||||
close_code.h
|
close_code.h
|
||||||
|
|
||||||
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
|
SDLTEST_HDRS = $(shell ls $(srcdir)/include | $(FGREP) SDL_test)
|
||||||
|
|
||||||
LT_AGE = @LT_AGE@
|
LT_AGE = @LT_AGE@
|
||||||
LT_CURRENT = @LT_CURRENT@
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Makefile to build the SDL library
|
# Makefile to build the SDL library
|
||||||
|
|
||||||
INCLUDE = -I./include
|
CPPFLAGS = -I./include
|
||||||
CFLAGS = -g -O2 $(INCLUDE)
|
CFLAGS = -g -O2
|
||||||
AR = ar
|
AR = ar
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 26
|
MINOR_VERSION = 28
|
||||||
MICRO_VERSION = 0
|
MICRO_VERSION = 0
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
DESCRIPTION = Simple DirectMedia Layer 2
|
DESCRIPTION = Simple DirectMedia Layer 2
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 26
|
MINOR_VERSION = 28
|
||||||
MICRO_VERSION = 0
|
MICRO_VERSION = 0
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
|
|
||||||
|
@@ -30,6 +30,18 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake")
|
|||||||
set(SDL2_SDL2test_FOUND TRUE)
|
set(SDL2_SDL2test_FOUND TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/sdlfind.cmake")
|
||||||
|
|
||||||
|
set(SDL_ALSA @SDL_ALSA@)
|
||||||
|
set(SDL_ALSA_SHARED @SDL_ALSA_SHARED@)
|
||||||
|
if(SDL_ALSA AND NOT SDL_ALSA_SHARED AND TARGET SDL2::SDL2-static)
|
||||||
|
sdlFindALSA()
|
||||||
|
endif()
|
||||||
|
unset(SDL_ALSA)
|
||||||
|
unset(SDL_ALSA_SHARED)
|
||||||
|
|
||||||
|
|
||||||
check_required_components(SDL2)
|
check_required_components(SDL2)
|
||||||
|
|
||||||
# Create SDL2::SDL2 alias for static-only builds
|
# Create SDL2::SDL2 alias for static-only builds
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -239,17 +239,17 @@ LoadSprite(const char *file)
|
|||||||
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
|
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
|
||||||
sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h);
|
sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h);
|
||||||
if (!sprites[i]) {
|
if (!sprites[i]) {
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) {
|
if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
|
||||||
SDL_DestroyTexture(sprites[i]);
|
SDL_DestroyTexture(sprites[i]);
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We're ready to roll. :) */
|
/* We're ready to roll. :) */
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -364,8 +364,9 @@ loop()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
for (i = 0; i < state->num_windows; ++i) {
|
for (i = 0; i < state->num_windows; ++i) {
|
||||||
if (state->windows[i] == NULL)
|
if (state->windows[i] == NULL) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
DrawSprites(state->renderers[i], sprites[i]);
|
DrawSprites(state->renderers[i], sprites[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -382,7 +383,7 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Initialize test framework */
|
/* Initialize test framework */
|
||||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||||
if (!state) {
|
if (state == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,7 +446,7 @@ main(int argc, char *argv[])
|
|||||||
/* Create the windows, initialize the renderers, and load the textures */
|
/* Create the windows, initialize the renderers, and load the textures */
|
||||||
sprites =
|
sprites =
|
||||||
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
|
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
|
||||||
if (!sprites) {
|
if (sprites == NULL) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
|
||||||
quit(2);
|
quit(2);
|
||||||
}
|
}
|
||||||
|
@@ -137,6 +137,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
@@ -68,6 +68,8 @@ if(EXISTS "${_sdl2_library}" AND EXISTS "${_sdl2_dll_library}")
|
|||||||
IMPORTED_LOCATION "${_sdl2_dll_library}"
|
IMPORTED_LOCATION "${_sdl2_dll_library}"
|
||||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
||||||
INTERFACE_SDL2_SHARED "ON"
|
INTERFACE_SDL2_SHARED "ON"
|
||||||
|
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||||
|
INTERFACE_SDL_VERSION "SDL2"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set(SDL2_SDL2_FOUND TRUE)
|
set(SDL2_SDL2_FOUND TRUE)
|
||||||
@@ -84,6 +86,8 @@ if(EXISTS "${_sdl2main_library}")
|
|||||||
set_target_properties(SDL2::SDL2main
|
set_target_properties(SDL2::SDL2main
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
IMPORTED_LOCATION "${_sdl2main_library}"
|
IMPORTED_LOCATION "${_sdl2main_library}"
|
||||||
|
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||||
|
INTERFACE_SDL_VERSION "SDL2"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set(SDL2_SDL2main_FOUND TRUE)
|
set(SDL2_SDL2main_FOUND TRUE)
|
||||||
@@ -100,6 +104,8 @@ if(EXISTS "${_sdl2test_library}")
|
|||||||
PROPERTIES
|
PROPERTIES
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
|
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
|
||||||
IMPORTED_LOCATION "${_sdl2test_library}"
|
IMPORTED_LOCATION "${_sdl2test_library}"
|
||||||
|
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||||
|
INTERFACE_SDL_VERSION "SDL2"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set(SDL2_SDL2test_FOUND TRUE)
|
set(SDL2_SDL2test_FOUND TRUE)
|
||||||
|
10
WhatsNew.txt
10
WhatsNew.txt
@@ -1,6 +1,16 @@
|
|||||||
|
|
||||||
This is a list of major changes in SDL's version history.
|
This is a list of major changes in SDL's version history.
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.28.0:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Added SDL_HasWindowSurface() and SDL_DestroyWindowSurface() to switch between the window surface and rendering APIs
|
||||||
|
* Added a display event SDL_DISPLAYEVENT_MOVED which is sent when the primary monitor changes or displays change position relative to each other
|
||||||
|
* Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
2.26.0:
|
2.26.0:
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
@@ -127,7 +127,7 @@ initializeTextures(SDL_Renderer *renderer)
|
|||||||
|
|
||||||
/* create ship texture from surface */
|
/* create ship texture from surface */
|
||||||
ship = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
ship = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||||
if (!ship) {
|
if (ship == NULL) {
|
||||||
fatalError("could not create ship texture");
|
fatalError("could not create ship texture");
|
||||||
}
|
}
|
||||||
SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND);
|
SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND);
|
||||||
@@ -145,7 +145,7 @@ initializeTextures(SDL_Renderer *renderer)
|
|||||||
}
|
}
|
||||||
/* create space texture from surface */
|
/* create space texture from surface */
|
||||||
space = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
space = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||||
if (!space) {
|
if (space == NULL) {
|
||||||
fatalError("could not create space texture");
|
fatalError("could not create space texture");
|
||||||
}
|
}
|
||||||
SDL_FreeSurface(bmp_surface);
|
SDL_FreeSurface(bmp_surface);
|
||||||
|
@@ -84,14 +84,16 @@ stepParticles(double deltaTime)
|
|||||||
/* is the particle actually active, or is it marked for deletion? */
|
/* is the particle actually active, or is it marked for deletion? */
|
||||||
if (curr->isActive) {
|
if (curr->isActive) {
|
||||||
/* is the particle off the screen? */
|
/* is the particle off the screen? */
|
||||||
if (curr->y > screen_h)
|
if (curr->y > screen_h) {
|
||||||
curr->isActive = 0;
|
curr->isActive = 0;
|
||||||
else if (curr->y < 0)
|
} else if (curr->y < 0) {
|
||||||
curr->isActive = 0;
|
curr->isActive = 0;
|
||||||
if (curr->x > screen_w)
|
}
|
||||||
|
if (curr->x > screen_w) {
|
||||||
curr->isActive = 0;
|
curr->isActive = 0;
|
||||||
else if (curr->x < 0)
|
} else if (curr->x < 0) {
|
||||||
curr->isActive = 0;
|
curr->isActive = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* step velocity, then step position */
|
/* step velocity, then step position */
|
||||||
curr->yvel += ACCEL * deltaMilliseconds;
|
curr->yvel += ACCEL * deltaMilliseconds;
|
||||||
@@ -133,15 +135,17 @@ stepParticles(double deltaTime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* if we're a dust particle, shrink our size */
|
/* if we're a dust particle, shrink our size */
|
||||||
if (curr->type == dust)
|
if (curr->type == dust) {
|
||||||
curr->size -= deltaMilliseconds * 0.010f;
|
curr->size -= deltaMilliseconds * 0.010f;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we're still active, pack ourselves in the array next
|
/* if we're still active, pack ourselves in the array next
|
||||||
to the last active guy (pack the array tightly) */
|
to the last active guy (pack the array tightly) */
|
||||||
if (curr->isActive)
|
if (curr->isActive) {
|
||||||
*(slot++) = *curr;
|
*(slot++) = *curr;
|
||||||
|
}
|
||||||
} /* endif (curr->isActive) */
|
} /* endif (curr->isActive) */
|
||||||
curr++;
|
curr++;
|
||||||
}
|
}
|
||||||
@@ -188,8 +192,9 @@ explodeEmitter(struct particle *emitter)
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 200; i++) {
|
for (i = 0; i < 200; i++) {
|
||||||
|
|
||||||
if (num_active_particles >= MAX_PARTICLES)
|
if (num_active_particles >= MAX_PARTICLES) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* come up with a random angle and speed for new particle */
|
/* come up with a random angle and speed for new particle */
|
||||||
float theta = randomFloat(0, 2.0f * 3.141592);
|
float theta = randomFloat(0, 2.0f * 3.141592);
|
||||||
@@ -226,8 +231,9 @@ void
|
|||||||
spawnTrailFromEmitter(struct particle *emitter)
|
spawnTrailFromEmitter(struct particle *emitter)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (num_active_particles >= MAX_PARTICLES)
|
if (num_active_particles >= MAX_PARTICLES) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* select the particle at the slot at the end of our array */
|
/* select the particle at the slot at the end of our array */
|
||||||
struct particle *p = &particles[num_active_particles];
|
struct particle *p = &particles[num_active_particles];
|
||||||
@@ -262,8 +268,9 @@ void
|
|||||||
spawnEmitterParticle(GLfloat x, GLfloat y)
|
spawnEmitterParticle(GLfloat x, GLfloat y)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (num_active_particles >= MAX_PARTICLES)
|
if (num_active_particles >= MAX_PARTICLES) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* find particle at endpoint of array */
|
/* find particle at endpoint of array */
|
||||||
struct particle *p = &particles[num_active_particles];
|
struct particle *p = &particles[num_active_particles];
|
||||||
|
@@ -117,7 +117,7 @@ initializeTexture(SDL_Renderer *renderer)
|
|||||||
|
|
||||||
/* convert RGBA surface to texture */
|
/* convert RGBA surface to texture */
|
||||||
texture = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
texture = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||||
if (!texture) {
|
if (texture == NULL) {
|
||||||
fatalError("could not create texture");
|
fatalError("could not create texture");
|
||||||
}
|
}
|
||||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||||
|
@@ -165,7 +165,7 @@ loadFont(void)
|
|||||||
{
|
{
|
||||||
SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp");
|
SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp");
|
||||||
|
|
||||||
if (!surface) {
|
if (surface == NULL) {
|
||||||
printf("Error loading bitmap: %s\n", SDL_GetError());
|
printf("Error loading bitmap: %s\n", SDL_GetError());
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -183,7 +183,7 @@ loadFont(void)
|
|||||||
SDL_BlitSurface(surface, NULL, converted, NULL);
|
SDL_BlitSurface(surface, NULL, converted, NULL);
|
||||||
/* create our texture */
|
/* create our texture */
|
||||||
texture = SDL_CreateTextureFromSurface(renderer, converted);
|
texture = SDL_CreateTextureFromSurface(renderer, converted);
|
||||||
if (!texture) {
|
if (texture == NULL) {
|
||||||
printf("texture creation failed: %s\n", SDL_GetError());
|
printf("texture creation failed: %s\n", SDL_GetError());
|
||||||
} else {
|
} else {
|
||||||
/* set blend mode for our texture */
|
/* set blend mode for our texture */
|
||||||
|
@@ -207,10 +207,10 @@ playSound(struct sound *s)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* if this channel's sound is older than the oldest so far, set it to oldest */
|
/* if this channel's sound is older than the oldest so far, set it to oldest */
|
||||||
if (mixer.channels[i].timestamp <
|
if (mixer.channels[i].timestamp < mixer.channels[oldest_channel].timestamp) {
|
||||||
mixer.channels[oldest_channel].timestamp)
|
|
||||||
oldest_channel = i;
|
oldest_channel = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* no empty channels, take the oldest one */
|
/* no empty channels, take the oldest one */
|
||||||
if (selected_channel == -1)
|
if (selected_channel == -1)
|
||||||
|
@@ -58,11 +58,11 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* create window and renderer */
|
/* create window and renderer */
|
||||||
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI);
|
window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI);
|
||||||
if (!window) {
|
if (window == NULL) {
|
||||||
fatalError("Could not initialize Window");
|
fatalError("Could not initialize Window");
|
||||||
}
|
}
|
||||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||||
if (!renderer) {
|
if (renderer == NULL) {
|
||||||
fatalError("Could not create renderer");
|
fatalError("Could not create renderer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ initializeTexture(SDL_Renderer *renderer)
|
|||||||
brush =
|
brush =
|
||||||
SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||||
SDL_FreeSurface(bmp_surface);
|
SDL_FreeSurface(bmp_surface);
|
||||||
if (!brush) {
|
if (brush == NULL) {
|
||||||
fatalError("could not create brush texture");
|
fatalError("could not create brush texture");
|
||||||
}
|
}
|
||||||
/* additive blending -- laying strokes on top of eachother makes them brighter */
|
/* additive blending -- laying strokes on top of eachother makes them brighter */
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.26.0</string>
|
<string>2.28.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.26.0</string>
|
<string>2.28.0</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@@ -9528,8 +9528,8 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
DYLIB_CURRENT_VERSION = 2801.0.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||||
@@ -9558,7 +9558,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2;
|
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2;
|
||||||
PRODUCT_NAME = SDL2;
|
PRODUCT_NAME = SDL2;
|
||||||
STRIP_STYLE = "non-global";
|
STRIP_STYLE = "non-global";
|
||||||
@@ -9570,7 +9570,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.0.17;
|
MARKETING_VERSION = 2.28.0;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -9613,8 +9613,8 @@
|
|||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
DYLIB_CURRENT_VERSION = 2801.0.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@@ -9643,7 +9643,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
ONLY_ACTIVE_ARCH = NO;
|
ONLY_ACTIVE_ARCH = NO;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2;
|
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2;
|
||||||
PRODUCT_NAME = SDL2;
|
PRODUCT_NAME = SDL2;
|
||||||
@@ -9656,7 +9656,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.0.17;
|
MARKETING_VERSION = 2.28.0;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -9862,8 +9862,8 @@
|
|||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
DYLIB_CURRENT_VERSION = 2801.0.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
@@ -9914,8 +9914,8 @@
|
|||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2601.0.0;
|
DYLIB_CURRENT_VERSION = 2801.0.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Title SDL 2.0.0
|
Title SDL 2.28.0
|
||||||
Version 1
|
Version 1
|
||||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||||
DefaultLocation /Library/Frameworks
|
DefaultLocation /Library/Frameworks
|
||||||
|
@@ -57,6 +57,8 @@ if(NOT TARGET SDL2::SDL2)
|
|||||||
INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL2"
|
INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL2"
|
||||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
||||||
INTERFACE_SDL2_SHARED "ON"
|
INTERFACE_SDL2_SHARED "ON"
|
||||||
|
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||||
|
INTERFACE_SDL_VERSION "SDL2"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set(SDL2_SDL2_FOUND TRUE)
|
set(SDL2_SDL2_FOUND TRUE)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -186,7 +186,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
|
|||||||
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
|
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
|
||||||
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
|
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
|
||||||
private BluetoothGatt connectGatt(boolean managed) {
|
private BluetoothGatt connectGatt(boolean managed) {
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
if (Build.VERSION.SDK_INT >= 23 /* Android 6.0 (M) */) {
|
||||||
try {
|
try {
|
||||||
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
|
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@@ -251,6 +251,8 @@ public class HIDDeviceManager {
|
|||||||
0x20d6, // PowerA
|
0x20d6, // PowerA
|
||||||
0x24c6, // PowerA
|
0x24c6, // PowerA
|
||||||
0x2c22, // Qanba
|
0x2c22, // Qanba
|
||||||
|
0x2dc8, // 8BitDo
|
||||||
|
0x9886, // ASTRO Gaming
|
||||||
};
|
};
|
||||||
|
|
||||||
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
|
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
|
||||||
@@ -271,14 +273,16 @@ public class HIDDeviceManager {
|
|||||||
final int XB1_IFACE_SUBCLASS = 71;
|
final int XB1_IFACE_SUBCLASS = 71;
|
||||||
final int XB1_IFACE_PROTOCOL = 208;
|
final int XB1_IFACE_PROTOCOL = 208;
|
||||||
final int[] SUPPORTED_VENDORS = {
|
final int[] SUPPORTED_VENDORS = {
|
||||||
|
0x044f, // Thrustmaster
|
||||||
0x045e, // Microsoft
|
0x045e, // Microsoft
|
||||||
0x0738, // Mad Catz
|
0x0738, // Mad Catz
|
||||||
0x0e6f, // PDP
|
0x0e6f, // PDP
|
||||||
0x0f0d, // Hori
|
0x0f0d, // Hori
|
||||||
|
0x10f5, // Turtle Beach
|
||||||
0x1532, // Razer Wildcat
|
0x1532, // Razer Wildcat
|
||||||
0x20d6, // PowerA
|
0x20d6, // PowerA
|
||||||
0x24c6, // PowerA
|
0x24c6, // PowerA
|
||||||
0x2dc8, /* 8BitDo */
|
0x2dc8, // 8BitDo
|
||||||
0x2e24, // Hyperkin
|
0x2e24, // Hyperkin
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -353,13 +357,13 @@ public class HIDDeviceManager {
|
|||||||
private void initializeBluetooth() {
|
private void initializeBluetooth() {
|
||||||
Log.d(TAG, "Initializing Bluetooth");
|
Log.d(TAG, "Initializing Bluetooth");
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT <= 30 &&
|
if (Build.VERSION.SDK_INT <= 30 /* Android 11.0 (R) */ &&
|
||||||
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
||||||
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
|
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18)) {
|
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18 /* Android 4.3 (JELLY_BEAN_MR2) */)) {
|
||||||
Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
|
Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -573,7 +577,7 @@ public class HIDDeviceManager {
|
|||||||
try {
|
try {
|
||||||
final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
|
final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
|
||||||
int flags;
|
int flags;
|
||||||
if (Build.VERSION.SDK_INT >= 31) {
|
if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) {
|
||||||
flags = FLAG_MUTABLE;
|
flags = FLAG_MUTABLE;
|
||||||
} else {
|
} else {
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
@@ -52,7 +52,7 @@ class HIDDeviceUSB implements HIDDevice {
|
|||||||
@Override
|
@Override
|
||||||
public String getSerialNumber() {
|
public String getSerialNumber() {
|
||||||
String result = null;
|
String result = null;
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
||||||
try {
|
try {
|
||||||
result = mDevice.getSerialNumber();
|
result = mDevice.getSerialNumber();
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ class HIDDeviceUSB implements HIDDevice {
|
|||||||
@Override
|
@Override
|
||||||
public String getManufacturerName() {
|
public String getManufacturerName() {
|
||||||
String result = null;
|
String result = null;
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
||||||
result = mDevice.getManufacturerName();
|
result = mDevice.getManufacturerName();
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
@@ -86,7 +86,7 @@ class HIDDeviceUSB implements HIDDevice {
|
|||||||
@Override
|
@Override
|
||||||
public String getProductName() {
|
public String getProductName() {
|
||||||
String result = null;
|
String result = null;
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
||||||
result = mDevice.getProductName();
|
result = mDevice.getProductName();
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
|
@@ -29,6 +29,7 @@ public class SDL {
|
|||||||
|
|
||||||
// This function stores the current activity (SDL or not)
|
// This function stores the current activity (SDL or not)
|
||||||
public static void setContext(Context context) {
|
public static void setContext(Context context) {
|
||||||
|
SDLAudioManager.setContext(context);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ import java.util.Locale;
|
|||||||
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
|
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
|
||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 2;
|
private static final int SDL_MAJOR_VERSION = 2;
|
||||||
private static final int SDL_MINOR_VERSION = 26;
|
private static final int SDL_MINOR_VERSION = 28;
|
||||||
private static final int SDL_MICRO_VERSION = 0;
|
private static final int SDL_MICRO_VERSION = 0;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
@@ -93,7 +93,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
|
|
||||||
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
|
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= 23) {
|
||||||
tst = InputDevice.SOURCE_BLUETOOTH_STYLUS;
|
tst = InputDevice.SOURCE_BLUETOOTH_STYLUS;
|
||||||
if ((s & tst) == tst) src += " BLUETOOTH_STYLUS";
|
if ((s & tst) == tst) src += " BLUETOOTH_STYLUS";
|
||||||
s2 &= ~tst;
|
s2 &= ~tst;
|
||||||
@@ -107,7 +107,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
if ((s & tst) == tst) src += " GAMEPAD";
|
if ((s & tst) == tst) src += " GAMEPAD";
|
||||||
s2 &= ~tst;
|
s2 &= ~tst;
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
tst = InputDevice.SOURCE_HDMI;
|
tst = InputDevice.SOURCE_HDMI;
|
||||||
if ((s & tst) == tst) src += " HDMI";
|
if ((s & tst) == tst) src += " HDMI";
|
||||||
s2 &= ~tst;
|
s2 &= ~tst;
|
||||||
@@ -146,7 +146,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
if ((s & tst) == tst) src += " TOUCHSCREEN";
|
if ((s & tst) == tst) src += " TOUCHSCREEN";
|
||||||
s2 &= ~tst;
|
s2 &= ~tst;
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
if (Build.VERSION.SDK_INT >= 18) {
|
||||||
tst = InputDevice.SOURCE_TOUCH_NAVIGATION;
|
tst = InputDevice.SOURCE_TOUCH_NAVIGATION;
|
||||||
if ((s & tst) == tst) src += " TOUCH_NAVIGATION";
|
if ((s & tst) == tst) src += " TOUCH_NAVIGATION";
|
||||||
s2 &= ~tst;
|
s2 &= ~tst;
|
||||||
@@ -170,7 +170,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public static boolean mIsResumedCalled, mHasFocus;
|
public static boolean mIsResumedCalled, mHasFocus;
|
||||||
public static final boolean mHasMultiWindow = (Build.VERSION.SDK_INT >= 24);
|
public static final boolean mHasMultiWindow = (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */);
|
||||||
|
|
||||||
// Cursor types
|
// Cursor types
|
||||||
// private static final int SDL_SYSTEM_CURSOR_NONE = -1;
|
// private static final int SDL_SYSTEM_CURSOR_NONE = -1;
|
||||||
@@ -224,9 +224,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
|
|
||||||
protected static SDLGenericMotionListener_API12 getMotionListener() {
|
protected static SDLGenericMotionListener_API12 getMotionListener() {
|
||||||
if (mMotionListener == null) {
|
if (mMotionListener == null) {
|
||||||
if (Build.VERSION.SDK_INT >= 26) {
|
if (Build.VERSION.SDK_INT >= 26 /* Android 8.0 (O) */) {
|
||||||
mMotionListener = new SDLGenericMotionListener_API26();
|
mMotionListener = new SDLGenericMotionListener_API26();
|
||||||
} else if (Build.VERSION.SDK_INT >= 24) {
|
} else if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
mMotionListener = new SDLGenericMotionListener_API24();
|
mMotionListener = new SDLGenericMotionListener_API24();
|
||||||
} else {
|
} else {
|
||||||
mMotionListener = new SDLGenericMotionListener_API12();
|
mMotionListener = new SDLGenericMotionListener_API12();
|
||||||
@@ -393,7 +393,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
mHIDDeviceManager = HIDDeviceManager.acquire(this);
|
mHIDDeviceManager = HIDDeviceManager.acquire(this);
|
||||||
|
|
||||||
// Set up the surface
|
// Set up the surface
|
||||||
mSurface = createSDLSurface(getApplication());
|
mSurface = createSDLSurface(this);
|
||||||
|
|
||||||
mLayout = new RelativeLayout(this);
|
mLayout = new RelativeLayout(this);
|
||||||
mLayout.addView(mSurface);
|
mLayout.addView(mSurface);
|
||||||
@@ -404,7 +404,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
SDLActivity.onNativeOrientationChanged(mCurrentOrientation);
|
SDLActivity.onNativeOrientationChanged(mCurrentOrientation);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT < 24) {
|
if (Build.VERSION.SDK_INT < 24 /* Android 7.0 (N) */) {
|
||||||
mCurrentLocale = getContext().getResources().getConfiguration().locale;
|
mCurrentLocale = getContext().getResources().getConfiguration().locale;
|
||||||
} else {
|
} else {
|
||||||
mCurrentLocale = getContext().getResources().getConfiguration().getLocales().get(0);
|
mCurrentLocale = getContext().getResources().getConfiguration().getLocales().get(0);
|
||||||
@@ -588,6 +588,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
mHIDDeviceManager = null;
|
mHIDDeviceManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDLAudioManager.release(this);
|
||||||
|
|
||||||
if (SDLActivity.mBrokenLibraries) {
|
if (SDLActivity.mBrokenLibraries) {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
return;
|
return;
|
||||||
@@ -766,7 +768,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COMMAND_CHANGE_WINDOW_STYLE:
|
case COMMAND_CHANGE_WINDOW_STYLE:
|
||||||
if (Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
|
||||||
if (context instanceof Activity) {
|
if (context instanceof Activity) {
|
||||||
Window window = ((Activity) context).getWindow();
|
Window window = ((Activity) context).getWindow();
|
||||||
if (window != null) {
|
if (window != null) {
|
||||||
@@ -841,7 +843,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
msg.obj = data;
|
msg.obj = data;
|
||||||
boolean result = commandHandler.sendMessage(msg);
|
boolean result = commandHandler.sendMessage(msg);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
|
||||||
if (command == COMMAND_CHANGE_WINDOW_STYLE) {
|
if (command == COMMAND_CHANGE_WINDOW_STYLE) {
|
||||||
// Ensure we don't return until the resize has actually happened,
|
// Ensure we don't return until the resize has actually happened,
|
||||||
// or 500ms have passed.
|
// or 500ms have passed.
|
||||||
@@ -969,15 +971,18 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
/* If set, hint "explicitly controls which UI orientations are allowed". */
|
/* If set, hint "explicitly controls which UI orientations are allowed". */
|
||||||
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
|
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
|
||||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
|
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
|
||||||
} else if (hint.contains("LandscapeRight")) {
|
|
||||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
|
||||||
} else if (hint.contains("LandscapeLeft")) {
|
} else if (hint.contains("LandscapeLeft")) {
|
||||||
|
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
|
} else if (hint.contains("LandscapeRight")) {
|
||||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) {
|
/* exact match to 'Portrait' to distinguish with PortraitUpsideDown */
|
||||||
|
boolean contains_Portrait = hint.contains("Portrait ") || hint.endsWith("Portrait");
|
||||||
|
|
||||||
|
if (contains_Portrait && hint.contains("PortraitUpsideDown")) {
|
||||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
|
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
|
||||||
} else if (hint.contains("Portrait")) {
|
} else if (contains_Portrait) {
|
||||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||||
} else if (hint.contains("PortraitUpsideDown")) {
|
} else if (hint.contains("PortraitUpsideDown")) {
|
||||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
||||||
@@ -1090,7 +1095,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
// thus SDK version 27. If we are in DeX mode and not API 27 or higher, as a result,
|
// thus SDK version 27. If we are in DeX mode and not API 27 or higher, as a result,
|
||||||
// we should stick to relative mode.
|
// we should stick to relative mode.
|
||||||
//
|
//
|
||||||
if ((Build.VERSION.SDK_INT < 27) && isDeXMode()) {
|
if (Build.VERSION.SDK_INT < 27 /* Android 8.1 (O_MR1) */ && isDeXMode()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1180,7 +1185,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static boolean isDeXMode() {
|
public static boolean isDeXMode() {
|
||||||
if (Build.VERSION.SDK_INT < 24) {
|
if (Build.VERSION.SDK_INT < 24 /* Android 7.0 (N) */) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -1617,7 +1622,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
private final Runnable rehideSystemUi = new Runnable() {
|
private final Runnable rehideSystemUi = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
|
||||||
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
|
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
||||||
@@ -1670,7 +1675,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
Bitmap bitmap = Bitmap.createBitmap(colors, width, height, Bitmap.Config.ARGB_8888);
|
Bitmap bitmap = Bitmap.createBitmap(colors, width, height, Bitmap.Config.ARGB_8888);
|
||||||
++mLastCursorID;
|
++mLastCursorID;
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
try {
|
try {
|
||||||
mCursors.put(mLastCursorID, PointerIcon.create(bitmap, hotSpotX, hotSpotY));
|
mCursors.put(mLastCursorID, PointerIcon.create(bitmap, hotSpotX, hotSpotY));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1686,7 +1691,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static void destroyCustomCursor(int cursorID) {
|
public static void destroyCustomCursor(int cursorID) {
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
try {
|
try {
|
||||||
mCursors.remove(cursorID);
|
mCursors.remove(cursorID);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1700,7 +1705,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
*/
|
*/
|
||||||
public static boolean setCustomCursor(int cursorID) {
|
public static boolean setCustomCursor(int cursorID) {
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
try {
|
try {
|
||||||
mSurface.setPointerIcon(mCursors.get(cursorID));
|
mSurface.setPointerIcon(mCursors.get(cursorID));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1755,7 +1760,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
cursor_type = 1002; //PointerIcon.TYPE_HAND;
|
cursor_type = 1002; //PointerIcon.TYPE_HAND;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
try {
|
try {
|
||||||
mSurface.setPointerIcon(PointerIcon.getSystemIcon(SDL.getContext(), cursor_type));
|
mSurface.setPointerIcon(PointerIcon.getSystemIcon(SDL.getContext(), cursor_type));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1769,7 +1774,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static void requestPermission(String permission, int requestCode) {
|
public static void requestPermission(String permission, int requestCode) {
|
||||||
if (Build.VERSION.SDK_INT < 23) {
|
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
||||||
nativePermissionResult(requestCode, true);
|
nativePermissionResult(requestCode, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1798,7 +1803,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
i.setData(Uri.parse(url));
|
i.setData(Uri.parse(url));
|
||||||
|
|
||||||
int flags = Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
|
int flags = Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
||||||
flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
|
flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
|
||||||
} else {
|
} else {
|
||||||
flags |= Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET;
|
flags |= Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET;
|
||||||
@@ -2002,6 +2007,18 @@ class SDLInputConnection extends BaseInputConnection {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
|
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
|
||||||
|
if (Build.VERSION.SDK_INT <= 29 /* Android 10.0 (Q) */) {
|
||||||
|
// Workaround to capture backspace key. Ref: http://stackoverflow.com/questions>/14560344/android-backspace-in-webview-baseinputconnection
|
||||||
|
// and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
|
||||||
|
if (beforeLength > 0 && afterLength == 0) {
|
||||||
|
// backspace(s)
|
||||||
|
while (beforeLength-- > 0) {
|
||||||
|
nativeGenerateScancodeForUnichar('\b');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
|
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
package org.libsdl.app;
|
package org.libsdl.app;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.media.AudioDeviceCallback;
|
||||||
|
import android.media.AudioDeviceInfo;
|
||||||
import android.media.AudioFormat;
|
import android.media.AudioFormat;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.AudioRecord;
|
import android.media.AudioRecord;
|
||||||
@@ -8,16 +11,49 @@ import android.media.MediaRecorder;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class SDLAudioManager
|
import java.util.Arrays;
|
||||||
{
|
|
||||||
|
public class SDLAudioManager {
|
||||||
protected static final String TAG = "SDLAudio";
|
protected static final String TAG = "SDLAudio";
|
||||||
|
|
||||||
protected static AudioTrack mAudioTrack;
|
protected static AudioTrack mAudioTrack;
|
||||||
protected static AudioRecord mAudioRecord;
|
protected static AudioRecord mAudioRecord;
|
||||||
|
protected static Context mContext;
|
||||||
|
|
||||||
|
private static final int[] NO_DEVICES = {};
|
||||||
|
|
||||||
|
private static AudioDeviceCallback mAudioDeviceCallback;
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
mAudioTrack = null;
|
mAudioTrack = null;
|
||||||
mAudioRecord = null;
|
mAudioRecord = null;
|
||||||
|
mAudioDeviceCallback = null;
|
||||||
|
|
||||||
|
if(Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */)
|
||||||
|
{
|
||||||
|
mAudioDeviceCallback = new AudioDeviceCallback() {
|
||||||
|
@Override
|
||||||
|
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
|
||||||
|
Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
|
||||||
|
Arrays.stream(removedDevices).forEach(deviceInfo -> removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setContext(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
if (context != null) {
|
||||||
|
registerAudioDeviceCallback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void release(Context context) {
|
||||||
|
unregisterAudioDeviceCallback(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
@@ -35,7 +71,7 @@ public class SDLAudioManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
||||||
int channelConfig;
|
int channelConfig;
|
||||||
int sampleSize;
|
int sampleSize;
|
||||||
int frameSize;
|
int frameSize;
|
||||||
@@ -43,14 +79,14 @@ public class SDLAudioManager
|
|||||||
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");
|
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");
|
||||||
|
|
||||||
/* On older devices let's use known good settings */
|
/* On older devices let's use known good settings */
|
||||||
if (Build.VERSION.SDK_INT < 21) {
|
if (Build.VERSION.SDK_INT < 21 /* Android 5.0 (LOLLIPOP) */) {
|
||||||
if (desiredChannels > 2) {
|
if (desiredChannels > 2) {
|
||||||
desiredChannels = 2;
|
desiredChannels = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */
|
/* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */
|
||||||
if (Build.VERSION.SDK_INT < 22) {
|
if (Build.VERSION.SDK_INT < 22 /* Android 5.1 (LOLLIPOP_MR1) */) {
|
||||||
if (sampleRate < 8000) {
|
if (sampleRate < 8000) {
|
||||||
sampleRate = 8000;
|
sampleRate = 8000;
|
||||||
} else if (sampleRate > 48000) {
|
} else if (sampleRate > 48000) {
|
||||||
@@ -59,7 +95,7 @@ public class SDLAudioManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
|
if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
|
||||||
int minSDKVersion = (isCapture ? 23 : 21);
|
int minSDKVersion = (isCapture ? 23 /* Android 6.0 (M) */ : 21 /* Android 5.0 (LOLLIPOP) */);
|
||||||
if (Build.VERSION.SDK_INT < minSDKVersion) {
|
if (Build.VERSION.SDK_INT < minSDKVersion) {
|
||||||
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
|
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
|
||||||
}
|
}
|
||||||
@@ -120,7 +156,7 @@ public class SDLAudioManager
|
|||||||
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
|
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
if (Build.VERSION.SDK_INT >= 23 /* Android 6.0 (M) */) {
|
||||||
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
|
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
|
||||||
} else {
|
} else {
|
||||||
Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");
|
Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");
|
||||||
@@ -201,6 +237,10 @@ public class SDLAudioManager
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */ && deviceId != 0) {
|
||||||
|
mAudioRecord.setPreferredDevice(getOutputAudioDeviceInfo(deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
mAudioRecord.startRecording();
|
mAudioRecord.startRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,6 +264,10 @@ public class SDLAudioManager
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */ && deviceId != 0) {
|
||||||
|
mAudioTrack.setPreferredDevice(getInputAudioDeviceInfo(deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
mAudioTrack.play();
|
mAudioTrack.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,11 +282,73 @@ public class SDLAudioManager
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static AudioDeviceInfo getInputAudioDeviceInfo(int deviceId) {
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
|
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS))
|
||||||
|
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AudioDeviceInfo getOutputAudioDeviceInfo(int deviceId) {
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
|
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS))
|
||||||
|
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerAudioDeviceCallback() {
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
|
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
audioManager.registerAudioDeviceCallback(mAudioDeviceCallback, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void unregisterAudioDeviceCallback(Context context) {
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
|
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
audioManager.unregisterAudioDeviceCallback(mAudioDeviceCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
public static int[] getAudioOutputDevices() {
|
||||||
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames);
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
|
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
|
||||||
|
} else {
|
||||||
|
return NO_DEVICES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called by SDL using JNI.
|
||||||
|
*/
|
||||||
|
public static int[] getAudioInputDevices() {
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
|
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
|
||||||
|
} else {
|
||||||
|
return NO_DEVICES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called by SDL using JNI.
|
||||||
|
*/
|
||||||
|
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
||||||
|
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -254,6 +360,11 @@ public class SDLAudioManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (android.os.Build.VERSION.SDK_INT < 21 /* Android 5.0 (LOLLIPOP) */) {
|
||||||
|
Log.e(TAG, "Attempted to make an incompatible audio call with uninitialized audio! (floating-point output is supported since Android 5.0 Lollipop)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < buffer.length;) {
|
for (int i = 0; i < buffer.length;) {
|
||||||
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
|
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
@@ -326,18 +437,22 @@ public class SDLAudioManager
|
|||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
||||||
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames);
|
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called by SDL using JNI. */
|
/** This method is called by SDL using JNI. */
|
||||||
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
|
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
|
||||||
|
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** This method is called by SDL using JNI. */
|
/** This method is called by SDL using JNI. */
|
||||||
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
|
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
|
||||||
if (Build.VERSION.SDK_INT < 23) {
|
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length);
|
return mAudioRecord.read(buffer, 0, buffer.length);
|
||||||
} else {
|
} else {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||||
@@ -346,7 +461,7 @@ public class SDLAudioManager
|
|||||||
|
|
||||||
/** This method is called by SDL using JNI. */
|
/** This method is called by SDL using JNI. */
|
||||||
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
|
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
|
||||||
if (Build.VERSION.SDK_INT < 23) {
|
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length);
|
return mAudioRecord.read(buffer, 0, buffer.length);
|
||||||
} else {
|
} else {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||||
@@ -391,4 +506,9 @@ public class SDLAudioManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static native int nativeSetupJNI();
|
public static native int nativeSetupJNI();
|
||||||
|
|
||||||
|
public static native void removeAudioDevice(boolean isCapture, int deviceId);
|
||||||
|
|
||||||
|
public static native void addAudioDevice(boolean isCapture, int deviceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@ public class SDLControllerManager
|
|||||||
public static native int nativeAddJoystick(int device_id, String name, String desc,
|
public static native int nativeAddJoystick(int device_id, String name, String desc,
|
||||||
int vendor_id, int product_id,
|
int vendor_id, int product_id,
|
||||||
boolean is_accelerometer, int button_mask,
|
boolean is_accelerometer, int button_mask,
|
||||||
int naxes, int nhats, int nballs);
|
int naxes, int axis_mask, int nhats, int nballs);
|
||||||
public static native int nativeRemoveJoystick(int device_id);
|
public static native int nativeRemoveJoystick(int device_id);
|
||||||
public static native int nativeAddHaptic(int device_id, String name);
|
public static native int nativeAddHaptic(int device_id, String name);
|
||||||
public static native int nativeRemoveHaptic(int device_id);
|
public static native int nativeRemoveHaptic(int device_id);
|
||||||
@@ -42,7 +42,7 @@ public class SDLControllerManager
|
|||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
if (mJoystickHandler == null) {
|
if (mJoystickHandler == null) {
|
||||||
if (Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
|
||||||
mJoystickHandler = new SDLJoystickHandler_API19();
|
mJoystickHandler = new SDLJoystickHandler_API19();
|
||||||
} else {
|
} else {
|
||||||
mJoystickHandler = new SDLJoystickHandler_API16();
|
mJoystickHandler = new SDLJoystickHandler_API16();
|
||||||
@@ -50,7 +50,7 @@ public class SDLControllerManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mHapticHandler == null) {
|
if (mHapticHandler == null) {
|
||||||
if (Build.VERSION.SDK_INT >= 26) {
|
if (Build.VERSION.SDK_INT >= 26 /* Android 8.0 (O) */) {
|
||||||
mHapticHandler = new SDLHapticHandler_API26();
|
mHapticHandler = new SDLHapticHandler_API26();
|
||||||
} else {
|
} else {
|
||||||
mHapticHandler = new SDLHapticHandler();
|
mHapticHandler = new SDLHapticHandler();
|
||||||
@@ -168,6 +168,32 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
|||||||
arg1Axis = MotionEvent.AXIS_GAS;
|
arg1Axis = MotionEvent.AXIS_GAS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the AXIS_Z is sorted between AXIS_RY and AXIS_RZ.
|
||||||
|
// This is because the usual pairing are:
|
||||||
|
// - AXIS_X + AXIS_Y (left stick).
|
||||||
|
// - AXIS_RX, AXIS_RY (sometimes the right stick, sometimes triggers).
|
||||||
|
// - AXIS_Z, AXIS_RZ (sometimes the right stick, sometimes triggers).
|
||||||
|
// This sorts the axes in the above order, which tends to be correct
|
||||||
|
// for Xbox-ish game pads that have the right stick on RX/RY and the
|
||||||
|
// triggers on Z/RZ.
|
||||||
|
//
|
||||||
|
// Gamepads that don't have AXIS_Z/AXIS_RZ but use
|
||||||
|
// AXIS_LTRIGGER/AXIS_RTRIGGER are unaffected by this.
|
||||||
|
//
|
||||||
|
// References:
|
||||||
|
// - https://developer.android.com/develop/ui/views/touch-and-input/game-controllers/controller-input
|
||||||
|
// - https://www.kernel.org/doc/html/latest/input/gamepad.html
|
||||||
|
if (arg0Axis == MotionEvent.AXIS_Z) {
|
||||||
|
arg0Axis = MotionEvent.AXIS_RZ - 1;
|
||||||
|
} else if (arg0Axis > MotionEvent.AXIS_Z && arg0Axis < MotionEvent.AXIS_RZ) {
|
||||||
|
--arg0Axis;
|
||||||
|
}
|
||||||
|
if (arg1Axis == MotionEvent.AXIS_Z) {
|
||||||
|
arg1Axis = MotionEvent.AXIS_RZ - 1;
|
||||||
|
} else if (arg1Axis > MotionEvent.AXIS_Z && arg1Axis < MotionEvent.AXIS_RZ) {
|
||||||
|
--arg1Axis;
|
||||||
|
}
|
||||||
|
|
||||||
return arg0Axis - arg1Axis;
|
return arg0Axis - arg1Axis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,7 +236,7 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
|||||||
mJoysticks.add(joystick);
|
mJoysticks.add(joystick);
|
||||||
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
|
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
|
||||||
getVendorId(joystickDevice), getProductId(joystickDevice), false,
|
getVendorId(joystickDevice), getProductId(joystickDevice), false,
|
||||||
getButtonMask(joystickDevice), joystick.axes.size(), joystick.hats.size()/2, 0);
|
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,6 +317,9 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
|||||||
public int getVendorId(InputDevice joystickDevice) {
|
public int getVendorId(InputDevice joystickDevice) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
public int getButtonMask(InputDevice joystickDevice) {
|
public int getButtonMask(InputDevice joystickDevice) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -308,6 +337,43 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
|
|||||||
return joystickDevice.getVendorId();
|
return joystickDevice.getVendorId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
|
||||||
|
// For compatibility, keep computing the axis mask like before,
|
||||||
|
// only really distinguishing 2, 4 and 6 axes.
|
||||||
|
int axis_mask = 0;
|
||||||
|
if (ranges.size() >= 2) {
|
||||||
|
// ((1 << SDL_GAMEPAD_AXIS_LEFTX) | (1 << SDL_GAMEPAD_AXIS_LEFTY))
|
||||||
|
axis_mask |= 0x0003;
|
||||||
|
}
|
||||||
|
if (ranges.size() >= 4) {
|
||||||
|
// ((1 << SDL_GAMEPAD_AXIS_RIGHTX) | (1 << SDL_GAMEPAD_AXIS_RIGHTY))
|
||||||
|
axis_mask |= 0x000c;
|
||||||
|
}
|
||||||
|
if (ranges.size() >= 6) {
|
||||||
|
// ((1 << SDL_GAMEPAD_AXIS_LEFT_TRIGGER) | (1 << SDL_GAMEPAD_AXIS_RIGHT_TRIGGER))
|
||||||
|
axis_mask |= 0x0030;
|
||||||
|
}
|
||||||
|
// Also add an indicator bit for whether the sorting order has changed.
|
||||||
|
// This serves to disable outdated gamecontrollerdb.txt mappings.
|
||||||
|
boolean have_z = false;
|
||||||
|
boolean have_past_z_before_rz = false;
|
||||||
|
for (InputDevice.MotionRange range : ranges) {
|
||||||
|
int axis = range.getAxis();
|
||||||
|
if (axis == MotionEvent.AXIS_Z) {
|
||||||
|
have_z = true;
|
||||||
|
} else if (axis > MotionEvent.AXIS_Z && axis < MotionEvent.AXIS_RZ) {
|
||||||
|
have_past_z_before_rz = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (have_z && have_past_z_before_rz) {
|
||||||
|
// If both these exist, the compare() function changed sorting order.
|
||||||
|
// Set a bit to indicate this fact.
|
||||||
|
axis_mask |= 0x8000;
|
||||||
|
}
|
||||||
|
return axis_mask;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getButtonMask(InputDevice joystickDevice) {
|
public int getButtonMask(InputDevice joystickDevice) {
|
||||||
int button_mask = 0;
|
int button_mask = 0;
|
||||||
@@ -743,7 +809,7 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsRelativeMouse() {
|
public boolean supportsRelativeMouse() {
|
||||||
return (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27));
|
return (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -753,7 +819,7 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setRelativeMouseEnabled(boolean enabled) {
|
public boolean setRelativeMouseEnabled(boolean enabled) {
|
||||||
if (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27)) {
|
if (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
SDLActivity.getContentView().requestPointerCapture();
|
SDLActivity.getContentView().requestPointerCapture();
|
||||||
} else {
|
} else {
|
||||||
|
@@ -116,7 +116,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
int nDeviceHeight = height;
|
int nDeviceHeight = height;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= 17) {
|
if (Build.VERSION.SDK_INT >= 17 /* Android 4.2 (JELLY_BEAN_MR1) */) {
|
||||||
DisplayMetrics realMetrics = new DisplayMetrics();
|
DisplayMetrics realMetrics = new DisplayMetrics();
|
||||||
mDisplay.getRealMetrics( realMetrics );
|
mDisplay.getRealMetrics( realMetrics );
|
||||||
nDeviceWidth = realMetrics.widthPixels;
|
nDeviceWidth = realMetrics.widthPixels;
|
||||||
@@ -163,7 +163,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
|
|
||||||
// Don't skip in MultiWindow.
|
// Don't skip in MultiWindow.
|
||||||
if (skip) {
|
if (skip) {
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||||
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
|
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
|
||||||
Log.v("SDL", "Don't skip in Multi-Window");
|
Log.v("SDL", "Don't skip in Multi-Window");
|
||||||
skip = false;
|
skip = false;
|
||||||
|
4
android-project/gradlew
vendored
4
android-project/gradlew
vendored
@@ -126,8 +126,8 @@ if $cygwin ; then
|
|||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
i=0
|
i=0
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -`
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Build the Android libraries without needing a project
|
# Build the Android libraries without needing a project
|
||||||
# (AndroidManifest.xml, jni/{Application,Android}.mk, etc.)
|
# (AndroidManifest.xml, jni/{Application,Android}.mk, etc.)
|
||||||
|
32
build-scripts/clang-format-src.sh
Executable file
32
build-scripts/clang-format-src.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd "$(dirname $0)/../src"
|
||||||
|
|
||||||
|
echo "Running clang-format in $(pwd)"
|
||||||
|
|
||||||
|
find . -regex '.*\.[chm]p*' -exec clang-format -i {} \;
|
||||||
|
|
||||||
|
# Revert third-party code
|
||||||
|
git checkout \
|
||||||
|
events/imKStoUCS.* \
|
||||||
|
hidapi \
|
||||||
|
joystick/controller_type.c \
|
||||||
|
joystick/controller_type.h \
|
||||||
|
joystick/hidapi/steam/controller_constants.h \
|
||||||
|
joystick/hidapi/steam/controller_structs.h \
|
||||||
|
libm \
|
||||||
|
stdlib/SDL_malloc.c \
|
||||||
|
stdlib/SDL_qsort.c \
|
||||||
|
stdlib/SDL_strtokr.c \
|
||||||
|
video/arm \
|
||||||
|
video/khronos \
|
||||||
|
video/x11/edid-parse.c \
|
||||||
|
video/yuv2rgb
|
||||||
|
clang-format -i hidapi/SDL_hidapi.c
|
||||||
|
|
||||||
|
# Revert generated code
|
||||||
|
git checkout dynapi/SDL_dynapi_overrides.h
|
||||||
|
git checkout dynapi/SDL_dynapi_procs.h
|
||||||
|
git checkout render/metal/SDL_shaders_metal_*.h
|
||||||
|
|
||||||
|
echo "clang-format complete!"
|
2
build-scripts/config.sub
vendored
2
build-scripts/config.sub
vendored
@@ -1075,7 +1075,7 @@ case $cpu-$vendor in
|
|||||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||||
cpu=i586
|
cpu=i586
|
||||||
;;
|
;;
|
||||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
|
pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
|
||||||
cpu=i686
|
cpu=i686
|
||||||
;;
|
;;
|
||||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -395,7 +395,7 @@ int main(void)
|
|||||||
printf(
|
printf(
|
||||||
"/*\n"
|
"/*\n"
|
||||||
" Simple DirectMedia Layer\n"
|
" Simple DirectMedia Layer\n"
|
||||||
" Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>\n"
|
" Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>\n"
|
||||||
"\n"
|
"\n"
|
||||||
" This software is provided 'as-is', without any express or implied\n"
|
" This software is provided 'as-is', without any express or implied\n"
|
||||||
" warranty. In no event will the authors be held liable for any damages\n"
|
" warranty. In no event will the authors be held liable for any damages\n"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -113,7 +113,7 @@ int main(void)
|
|||||||
printf(
|
printf(
|
||||||
"/*\n"
|
"/*\n"
|
||||||
" Simple DirectMedia Layer\n"
|
" Simple DirectMedia Layer\n"
|
||||||
" Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>\n"
|
" Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>\n"
|
||||||
"\n"
|
"\n"
|
||||||
" This software is provided 'as-is', without any express or implied\n"
|
" This software is provided 'as-is', without any express or implied\n"
|
||||||
" warranty. In no event will the authors be held liable for any damages\n"
|
" warranty. In no event will the authors be held liable for any damages\n"
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
cd `dirname $0`/..
|
||||||
|
|
||||||
ref_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL_version.h)
|
ref_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL_version.h)
|
||||||
ref_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL_version.h)
|
ref_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL_version.h)
|
||||||
ref_micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL_version.h)
|
ref_micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL_version.h)
|
||||||
@@ -139,6 +141,25 @@ else
|
|||||||
not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_version.h $ref_version"
|
not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_version.h $ref_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
version=$(sed -Ene 's/Title SDL (.*)/\1/p' Xcode/SDL/pkg-support/SDL.info)
|
||||||
|
|
||||||
|
if [ "$ref_version" = "$version" ]; then
|
||||||
|
ok "SDL.info Title $version"
|
||||||
|
else
|
||||||
|
not_ok "SDL.info Title $version disagrees with SDL_version.h $ref_version"
|
||||||
|
fi
|
||||||
|
|
||||||
|
marketing=$(sed -Ene 's/.*MARKETING_VERSION = (.*);/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
|
||||||
|
|
||||||
|
ref="$ref_version
|
||||||
|
$ref_version"
|
||||||
|
|
||||||
|
if [ "$ref" = "$marketing" ]; then
|
||||||
|
ok "project.pbxproj MARKETING_VERSION is consistent"
|
||||||
|
else
|
||||||
|
not_ok "project.pbxproj MARKETING_VERSION is inconsistent, expected $ref, got $marketing"
|
||||||
|
fi
|
||||||
|
|
||||||
# For simplicity this assumes we'll never break ABI before SDL 3.
|
# For simplicity this assumes we'll never break ABI before SDL 3.
|
||||||
dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
|
dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
|
||||||
|
|
||||||
|
@@ -30,6 +30,10 @@ echo "Updating version to '$NEWVERSION' ..."
|
|||||||
# !!! FIXME: This first one is a kinda scary search/replace that might fail later if another X.Y.Z version is added to the file.
|
# !!! FIXME: This first one is a kinda scary search/replace that might fail later if another X.Y.Z version is added to the file.
|
||||||
perl -w -pi -e 's/(\<string\>)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/Info-Framework.plist
|
perl -w -pi -e 's/(\<string\>)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/Info-Framework.plist
|
||||||
|
|
||||||
|
perl -w -pi -e 's/(Title SDL )\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/pkg-support/SDL.info
|
||||||
|
|
||||||
|
perl -w -pi -e 's/(MARKETING_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||||
|
|
||||||
DYVER=`expr $MINOR \* 100 + 1`
|
DYVER=`expr $MINOR \* 100 + 1`
|
||||||
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ my $projectfullname = 'Simple Directmedia Layer';
|
|||||||
my $projectshortname = 'SDL';
|
my $projectshortname = 'SDL';
|
||||||
my $wikisubdir = '';
|
my $wikisubdir = '';
|
||||||
my $incsubdir = 'include';
|
my $incsubdir = 'include';
|
||||||
|
my $readmesubdir = undef;
|
||||||
my $apiprefixregex = undef;
|
my $apiprefixregex = undef;
|
||||||
my $versionfname = 'include/SDL_version.h';
|
my $versionfname = 'include/SDL_version.h';
|
||||||
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
|
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
|
||||||
@@ -22,10 +23,12 @@ my $wikiurl = 'https://wiki.libsdl.org';
|
|||||||
my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new';
|
my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new';
|
||||||
my $srcpath = undef;
|
my $srcpath = undef;
|
||||||
my $wikipath = undef;
|
my $wikipath = undef;
|
||||||
|
my $wikireadmesubdir = 'README';
|
||||||
my $warn_about_missing = 0;
|
my $warn_about_missing = 0;
|
||||||
my $copy_direction = 0;
|
my $copy_direction = 0;
|
||||||
my $optionsfname = undef;
|
my $optionsfname = undef;
|
||||||
my $wikipreamble = undef;
|
my $wikipreamble = undef;
|
||||||
|
my $changeformat = undef;
|
||||||
|
|
||||||
foreach (@ARGV) {
|
foreach (@ARGV) {
|
||||||
$warn_about_missing = 1, next if $_ eq '--warn-about-missing';
|
$warn_about_missing = 1, next if $_ eq '--warn-about-missing';
|
||||||
@@ -36,6 +39,9 @@ foreach (@ARGV) {
|
|||||||
if (/\A--options=(.*)\Z/) {
|
if (/\A--options=(.*)\Z/) {
|
||||||
$optionsfname = $1;
|
$optionsfname = $1;
|
||||||
next;
|
next;
|
||||||
|
} elsif (/\A--changeformat=(.*)\Z/) {
|
||||||
|
$changeformat = $1;
|
||||||
|
next;
|
||||||
}
|
}
|
||||||
$srcpath = $_, next if not defined $srcpath;
|
$srcpath = $_, next if not defined $srcpath;
|
||||||
$wikipath = $_, next if not defined $wikipath;
|
$wikipath = $_, next if not defined $wikipath;
|
||||||
@@ -67,6 +73,7 @@ if (defined $optionsfname) {
|
|||||||
$projectshortname = $val, next if $key eq 'projectshortname';
|
$projectshortname = $val, next if $key eq 'projectshortname';
|
||||||
$wikisubdir = $val, next if $key eq 'wikisubdir';
|
$wikisubdir = $val, next if $key eq 'wikisubdir';
|
||||||
$incsubdir = $val, next if $key eq 'incsubdir';
|
$incsubdir = $val, next if $key eq 'incsubdir';
|
||||||
|
$readmesubdir = $val, next if $key eq 'readmesubdir';
|
||||||
$versionmajorregex = $val, next if $key eq 'versionmajorregex';
|
$versionmajorregex = $val, next if $key eq 'versionmajorregex';
|
||||||
$versionminorregex = $val, next if $key eq 'versionminorregex';
|
$versionminorregex = $val, next if $key eq 'versionminorregex';
|
||||||
$versionpatchregex = $val, next if $key eq 'versionpatchregex';
|
$versionpatchregex = $val, next if $key eq 'versionpatchregex';
|
||||||
@@ -131,6 +138,7 @@ sub wordwrap_with_bullet_indent { # don't call this directly.
|
|||||||
my $usual_prefix = ' ' x $bulletlen;
|
my $usual_prefix = ' ' x $bulletlen;
|
||||||
|
|
||||||
foreach (@wrappedlines) {
|
foreach (@wrappedlines) {
|
||||||
|
s/\s*\Z//;
|
||||||
$retval .= "$prefix$_\n";
|
$retval .= "$prefix$_\n";
|
||||||
$prefix = $usual_prefix;
|
$prefix = $usual_prefix;
|
||||||
}
|
}
|
||||||
@@ -255,10 +263,30 @@ sub wikify_chunk {
|
|||||||
$str .= "<syntaxhighlight lang='$codelang'>$code<\/syntaxhighlight>";
|
$str .= "<syntaxhighlight lang='$codelang'>$code<\/syntaxhighlight>";
|
||||||
}
|
}
|
||||||
} elsif ($wikitype eq 'md') {
|
} elsif ($wikitype eq 'md') {
|
||||||
|
# convert `code` things first, so they aren't mistaken for other markdown items.
|
||||||
|
my $codedstr = '';
|
||||||
|
while ($str =~ s/\A(.*?)(\`.*?\`)//ms) {
|
||||||
|
my $codeblock = $2;
|
||||||
|
$codedstr .= wikify_chunk($wikitype, $1, undef, undef);
|
||||||
|
if (defined $apiprefixregex) {
|
||||||
|
# Convert obvious API things to wikilinks, even inside `code` blocks,
|
||||||
|
# BUT ONLY IF the entire code block is the API thing,
|
||||||
|
# So something like "just call `SDL_Whatever`" will become
|
||||||
|
# "just call [`SDL_Whatever`](SDL_Whatever)", but
|
||||||
|
# "just call `SDL_Whatever(7)`" will not. It's just the safest
|
||||||
|
# way to do this without resorting to wrapping things in html <code> tags.
|
||||||
|
$codeblock =~ s/\A\`($apiprefixregex[a-zA-Z0-9_]+)\`\Z/[`$1`]($1)/gms;
|
||||||
|
}
|
||||||
|
$codedstr .= $codeblock;
|
||||||
|
}
|
||||||
|
|
||||||
# Convert obvious API things to wikilinks.
|
# Convert obvious API things to wikilinks.
|
||||||
if (defined $apiprefixregex) {
|
if (defined $apiprefixregex) {
|
||||||
$str =~ s/\b($apiprefixregex[a-zA-Z0-9_]+)/[$1]($1)/gms;
|
$str =~ s/\b($apiprefixregex[a-zA-Z0-9_]+)/[$1]($1)/gms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$str = $codedstr . $str;
|
||||||
|
|
||||||
if (defined $code) {
|
if (defined $code) {
|
||||||
$str .= "```$codelang$code```";
|
$str .= "```$codelang$code```";
|
||||||
}
|
}
|
||||||
@@ -325,6 +353,11 @@ sub dewikify_chunk {
|
|||||||
|
|
||||||
# bullets
|
# bullets
|
||||||
$str =~ s/^\* /- /gm;
|
$str =~ s/^\* /- /gm;
|
||||||
|
} elsif ($wikitype eq 'md') {
|
||||||
|
# Dump obvious wikilinks. The rest can just passthrough.
|
||||||
|
if (defined $apiprefixregex) {
|
||||||
|
$str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/$1/gms;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $code) {
|
if (defined $code) {
|
||||||
@@ -355,6 +388,30 @@ sub dewikify_chunk {
|
|||||||
|
|
||||||
# bullets
|
# bullets
|
||||||
$str =~ s/^\* /\n\\\(bu /gm;
|
$str =~ s/^\* /\n\\\(bu /gm;
|
||||||
|
} elsif ($wikitype eq 'md') {
|
||||||
|
# Dump obvious wikilinks.
|
||||||
|
if (defined $apiprefixregex) {
|
||||||
|
$str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/\n.BR $1\n/gms;
|
||||||
|
}
|
||||||
|
|
||||||
|
# links
|
||||||
|
$str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\n.URL "$2" "$1"\n/g;
|
||||||
|
|
||||||
|
# <code></code> is also popular. :/
|
||||||
|
$str =~ s/\s*\`(.*?)\`\s*/\n.BR $1\n/gms;
|
||||||
|
|
||||||
|
# bold+italic
|
||||||
|
$str =~ s/\s*\*\*\*(.*?)\*\*\*\s*/\n.BI $1\n/gms;
|
||||||
|
|
||||||
|
# bold
|
||||||
|
$str =~ s/\s*\*\*(.*?)\*\*\s*/\n.B $1\n/gms;
|
||||||
|
|
||||||
|
# italic
|
||||||
|
$str =~ s/\s*\*(.*?)\*\s*/\n.I $1\n/gms;
|
||||||
|
|
||||||
|
# bullets
|
||||||
|
$str =~ s/^\- /\n\\\(bu /gm;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
die("Unexpected wikitype when converting to manpages\n"); # !!! FIXME: need to handle Markdown wiki pages.
|
die("Unexpected wikitype when converting to manpages\n"); # !!! FIXME: need to handle Markdown wiki pages.
|
||||||
}
|
}
|
||||||
@@ -399,6 +456,23 @@ sub dewikify {
|
|||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub filecopy {
|
||||||
|
my $src = shift;
|
||||||
|
my $dst = shift;
|
||||||
|
my $endline = shift;
|
||||||
|
$endline = "\n" if not defined $endline;
|
||||||
|
|
||||||
|
open(COPYIN, '<', $src) or die("Failed to open '$src' for reading: $!\n");
|
||||||
|
open(COPYOUT, '>', $dst) or die("Failed to open '$dst' for writing: $!\n");
|
||||||
|
while (<COPYIN>) {
|
||||||
|
chomp;
|
||||||
|
s/[ \t\r\n]*\Z//;
|
||||||
|
print COPYOUT "$_$endline";
|
||||||
|
}
|
||||||
|
close(COPYOUT);
|
||||||
|
close(COPYIN);
|
||||||
|
}
|
||||||
|
|
||||||
sub usage {
|
sub usage {
|
||||||
die("USAGE: $0 <source code git clone path> <wiki git clone path> [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing]\n\n");
|
die("USAGE: $0 <source code git clone path> <wiki git clone path> [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing]\n\n");
|
||||||
}
|
}
|
||||||
@@ -415,6 +489,7 @@ my @standard_wiki_sections = (
|
|||||||
'Function Parameters',
|
'Function Parameters',
|
||||||
'Return Value',
|
'Return Value',
|
||||||
'Remarks',
|
'Remarks',
|
||||||
|
'Thread Safety',
|
||||||
'Version',
|
'Version',
|
||||||
'Code Examples',
|
'Code Examples',
|
||||||
'Related Functions'
|
'Related Functions'
|
||||||
@@ -438,9 +513,15 @@ my %headerfuncshasdoxygen = (); # $headerfuncschunk{"SDL_OpenAudio"} -> 1 if t
|
|||||||
my $incpath = "$srcpath";
|
my $incpath = "$srcpath";
|
||||||
$incpath .= "/$incsubdir" if $incsubdir ne '';
|
$incpath .= "/$incsubdir" if $incsubdir ne '';
|
||||||
|
|
||||||
|
my $wikireadmepath = "$wikipath/$wikireadmesubdir";
|
||||||
|
my $readmepath = undef;
|
||||||
|
if (defined $readmesubdir) {
|
||||||
|
$readmepath = "$srcpath/$readmesubdir";
|
||||||
|
}
|
||||||
|
|
||||||
opendir(DH, $incpath) or die("Can't opendir '$incpath': $!\n");
|
opendir(DH, $incpath) or die("Can't opendir '$incpath': $!\n");
|
||||||
while (readdir(DH)) {
|
while (my $d = readdir(DH)) {
|
||||||
my $dent = $_;
|
my $dent = $d;
|
||||||
next if not $dent =~ /$selectheaderregex/; # just selected headers.
|
next if not $dent =~ /$selectheaderregex/; # just selected headers.
|
||||||
open(FH, '<', "$incpath/$dent") or die("Can't open '$incpath/$dent': $!\n");
|
open(FH, '<', "$incpath/$dent") or die("Can't open '$incpath/$dent': $!\n");
|
||||||
|
|
||||||
@@ -588,8 +669,8 @@ my %wikitypes = (); # contains string of wiki page extension, like $wikitypes{"
|
|||||||
my %wikifuncs = (); # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikifuncs{"SDL_OpenAudio"}{"Remarks"}.
|
my %wikifuncs = (); # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikifuncs{"SDL_OpenAudio"}{"Remarks"}.
|
||||||
my %wikisectionorder = (); # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
|
my %wikisectionorder = (); # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
|
||||||
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
|
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
|
||||||
while (readdir(DH)) {
|
while (my $d = readdir(DH)) {
|
||||||
my $dent = $_;
|
my $dent = $d;
|
||||||
my $type = '';
|
my $type = '';
|
||||||
if ($dent =~ /\.(md|mediawiki)\Z/) {
|
if ($dent =~ /\.(md|mediawiki)\Z/) {
|
||||||
$type = $1;
|
$type = $1;
|
||||||
@@ -726,13 +807,14 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
next if not defined $wikifuncs{$fn}; # don't have a page for that function, skip it.
|
next if not defined $wikifuncs{$fn}; # don't have a page for that function, skip it.
|
||||||
my $wikitype = $wikitypes{$fn};
|
my $wikitype = $wikitypes{$fn};
|
||||||
my $sectionsref = $wikifuncs{$fn};
|
my $sectionsref = $wikifuncs{$fn};
|
||||||
my $remarks = %$sectionsref{'Remarks'};
|
my $remarks = $sectionsref->{'Remarks'};
|
||||||
my $params = %$sectionsref{'Function Parameters'};
|
my $params = $sectionsref->{'Function Parameters'};
|
||||||
my $returns = %$sectionsref{'Return Value'};
|
my $returns = $sectionsref->{'Return Value'};
|
||||||
my $version = %$sectionsref{'Version'};
|
my $threadsafety = $sectionsref->{'Thread Safety'};
|
||||||
my $related = %$sectionsref{'Related Functions'};
|
my $version = $sectionsref->{'Version'};
|
||||||
my $deprecated = %$sectionsref{'Deprecated'};
|
my $related = $sectionsref->{'Related Functions'};
|
||||||
my $brief = %$sectionsref{'[Brief]'};
|
my $deprecated = $sectionsref->{'Deprecated'};
|
||||||
|
my $brief = $sectionsref->{'[Brief]'};
|
||||||
my $addblank = 0;
|
my $addblank = 0;
|
||||||
my $str = '';
|
my $str = '';
|
||||||
|
|
||||||
@@ -797,6 +879,33 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
$str .= "${whitespace}$_\n";
|
$str .= "${whitespace}$_\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elsif ($wikitype eq 'md') {
|
||||||
|
my $l;
|
||||||
|
$l = shift @lines;
|
||||||
|
die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*\|\s*\|\s*\|\s*\Z/);
|
||||||
|
$l = shift @lines;
|
||||||
|
die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*\|\s*\-*\s*\|\s*\-*\s*\|\s*\Z/);
|
||||||
|
while (scalar(@lines) >= 1) {
|
||||||
|
$l = shift @lines;
|
||||||
|
if ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) {
|
||||||
|
my $name = $1;
|
||||||
|
my $desc = $2;
|
||||||
|
$name =~ s/\A\*\*(.*?)\*\*/$1/;
|
||||||
|
$name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
|
||||||
|
#print STDERR "FN: $fn NAME: $name DESC: $desc\n";
|
||||||
|
my $whitespacelen = length($name) + 8;
|
||||||
|
my $whitespace = ' ' x $whitespacelen;
|
||||||
|
$desc = wordwrap($desc, -$whitespacelen);
|
||||||
|
my @desclines = split /\n/, $desc;
|
||||||
|
my $firstline = shift @desclines;
|
||||||
|
$str .= "\\param $name $firstline\n";
|
||||||
|
foreach (@desclines) {
|
||||||
|
$str .= "${whitespace}$_\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
last; # we seem to have run out of table.
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
die("write me");
|
die("write me");
|
||||||
}
|
}
|
||||||
@@ -821,6 +930,21 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined $threadsafety) {
|
||||||
|
# !!! FIXME: lots of code duplication in all of these.
|
||||||
|
$str .= "\n" if $addblank; $addblank = 1;
|
||||||
|
my $v = dewikify($wikitype, $threadsafety);
|
||||||
|
my $whitespacelen = length("\\threadsafety") + 1;
|
||||||
|
my $whitespace = ' ' x $whitespacelen;
|
||||||
|
$v = wordwrap($v, -$whitespacelen);
|
||||||
|
my @desclines = split /\n/, $v;
|
||||||
|
my $firstline = shift @desclines;
|
||||||
|
$str .= "\\threadsafety $firstline\n";
|
||||||
|
foreach (@desclines) {
|
||||||
|
$str .= "${whitespace}$_\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (defined $version) {
|
if (defined $version) {
|
||||||
# !!! FIXME: lots of code duplication in all of these.
|
# !!! FIXME: lots of code duplication in all of these.
|
||||||
$str .= "\n" if $addblank; $addblank = 1;
|
$str .= "\n" if $addblank; $addblank = 1;
|
||||||
@@ -845,6 +969,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
s/\A(\:|\* )//;
|
s/\A(\:|\* )//;
|
||||||
s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
||||||
s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain.
|
s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain.
|
||||||
|
s/\[(.*?)\]\(.*?\)/$1/; # in case some wikilinks remain.
|
||||||
s/\A\/*//;
|
s/\A\/*//;
|
||||||
$str .= "\\sa $_\n";
|
$str .= "\\sa $_\n";
|
||||||
}
|
}
|
||||||
@@ -905,11 +1030,32 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
rename($path, "$incpath/$header") or die("Can't rename '$path' to '$incpath/$header': $!\n");
|
rename($path, "$incpath/$header") or die("Can't rename '$path' to '$incpath/$header': $!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined $readmepath) {
|
||||||
|
if ( -d $wikireadmepath ) {
|
||||||
|
mkdir($readmepath); # just in case
|
||||||
|
opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n");
|
||||||
|
while (readdir(DH)) {
|
||||||
|
my $dent = $_;
|
||||||
|
if ($dent =~ /\A(.*?)\.md\Z/) { # we only bridge Markdown files here.
|
||||||
|
next if $1 eq 'FrontPage';
|
||||||
|
filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir(DH);
|
||||||
|
}
|
||||||
|
}
|
||||||
} elsif ($copy_direction == -1) { # --copy-to-wiki
|
} elsif ($copy_direction == -1) { # --copy-to-wiki
|
||||||
|
|
||||||
|
if (defined $changeformat) {
|
||||||
|
$dewikify_mode = $changeformat;
|
||||||
|
$wordwrap_mode = $changeformat;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (keys %headerfuncs) {
|
foreach (keys %headerfuncs) {
|
||||||
my $fn = $_;
|
my $fn = $_;
|
||||||
next if not $headerfuncshasdoxygen{$fn};
|
next if not $headerfuncshasdoxygen{$fn};
|
||||||
my $wikitype = defined $wikitypes{$fn} ? $wikitypes{$fn} : 'mediawiki'; # default to MediaWiki for new stuff FOR NOW.
|
my $origwikitype = defined $wikitypes{$fn} ? $wikitypes{$fn} : 'md'; # default to MarkDown for new stuff.
|
||||||
|
my $wikitype = (defined $changeformat) ? $changeformat : $origwikitype;
|
||||||
die("Unexpected wikitype '$wikitype'\n") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage'));
|
die("Unexpected wikitype '$wikitype'\n") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage'));
|
||||||
|
|
||||||
#print("$fn\n"); next;
|
#print("$fn\n"); next;
|
||||||
@@ -1047,6 +1193,21 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
}
|
}
|
||||||
$desc =~ s/[\s\n]+\Z//ms;
|
$desc =~ s/[\s\n]+\Z//ms;
|
||||||
$sections{'Version'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
$sections{'Version'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
||||||
|
} elsif ($l =~ /\A\\threadsafety\s+(.*)\Z/) {
|
||||||
|
my $desc = $1;
|
||||||
|
while (@doxygenlines) {
|
||||||
|
my $subline = $doxygenlines[0];
|
||||||
|
$subline =~ s/\A\s*//;
|
||||||
|
last if $subline =~ /\A\\/; # some sort of doxygen command, assume we're past this thing.
|
||||||
|
shift @doxygenlines; # dump this line from the array; we're using it.
|
||||||
|
if ($subline eq '') { # empty line, make sure it keeps the newline char.
|
||||||
|
$desc .= "\n";
|
||||||
|
} else {
|
||||||
|
$desc .= " $subline";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$desc =~ s/[\s\n]+\Z//ms;
|
||||||
|
$sections{'Thread Safety'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
||||||
} elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
|
} elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
|
||||||
my $sa = $1;
|
my $sa = $1;
|
||||||
$sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
$sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
||||||
@@ -1125,8 +1286,25 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
push @$wikisectionorderref, '[footer]';
|
push @$wikisectionorderref, '[footer]';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If changing format, convert things that otherwise are passed through unmolested.
|
||||||
|
if (defined $changeformat) {
|
||||||
|
if (($dewikify_mode eq 'md') and ($origwikitype eq 'mediawiki')) {
|
||||||
|
$$sectionsref{'[footer]'} =~ s/\[\[(Category[a-zA-Z0-9_]+)\]\]/[$1]($1)/g;
|
||||||
|
} elsif (($dewikify_mode eq 'mediawiki') and ($origwikitype eq 'md')) {
|
||||||
|
$$sectionsref{'[footer]'} =~ s/\[(Category[a-zA-Z0-9_]+)\]\(.*?\)/[[$1]]/g;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (keys %only_wiki_sections) {
|
||||||
|
my $sect = $_;
|
||||||
|
if (defined $$sectionsref{$sect}) {
|
||||||
|
$$sectionsref{$sect} = wikify($wikitype, dewikify($origwikitype, $$sectionsref{$sect}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# !!! FIXME: This won't be CategoryAPI if we eventually handle things other than functions.
|
# !!! FIXME: This won't be CategoryAPI if we eventually handle things other than functions.
|
||||||
my $footer = $$sectionsref{'[footer]'};
|
my $footer = $$sectionsref{'[footer]'};
|
||||||
|
|
||||||
if ($wikitype eq 'mediawiki') {
|
if ($wikitype eq 'mediawiki') {
|
||||||
$footer =~ s/\[\[CategoryAPI\]\],?\s*//g;
|
$footer =~ s/\[\[CategoryAPI\]\],?\s*//g;
|
||||||
$footer = '[[CategoryAPI]]' . (($footer eq '') ? "\n" : ", $footer");
|
$footer = '[[CategoryAPI]]' . (($footer eq '') ? "\n" : ", $footer");
|
||||||
@@ -1137,10 +1315,11 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
$$sectionsref{'[footer]'} = $footer;
|
$$sectionsref{'[footer]'} = $footer;
|
||||||
|
|
||||||
if (defined $wikipreamble) {
|
if (defined $wikipreamble) {
|
||||||
|
my $wikified_preamble = wikify($wikitype, $wikipreamble);
|
||||||
if ($wikitype eq 'mediawiki') {
|
if ($wikitype eq 'mediawiki') {
|
||||||
print FH "====== $wikipreamble ======\n";
|
print FH "====== $wikified_preamble ======\n";
|
||||||
} elsif ($wikitype eq 'md') {
|
} elsif ($wikitype eq 'md') {
|
||||||
print FH "###### $wikipreamble\n";
|
print FH "###### $wikified_preamble\n";
|
||||||
} else { die("Unexpected wikitype '$wikitype'\n"); }
|
} else { die("Unexpected wikitype '$wikitype'\n"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1185,9 +1364,51 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
|
|
||||||
print FH "\n\n";
|
print FH "\n\n";
|
||||||
close(FH);
|
close(FH);
|
||||||
|
|
||||||
|
if (defined $changeformat and ($origwikitype ne $wikitype)) {
|
||||||
|
system("cd '$wikipath' ; git mv '$_.${origwikitype}' '$_.${wikitype}'");
|
||||||
|
unlink("$wikipath/$_.${origwikitype}");
|
||||||
|
}
|
||||||
|
|
||||||
rename($path, "$wikipath/$_.${wikitype}") or die("Can't rename '$path' to '$wikipath/$_.${wikitype}': $!\n");
|
rename($path, "$wikipath/$_.${wikitype}") or die("Can't rename '$path' to '$wikipath/$_.${wikitype}': $!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined $readmepath) {
|
||||||
|
if ( -d $readmepath ) {
|
||||||
|
mkdir($wikireadmepath); # just in case
|
||||||
|
opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n");
|
||||||
|
while (my $d = readdir(DH)) {
|
||||||
|
my $dent = $d;
|
||||||
|
if ($dent =~ /\AREADME\-(.*?\.md)\Z/) { # we only bridge Markdown files here.
|
||||||
|
my $wikifname = $1;
|
||||||
|
next if $wikifname eq 'FrontPage.md';
|
||||||
|
filecopy("$readmepath/$dent", "$wikireadmepath/$wikifname", "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir(DH);
|
||||||
|
|
||||||
|
my @pages = ();
|
||||||
|
opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n");
|
||||||
|
while (my $d = readdir(DH)) {
|
||||||
|
my $dent = $d;
|
||||||
|
if ($dent =~ /\A(.*?)\.(mediawiki|md)\Z/) {
|
||||||
|
my $wikiname = $1;
|
||||||
|
next if $wikiname eq 'FrontPage';
|
||||||
|
push @pages, $wikiname;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir(DH);
|
||||||
|
|
||||||
|
open(FH, '>', "$wikireadmepath/FrontPage.md") or die("Can't open '$wikireadmepath/FrontPage.md': $!\n");
|
||||||
|
print FH "# All READMEs available here\n\n";
|
||||||
|
foreach (sort @pages) {
|
||||||
|
my $wikiname = $_;
|
||||||
|
print FH "- [$wikiname]($wikiname)\n";
|
||||||
|
}
|
||||||
|
close(FH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} elsif ($copy_direction == -2) { # --copy-to-manpages
|
} elsif ($copy_direction == -2) { # --copy-to-manpages
|
||||||
# This only takes from the wiki data, since it has sections we omit from the headers, like code examples.
|
# This only takes from the wiki data, since it has sections we omit from the headers, like code examples.
|
||||||
|
|
||||||
@@ -1235,14 +1456,15 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
next if not defined $wikifuncs{$fn}; # don't have a page for that function, skip it.
|
next if not defined $wikifuncs{$fn}; # don't have a page for that function, skip it.
|
||||||
my $wikitype = $wikitypes{$fn};
|
my $wikitype = $wikitypes{$fn};
|
||||||
my $sectionsref = $wikifuncs{$fn};
|
my $sectionsref = $wikifuncs{$fn};
|
||||||
my $remarks = %$sectionsref{'Remarks'};
|
my $remarks = $sectionsref->{'Remarks'};
|
||||||
my $params = %$sectionsref{'Function Parameters'};
|
my $params = $sectionsref->{'Function Parameters'};
|
||||||
my $returns = %$sectionsref{'Return Value'};
|
my $returns = $sectionsref->{'Return Value'};
|
||||||
my $version = %$sectionsref{'Version'};
|
my $version = $sectionsref->{'Version'};
|
||||||
my $related = %$sectionsref{'Related Functions'};
|
my $threadsafety = $sectionsref->{'Thread Safety'};
|
||||||
my $examples = %$sectionsref{'Code Examples'};
|
my $related = $sectionsref->{'Related Functions'};
|
||||||
my $deprecated = %$sectionsref{'Deprecated'};
|
my $examples = $sectionsref->{'Code Examples'};
|
||||||
my $brief = %$sectionsref{'[Brief]'};
|
my $deprecated = $sectionsref->{'Deprecated'};
|
||||||
|
my $brief = $sectionsref->{'[Brief]'};
|
||||||
my $decl = $headerdecls{$fn};
|
my $decl = $headerdecls{$fn};
|
||||||
my $str = '';
|
my $str = '';
|
||||||
|
|
||||||
@@ -1329,6 +1551,28 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
$str .= ".I $name\n";
|
$str .= ".I $name\n";
|
||||||
$str .= "$desc\n";
|
$str .= "$desc\n";
|
||||||
}
|
}
|
||||||
|
} elsif ($wikitype eq 'md') {
|
||||||
|
my $l;
|
||||||
|
$l = shift @lines;
|
||||||
|
die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*\|\s*\|\s*\|\s*\Z/);
|
||||||
|
$l = shift @lines;
|
||||||
|
die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*\|\s*\-*\s*\|\s*\-*\s*\|\s*\Z/);
|
||||||
|
while (scalar(@lines) >= 1) {
|
||||||
|
$l = shift @lines;
|
||||||
|
if ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) {
|
||||||
|
my $name = $1;
|
||||||
|
my $desc = $2;
|
||||||
|
$name =~ s/\A\*\*(.*?)\*\*/$1/;
|
||||||
|
$name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
|
||||||
|
$desc = dewikify($wikitype, $desc);
|
||||||
|
|
||||||
|
$str .= ".TP\n";
|
||||||
|
$str .= ".I $name\n";
|
||||||
|
$str .= "$desc\n";
|
||||||
|
} else {
|
||||||
|
last; # we seem to have run out of table.
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
die("write me");
|
die("write me");
|
||||||
}
|
}
|
||||||
@@ -1346,6 +1590,11 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
$dewikify_manpage_code_indent = 1;
|
$dewikify_manpage_code_indent = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined $threadsafety) {
|
||||||
|
$str .= ".SH THREAD SAFETY\n";
|
||||||
|
$str .= dewikify($wikitype, $threadsafety) . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (defined $version) {
|
if (defined $version) {
|
||||||
$str .= ".SH AVAILABILITY\n";
|
$str .= ".SH AVAILABILITY\n";
|
||||||
$str .= dewikify($wikitype, $version) . "\n";
|
$str .= dewikify($wikitype, $version) . "\n";
|
||||||
@@ -1361,8 +1610,11 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
s/\A(\:|\* )//;
|
s/\A(\:|\* )//;
|
||||||
s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
||||||
s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain.
|
s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain.
|
||||||
|
s/\[(.*?)\]\(.*?\)/$1/; # in case some wikilinks remain.
|
||||||
|
s/\A\*\s*\Z//;
|
||||||
s/\A\/*//;
|
s/\A\/*//;
|
||||||
s/\A\.BR\s+//; # dewikify added this, but we want to handle it.
|
s/\A\.BR\s+//; # dewikify added this, but we want to handle it.
|
||||||
|
s/\A\.I\s+//; # dewikify added this, but we want to handle it.
|
||||||
s/\A\s+//;
|
s/\A\s+//;
|
||||||
s/\s+\Z//;
|
s/\s+\Z//;
|
||||||
next if $_ eq '';
|
next if $_ eq '';
|
||||||
|
@@ -32,6 +32,8 @@ function(check_cpu_architecture ARCH VARIABLE)
|
|||||||
_internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE})
|
_internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE})
|
||||||
elseif(ARCH STREQUAL "arm64")
|
elseif(ARCH STREQUAL "arm64")
|
||||||
_internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
|
_internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
|
||||||
|
elseif(ARCH STREQUAL "loongarch64")
|
||||||
|
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
|
||||||
else()
|
else()
|
||||||
message(WARNING "Unknown CPU architectures (${ARCH}).")
|
message(WARNING "Unknown CPU architectures (${ARCH}).")
|
||||||
set(${VARIABLE} FALSE)
|
set(${VARIABLE} FALSE)
|
||||||
|
@@ -29,7 +29,7 @@ ENDMACRO()
|
|||||||
|
|
||||||
# Message Output
|
# Message Output
|
||||||
macro(MESSAGE_WARN _TEXT)
|
macro(MESSAGE_WARN _TEXT)
|
||||||
message(STATUS "*** WARNING: ${_TEXT}")
|
message(WARNING "${_TEXT}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(MESSAGE_ERROR _TEXT)
|
macro(MESSAGE_ERROR _TEXT)
|
||||||
@@ -64,7 +64,7 @@ macro(MESSAGE_TESTED_OPTION _NAME)
|
|||||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(LISTTOSTR _LIST _OUTPUT)
|
function(LISTTOSTR _LIST _OUTPUT)
|
||||||
if(${ARGC} EQUAL 3)
|
if(${ARGC} EQUAL 3)
|
||||||
# prefix for each element
|
# prefix for each element
|
||||||
set(_LPREFIX ${ARGV2})
|
set(_LPREFIX ${ARGV2})
|
||||||
@@ -73,10 +73,12 @@ macro(LISTTOSTR _LIST _OUTPUT)
|
|||||||
endif()
|
endif()
|
||||||
# Do not use string(REPLACE ";" " ") here to avoid messing up list
|
# Do not use string(REPLACE ";" " ") here to avoid messing up list
|
||||||
# entries
|
# entries
|
||||||
|
set(res)
|
||||||
foreach(_ITEM ${${_LIST}})
|
foreach(_ITEM ${${_LIST}})
|
||||||
set(${_OUTPUT} "${${_OUTPUT}} ${_LPREFIX}${_ITEM}")
|
set(res "${res} ${_LPREFIX}${_ITEM}")
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
set(${_OUTPUT} "${res}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
macro(LISTTOSTRREV _LIST _OUTPUT)
|
macro(LISTTOSTRREV _LIST _OUTPUT)
|
||||||
if(${ARGC} EQUAL 3)
|
if(${ARGC} EQUAL 3)
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
include(CMakeParseArguments)
|
include(CMakeParseArguments)
|
||||||
|
include(${SDL2_SOURCE_DIR}/cmake/sdlfind.cmake)
|
||||||
macro(FindLibraryAndSONAME _LIB)
|
macro(FindLibraryAndSONAME _LIB)
|
||||||
cmake_parse_arguments(FLAS "" "" "LIBDIRS" ${ARGN})
|
cmake_parse_arguments(FLAS "" "" "LIBDIRS" ${ARGN})
|
||||||
|
|
||||||
@@ -6,6 +7,13 @@ macro(FindLibraryAndSONAME _LIB)
|
|||||||
string(REGEX REPLACE "\\-" "_" _LNAME "${_UPPERLNAME}")
|
string(REGEX REPLACE "\\-" "_" _LNAME "${_UPPERLNAME}")
|
||||||
|
|
||||||
find_library(${_LNAME}_LIB ${_LIB} PATHS ${FLAS_LIBDIRS})
|
find_library(${_LNAME}_LIB ${_LIB} PATHS ${FLAS_LIBDIRS})
|
||||||
|
|
||||||
|
if(${_LNAME}_LIB MATCHES ".*\\${CMAKE_SHARED_LIBRARY_SUFFIX}.*" AND NOT ${_LNAME}_LIB MATCHES ".*\\${CMAKE_STATIC_LIBRARY_SUFFIX}.*")
|
||||||
|
set(${_LNAME}_SHARED TRUE)
|
||||||
|
else()
|
||||||
|
set(${_LNAME}_SHARED FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${_LNAME}_LIB)
|
if(${_LNAME}_LIB)
|
||||||
# reduce the library name for shared linking
|
# reduce the library name for shared linking
|
||||||
|
|
||||||
@@ -83,26 +91,35 @@ endmacro()
|
|||||||
# - HAVE_SDL_LOADSO opt
|
# - HAVE_SDL_LOADSO opt
|
||||||
macro(CheckALSA)
|
macro(CheckALSA)
|
||||||
if(SDL_ALSA)
|
if(SDL_ALSA)
|
||||||
CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H)
|
sdlFindALSA()
|
||||||
if(HAVE_ASOUNDLIB_H)
|
if(ALSA_FOUND)
|
||||||
CHECK_LIBRARY_EXISTS(asound snd_pcm_recover "" HAVE_LIBASOUND)
|
file(GLOB ALSA_SOURCES "${SDL2_SOURCE_DIR}/src/audio/alsa/*.c")
|
||||||
endif()
|
|
||||||
if(HAVE_LIBASOUND)
|
|
||||||
set(HAVE_ALSA TRUE)
|
|
||||||
file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c)
|
|
||||||
list(APPEND SOURCE_FILES ${ALSA_SOURCES})
|
list(APPEND SOURCE_FILES ${ALSA_SOURCES})
|
||||||
set(SDL_AUDIO_DRIVER_ALSA 1)
|
set(SDL_AUDIO_DRIVER_ALSA 1)
|
||||||
if(SDL_ALSA_SHARED AND NOT HAVE_SDL_LOADSO)
|
set(HAVE_ALSA TRUE)
|
||||||
message_warn("You must have SDL_LoadObject() support for dynamic ALSA loading")
|
set(HAVE_ALSA_SHARED FALSE)
|
||||||
endif()
|
if(SDL_ALSA_SHARED)
|
||||||
|
if(HAVE_SDL_LOADSO)
|
||||||
FindLibraryAndSONAME("asound")
|
FindLibraryAndSONAME("asound")
|
||||||
if(SDL_ALSA_SHARED AND ASOUND_LIB AND HAVE_SDL_LOADSO)
|
if(ASOUND_LIB AND ASOUND_SHARED)
|
||||||
|
target_include_directories(sdl-build-options INTERFACE $<TARGET_PROPERTY:ALSA::ALSA,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"")
|
set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"")
|
||||||
set(HAVE_ALSA_SHARED TRUE)
|
set(HAVE_ALSA_SHARED TRUE)
|
||||||
else()
|
else()
|
||||||
list(APPEND EXTRA_LIBS asound)
|
message(WARNING "Unable to find asound shared object")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(WARNING "You must have SDL_LoadObject() support for dynamic ALSA loading")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(NOT HAVE_ALSA_SHARED)
|
||||||
|
list(APPEND CMAKE_DEPENDS ALSA::ALSA)
|
||||||
|
list(APPEND PKGCONFIG_DEPENDS alsa)
|
||||||
endif()
|
endif()
|
||||||
set(HAVE_SDL_AUDIO TRUE)
|
set(HAVE_SDL_AUDIO TRUE)
|
||||||
|
else()
|
||||||
|
set(HAVE_ALSA FALSE)
|
||||||
|
message(WARNING "Unable to found the alsa development library")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
@@ -400,6 +417,7 @@ endmacro()
|
|||||||
# - SDL_X11_SHARED opt
|
# - SDL_X11_SHARED opt
|
||||||
# - HAVE_SDL_LOADSO opt
|
# - HAVE_SDL_LOADSO opt
|
||||||
macro(CheckX11)
|
macro(CheckX11)
|
||||||
|
cmake_push_check_state(RESET)
|
||||||
if(SDL_X11)
|
if(SDL_X11)
|
||||||
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss)
|
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss)
|
||||||
FindLibraryAndSONAME("${_LIB}")
|
FindLibraryAndSONAME("${_LIB}")
|
||||||
@@ -422,6 +440,7 @@ macro(CheckX11)
|
|||||||
|
|
||||||
if(X_INCLUDEDIR)
|
if(X_INCLUDEDIR)
|
||||||
list(APPEND EXTRA_CFLAGS "-I${X_INCLUDEDIR}")
|
list(APPEND EXTRA_CFLAGS "-I${X_INCLUDEDIR}")
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${X_INCLUDEDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_file(HAVE_XCURSOR_H NAMES "X11/Xcursor/Xcursor.h" HINTS "${X_INCLUDEDIR}")
|
find_file(HAVE_XCURSOR_H NAMES "X11/Xcursor/Xcursor.h" HINTS "${X_INCLUDEDIR}")
|
||||||
@@ -597,6 +616,7 @@ macro(CheckX11)
|
|||||||
# Prevent Mesa from including X11 headers
|
# Prevent Mesa from including X11 headers
|
||||||
list(APPEND EXTRA_CFLAGS "-DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11")
|
list(APPEND EXTRA_CFLAGS "-DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11")
|
||||||
endif()
|
endif()
|
||||||
|
cmake_pop_check_state()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(WaylandProtocolGen _SCANNER _CODE_MODE _XML _PROTL)
|
macro(WaylandProtocolGen _SCANNER _CODE_MODE _XML _PROTL)
|
||||||
@@ -714,6 +734,17 @@ macro(CheckWayland)
|
|||||||
else()
|
else()
|
||||||
list(APPEND EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES})
|
list(APPEND EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
cmake_push_check_state()
|
||||||
|
list(APPEND CMAKE_REQUIRED_FLAGS ${PKG_LIBDECOR_CFLAGS})
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${PKG_LIBDECOR_INCLUDE_DIRS})
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES ${PKG_LIBDECOR_LINK_LIBRARIES})
|
||||||
|
check_symbol_exists(libdecor_frame_get_max_content_size "libdecor.h" HAVE_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE)
|
||||||
|
check_symbol_exists(libdecor_frame_get_min_content_size "libdecor.h" HAVE_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE)
|
||||||
|
if(HAVE_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE AND HAVE_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE)
|
||||||
|
set(SDL_HAVE_LIBDECOR_GET_MIN_MAX 1)
|
||||||
|
endif()
|
||||||
|
cmake_pop_check_state()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -946,7 +977,6 @@ macro(CheckPTHREAD)
|
|||||||
list(APPEND SDL_CFLAGS ${PTHREAD_CFLAGS})
|
list(APPEND SDL_CFLAGS ${PTHREAD_CFLAGS})
|
||||||
|
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#define _GNU_SOURCE 1
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
@@ -957,7 +987,6 @@ macro(CheckPTHREAD)
|
|||||||
set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
|
set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
|
||||||
else()
|
else()
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#define _GNU_SOURCE 1
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
@@ -988,10 +1017,13 @@ macro(CheckPTHREAD)
|
|||||||
check_include_files("pthread_np.h" HAVE_PTHREAD_NP_H)
|
check_include_files("pthread_np.h" HAVE_PTHREAD_NP_H)
|
||||||
if (HAVE_PTHREAD_H)
|
if (HAVE_PTHREAD_H)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#define _GNU_SOURCE 1
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
#ifdef __APPLE__
|
||||||
|
pthread_setname_np(\"\");
|
||||||
|
#else
|
||||||
pthread_setname_np(pthread_self(),\"\");
|
pthread_setname_np(pthread_self(),\"\");
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}" HAVE_PTHREAD_SETNAME_NP)
|
}" HAVE_PTHREAD_SETNAME_NP)
|
||||||
if (HAVE_PTHREAD_NP_H)
|
if (HAVE_PTHREAD_NP_H)
|
||||||
@@ -1291,3 +1323,16 @@ macro(CheckKMSDRM)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(CheckLibUDev)
|
||||||
|
if(SDL_LIBUDEV)
|
||||||
|
check_include_file("libudev.h" have_libudev_header)
|
||||||
|
if(have_libudev_header)
|
||||||
|
set(HAVE_LIBUDEV_H TRUE)
|
||||||
|
FindLibraryAndSONAME(udev)
|
||||||
|
if(UDEV_LIB_SONAME)
|
||||||
|
set(SDL_UDEV_DYNAMIC "\"${UDEV_LIB_SONAME}\"")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
9
cmake/sdlfind.cmake
Normal file
9
cmake/sdlfind.cmake
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
macro(sdlFindALSA)
|
||||||
|
find_package(ALSA MODULE)
|
||||||
|
if(ALSA_FOUND AND (NOT TARGET ALSA::ALSA) )
|
||||||
|
add_Library(ALSA::ALSA UNKNOWN IMPORTED)
|
||||||
|
set_property(TARGET ALSA::ALSA PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIRS})
|
||||||
|
set_property(TARGET ALSA::ALSA APPEND PROPERTY IMPORTED_LOCATION ${ALSA_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endmacro()
|
55
cmake/sdlplatform.cmake
Normal file
55
cmake/sdlplatform.cmake
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
macro(SDL_DetectCMakePlatform)
|
||||||
|
set(SDL_CMAKE_PLATFORM )
|
||||||
|
# Get the platform
|
||||||
|
if(WIN32)
|
||||||
|
set(SDL_CMAKE_PLATFORM WINDOWS)
|
||||||
|
elseif(UNIX AND NOT APPLE)
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
|
||||||
|
set(SDL_CMAKE_PLATFORM LINUX)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM FREEBSD)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM NETBSD)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM OPENBSD)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM GNU)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM BSDI)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
|
||||||
|
set(SDL_CMAKE_PLATFORM FREEBSD)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM SYSV5)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM SOLARIS)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM HPUX)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM AIX)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM MINIX)
|
||||||
|
endif()
|
||||||
|
elseif(APPLE)
|
||||||
|
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.*")
|
||||||
|
# !!! FIXME: remove the version check when we start requiring >= 3.14.0
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.14)
|
||||||
|
set(SDL_CMAKE_PLATFORM IOS)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
|
||||||
|
message_error("BeOS support has been removed as of SDL 2.0.2.")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
|
||||||
|
set(SDL_CMAKE_PLATFORM HAIKU)
|
||||||
|
elseif(NINTENDO_3DS)
|
||||||
|
set(SDL_CMAKE_PLATFORM N3DS)
|
||||||
|
endif()
|
||||||
|
if(SDL_CMAKE_PLATFORM)
|
||||||
|
set(${SDL_CMAKE_PLATFORM} TRUE)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
@@ -13,7 +13,7 @@ case "$machine" in
|
|||||||
*android* )
|
*android* )
|
||||||
EXEPREFIX="lib"
|
EXEPREFIX="lib"
|
||||||
EXESUFFIX=".so"
|
EXESUFFIX=".so"
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared"
|
LDFLAGS="$LDFLAGS -shared"
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
EXEPREFIX=""
|
EXEPREFIX=""
|
||||||
@@ -25,20 +25,20 @@ set -e
|
|||||||
|
|
||||||
# Get the canonical path of the folder containing this script
|
# Get the canonical path of the folder containing this script
|
||||||
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
||||||
CFLAGS="$( pkg-config sdl2 --cflags )"
|
SDL_CFLAGS="$( pkg-config sdl2 --cflags )"
|
||||||
LDFLAGS="$( pkg-config sdl2 --libs )"
|
SDL_LDFLAGS="$( pkg-config sdl2 --libs )"
|
||||||
STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
|
SDL_STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
|
||||||
|
|
||||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $CFLAGS $EXTRA_CFLAGS"
|
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
|
||||||
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
|
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
|
||||||
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
|
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
|
||||||
|
|
||||||
echo "-- CC: $CC"
|
echo "-- CC: $CC"
|
||||||
echo "-- CFLAGS: $CFLAGS"
|
echo "-- CFLAGS: $CFLAGS"
|
||||||
echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS"
|
|
||||||
echo "-- LDFLASG: $LDFLAGS"
|
echo "-- LDFLASG: $LDFLAGS"
|
||||||
echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS"
|
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
|
||||||
echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
|
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
|
||||||
|
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
|
||||||
|
|
||||||
echo "-- COMPILE: $compile_cmd"
|
echo "-- COMPILE: $compile_cmd"
|
||||||
echo "-- LINK: $link_cmd"
|
echo "-- LINK: $link_cmd"
|
||||||
|
@@ -13,7 +13,7 @@ case "$machine" in
|
|||||||
*android* )
|
*android* )
|
||||||
EXEPREFIX="lib"
|
EXEPREFIX="lib"
|
||||||
EXESUFFIX=".so"
|
EXESUFFIX=".so"
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared"
|
LDFLAGS="$LDFLAGS -shared"
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
EXEPREFIX=""
|
EXEPREFIX=""
|
||||||
@@ -25,20 +25,20 @@ set -e
|
|||||||
|
|
||||||
# Get the canonical path of the folder containing this script
|
# Get the canonical path of the folder containing this script
|
||||||
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
|
||||||
CFLAGS="$( sdl2-config --cflags )"
|
SDL_CFLAGS="$( sdl2-config --cflags )"
|
||||||
LDFLAGS="$( sdl2-config --libs )"
|
SDL_LDFLAGS="$( sdl2-config --libs )"
|
||||||
STATIC_LDFLAGS="$( sdl2-config --static-libs )"
|
SDL_STATIC_LDFLAGS="$( sdl2-config --static-libs )"
|
||||||
|
|
||||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $EXTRA_CFLAGS"
|
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $SDL_CFLAGS"
|
||||||
link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
|
link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
|
||||||
static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
|
static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
|
||||||
|
|
||||||
echo "-- CC: $CC"
|
echo "-- CC: $CC"
|
||||||
echo "-- CFLAGS: $CFLAGS"
|
echo "-- CFLAGS: $CFLAGS"
|
||||||
echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS"
|
|
||||||
echo "-- LDFLAGS: $LDFLAGS"
|
echo "-- LDFLAGS: $LDFLAGS"
|
||||||
echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS"
|
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
|
||||||
echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
|
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
|
||||||
|
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
|
||||||
|
|
||||||
echo "-- COMPILE: $compile_cmd"
|
echo "-- COMPILE: $compile_cmd"
|
||||||
echo "-- LINK: $link_cmd"
|
echo "-- LINK: $link_cmd"
|
||||||
|
379
configure
vendored
379
configure
vendored
@@ -677,6 +677,7 @@ ENABLE_STATIC_TRUE
|
|||||||
ENABLE_SHARED_FALSE
|
ENABLE_SHARED_FALSE
|
||||||
ENABLE_SHARED_TRUE
|
ENABLE_SHARED_TRUE
|
||||||
PKGCONFIG_LIBS_PRIV
|
PKGCONFIG_LIBS_PRIV
|
||||||
|
PKGCONFIG_DEPENDS
|
||||||
SDL_RLD_FLAGS
|
SDL_RLD_FLAGS
|
||||||
SDL_STATIC_LIBS
|
SDL_STATIC_LIBS
|
||||||
SDL_LIBS
|
SDL_LIBS
|
||||||
@@ -2448,6 +2449,58 @@ printf "%s\n" "$ac_res" >&6; }
|
|||||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||||
|
|
||||||
} # ac_fn_c_check_member
|
} # ac_fn_c_check_member
|
||||||
|
|
||||||
|
# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
|
||||||
|
# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
|
||||||
|
ac_fn_check_decl ()
|
||||||
|
{
|
||||||
|
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||||
|
as_decl_name=`echo $2|sed 's/ *(.*//'`
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
|
||||||
|
printf %s "checking whether $as_decl_name is declared... " >&6; }
|
||||||
|
if eval test \${$3+y}
|
||||||
|
then :
|
||||||
|
printf %s "(cached) " >&6
|
||||||
|
else $as_nop
|
||||||
|
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
|
||||||
|
eval ac_save_FLAGS=\$$6
|
||||||
|
as_fn_append $6 " $5"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
$4
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
#ifndef $as_decl_name
|
||||||
|
#ifdef __cplusplus
|
||||||
|
(void) $as_decl_use;
|
||||||
|
#else
|
||||||
|
(void) $as_decl_name;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"
|
||||||
|
then :
|
||||||
|
eval "$3=yes"
|
||||||
|
else $as_nop
|
||||||
|
eval "$3=no"
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
|
eval $6=\$ac_save_FLAGS
|
||||||
|
|
||||||
|
fi
|
||||||
|
eval ac_res=\$$3
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||||
|
printf "%s\n" "$ac_res" >&6; }
|
||||||
|
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||||
|
|
||||||
|
} # ac_fn_check_decl
|
||||||
ac_configure_args_raw=
|
ac_configure_args_raw=
|
||||||
for ac_arg
|
for ac_arg
|
||||||
do
|
do
|
||||||
@@ -3453,7 +3506,7 @@ orig_CFLAGS="$CFLAGS"
|
|||||||
|
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=26
|
SDL_MINOR_VERSION=28
|
||||||
SDL_MICRO_VERSION=0
|
SDL_MICRO_VERSION=0
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
@@ -17652,6 +17705,79 @@ printf "%s\n" "$ac_cv_path_EGREP" >&6; }
|
|||||||
EGREP="$ac_cv_path_EGREP"
|
EGREP="$ac_cv_path_EGREP"
|
||||||
|
|
||||||
|
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
|
||||||
|
printf %s "checking for fgrep... " >&6; }
|
||||||
|
if test ${ac_cv_path_FGREP+y}
|
||||||
|
then :
|
||||||
|
printf %s "(cached) " >&6
|
||||||
|
else $as_nop
|
||||||
|
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
|
||||||
|
then ac_cv_path_FGREP="$GREP -F"
|
||||||
|
else
|
||||||
|
if test -z "$FGREP"; then
|
||||||
|
ac_path_FGREP_found=false
|
||||||
|
# Loop through the user's path and test for each of PROGNAME-LIST
|
||||||
|
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||||
|
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
|
||||||
|
do
|
||||||
|
IFS=$as_save_IFS
|
||||||
|
case $as_dir in #(((
|
||||||
|
'') as_dir=./ ;;
|
||||||
|
*/) ;;
|
||||||
|
*) as_dir=$as_dir/ ;;
|
||||||
|
esac
|
||||||
|
for ac_prog in fgrep
|
||||||
|
do
|
||||||
|
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||||
|
ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext"
|
||||||
|
as_fn_executable_p "$ac_path_FGREP" || continue
|
||||||
|
# Check for GNU ac_path_FGREP and select it if it is found.
|
||||||
|
# Check for GNU $ac_path_FGREP
|
||||||
|
case `"$ac_path_FGREP" --version 2>&1` in
|
||||||
|
*GNU*)
|
||||||
|
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
|
||||||
|
*)
|
||||||
|
ac_count=0
|
||||||
|
printf %s 0123456789 >"conftest.in"
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
cat "conftest.in" "conftest.in" >"conftest.tmp"
|
||||||
|
mv "conftest.tmp" "conftest.in"
|
||||||
|
cp "conftest.in" "conftest.nl"
|
||||||
|
printf "%s\n" 'FGREP' >> "conftest.nl"
|
||||||
|
"$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
|
||||||
|
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
|
||||||
|
as_fn_arith $ac_count + 1 && ac_count=$as_val
|
||||||
|
if test $ac_count -gt ${ac_path_FGREP_max-0}; then
|
||||||
|
# Best one so far, save it but keep looking for a better one
|
||||||
|
ac_cv_path_FGREP="$ac_path_FGREP"
|
||||||
|
ac_path_FGREP_max=$ac_count
|
||||||
|
fi
|
||||||
|
# 10*(2^10) chars as input seems more than enough
|
||||||
|
test $ac_count -gt 10 && break
|
||||||
|
done
|
||||||
|
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$ac_path_FGREP_found && break 3
|
||||||
|
done
|
||||||
|
done
|
||||||
|
done
|
||||||
|
IFS=$as_save_IFS
|
||||||
|
if test -z "$ac_cv_path_FGREP"; then
|
||||||
|
as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ac_cv_path_FGREP=$FGREP
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
|
||||||
|
printf "%s\n" "$ac_cv_path_FGREP" >&6; }
|
||||||
|
FGREP="$ac_cv_path_FGREP"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Find a good install program. We prefer a C program (faster),
|
# Find a good install program. We prefer a C program (faster),
|
||||||
# so one script is as good as another. But avoid the broken or
|
# so one script is as good as another. But avoid the broken or
|
||||||
@@ -18292,8 +18418,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
|
|||||||
|
|
||||||
find_lib()
|
find_lib()
|
||||||
{
|
{
|
||||||
gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | $FGREP programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
||||||
gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | $FGREP libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
|
||||||
env_lib_path=`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`
|
env_lib_path=`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`
|
||||||
if test "$cross_compiling" = yes; then
|
if test "$cross_compiling" = yes; then
|
||||||
host_lib_path=""
|
host_lib_path=""
|
||||||
@@ -23099,6 +23225,41 @@ printf "%s\n" "$need_gcc_Wno_multichar" >&6; }
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckUnusedLocalTypedefs()
|
||||||
|
{
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -Wunused-local-typedefs option" >&5
|
||||||
|
printf %s "checking for GCC -Wunused-local-typedefs option... " >&6; }
|
||||||
|
have_gcc_unused_local_typedefs=no
|
||||||
|
|
||||||
|
save_CFLAGS="$CFLAGS"
|
||||||
|
CFLAGS="$save_CFLAGS -Wunused-local-typedefs"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
int x = 0;
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"
|
||||||
|
then :
|
||||||
|
have_gcc_unused_local_typedefs=yes
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_unused_local_typedefs" >&5
|
||||||
|
printf "%s\n" "$have_gcc_unused_local_typedefs" >&6; }
|
||||||
|
CFLAGS="$save_CFLAGS"
|
||||||
|
|
||||||
|
if test x$have_gcc_unused_local_typedefs = xyes; then
|
||||||
|
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-unused-local-typedefs"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
CheckWayland()
|
CheckWayland()
|
||||||
{
|
{
|
||||||
# Check whether --enable-video-wayland was given.
|
# Check whether --enable-video-wayland was given.
|
||||||
@@ -23329,6 +23490,122 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR \"$decor_lib\""
|
|||||||
else
|
else
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS"
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
saved_cflags=$CFLAGS
|
||||||
|
CFLAGS="$CFLAGS $DECOR_CFLAGS"
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
|
||||||
|
printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
|
||||||
|
if test ${ac_cv_c_undeclared_builtin_options+y}
|
||||||
|
then :
|
||||||
|
printf %s "(cached) " >&6
|
||||||
|
else $as_nop
|
||||||
|
ac_save_CFLAGS=$CFLAGS
|
||||||
|
ac_cv_c_undeclared_builtin_options='cannot detect'
|
||||||
|
for ac_arg in '' -fno-builtin; do
|
||||||
|
CFLAGS="$ac_save_CFLAGS $ac_arg"
|
||||||
|
# This test program should *not* compile successfully.
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
(void) strchr;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"
|
||||||
|
then :
|
||||||
|
|
||||||
|
else $as_nop
|
||||||
|
# This test program should compile successfully.
|
||||||
|
# No library function is consistently available on
|
||||||
|
# freestanding implementations, so test against a dummy
|
||||||
|
# declaration. Include always-available headers on the
|
||||||
|
# off chance that they somehow elicit warnings.
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <float.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
extern void ac_decl (int, char *);
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
(void) ac_decl (0, (char *) 0);
|
||||||
|
(void) ac_decl;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"
|
||||||
|
then :
|
||||||
|
if test x"$ac_arg" = x
|
||||||
|
then :
|
||||||
|
ac_cv_c_undeclared_builtin_options='none needed'
|
||||||
|
else $as_nop
|
||||||
|
ac_cv_c_undeclared_builtin_options=$ac_arg
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
|
done
|
||||||
|
CFLAGS=$ac_save_CFLAGS
|
||||||
|
|
||||||
|
fi
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
|
||||||
|
printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
|
||||||
|
case $ac_cv_c_undeclared_builtin_options in #(
|
||||||
|
'cannot detect') :
|
||||||
|
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||||
|
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||||
|
as_fn_error $? "cannot make $CC report undeclared builtins
|
||||||
|
See \`config.log' for more details" "$LINENO" 5; } ;; #(
|
||||||
|
'none needed') :
|
||||||
|
ac_c_undeclared_builtin_options='' ;; #(
|
||||||
|
*) :
|
||||||
|
ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ac_fn_check_decl "$LINENO" "libdecor_frame_get_min_content_size" "ac_cv_have_decl_libdecor_frame_get_min_content_size" "#include <libdecor.h>
|
||||||
|
" "$ac_c_undeclared_builtin_options" "CFLAGS"
|
||||||
|
if test "x$ac_cv_have_decl_libdecor_frame_get_min_content_size" = xyes
|
||||||
|
then :
|
||||||
|
ac_have_decl=1
|
||||||
|
else $as_nop
|
||||||
|
ac_have_decl=0
|
||||||
|
fi
|
||||||
|
printf "%s\n" "#define HAVE_DECL_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE $ac_have_decl" >>confdefs.h
|
||||||
|
if test $ac_have_decl = 1
|
||||||
|
then :
|
||||||
|
libdecor_get_min_max=yes
|
||||||
|
fi
|
||||||
|
ac_fn_check_decl "$LINENO" "libdecor_frame_get_max_content_size" "ac_cv_have_decl_libdecor_frame_get_max_content_size" "#include <libdecor.h>
|
||||||
|
" "$ac_c_undeclared_builtin_options" "CFLAGS"
|
||||||
|
if test "x$ac_cv_have_decl_libdecor_frame_get_max_content_size" = xyes
|
||||||
|
then :
|
||||||
|
ac_have_decl=1
|
||||||
|
else $as_nop
|
||||||
|
ac_have_decl=0
|
||||||
|
fi
|
||||||
|
printf "%s\n" "#define HAVE_DECL_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE $ac_have_decl" >>confdefs.h
|
||||||
|
if test $ac_have_decl = 1
|
||||||
|
then :
|
||||||
|
libdecor_get_min_max=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$libdecor_get_min_max = xyes; then
|
||||||
|
|
||||||
|
printf "%s\n" "#define SDL_HAVE_LIBDECOR_GET_MIN_MAX 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
|
CFLAGS="$saved_cflags"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -28162,52 +28439,6 @@ else $as_nop
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$enable_clock_gettime = xyes; then
|
if test x$enable_clock_gettime = xyes; then
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
|
|
||||||
printf %s "checking for clock_gettime in -lrt... " >&6; }
|
|
||||||
if test ${ac_cv_lib_rt_clock_gettime+y}
|
|
||||||
then :
|
|
||||||
printf %s "(cached) " >&6
|
|
||||||
else $as_nop
|
|
||||||
ac_check_lib_save_LIBS=$LIBS
|
|
||||||
LIBS="-lrt $LIBS"
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
|
|
||||||
/* Override any GCC internal prototype to avoid an error.
|
|
||||||
Use char because int might match the return type of a GCC
|
|
||||||
builtin and then its argument prototype would still apply. */
|
|
||||||
char clock_gettime ();
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
return clock_gettime ();
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_link "$LINENO"
|
|
||||||
then :
|
|
||||||
ac_cv_lib_rt_clock_gettime=yes
|
|
||||||
else $as_nop
|
|
||||||
ac_cv_lib_rt_clock_gettime=no
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
LIBS=$ac_check_lib_save_LIBS
|
|
||||||
fi
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
|
|
||||||
printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; }
|
|
||||||
if test "x$ac_cv_lib_rt_clock_gettime" = xyes
|
|
||||||
then :
|
|
||||||
have_clock_gettime=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test x$have_clock_gettime = xyes; then
|
|
||||||
|
|
||||||
printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
|
|
||||||
|
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
|
|
||||||
else
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lc" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lc" >&5
|
||||||
printf %s "checking for clock_gettime in -lc... " >&6; }
|
printf %s "checking for clock_gettime in -lc... " >&6; }
|
||||||
if test ${ac_cv_lib_c_clock_gettime+y}
|
if test ${ac_cv_lib_c_clock_gettime+y}
|
||||||
@@ -28252,7 +28483,52 @@ fi
|
|||||||
|
|
||||||
printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
|
printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
|
||||||
|
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
|
else
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
|
||||||
|
printf %s "checking for clock_gettime in -lrt... " >&6; }
|
||||||
|
if test ${ac_cv_lib_rt_clock_gettime+y}
|
||||||
|
then :
|
||||||
|
printf %s "(cached) " >&6
|
||||||
|
else $as_nop
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-lrt $LIBS"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
char clock_gettime ();
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
return clock_gettime ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"
|
||||||
|
then :
|
||||||
|
ac_cv_lib_rt_clock_gettime=yes
|
||||||
|
else $as_nop
|
||||||
|
ac_cv_lib_rt_clock_gettime=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
|
||||||
|
printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; }
|
||||||
|
if test "x$ac_cv_lib_rt_clock_gettime" = xyes
|
||||||
|
then :
|
||||||
|
have_clock_gettime=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$have_clock_gettime = xyes; then
|
||||||
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
|
||||||
|
|
||||||
|
printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
|
||||||
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -28330,6 +28606,7 @@ printf "%s\n" "#define SDL_JOYSTICK_VIRTUAL 1" >>confdefs.h
|
|||||||
}
|
}
|
||||||
|
|
||||||
CheckWarnAll
|
CheckWarnAll
|
||||||
|
CheckUnusedLocalTypedefs
|
||||||
CheckNoStrictAliasing
|
CheckNoStrictAliasing
|
||||||
|
|
||||||
CheckEventSignals
|
CheckEventSignals
|
||||||
@@ -29800,6 +30077,8 @@ done
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PKGCONFIG_DEPENDS=""
|
||||||
|
|
||||||
if test x$enable_shared = xyes; then
|
if test x$enable_shared = xyes; then
|
||||||
PKGCONFIG_LIBS_PRIV="
|
PKGCONFIG_LIBS_PRIV="
|
||||||
Libs.private:"
|
Libs.private:"
|
||||||
|
50
configure.ac
50
configure.ac
@@ -12,7 +12,7 @@ orig_CFLAGS="$CFLAGS"
|
|||||||
dnl Set various version strings - taken gratefully from the GTk sources
|
dnl Set various version strings - taken gratefully from the GTk sources
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=26
|
SDL_MINOR_VERSION=28
|
||||||
SDL_MICRO_VERSION=0
|
SDL_MICRO_VERSION=0
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
@@ -62,6 +62,7 @@ AC_PROG_AWK
|
|||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_EGREP
|
AC_PROG_EGREP
|
||||||
|
AC_PROG_FGREP
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
@@ -180,8 +181,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
|
|||||||
dnl Function to find a library in the compiler search path
|
dnl Function to find a library in the compiler search path
|
||||||
find_lib()
|
find_lib()
|
||||||
{
|
{
|
||||||
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | $FGREP programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
||||||
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | $FGREP libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
|
||||||
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
|
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
|
||||||
if test "$cross_compiling" = yes; then
|
if test "$cross_compiling" = yes; then
|
||||||
host_lib_path=""
|
host_lib_path=""
|
||||||
@@ -1673,6 +1674,27 @@ dnl Haiku headers use multicharacter constants all over the place. Ignore these
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dnl See if GCC's -Wunused-local-typedefs is supported and disable it
|
||||||
|
dnl because it triggers on gcc 4.8.4 for compile time asserts inside
|
||||||
|
dnl of functions.
|
||||||
|
CheckUnusedLocalTypedefs()
|
||||||
|
{
|
||||||
|
AC_MSG_CHECKING(for GCC -Wunused-local-typedefs option)
|
||||||
|
have_gcc_unused_local_typedefs=no
|
||||||
|
|
||||||
|
save_CFLAGS="$CFLAGS"
|
||||||
|
CFLAGS="$save_CFLAGS -Wunused-local-typedefs"
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
int x = 0;
|
||||||
|
]],[])], [have_gcc_unused_local_typedefs=yes],[])
|
||||||
|
AC_MSG_RESULT($have_gcc_unused_local_typedefs)
|
||||||
|
CFLAGS="$save_CFLAGS"
|
||||||
|
|
||||||
|
if test x$have_gcc_unused_local_typedefs = xyes; then
|
||||||
|
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-unused-local-typedefs"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
dnl Check for Wayland
|
dnl Check for Wayland
|
||||||
CheckWayland()
|
CheckWayland()
|
||||||
{
|
{
|
||||||
@@ -1786,6 +1808,14 @@ dnl See if libdecor is available
|
|||||||
else
|
else
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS"
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
saved_cflags=$CFLAGS
|
||||||
|
CFLAGS="$CFLAGS $DECOR_CFLAGS"
|
||||||
|
AC_CHECK_DECLS([libdecor_frame_get_min_content_size, libdecor_frame_get_max_content_size], [libdecor_get_min_max=yes], [ ], [[#include <libdecor.h>]])
|
||||||
|
if test x$libdecor_get_min_max = xyes; then
|
||||||
|
AC_DEFINE(SDL_HAVE_LIBDECOR_GET_MIN_MAX, 1, [ ])
|
||||||
|
fi
|
||||||
|
CFLAGS="$saved_cflags"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -3672,15 +3702,14 @@ CheckClockGettime()
|
|||||||
[AS_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [default=yes]])],
|
[AS_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [default=yes]])],
|
||||||
, enable_clock_gettime=yes)
|
, enable_clock_gettime=yes)
|
||||||
if test x$enable_clock_gettime = xyes; then
|
if test x$enable_clock_gettime = xyes; then
|
||||||
AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
|
|
||||||
if test x$have_clock_gettime = xyes; then
|
|
||||||
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
|
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
|
|
||||||
else
|
|
||||||
AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
|
AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
|
||||||
if test x$have_clock_gettime = xyes; then
|
if test x$have_clock_gettime = xyes; then
|
||||||
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
|
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
|
||||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
|
else
|
||||||
|
AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
|
||||||
|
if test x$have_clock_gettime = xyes; then
|
||||||
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
|
||||||
|
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -3738,6 +3767,7 @@ CheckVirtualJoystick()
|
|||||||
|
|
||||||
dnl Do this on all platforms, before everything else (other things might want to override it).
|
dnl Do this on all platforms, before everything else (other things might want to override it).
|
||||||
CheckWarnAll
|
CheckWarnAll
|
||||||
|
CheckUnusedLocalTypedefs
|
||||||
CheckNoStrictAliasing
|
CheckNoStrictAliasing
|
||||||
|
|
||||||
dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow.
|
dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow.
|
||||||
@@ -4860,6 +4890,8 @@ AC_SUBST(SDL_CFLAGS)
|
|||||||
AC_SUBST(SDL_LIBS)
|
AC_SUBST(SDL_LIBS)
|
||||||
AC_SUBST(SDL_STATIC_LIBS)
|
AC_SUBST(SDL_STATIC_LIBS)
|
||||||
AC_SUBST(SDL_RLD_FLAGS)
|
AC_SUBST(SDL_RLD_FLAGS)
|
||||||
|
PKGCONFIG_DEPENDS=""
|
||||||
|
AC_SUBST(PKGCONFIG_DEPENDS)
|
||||||
if test x$enable_shared = xyes; then
|
if test x$enable_shared = xyes; then
|
||||||
PKGCONFIG_LIBS_PRIV="
|
PKGCONFIG_LIBS_PRIV="
|
||||||
Libs.private:"
|
Libs.private:"
|
||||||
|
@@ -68,14 +68,22 @@ Finally, a word of caution: re running androidbuild.sh wipes any changes you may
|
|||||||
done in the build directory for the app!
|
done in the build directory for the app!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
For more complex projects, follow these instructions:
|
For more complex projects, follow these instructions:
|
||||||
|
|
||||||
1. Copy the android-project directory wherever you want to keep your projects
|
1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT).
|
||||||
and rename it to the name of your project.
|
|
||||||
2. Move or symlink this SDL directory into the "<project>/app/jni" directory
|
|
||||||
3. Edit "<project>/app/jni/src/Android.mk" to include your source files
|
|
||||||
|
|
||||||
4a. If you want to use Android Studio, simply open your <project> directory and start building.
|
(The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.)
|
||||||
|
|
||||||
|
2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory
|
||||||
|
|
||||||
|
(This is needed as the source of SDL has to be compiled by the Android compiler)
|
||||||
|
|
||||||
|
3. Edit "YOURPROJECT/app/jni/src/Android.mk" to include your source files.
|
||||||
|
|
||||||
|
(They should be separated by spaces after the "LOCAL_SRC_FILES := " declaration)
|
||||||
|
|
||||||
|
4a. If you want to use Android Studio, simply open your 'YOURPROJECT' directory and start building.
|
||||||
|
|
||||||
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
|
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
|
||||||
|
|
||||||
@@ -83,9 +91,9 @@ For more complex projects, follow these instructions:
|
|||||||
If you already have a project that uses CMake, the instructions change somewhat:
|
If you already have a project that uses CMake, the instructions change somewhat:
|
||||||
|
|
||||||
1. Do points 1 and 2 from the instruction above.
|
1. Do points 1 and 2 from the instruction above.
|
||||||
2. Edit "<project>/app/build.gradle" to comment out or remove sections containing ndk-build
|
2. Edit "YOURPROJECT/app/build.gradle" to comment out or remove sections containing ndk-build
|
||||||
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
|
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
|
||||||
3. Edit "<project>/app/jni/CMakeLists.txt" to include your project (it defaults to
|
3. Edit "YOURPROJECT/app/jni/CMakeLists.txt" to include your project (it defaults to
|
||||||
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
|
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
|
||||||
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
|
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
|
||||||
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
|
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
|
||||||
|
@@ -25,3 +25,4 @@ cmake --install build
|
|||||||
- SDL2main should be used to ensure ROMFS is enabled.
|
- SDL2main should be used to ensure ROMFS is enabled.
|
||||||
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
||||||
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
||||||
|
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -125,8 +125,6 @@ typedef struct SDL_AssertData
|
|||||||
const struct SDL_AssertData *next;
|
const struct SDL_AssertData *next;
|
||||||
} SDL_AssertData;
|
} SDL_AssertData;
|
||||||
|
|
||||||
#if (SDL_ASSERT_LEVEL > 0)
|
|
||||||
|
|
||||||
/* Never call this directly. Use the SDL_assert* macros. */
|
/* Never call this directly. Use the SDL_assert* macros. */
|
||||||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||||
const char *,
|
const char *,
|
||||||
@@ -151,9 +149,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
|||||||
#define SDL_enabled_assert(condition) \
|
#define SDL_enabled_assert(condition) \
|
||||||
do { \
|
do { \
|
||||||
while ( !(condition) ) { \
|
while ( !(condition) ) { \
|
||||||
static struct SDL_AssertData sdl_assert_data = { \
|
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
|
||||||
0, 0, #condition, 0, 0, 0, 0 \
|
|
||||||
}; \
|
|
||||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||||
continue; /* go again. */ \
|
continue; /* go again. */ \
|
||||||
@@ -164,8 +160,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
|||||||
} \
|
} \
|
||||||
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
||||||
|
|
||||||
#endif /* enabled assertions support code */
|
|
||||||
|
|
||||||
/* Enable various levels of assertions. */
|
/* Enable various levels of assertions. */
|
||||||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
||||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -249,9 +249,8 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
|||||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
||||||
#define SDL_CPUPauseInstruction() __yield()
|
#define SDL_CPUPauseInstruction() __yield()
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
/* watcom assembler rejects PAUSE if CPU < i686, and it refuses REP NOP as an invalid combination. Hardcode the bytes. */
|
|
||||||
extern __inline void SDL_CPUPauseInstruction(void);
|
extern __inline void SDL_CPUPauseInstruction(void);
|
||||||
#pragma aux SDL_CPUPauseInstruction = "db 0f3h,90h"
|
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
|
||||||
#else
|
#else
|
||||||
#define SDL_CPUPauseInstruction()
|
#define SDL_CPUPauseInstruction()
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -52,7 +52,7 @@ typedef enum
|
|||||||
dstA = dstA */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
||||||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
||||||
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
||||||
|
|
||||||
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -332,6 +332,7 @@
|
|||||||
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
|
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
|
||||||
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
|
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
|
||||||
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
|
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
|
||||||
|
#cmakedefine SDL_INPUT_WSCONS @SDL_INPUT_WSCONS@
|
||||||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
||||||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
||||||
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
|
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
|
||||||
@@ -359,6 +360,7 @@
|
|||||||
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
|
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
|
||||||
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
|
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
|
||||||
#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
|
#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
|
||||||
|
#cmakedefine SDL_UDEV_DYNAMIC @SDL_UDEV_DYNAMIC@
|
||||||
|
|
||||||
/* Enable various sensor drivers */
|
/* Enable various sensor drivers */
|
||||||
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
|
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
|
||||||
@@ -539,7 +541,9 @@
|
|||||||
#cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@
|
#cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@
|
||||||
#cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@
|
#cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@
|
||||||
|
|
||||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
#cmakedefine SDL_HAVE_LIBDECOR_GET_MIN_MAX @SDL_HAVE_LIBDECOR_GET_MIN_MAX@
|
||||||
|
|
||||||
|
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||||
typedef signed __int8 int8_t;
|
typedef signed __int8 int8_t;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -491,4 +491,7 @@
|
|||||||
/* Enable dynamic libsamplerate support */
|
/* Enable dynamic libsamplerate support */
|
||||||
#undef SDL_LIBSAMPLERATE_DYNAMIC
|
#undef SDL_LIBSAMPLERATE_DYNAMIC
|
||||||
|
|
||||||
|
/* Libdecor get min/max content size functions */
|
||||||
|
#undef SDL_HAVE_LIBDECOR_GET_MIN_MAX
|
||||||
|
|
||||||
#endif /* SDL_config_h_ */
|
#endif /* SDL_config_h_ */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
#define HAVE_STDARG_H 1
|
#define HAVE_STDARG_H 1
|
||||||
#define HAVE_STDDEF_H 1
|
#define HAVE_STDDEF_H 1
|
||||||
|
|
||||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||||
typedef signed __int8 int8_t;
|
typedef signed __int8 int8_t;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
/* This is a set of defines to configure the SDL features */
|
||||||
|
|
||||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||||
typedef signed __int8 int8_t;
|
typedef signed __int8 int8_t;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -209,16 +209,21 @@
|
|||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||||
#define SDL_VIDEO_DRIVER_WINDOWS 1
|
#define SDL_VIDEO_DRIVER_WINDOWS 1
|
||||||
|
|
||||||
/* #ifndef SDL_VIDEO_RENDER_D3D
|
|
||||||
#define SDL_VIDEO_RENDER_D3D 1
|
|
||||||
#endif*/
|
|
||||||
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
|
|
||||||
#define SDL_VIDEO_RENDER_D3D11 1
|
|
||||||
#endif
|
|
||||||
#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
|
#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
|
||||||
#define SDL_VIDEO_RENDER_D3D12 1
|
#define SDL_VIDEO_RENDER_D3D12 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Enable OpenGL support */
|
||||||
|
#ifndef SDL_VIDEO_OPENGL
|
||||||
|
#define SDL_VIDEO_OPENGL 1
|
||||||
|
#endif
|
||||||
|
#ifndef SDL_VIDEO_OPENGL_WGL
|
||||||
|
#define SDL_VIDEO_OPENGL_WGL 1
|
||||||
|
#endif
|
||||||
|
#ifndef SDL_VIDEO_RENDER_OGL
|
||||||
|
#define SDL_VIDEO_RENDER_OGL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enable system power support */
|
/* Enable system power support */
|
||||||
/*#define SDL_POWER_WINDOWS 1*/
|
/*#define SDL_POWER_WINDOWS 1*/
|
||||||
#define SDL_POWER_HARDWIRED 1
|
#define SDL_POWER_HARDWIRED 1
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -140,7 +140,7 @@ extern "C" {
|
|||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP16
|
#if HAS_BUILTIN_BSWAP16
|
||||||
#define SDL_Swap16(x) __builtin_bswap16(x)
|
#define SDL_Swap16(x) __builtin_bswap16(x)
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||||
#pragma intrinsic(_byteswap_ushort)
|
#pragma intrinsic(_byteswap_ushort)
|
||||||
#define SDL_Swap16(x) _byteswap_ushort(x)
|
#define SDL_Swap16(x) _byteswap_ushort(x)
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||||
@@ -189,7 +189,7 @@ SDL_Swap16(Uint16 x)
|
|||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP32
|
#if HAS_BUILTIN_BSWAP32
|
||||||
#define SDL_Swap32(x) __builtin_bswap32(x)
|
#define SDL_Swap32(x) __builtin_bswap32(x)
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||||
#pragma intrinsic(_byteswap_ulong)
|
#pragma intrinsic(_byteswap_ulong)
|
||||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
#define SDL_Swap32(x) _byteswap_ulong(x)
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||||
@@ -241,7 +241,7 @@ SDL_Swap32(Uint32 x)
|
|||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP64
|
#if HAS_BUILTIN_BSWAP64
|
||||||
#define SDL_Swap64(x) __builtin_bswap64(x)
|
#define SDL_Swap64(x) __builtin_bswap64(x)
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||||
#pragma intrinsic(_byteswap_uint64)
|
#pragma intrinsic(_byteswap_uint64)
|
||||||
#define SDL_Swap64(x) _byteswap_uint64(x)
|
#define SDL_Swap64(x) _byteswap_uint64(x)
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -724,10 +724,10 @@ typedef enum
|
|||||||
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
||||||
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
||||||
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
|
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
|
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
|
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
|
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
||||||
SDL_CONTROLLER_BUTTON_MAX
|
SDL_CONTROLLER_BUTTON_MAX
|
||||||
} SDL_GameControllerButton;
|
} SDL_GameControllerButton;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -377,6 +377,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
|
#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable that controls whether the on-screen keyboard should be shown when text input is active
|
||||||
|
*
|
||||||
|
* The variable can be set to the following values:
|
||||||
|
* "0" - Do not show the on-screen keyboard
|
||||||
|
* "1" - Show the on-screen keyboard
|
||||||
|
*
|
||||||
|
* The default value is "1". This hint must be set before text input is activated.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
|
* \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
|
||||||
*
|
*
|
||||||
@@ -1310,6 +1321,8 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* This variable can be one of the following values:
|
* This variable can be one of the following values:
|
||||||
* "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
|
* "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
|
||||||
|
*
|
||||||
|
* Since SDL 2.0.22 this variable accepts a comma-separated list of values above.
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION"
|
#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION"
|
||||||
|
|
||||||
@@ -1954,6 +1967,28 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Controls whether menus can be opened with their keyboard shortcut (Alt+mnemonic).
|
||||||
|
*
|
||||||
|
* If the mnemonics are enabled, then menus can be opened by pressing the Alt
|
||||||
|
* key and the corresponding mnemonic (for example, Alt+F opens the File menu).
|
||||||
|
* However, in case an invalid mnemonic is pressed, Windows makes an audible
|
||||||
|
* beep to convey that nothing happened. This is true even if the window has
|
||||||
|
* no menu at all!
|
||||||
|
*
|
||||||
|
* Because most SDL applications don't have menus, and some want to use the Alt
|
||||||
|
* key for other purposes, SDL disables mnemonics (and the beeping) by default.
|
||||||
|
*
|
||||||
|
* Note: This also affects keyboard events: with mnemonics enabled, when a
|
||||||
|
* menu is opened from the keyboard, you will not receive a KEYUP event for
|
||||||
|
* the mnemonic key, and *might* not receive one for Alt.
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Alt+mnemonic does nothing, no beeping. (default)
|
||||||
|
* "1" - Alt+mnemonic opens menus, invalid mnemonics produce a beep.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS "SDL_WINDOWS_ENABLE_MENU_MNEMONICS"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling whether the windows message loop is processed by SDL
|
* \brief A variable controlling whether the windows message loop is processed by SDL
|
||||||
*
|
*
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
#include "SDL_guid.h"
|
#include "SDL_guid.h"
|
||||||
|
#include "SDL_mutex.h"
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
@@ -66,6 +67,9 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* The joystick structure used to identify an SDL joystick
|
* The joystick structure used to identify an SDL joystick
|
||||||
*/
|
*/
|
||||||
|
#ifdef SDL_THREAD_SAFETY_ANALYSIS
|
||||||
|
extern SDL_mutex *SDL_joystick_lock;
|
||||||
|
#endif
|
||||||
struct _SDL_Joystick;
|
struct _SDL_Joystick;
|
||||||
typedef struct _SDL_Joystick SDL_Joystick;
|
typedef struct _SDL_Joystick SDL_Joystick;
|
||||||
|
|
||||||
@@ -131,7 +135,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.7.
|
* \since This function is available since SDL 2.0.7.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -146,7 +150,7 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.7.
|
* \since This function is available since SDL 2.0.7.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count the number of joysticks attached to the system.
|
* Count the number of joysticks attached to the system.
|
||||||
@@ -284,13 +288,12 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
|
|||||||
/**
|
/**
|
||||||
* Get the instance ID of a joystick.
|
* Get the instance ID of a joystick.
|
||||||
*
|
*
|
||||||
* This can be called before any joysticks are opened. If the index is out of
|
* This can be called before any joysticks are opened.
|
||||||
* range, this function will return -1.
|
|
||||||
*
|
*
|
||||||
* \param device_index the index of the joystick to query (the N'th joystick
|
* \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
|
* \returns the instance id of the selected joystick. If called on an invalid
|
||||||
* index, this function returns zero
|
* index, this function returns -1.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.6.
|
* \since This function is available since SDL 2.0.6.
|
||||||
*/
|
*/
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
* an SDLK_* constant for those keys that do not generate characters.
|
* an SDLK_* constant for those keys that do not generate characters.
|
||||||
*
|
*
|
||||||
* A special exception is the number keys at the top of the keyboard which
|
* A special exception is the number keys at the top of the keyboard which
|
||||||
* always map to SDLK_0...SDLK_9, regardless of layout.
|
* map to SDLK_0...SDLK_9 on AZERTY layouts.
|
||||||
*/
|
*/
|
||||||
typedef Sint32 SDL_Keycode;
|
typedef Sint32 SDL_Keycode;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user