mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-09 01:14:24 +02:00
Compare commits
642 Commits
release-3.
...
release-3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2999a4047 | ||
|
|
b42dbd8ecb | ||
|
|
b35ffa1f69 | ||
|
|
ab01c9f92a | ||
|
|
c991501120 | ||
|
|
ec65d10e07 | ||
|
|
c9b993f7b6 | ||
|
|
17c70ee0aa | ||
|
|
6d7bceb41d | ||
|
|
49955b3732 | ||
|
|
3d03699d2b | ||
|
|
c12b2e41cb | ||
|
|
bba304c0b4 | ||
|
|
814deb9438 | ||
|
|
f5e5f65889 | ||
|
|
65da64b0eb | ||
|
|
3588d09b1c | ||
|
|
5afbd85755 | ||
|
|
6034cf5cd8 | ||
|
|
cfc41248be | ||
|
|
d1d0a50751 | ||
|
|
aeca6a77cf | ||
|
|
a45a2368a7 | ||
|
|
888104f5ad | ||
|
|
ec1d66d4f6 | ||
|
|
4b0a1df21f | ||
|
|
bfe3abdc26 | ||
|
|
9b1843c8da | ||
|
|
12d8540800 | ||
|
|
15f1a26656 | ||
|
|
cb81c21f62 | ||
|
|
c3cb21a498 | ||
|
|
cd4aa78d9a | ||
|
|
1f216da1e6 | ||
|
|
99cbedd662 | ||
|
|
e8fbb7e820 | ||
|
|
7f84afa68b | ||
|
|
51786880f4 | ||
|
|
e0050c3a9f | ||
|
|
0ca7052345 | ||
|
|
bcdb3eddcc | ||
|
|
057634d069 | ||
|
|
eb5eb4a33d | ||
|
|
df145a9649 | ||
|
|
b8618dd405 | ||
|
|
ddb497e815 | ||
|
|
6a42180dbf | ||
|
|
223a3dc461 | ||
|
|
13373ef501 | ||
|
|
a7de0d9a3e | ||
|
|
7f3ae3d574 | ||
|
|
80f82acdf8 | ||
|
|
78146bb14c | ||
|
|
c61f97dbce | ||
|
|
c823f837c0 | ||
|
|
f8252fcc91 | ||
|
|
98ed8b98b1 | ||
|
|
5f5a73a8f6 | ||
|
|
50be2a7e56 | ||
|
|
4fdbac7207 | ||
|
|
8199076878 | ||
|
|
c49de41ef3 | ||
|
|
ad5681c45b | ||
|
|
daf76f1ff6 | ||
|
|
cdff4b2bb5 | ||
|
|
d3a1a97db8 | ||
|
|
962464629d | ||
|
|
3291c2e560 | ||
|
|
b797a84b5d | ||
|
|
45b0460019 | ||
|
|
5d0919855e | ||
|
|
6d2d283954 | ||
|
|
49db06b604 | ||
|
|
85012b6074 | ||
|
|
14271c72f3 | ||
|
|
d73922e407 | ||
|
|
c8d23a5f01 | ||
|
|
4d8c8cdeda | ||
|
|
148d8c4995 | ||
|
|
4ae517e24e | ||
|
|
1fd4703907 | ||
|
|
024221d448 | ||
|
|
bfe046b60f | ||
|
|
1bfa90cb1f | ||
|
|
0c2e3308a5 | ||
|
|
11fc77b704 | ||
|
|
28af0d58c6 | ||
|
|
bca544448f | ||
|
|
badbf8da4e | ||
|
|
b140291cd0 | ||
|
|
70b12c1b1b | ||
|
|
2bbd74b4b6 | ||
|
|
add176e538 | ||
|
|
86384afbcf | ||
|
|
328f833d51 | ||
|
|
a002a6313e | ||
|
|
4fc5405f16 | ||
|
|
16d9f7316f | ||
|
|
95977f41b7 | ||
|
|
3302162ede | ||
|
|
29f857fed6 | ||
|
|
492ed877ea | ||
|
|
b1959ecf23 | ||
|
|
928454cbfe | ||
|
|
36b306a36c | ||
|
|
92570af7d3 | ||
|
|
5a9050aea3 | ||
|
|
3d9f4c3328 | ||
|
|
04ceb2d4a0 | ||
|
|
e6987e2452 | ||
|
|
4cd6df1997 | ||
|
|
9163913305 | ||
|
|
b3f4ba0725 | ||
|
|
354bda8dde | ||
|
|
8ccbfdf368 | ||
|
|
19b646849c | ||
|
|
48a83d69cc | ||
|
|
ec682cc794 | ||
|
|
d2d655b41f | ||
|
|
d6021b7d89 | ||
|
|
8dcb6db823 | ||
|
|
d0cfcf10bb | ||
|
|
dd791f6838 | ||
|
|
988714beb9 | ||
|
|
78756540cb | ||
|
|
205b5c9f44 | ||
|
|
bca30aafed | ||
|
|
840d5c16d2 | ||
|
|
25b9a686b0 | ||
|
|
54c2f2c3f7 | ||
|
|
b9cf5f08db | ||
|
|
c7a36fa3c9 | ||
|
|
73ca5f53e7 | ||
|
|
2be2fb4918 | ||
|
|
fec1dd4a8b | ||
|
|
2a3a8f736c | ||
|
|
d3aff13aa3 | ||
|
|
54fb312a2c | ||
|
|
20aa0ad1c5 | ||
|
|
ff667d35f2 | ||
|
|
ff9599fb7e | ||
|
|
0448f20394 | ||
|
|
db07924104 | ||
|
|
e60acdc477 | ||
|
|
d69f658835 | ||
|
|
3eb9328d3e | ||
|
|
a8589a8422 | ||
|
|
0bdaaf6c76 | ||
|
|
390197d3aa | ||
|
|
9fafba49dc | ||
|
|
5d47efe7fb | ||
|
|
824234accc | ||
|
|
6519158ae5 | ||
|
|
00718d60d2 | ||
|
|
18c2e179ee | ||
|
|
21ae008fc2 | ||
|
|
97a8bb44e6 | ||
|
|
5d33fce898 | ||
|
|
bb5df96f69 | ||
|
|
12b97944f3 | ||
|
|
0f17fbe1ca | ||
|
|
c3480ca99c | ||
|
|
936d94c2ee | ||
|
|
6cb55ebd46 | ||
|
|
482c5130eb | ||
|
|
066bcc5204 | ||
|
|
21baa27bea | ||
|
|
93fd4a1c80 | ||
|
|
7135779599 | ||
|
|
62c151d044 | ||
|
|
11d38fc23b | ||
|
|
d027f0ae6e | ||
|
|
44290c204e | ||
|
|
0b69860af6 | ||
|
|
e7a1ae0ea5 | ||
|
|
7af36d6c40 | ||
|
|
d1ae1163dd | ||
|
|
b2cf5729b4 | ||
|
|
11b8dd76db | ||
|
|
56507a6122 | ||
|
|
8d4324cba2 | ||
|
|
35408a2126 | ||
|
|
e5b9dfd181 | ||
|
|
e8a5d07e5e | ||
|
|
8c1daf0caf | ||
|
|
ad2b211f75 | ||
|
|
414ae344af | ||
|
|
71af2c020c | ||
|
|
e755f50072 | ||
|
|
a0b8275e9c | ||
|
|
ea362839b1 | ||
|
|
e7dd5d841b | ||
|
|
5594d03da0 | ||
|
|
f2ae66b64f | ||
|
|
393d99338f | ||
|
|
4d88280931 | ||
|
|
e8cc359b5e | ||
|
|
3b4a198655 | ||
|
|
03dd1520a3 | ||
|
|
a6fd74fa3b | ||
|
|
03b36bac94 | ||
|
|
a96677bdf6 | ||
|
|
67f89d0a2b | ||
|
|
f6de8877ec | ||
|
|
7c189b1f17 | ||
|
|
a7947080c0 | ||
|
|
08c82a3781 | ||
|
|
589aea50c2 | ||
|
|
72acd7c9df | ||
|
|
1a70d1158e | ||
|
|
ae915c6516 | ||
|
|
54d573332e | ||
|
|
0204a69f6b | ||
|
|
b2689ff76a | ||
|
|
611940fb80 | ||
|
|
16c0329a2a | ||
|
|
2743716132 | ||
|
|
a744eee993 | ||
|
|
0e24267eb5 | ||
|
|
f4d6043aa4 | ||
|
|
9fb9bd31a3 | ||
|
|
c3828bb0a3 | ||
|
|
40371f0907 | ||
|
|
94f9434564 | ||
|
|
bfaf247d30 | ||
|
|
2287c43b59 | ||
|
|
15cc0f5f91 | ||
|
|
68e0108b1c | ||
|
|
7b3796bc39 | ||
|
|
b5bc6d2cc4 | ||
|
|
0d1d4ea1f9 | ||
|
|
1a48f897f2 | ||
|
|
2b42789de6 | ||
|
|
b9c1da10ba | ||
|
|
56f5a76696 | ||
|
|
c7e8977e60 | ||
|
|
e6ba3612db | ||
|
|
5e77fb314c | ||
|
|
1a2841deb1 | ||
|
|
688637eca8 | ||
|
|
85d1d70ca1 | ||
|
|
09356c709a | ||
|
|
07b9e86d02 | ||
|
|
8e46e5d8b4 | ||
|
|
96292a5b46 | ||
|
|
ffa618c00b | ||
|
|
291b9b3c82 | ||
|
|
ec45117f0f | ||
|
|
0d7aff9c56 | ||
|
|
d31b239288 | ||
|
|
b1cadf0e99 | ||
|
|
c1f67585e6 | ||
|
|
93988e28c0 | ||
|
|
edef6e66e9 | ||
|
|
e3f47809c4 | ||
|
|
f759e7ac59 | ||
|
|
544eb2c5a9 | ||
|
|
30e3eba20a | ||
|
|
f0e85a2a9c | ||
|
|
106af5b46a | ||
|
|
522716ed90 | ||
|
|
a65fbb0211 | ||
|
|
46ec859bd1 | ||
|
|
2a7aa4eae4 | ||
|
|
c31ddf021e | ||
|
|
eaa2a8239f | ||
|
|
d313ecb737 | ||
|
|
64b2af0340 | ||
|
|
58d0702948 | ||
|
|
707717e94b | ||
|
|
a140bba55a | ||
|
|
f4ddacacd0 | ||
|
|
ebba656bdb | ||
|
|
b78c61d67a | ||
|
|
4210aa61e1 | ||
|
|
d8a345d924 | ||
|
|
b8dc9767da | ||
|
|
1ab01b9367 | ||
|
|
ee371ff740 | ||
|
|
ef58dd77ca | ||
|
|
e6a7121904 | ||
|
|
a6ed8ab59d | ||
|
|
bd40d0ded1 | ||
|
|
68bfcb6c54 | ||
|
|
0d01efca52 | ||
|
|
0e65e04ce1 | ||
|
|
58d351fe98 | ||
|
|
9b71f18141 | ||
|
|
554f08bac3 | ||
|
|
913813a933 | ||
|
|
4e34c771e4 | ||
|
|
9995174e68 | ||
|
|
5a0197d430 | ||
|
|
4a55143e15 | ||
|
|
87c9bc1b1f | ||
|
|
16a57b70f7 | ||
|
|
69564cd0b1 | ||
|
|
da648b00e7 | ||
|
|
5886d90308 | ||
|
|
e84df0cad1 | ||
|
|
e482904111 | ||
|
|
b8ee44ca6a | ||
|
|
4a4abe4240 | ||
|
|
fe47f5cc30 | ||
|
|
5b64be0810 | ||
|
|
17656d051b | ||
|
|
233fce456a | ||
|
|
5290bb036c | ||
|
|
2bff72b4f6 | ||
|
|
08ebeaee5c | ||
|
|
12b56f5447 | ||
|
|
165b86e7b7 | ||
|
|
608101a185 | ||
|
|
554bee6aae | ||
|
|
3e0ce51067 | ||
|
|
7261c43342 | ||
|
|
ad57c6ea37 | ||
|
|
caecff650d | ||
|
|
f6300be4b2 | ||
|
|
bde5687a3c | ||
|
|
0f3504f78d | ||
|
|
0aaa0321cc | ||
|
|
caaaf52583 | ||
|
|
56449f167d | ||
|
|
c7325228dc | ||
|
|
079967afa5 | ||
|
|
2ed55b614c | ||
|
|
28721e3cd2 | ||
|
|
9d9845d063 | ||
|
|
a96dc76831 | ||
|
|
ad8e517227 | ||
|
|
8d578d590f | ||
|
|
6b4a211374 | ||
|
|
55b023c961 | ||
|
|
e2d0fe3e2f | ||
|
|
6b56ff7a97 | ||
|
|
67f796ebde | ||
|
|
06da7490fc | ||
|
|
af83c442d3 | ||
|
|
d726e98596 | ||
|
|
c9a6709bd2 | ||
|
|
25816bea41 | ||
|
|
e0f6e96da0 | ||
|
|
57de46ae7e | ||
|
|
59693c8996 | ||
|
|
f0efffc093 | ||
|
|
1b41cd759c | ||
|
|
d42a1402e8 | ||
|
|
5c44678d55 | ||
|
|
0638fd58ce | ||
|
|
cb662b6730 | ||
|
|
e874c7515e | ||
|
|
2ba797576b | ||
|
|
180b454d61 | ||
|
|
6ce7ae77b1 | ||
|
|
abbaf95cf0 | ||
|
|
1081b70951 | ||
|
|
4f51f956ad | ||
|
|
b076f4b590 | ||
|
|
91180f8cb4 | ||
|
|
99aa859362 | ||
|
|
31267feb03 | ||
|
|
6a5bac72cb | ||
|
|
2ed5062950 | ||
|
|
0b0b02c5a1 | ||
|
|
28c71368a1 | ||
|
|
25bd4285ab | ||
|
|
180171cad6 | ||
|
|
bc3eeecf7f | ||
|
|
9178d14519 | ||
|
|
6cd35f5b72 | ||
|
|
72d5eb0ecb | ||
|
|
5cf924420d | ||
|
|
290574e6f6 | ||
|
|
d9db975b4b | ||
|
|
e5c0e5efa7 | ||
|
|
26a1aae098 | ||
|
|
ab114490fc | ||
|
|
9546c54286 | ||
|
|
4d3cdb70b5 | ||
|
|
a66816a72f | ||
|
|
c925f72562 | ||
|
|
ef97329f41 | ||
|
|
195f709eda | ||
|
|
eb57d94ec5 | ||
|
|
d6212ae839 | ||
|
|
b494897b3d | ||
|
|
559d4415eb | ||
|
|
49e9134774 | ||
|
|
9571b0ece8 | ||
|
|
b55cfaf90b | ||
|
|
509168856f | ||
|
|
24fa2722c3 | ||
|
|
142700f909 | ||
|
|
f3611681df | ||
|
|
7f0a5d6a10 | ||
|
|
2001cc15d5 | ||
|
|
8d604353a5 | ||
|
|
8410e11ecb | ||
|
|
9f8161bf4a | ||
|
|
c038d6f7f8 | ||
|
|
2fff37fffc | ||
|
|
6feb86be71 | ||
|
|
ed22220bc6 | ||
|
|
219cb1a59d | ||
|
|
71bd25a893 | ||
|
|
01ef4c46a1 | ||
|
|
64f728ec48 | ||
|
|
ba10adf1fb | ||
|
|
c18aa99358 | ||
|
|
3498412611 | ||
|
|
8c1b3ff210 | ||
|
|
1870052af6 | ||
|
|
3b1e3d5176 | ||
|
|
cdf26c6e97 | ||
|
|
9f1a1405a6 | ||
|
|
6e97d8d1b3 | ||
|
|
9d9a24d325 | ||
|
|
0897f4a7d1 | ||
|
|
5aec645191 | ||
|
|
07c33068f3 | ||
|
|
d684e5d57e | ||
|
|
219500d95c | ||
|
|
810addf7ae | ||
|
|
4ef077ca52 | ||
|
|
7d2275c4dc | ||
|
|
cbd8917047 | ||
|
|
c98a19401c | ||
|
|
434836c480 | ||
|
|
50d02ad732 | ||
|
|
5ac37a8ffc | ||
|
|
7dd2915475 | ||
|
|
0ae1ddee17 | ||
|
|
db4c7e47f1 | ||
|
|
362445460e | ||
|
|
de5cb9db23 | ||
|
|
418eab29eb | ||
|
|
2f3d242183 | ||
|
|
4ad6d18203 | ||
|
|
cd4a4f8a9f | ||
|
|
a96e72da02 | ||
|
|
337f012de2 | ||
|
|
3c29b620e4 | ||
|
|
579fc161f0 | ||
|
|
22e968af4e | ||
|
|
e37e96cfff | ||
|
|
56c76c20a0 | ||
|
|
efd812c399 | ||
|
|
b2b92bbe25 | ||
|
|
a29c67ac94 | ||
|
|
f88e0aaac0 | ||
|
|
29a4a4a5d1 | ||
|
|
01000c73b0 | ||
|
|
1a5d1dfef0 | ||
|
|
2c38143834 | ||
|
|
c56a1c664c | ||
|
|
41cae64580 | ||
|
|
c6dd2662c3 | ||
|
|
f48027cf12 | ||
|
|
fabbc8d183 | ||
|
|
a142e5ef7d | ||
|
|
825c0c7691 | ||
|
|
dc30a00a26 | ||
|
|
5a05ef01ad | ||
|
|
0237997e4d | ||
|
|
4f90432a49 | ||
|
|
0cd6942bfc | ||
|
|
1beb6fdedf | ||
|
|
3b4472ecf7 | ||
|
|
faed8b620c | ||
|
|
982b778e45 | ||
|
|
3a8f1cb7c5 | ||
|
|
3c2d7ecdd6 | ||
|
|
0834f1d6ce | ||
|
|
6ce446b768 | ||
|
|
e045edb567 | ||
|
|
6cd14660cf | ||
|
|
f5ac58c9f4 | ||
|
|
c1779ca4a5 | ||
|
|
6d8309f72e | ||
|
|
cf95db46a7 | ||
|
|
b8abfeb7f3 | ||
|
|
014e24e1a8 | ||
|
|
e42071a47c | ||
|
|
1543f523b7 | ||
|
|
f2d0e965fc | ||
|
|
f782278d20 | ||
|
|
3b17d08eb2 | ||
|
|
18d367afd2 | ||
|
|
9a4faf9ab9 | ||
|
|
cb0ba020d4 | ||
|
|
f705e2f9f7 | ||
|
|
e76bffa183 | ||
|
|
a4e19dc567 | ||
|
|
4e1282617a | ||
|
|
f102ff16a2 | ||
|
|
50935a9d41 | ||
|
|
a1dde664d1 | ||
|
|
ba5325fba1 | ||
|
|
e225a10ea8 | ||
|
|
c4fba75a12 | ||
|
|
5b052e6f8c | ||
|
|
d89c3489f8 | ||
|
|
a447863e4f | ||
|
|
34db21cea8 | ||
|
|
943226edc1 | ||
|
|
281494676a | ||
|
|
413b55deb7 | ||
|
|
8222513f63 | ||
|
|
2dd20ce8e7 | ||
|
|
d308df6d62 | ||
|
|
f51b88e6b5 | ||
|
|
7cb0fa5c56 | ||
|
|
976c92a2fb | ||
|
|
15db51d7ff | ||
|
|
4aa4e6a18e | ||
|
|
0759f22a91 | ||
|
|
02036ee643 | ||
|
|
9109e05f3f | ||
|
|
2103451d00 | ||
|
|
b6db091d60 | ||
|
|
9827653c38 | ||
|
|
877399b2b2 | ||
|
|
3f059376ac | ||
|
|
30a6d01cc5 | ||
|
|
b6fb47aa70 | ||
|
|
7ecae856e5 | ||
|
|
5db7694f22 | ||
|
|
366294e1c5 | ||
|
|
4d966ff546 | ||
|
|
6b665066f0 | ||
|
|
519011f271 | ||
|
|
5c224a3221 | ||
|
|
4b8c38e7ba | ||
|
|
16f6c1058c | ||
|
|
7939309520 | ||
|
|
cec6073085 | ||
|
|
a9f121f3f7 | ||
|
|
361218ce15 | ||
|
|
04dcfada00 | ||
|
|
d73ad0ef18 | ||
|
|
a1b888f622 | ||
|
|
d6267afcb9 | ||
|
|
b8325be9cf | ||
|
|
e77ef86f09 | ||
|
|
951ba597ed | ||
|
|
ab5e178dab | ||
|
|
04dace6c75 | ||
|
|
013918cd83 | ||
|
|
996466e855 | ||
|
|
61e7878ac0 | ||
|
|
c067cb4e7d | ||
|
|
38697dd812 | ||
|
|
f03572335a | ||
|
|
d8837edfa2 | ||
|
|
e5f8043037 | ||
|
|
134b57f6f5 | ||
|
|
072e760197 | ||
|
|
d37a3e2a71 | ||
|
|
ed8e7e85f0 | ||
|
|
eb9faad124 | ||
|
|
3ed80843fe | ||
|
|
4029521a63 | ||
|
|
f971a59746 | ||
|
|
5836266bfb | ||
|
|
ed893bde04 | ||
|
|
a934a36a18 | ||
|
|
59857acd08 | ||
|
|
8129b637f3 | ||
|
|
9e1675671d | ||
|
|
d39d951f89 | ||
|
|
10ed6f49a9 | ||
|
|
c2c848a752 | ||
|
|
8b191c3ca6 | ||
|
|
06a412cd68 | ||
|
|
b74609d5f3 | ||
|
|
d8756582f9 | ||
|
|
ff90984dc3 | ||
|
|
81952f9f96 | ||
|
|
d0122ff624 | ||
|
|
7a36aa37aa | ||
|
|
464cb0ab6e | ||
|
|
ac21e3ef3f | ||
|
|
a5b51669fb | ||
|
|
0ac030549b | ||
|
|
6f1afe7084 | ||
|
|
6302589829 | ||
|
|
3225d31679 | ||
|
|
ae05ab280d | ||
|
|
51a6cb2cf5 | ||
|
|
daf468e141 | ||
|
|
cd673c8254 | ||
|
|
3f13c0b36d | ||
|
|
3e34720851 | ||
|
|
0799237d74 | ||
|
|
53f64e40c4 | ||
|
|
a530df20b2 | ||
|
|
b958189c92 | ||
|
|
341f910835 | ||
|
|
84dff407d4 | ||
|
|
21e6c5814c | ||
|
|
776f0a685c | ||
|
|
9f32fafe21 | ||
|
|
74b3b8e9e3 | ||
|
|
fa4a9ba74e | ||
|
|
9a6f8a2512 | ||
|
|
1173bc2dde | ||
|
|
ada55bd887 | ||
|
|
fe97cff7d1 | ||
|
|
8cdeb1a35a | ||
|
|
7c82171a85 | ||
|
|
2d2085c80b | ||
|
|
03a4eea0ef | ||
|
|
fec3e2cd45 | ||
|
|
2aec1c2ef6 | ||
|
|
b32cd4f84b | ||
|
|
550bdc658a | ||
|
|
d75ba9c2d2 | ||
|
|
2477f7f982 | ||
|
|
e454d7d4be | ||
|
|
cd8bffb2dd | ||
|
|
9646e3cc1b | ||
|
|
1a2362ebf1 | ||
|
|
f6864924f7 | ||
|
|
6b3dafa4d3 | ||
|
|
5c0c5d2816 | ||
|
|
de11dd3d60 | ||
|
|
ac09af2600 | ||
|
|
26d1afa29c | ||
|
|
6aab3b9da8 | ||
|
|
d959719a3d | ||
|
|
5a7b17fec5 | ||
|
|
1d6bb62870 | ||
|
|
0c3603d893 | ||
|
|
38a5bca892 | ||
|
|
70a289076a | ||
|
|
1d0ecf982f | ||
|
|
18d93d11e1 | ||
|
|
110a832f5c | ||
|
|
6a9e970880 | ||
|
|
4e3058ce82 | ||
|
|
bc6307a872 |
66
.github/workflows/create-test-plan.py
vendored
66
.github/workflows/create-test-plan.py
vendored
@@ -20,7 +20,6 @@ class AppleArch(Enum):
|
|||||||
class MsvcArch(Enum):
|
class MsvcArch(Enum):
|
||||||
X86 = "x86"
|
X86 = "x86"
|
||||||
X64 = "x64"
|
X64 = "x64"
|
||||||
Arm32 = "arm"
|
|
||||||
Arm64 = "arm64"
|
Arm64 = "arm64"
|
||||||
|
|
||||||
|
|
||||||
@@ -31,7 +30,9 @@ class JobOs(Enum):
|
|||||||
Ubuntu22_04 = "ubuntu-22.04"
|
Ubuntu22_04 = "ubuntu-22.04"
|
||||||
Ubuntu24_04 = "ubuntu-24.04"
|
Ubuntu24_04 = "ubuntu-24.04"
|
||||||
Ubuntu24_04_arm = "ubuntu-24.04-arm"
|
Ubuntu24_04_arm = "ubuntu-24.04-arm"
|
||||||
Macos13 = "macos-13"
|
Macos14 = "macos-14" # macOS Sonoma (2023)
|
||||||
|
Macos15 = "macos-15" # macOS Sequoia (2024)
|
||||||
|
Macos26 = "macos-26" # macOS Tahoe (2025)
|
||||||
|
|
||||||
|
|
||||||
class SdlPlatform(Enum):
|
class SdlPlatform(Enum):
|
||||||
@@ -54,6 +55,7 @@ class SdlPlatform(Enum):
|
|||||||
Riscos = "riscos"
|
Riscos = "riscos"
|
||||||
FreeBSD = "freebsd"
|
FreeBSD = "freebsd"
|
||||||
NetBSD = "netbsd"
|
NetBSD = "netbsd"
|
||||||
|
OpenBSD = "openbsd"
|
||||||
|
|
||||||
|
|
||||||
class Msys2Platform(Enum):
|
class Msys2Platform(Enum):
|
||||||
@@ -108,7 +110,6 @@ JOB_SPECS = {
|
|||||||
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
|
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
|
||||||
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
|
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
|
||||||
"msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ),
|
"msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ),
|
||||||
"msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ),
|
|
||||||
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
|
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
|
||||||
"msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ),
|
"msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ),
|
||||||
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ),
|
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ),
|
||||||
@@ -116,7 +117,7 @@ JOB_SPECS = {
|
|||||||
"steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ),
|
"steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ),
|
||||||
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
|
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
|
||||||
"ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ),
|
"ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ),
|
||||||
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos13, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
|
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos14, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
|
||||||
"macos-framework-arm64": JobSpec(name="MacOS (Framework) (arm64)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact=None, apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, ),
|
"macos-framework-arm64": JobSpec(name="MacOS (Framework) (arm64)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact=None, apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, ),
|
||||||
"macos-gnu-arm64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-gnu", apple_framework=False, apple_archs={AppleArch.Aarch64, }, ),
|
"macos-gnu-arm64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-gnu", apple_framework=False, apple_archs={AppleArch.Aarch64, }, ),
|
||||||
"ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ),
|
"ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ),
|
||||||
@@ -137,6 +138,7 @@ JOB_SPECS = {
|
|||||||
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
|
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
|
||||||
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
|
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
|
||||||
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
|
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
|
||||||
|
"openbsd": JobSpec(name="OpenBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.OpenBSD, artifact="SDL-openbsd-x64", ),
|
||||||
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
|
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,6 +176,7 @@ class JobDetails:
|
|||||||
brew_packages: list[str] = dataclasses.field(default_factory=list)
|
brew_packages: list[str] = dataclasses.field(default_factory=list)
|
||||||
cmake_toolchain_file: str = ""
|
cmake_toolchain_file: str = ""
|
||||||
cmake_arguments: list[str] = dataclasses.field(default_factory=list)
|
cmake_arguments: list[str] = dataclasses.field(default_factory=list)
|
||||||
|
cmake_generator: str = "Ninja"
|
||||||
cmake_build_arguments: list[str] = dataclasses.field(default_factory=list)
|
cmake_build_arguments: list[str] = dataclasses.field(default_factory=list)
|
||||||
clang_tidy: bool = True
|
clang_tidy: bool = True
|
||||||
cppflags: list[str] = dataclasses.field(default_factory=list)
|
cppflags: list[str] = dataclasses.field(default_factory=list)
|
||||||
@@ -201,8 +204,7 @@ class JobDetails:
|
|||||||
minidump: bool = False
|
minidump: bool = False
|
||||||
intel: bool = False
|
intel: bool = False
|
||||||
msys2_msystem: str = ""
|
msys2_msystem: str = ""
|
||||||
msys2_env: str = ""
|
msys2_packages: list[str] = dataclasses.field(default_factory=list)
|
||||||
msys2_no_perl: bool = False
|
|
||||||
werror: bool = True
|
werror: bool = True
|
||||||
msvc_vcvars_arch: str = ""
|
msvc_vcvars_arch: str = ""
|
||||||
msvc_vcvars_sdk: str = ""
|
msvc_vcvars_sdk: str = ""
|
||||||
@@ -222,6 +224,7 @@ class JobDetails:
|
|||||||
check_sources: bool = False
|
check_sources: bool = False
|
||||||
setup_python: bool = False
|
setup_python: bool = False
|
||||||
pypi_packages: list[str] = dataclasses.field(default_factory=list)
|
pypi_packages: list[str] = dataclasses.field(default_factory=list)
|
||||||
|
binutils_strings: str = "strings"
|
||||||
|
|
||||||
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
|
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
|
||||||
data = {
|
data = {
|
||||||
@@ -235,8 +238,7 @@ class JobDetails:
|
|||||||
"enable-artifacts": enable_artifacts,
|
"enable-artifacts": enable_artifacts,
|
||||||
"shell": self.shell,
|
"shell": self.shell,
|
||||||
"msys2-msystem": self.msys2_msystem,
|
"msys2-msystem": self.msys2_msystem,
|
||||||
"msys2-env": self.msys2_env,
|
"msys2-packages": my_shlex_join(self.msys2_packages),
|
||||||
"msys2-no-perl": self.msys2_no_perl,
|
|
||||||
"android-ndk": self.android_ndk,
|
"android-ndk": self.android_ndk,
|
||||||
"java": self.java,
|
"java": self.java,
|
||||||
"intel": self.intel,
|
"intel": self.intel,
|
||||||
@@ -255,6 +257,7 @@ class JobDetails:
|
|||||||
"cflags": my_shlex_join(self.cppflags + self.cflags),
|
"cflags": my_shlex_join(self.cppflags + self.cflags),
|
||||||
"cxxflags": my_shlex_join(self.cppflags + self.cxxflags),
|
"cxxflags": my_shlex_join(self.cppflags + self.cxxflags),
|
||||||
"ldflags": my_shlex_join(self.ldflags),
|
"ldflags": my_shlex_join(self.ldflags),
|
||||||
|
"cmake-generator": self.cmake_generator,
|
||||||
"cmake-toolchain-file": self.cmake_toolchain_file,
|
"cmake-toolchain-file": self.cmake_toolchain_file,
|
||||||
"clang-tidy": self.clang_tidy,
|
"clang-tidy": self.clang_tidy,
|
||||||
"cmake-arguments": my_shlex_join(self.cmake_arguments),
|
"cmake-arguments": my_shlex_join(self.cmake_arguments),
|
||||||
@@ -289,6 +292,7 @@ class JobDetails:
|
|||||||
"check-sources": self.check_sources,
|
"check-sources": self.check_sources,
|
||||||
"setup-python": self.setup_python,
|
"setup-python": self.setup_python,
|
||||||
"pypi-packages": my_shlex_join(self.pypi_packages),
|
"pypi-packages": my_shlex_join(self.pypi_packages),
|
||||||
|
"binutils-strings": self.binutils_strings,
|
||||||
}
|
}
|
||||||
return {k: v for k, v in data.items() if v != ""}
|
return {k: v for k, v in data.items() if v != ""}
|
||||||
|
|
||||||
@@ -403,10 +407,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
job.msvc_vcvars_arch = "x64_x86"
|
job.msvc_vcvars_arch = "x64_x86"
|
||||||
case MsvcArch.X64:
|
case MsvcArch.X64:
|
||||||
job.msvc_vcvars_arch = "x64"
|
job.msvc_vcvars_arch = "x64"
|
||||||
case MsvcArch.Arm32:
|
|
||||||
job.msvc_vcvars_arch = "x64_arm"
|
|
||||||
job.msvc_vcvars_sdk = "10.0.22621.0" # 10.0.26100.0 dropped ARM32 um and ucrt libraries
|
|
||||||
job.run_tests = False
|
|
||||||
case MsvcArch.Arm64:
|
case MsvcArch.Arm64:
|
||||||
job.msvc_vcvars_arch = "x64_arm64"
|
job.msvc_vcvars_arch = "x64_arm64"
|
||||||
job.run_tests = False
|
job.run_tests = False
|
||||||
@@ -514,9 +514,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
job.ccache = True
|
job.ccache = True
|
||||||
job.apt_packages = []
|
job.apt_packages = []
|
||||||
job.brew_packages.extend((
|
job.brew_packages.extend((
|
||||||
"ccache",
|
|
||||||
"ninja",
|
"ninja",
|
||||||
))
|
))
|
||||||
|
if job.ccache:
|
||||||
|
job.brew_packages.append("ccache")
|
||||||
if job.clang_tidy:
|
if job.clang_tidy:
|
||||||
job.brew_packages.append("llvm")
|
job.brew_packages.append("llvm")
|
||||||
if spec.xcode:
|
if spec.xcode:
|
||||||
@@ -550,6 +551,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
"testmultiaudio-apk",
|
"testmultiaudio-apk",
|
||||||
"testsprite-apk",
|
"testsprite-apk",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# -fPIC is required after updating NDK from 21 to 28
|
||||||
|
job.cflags.append("-fPIC")
|
||||||
|
job.cxxflags.append("-fPIC")
|
||||||
case SdlPlatform.Emscripten:
|
case SdlPlatform.Emscripten:
|
||||||
job.clang_tidy = False # clang-tidy does not understand -gsource-map
|
job.clang_tidy = False # clang-tidy does not understand -gsource-map
|
||||||
job.shared = False
|
job.shared = False
|
||||||
@@ -675,28 +680,41 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
job.shared_lib = SharedLibType.SO_0
|
job.shared_lib = SharedLibType.SO_0
|
||||||
job.static_lib = StaticLibType.A
|
job.static_lib = StaticLibType.A
|
||||||
case SdlPlatform.N3ds:
|
case SdlPlatform.N3ds:
|
||||||
job.ccache = True
|
job.cmake_generator = "Unix Makefiles"
|
||||||
|
job.cmake_build_arguments.append("-j$(nproc)")
|
||||||
|
job.ccache = False
|
||||||
job.shared = False
|
job.shared = False
|
||||||
job.apt_packages = ["ccache", "ninja-build", "binutils"]
|
job.apt_packages = []
|
||||||
job.clang_tidy = False
|
job.clang_tidy = False
|
||||||
job.run_tests = False
|
job.run_tests = False
|
||||||
job.cc_from_cmake = True
|
job.cc_from_cmake = True
|
||||||
job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake"
|
job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake"
|
||||||
|
job.binutils_strings = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-strings"
|
||||||
job.static_lib = StaticLibType.A
|
job.static_lib = StaticLibType.A
|
||||||
case SdlPlatform.Msys2:
|
case SdlPlatform.Msys2:
|
||||||
job.ccache = True
|
job.ccache = True
|
||||||
job.shell = "msys2 {0}"
|
job.shell = "msys2 {0}"
|
||||||
assert spec.msys2_platform
|
assert spec.msys2_platform
|
||||||
job.msys2_msystem = spec.msys2_platform.value
|
job.msys2_msystem = spec.msys2_platform.value
|
||||||
job.msys2_env = {
|
job.shared_lib = SharedLibType.WIN32
|
||||||
|
job.static_lib = StaticLibType.A
|
||||||
|
msys2_env = {
|
||||||
"mingw32": "mingw-w64-i686",
|
"mingw32": "mingw-w64-i686",
|
||||||
"mingw64": "mingw-w64-x86_64",
|
"mingw64": "mingw-w64-x86_64",
|
||||||
"clang64": "mingw-w64-clang-x86_64",
|
"clang64": "mingw-w64-clang-x86_64",
|
||||||
"ucrt64": "mingw-w64-ucrt-x86_64",
|
"ucrt64": "mingw-w64-ucrt-x86_64",
|
||||||
}[spec.msys2_platform.value]
|
}[spec.msys2_platform.value]
|
||||||
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, )
|
job.msys2_packages.extend([
|
||||||
job.shared_lib = SharedLibType.WIN32
|
f"{msys2_env}-cc",
|
||||||
job.static_lib = StaticLibType.A
|
f"{msys2_env}-cmake",
|
||||||
|
f"{msys2_env}-ninja",
|
||||||
|
f"{msys2_env}-pkg-config",
|
||||||
|
])
|
||||||
|
if spec.msys2_platform not in (Msys2Platform.Mingw32, ):
|
||||||
|
job.msys2_packages.append(f"{msys2_env}-perl")
|
||||||
|
job.msys2_packages.append(f"{msys2_env}-clang-tools-extra")
|
||||||
|
if job.ccache:
|
||||||
|
job.msys2_packages.append(f"{msys2_env}-ccache")
|
||||||
case SdlPlatform.Riscos:
|
case SdlPlatform.Riscos:
|
||||||
job.ccache = False # FIXME: enable when container gets upgrade
|
job.ccache = False # FIXME: enable when container gets upgrade
|
||||||
# FIXME: Enable SDL_WERROR
|
# FIXME: Enable SDL_WERROR
|
||||||
@@ -713,7 +731,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
))
|
))
|
||||||
job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake"
|
job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake"
|
||||||
job.static_lib = StaticLibType.A
|
job.static_lib = StaticLibType.A
|
||||||
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD:
|
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD | SdlPlatform.OpenBSD:
|
||||||
job.cpactions = True
|
job.cpactions = True
|
||||||
job.no_cmake = True
|
job.no_cmake = True
|
||||||
job.run_tests = False
|
job.run_tests = False
|
||||||
@@ -723,7 +741,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
match spec.platform:
|
match spec.platform:
|
||||||
case SdlPlatform.FreeBSD:
|
case SdlPlatform.FreeBSD:
|
||||||
job.cpactions_os = "freebsd"
|
job.cpactions_os = "freebsd"
|
||||||
job.cpactions_version = "14.2"
|
job.cpactions_version = "14.3"
|
||||||
job.cpactions_arch = "x86-64"
|
job.cpactions_arch = "x86-64"
|
||||||
job.cpactions_setup_cmd = "sudo pkg update"
|
job.cpactions_setup_cmd = "sudo pkg update"
|
||||||
job.cpactions_install_cmd = "sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd"
|
job.cpactions_install_cmd = "sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd"
|
||||||
@@ -737,6 +755,12 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
|||||||
job.cpactions_arch = "x86-64"
|
job.cpactions_arch = "x86-64"
|
||||||
job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update"
|
job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update"
|
||||||
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
|
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
|
||||||
|
case SdlPlatform.OpenBSD:
|
||||||
|
job.cpactions_os = "openbsd"
|
||||||
|
job.cpactions_version = "7.7"
|
||||||
|
job.cpactions_arch = "x86-64"
|
||||||
|
job.cpactions_setup_cmd = "sudo pkg_add -u"
|
||||||
|
job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols libxkbcommon libinotify pulseaudio dbus ibus"
|
||||||
case _:
|
case _:
|
||||||
raise ValueError(f"Unsupported platform={spec.platform}")
|
raise ValueError(f"Unsupported platform={spec.platform}")
|
||||||
|
|
||||||
|
|||||||
31
.github/workflows/generic.yml
vendored
31
.github/workflows/generic.yml
vendored
@@ -27,14 +27,7 @@ jobs:
|
|||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
msystem: ${{ matrix.platform.msys2-msystem }}
|
msystem: ${{ matrix.platform.msys2-msystem }}
|
||||||
install: >-
|
install: ${{ matrix.platform.msys2-packages }}
|
||||||
${{ matrix.platform.msys2-env }}-cc
|
|
||||||
${{ matrix.platform.msys2-env }}-cmake
|
|
||||||
${{ matrix.platform.msys2-env }}-ninja
|
|
||||||
${{ (!matrix.platform.msys2-no-perl && format('{0}-perl', matrix.platform.msys2-env)) || '' }}
|
|
||||||
${{ matrix.platform.msys2-env }}-pkg-config
|
|
||||||
${{ matrix.platform.msys2-env }}-clang-tools-extra
|
|
||||||
${{ (matrix.platform.ccache && format('{0}-ccache', matrix.platform.msys2-env)) || '' }}
|
|
||||||
- name: 'About this job'
|
- name: 'About this job'
|
||||||
run: |
|
run: |
|
||||||
echo "key=${{ matrix.platform.key }}"
|
echo "key=${{ matrix.platform.key }}"
|
||||||
@@ -75,8 +68,8 @@ jobs:
|
|||||||
if: ${{ matrix.platform.android-ndk }}
|
if: ${{ matrix.platform.android-ndk }}
|
||||||
id: setup-ndk
|
id: setup-ndk
|
||||||
with:
|
with:
|
||||||
local-cache: true
|
local-cache: false
|
||||||
ndk-version: r21e
|
ndk-version: r28c
|
||||||
- name: 'Configure Android NDK variables'
|
- name: 'Configure Android NDK variables'
|
||||||
if: ${{ matrix.platform.android-ndk }}
|
if: ${{ matrix.platform.android-ndk }}
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -201,7 +194,7 @@ jobs:
|
|||||||
#shell: ${{ matrix.platform.shell }}
|
#shell: ${{ matrix.platform.shell }}
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.platform.source-cmd }}
|
${{ matrix.platform.source-cmd }}
|
||||||
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -GNinja \
|
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -G "${{ matrix.platform.cmake-generator }}" \
|
||||||
-Wdeprecated -Wdev -Werror \
|
-Wdeprecated -Wdev -Werror \
|
||||||
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
|
||||||
-DSDL_WERROR=${{ matrix.platform.werror }} \
|
-DSDL_WERROR=${{ matrix.platform.werror }} \
|
||||||
@@ -232,9 +225,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "This should show us the SDL_REVISION"
|
echo "This should show us the SDL_REVISION"
|
||||||
echo "Shared library:"
|
echo "Shared library:"
|
||||||
${{ (matrix.platform.shared-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
|
${{ (matrix.platform.shared-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
|
||||||
echo "Static library:"
|
echo "Static library:"
|
||||||
${{ (matrix.platform.static-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
|
${{ (matrix.platform.static-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
|
||||||
- name: 'Run build-time tests (CMake)'
|
- name: 'Run build-time tests (CMake)'
|
||||||
id: tests
|
id: tests
|
||||||
if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }}
|
if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }}
|
||||||
@@ -321,7 +314,7 @@ jobs:
|
|||||||
- name: 'Build (cross-platform-actions, BSD)'
|
- name: 'Build (cross-platform-actions, BSD)'
|
||||||
id: cpactions
|
id: cpactions
|
||||||
if: ${{ matrix.platform.cpactions }}
|
if: ${{ matrix.platform.cpactions }}
|
||||||
uses: cross-platform-actions/action@v0.27.0
|
uses: cross-platform-actions/action@v0.29.0
|
||||||
with:
|
with:
|
||||||
operating_system: '${{ matrix.platform.cpactions-os }}'
|
operating_system: '${{ matrix.platform.cpactions-os }}'
|
||||||
architecture: '${{ matrix.platform.cpactions-arch }}'
|
architecture: '${{ matrix.platform.cpactions-arch }}'
|
||||||
@@ -406,6 +399,14 @@ jobs:
|
|||||||
build-scripts/test-versioning.sh
|
build-scripts/test-versioning.sh
|
||||||
python build-scripts/check_android_jni.py
|
python build-scripts/check_android_jni.py
|
||||||
python build-scripts/check_stdlib_usage.py
|
python build-scripts/check_stdlib_usage.py
|
||||||
|
- name: 'Verify alignment of Android test apks'
|
||||||
|
if: ${{ matrix.platform.android-ndk && !matrix.platform.no-cmake }}
|
||||||
|
run: |
|
||||||
|
find ./ -iname '*.apk' | xargs -L1 ./build-scripts/check_elf_alignment.sh
|
||||||
|
- name: 'Verify alignment of Android .so files'
|
||||||
|
if: ${{ matrix.platform.android-ndk && !matrix.platform.no-cmake }}
|
||||||
|
run: |
|
||||||
|
find ./ -iname '*.so' | xargs -L1 ./build-scripts/check_elf_alignment.sh
|
||||||
- name: 'Upload binary package'
|
- name: 'Upload binary package'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }}
|
if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }}
|
||||||
@@ -428,4 +429,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
name: '${{ matrix.platform.artifact }}-apks'
|
name: '${{ matrix.platform.artifact }}-apks'
|
||||||
path: build/test/*.apk
|
path: build/test/*.apk
|
||||||
|
|||||||
77
.github/workflows/release.yml
vendored
77
.github/workflows/release.yml
vendored
@@ -95,9 +95,17 @@ jobs:
|
|||||||
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
||||||
- name: 'CMake (configure + build + tests + examples)'
|
- name: 'CMake (configure + build + tests + examples)'
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
|
cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
|
||||||
cmake --build /tmp/build --verbose
|
cmake --build /tmp/build --verbose
|
||||||
ctest --test-dir /tmp/build --no-tests=error --output-on-failure
|
ctest --test-dir /tmp/build --no-tests=error --output-on-failure
|
||||||
|
- name: 'Verify SDL_REVISION contains SDL-'
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
if test "x$(strings /tmp/build/libSDL3.so.0 | grep SDL- | grep -v SDL-tray | wc -l)" != x1; then
|
||||||
|
echo "SDL- string not found: must be present in SDL_REVISION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
dmg:
|
dmg:
|
||||||
needs: [src]
|
needs: [src]
|
||||||
@@ -204,10 +212,22 @@ jobs:
|
|||||||
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
|
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
|
||||||
-DCMAKE_SYSTEM_NAME=iOS \
|
-DCMAKE_SYSTEM_NAME=iOS \
|
||||||
-DCMAKE_OSX_ARCHITECTURES="arm64" \
|
-DCMAKE_OSX_ARCHITECTURES="arm64" \
|
||||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
||||||
-Werror=dev \
|
-Werror=dev \
|
||||||
-B build_ios
|
-B build_ios
|
||||||
cmake --build build_ios --config Release --verbose
|
cmake --build build_ios --config Release --verbose
|
||||||
|
|
||||||
|
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
||||||
|
-DTEST_FULL=FALSE \
|
||||||
|
-DTEST_STATIC=FALSE \
|
||||||
|
-DTEST_TEST=FALSE \
|
||||||
|
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/ios-arm64" \
|
||||||
|
-DCMAKE_SYSTEM_NAME=iOS \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES="arm64" \
|
||||||
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
||||||
|
-Werror=dev \
|
||||||
|
-B build_ios2
|
||||||
|
cmake --build build_ios2 --config Release --verbose
|
||||||
- name: 'CMake (configure + build) tvOS'
|
- name: 'CMake (configure + build) tvOS'
|
||||||
run: |
|
run: |
|
||||||
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
||||||
@@ -217,10 +237,22 @@ jobs:
|
|||||||
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
|
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
|
||||||
-DCMAKE_SYSTEM_NAME=tvOS \
|
-DCMAKE_SYSTEM_NAME=tvOS \
|
||||||
-DCMAKE_OSX_ARCHITECTURES="arm64" \
|
-DCMAKE_OSX_ARCHITECTURES="arm64" \
|
||||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
||||||
-Werror=dev \
|
-Werror=dev \
|
||||||
-B build_tvos
|
-B build_tvos
|
||||||
cmake --build build_tvos --config Release --verbose
|
cmake --build build_tvos --config Release --verbose
|
||||||
|
|
||||||
|
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
||||||
|
-DTEST_FULL=FALSE \
|
||||||
|
-DTEST_STATIC=FALSE \
|
||||||
|
-DTEST_TEST=FALSE \
|
||||||
|
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/tvos-arm64" \
|
||||||
|
-DCMAKE_SYSTEM_NAME=tvOS \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES="arm64" \
|
||||||
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
||||||
|
-Werror=dev \
|
||||||
|
-B build_tvos2
|
||||||
|
cmake --build build_tvos2 --config Release --verbose
|
||||||
- name: 'CMake (configure + build) iOS simulator'
|
- name: 'CMake (configure + build) iOS simulator'
|
||||||
run: |
|
run: |
|
||||||
sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
|
sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
|
||||||
@@ -237,6 +269,19 @@ jobs:
|
|||||||
-Werror=dev \
|
-Werror=dev \
|
||||||
-B build_ios_simulator
|
-B build_ios_simulator
|
||||||
cmake --build build_ios_simulator --config Release --verbose
|
cmake --build build_ios_simulator --config Release --verbose
|
||||||
|
|
||||||
|
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
||||||
|
-DTEST_FULL=FALSE \
|
||||||
|
-DTEST_STATIC=FALSE \
|
||||||
|
-DTEST_TEST=FALSE \
|
||||||
|
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/ios-arm64_x86_64-simulator" \
|
||||||
|
-DCMAKE_SYSTEM_NAME=iOS \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
|
||||||
|
-DCMAKE_OSX_SYSROOT="${sysroot}" \
|
||||||
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
||||||
|
-Werror=dev \
|
||||||
|
-B build_ios_simulator2
|
||||||
|
cmake --build build_ios_simulator2 --config Release --verbose
|
||||||
- name: 'CMake (configure + build) tvOS simulator'
|
- name: 'CMake (configure + build) tvOS simulator'
|
||||||
run: |
|
run: |
|
||||||
sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
|
sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
|
||||||
@@ -254,9 +299,22 @@ jobs:
|
|||||||
-B build_tvos_simulator
|
-B build_tvos_simulator
|
||||||
cmake --build build_tvos_simulator --config Release --verbose
|
cmake --build build_tvos_simulator --config Release --verbose
|
||||||
|
|
||||||
|
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
|
||||||
|
-DTEST_FULL=FALSE \
|
||||||
|
-DTEST_STATIC=FALSE \
|
||||||
|
-DTEST_TEST=FALSE \
|
||||||
|
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/tvos-arm64_x86_64-simulator" \
|
||||||
|
-DCMAKE_SYSTEM_NAME=tvOS \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
|
||||||
|
-DCMAKE_OSX_SYSROOT="${sysroot}" \
|
||||||
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
||||||
|
-Werror=dev \
|
||||||
|
-B build_tvos_simulator2
|
||||||
|
cmake --build build_tvos_simulator2 --config Release --verbose
|
||||||
|
|
||||||
msvc:
|
msvc:
|
||||||
needs: [src]
|
needs: [src]
|
||||||
runs-on: windows-2019
|
runs-on: windows-2025
|
||||||
outputs:
|
outputs:
|
||||||
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
|
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
|
||||||
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
|
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
|
||||||
@@ -532,10 +590,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
sparse-checkout: 'build-scripts/build-release.py'
|
sparse-checkout: 'build-scripts/build-release.py'
|
||||||
- name: 'Setup Android NDK'
|
- name: 'Setup Android NDK'
|
||||||
|
id: setup-ndk
|
||||||
uses: nttld/setup-ndk@v1
|
uses: nttld/setup-ndk@v1
|
||||||
with:
|
with:
|
||||||
local-cache: true
|
local-cache: false
|
||||||
ndk-version: r21e
|
ndk-version: r28c
|
||||||
- name: 'Setup Java JDK'
|
- name: 'Setup Java JDK'
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
@@ -561,6 +620,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python build-scripts/build-release.py \
|
python build-scripts/build-release.py \
|
||||||
--actions android \
|
--actions android \
|
||||||
|
--android-api 21 \
|
||||||
|
--android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
|
||||||
--commit ${{ inputs.commit }} \
|
--commit ${{ inputs.commit }} \
|
||||||
--root "${{ steps.tar.outputs.path }}" \
|
--root "${{ steps.tar.outputs.path }}" \
|
||||||
--github \
|
--github \
|
||||||
@@ -607,8 +668,14 @@ jobs:
|
|||||||
python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/SDL3-android
|
python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/SDL3-android
|
||||||
echo "prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT
|
echo "prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT
|
||||||
echo "sdl3-aar=/tmp/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" >>$GITHUB_OUTPUT
|
echo "sdl3-aar=/tmp/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" >>$GITHUB_OUTPUT
|
||||||
|
- name: 'Verify alignment of libSDL3.so (arm64-v8a/x86_64)'
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
${{ steps.src.outputs.path }}/build-scripts/check_elf_alignment.sh ${{ steps.sdk.outputs.prefix }}/lib/arm64-v8a/libSDL3.so
|
||||||
|
${{ steps.src.outputs.path }}/build-scripts/check_elf_alignment.sh ${{ steps.sdk.outputs.prefix }}/lib/x86_64/libSDL3.so
|
||||||
- name: 'CMake (configure + build) x86, x64, arm32, arm64'
|
- name: 'CMake (configure + build) x86, x64, arm32, arm64'
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
|
android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
|
||||||
for android_abi in ${android_abis}; do
|
for android_abi in ${android_abis}; do
|
||||||
echo "Configuring ${android_abi}..."
|
echo "Configuring ${android_abi}..."
|
||||||
|
|||||||
184
CMakeLists.txt
184
CMakeLists.txt
@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
project(SDL3 LANGUAGES C VERSION "3.2.6")
|
project(SDL3 LANGUAGES C VERSION "3.2.31")
|
||||||
|
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||||
set(SDL3_MAINPROJECT ON)
|
set(SDL3_MAINPROJECT ON)
|
||||||
@@ -46,6 +46,7 @@ endif()
|
|||||||
|
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
include(CheckIncludeFiles)
|
||||||
include(CheckLanguage)
|
include(CheckLanguage)
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
@@ -79,6 +80,12 @@ include("${SDL3_SOURCE_DIR}/cmake/PreseedEmscriptenCache.cmake")
|
|||||||
|
|
||||||
SDL_DetectCompiler()
|
SDL_DetectCompiler()
|
||||||
SDL_DetectTargetCPUArchitectures(SDL_CPUS)
|
SDL_DetectTargetCPUArchitectures(SDL_CPUS)
|
||||||
|
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||||
|
list(LENGTH CMAKE_OSX_ARCHITECTURES _num_arches)
|
||||||
|
if(_num_arches GREATER 1)
|
||||||
|
set(APPLE_MULTIARCH TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Increment this if there is an incompatible change - but if that happens,
|
# Increment this if there is an incompatible change - but if that happens,
|
||||||
# we should rename the library from SDL3 to SDL4, at which point this would
|
# we should rename the library from SDL3 to SDL4, at which point this would
|
||||||
@@ -183,26 +190,6 @@ if(MSVC)
|
|||||||
set(SDL_RELOCATABLE_DEFAULT ON)
|
set(SDL_RELOCATABLE_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
if(NOT SDL_LIBC)
|
|
||||||
# Make sure /RTC1 is disabled, otherwise it will use functions from the CRT
|
|
||||||
foreach(flag_var
|
|
||||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
|
||||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
|
||||||
string(REGEX REPLACE "/RTC(su|[1su])" "" ${flag_var} "${${flag_var}}")
|
|
||||||
endforeach(flag_var)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC_CLANG)
|
|
||||||
# clang-cl treats /W4 as '-Wall -Wextra' -- we don't need -Wextra
|
|
||||||
foreach(flag_var
|
|
||||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
|
||||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
|
||||||
string(REGEX REPLACE "/W4" "/W3" ${flag_var} "${${flag_var}}")
|
|
||||||
endforeach(flag_var)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SDL_SHARED_DEFAULT ON)
|
set(SDL_SHARED_DEFAULT ON)
|
||||||
set(SDL_STATIC_DEFAULT ON)
|
set(SDL_STATIC_DEFAULT ON)
|
||||||
|
|
||||||
@@ -370,7 +357,7 @@ dep_option(SDL_WASAPI "Use the Windows WASAPI audio driver" ON "WIN
|
|||||||
dep_option(SDL_RENDER_D3D "Enable the Direct3D 9 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
|
dep_option(SDL_RENDER_D3D "Enable the Direct3D 9 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
|
||||||
dep_option(SDL_RENDER_D3D11 "Enable the Direct3D 11 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
|
dep_option(SDL_RENDER_D3D11 "Enable the Direct3D 11 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
|
||||||
dep_option(SDL_RENDER_D3D12 "Enable the Direct3D 12 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
|
dep_option(SDL_RENDER_D3D12 "Enable the Direct3D 12 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
|
||||||
dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;${APPLE}" OFF)
|
dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;APPLE" OFF)
|
||||||
dep_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON "SDL_RENDER;SDL_GPU" OFF)
|
dep_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON "SDL_RENDER;SDL_GPU" OFF)
|
||||||
dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
|
dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
|
||||||
dep_option(SDL_VULKAN "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR WINDOWS" OFF)
|
dep_option(SDL_VULKAN "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR WINDOWS" OFF)
|
||||||
@@ -421,6 +408,29 @@ if(SDL_PRESEED)
|
|||||||
SDL_Preseed_CMakeCache()
|
SDL_Preseed_CMakeCache()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
if(NOT SDL_LIBC)
|
||||||
|
# Make sure /RTC1 is disabled, otherwise it will use functions from the CRT
|
||||||
|
foreach(flag_var
|
||||||
|
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||||
|
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||||
|
string(REGEX REPLACE "/RTC(su|[1su])" "" ${flag_var} "${${flag_var}}")
|
||||||
|
endforeach(flag_var)
|
||||||
|
set(CMAKE_MSVC_RUNTIME_CHECKS "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC_CLANG)
|
||||||
|
# clang-cl treats /W4 as '-Wall -Wextra' -- we don't need -Wextra
|
||||||
|
foreach(flag_var
|
||||||
|
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
|
string(REGEX REPLACE "/W4" "/W3" ${flag_var} "${${flag_var}}")
|
||||||
|
endforeach(flag_var)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(SDL_SHARED)
|
if(SDL_SHARED)
|
||||||
add_library(SDL3-shared SHARED)
|
add_library(SDL3-shared SHARED)
|
||||||
add_library(SDL3::SDL3-shared ALIAS SDL3-shared)
|
add_library(SDL3::SDL3-shared ALIAS SDL3-shared)
|
||||||
@@ -606,12 +616,7 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(NOT OPENBSD)
|
||||||
check_linker_flag(C "-Wl,-undefined,error" LINKER_SUPPORTS_WL_UNDEFINED_ERROR)
|
|
||||||
if(LINKER_SUPPORTS_WL_UNDEFINED_ERROR)
|
|
||||||
sdl_shared_link_options("-Wl,-undefined,error")
|
|
||||||
endif()
|
|
||||||
elseif(NOT OPENBSD)
|
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
check_linker_flag(C "-Wl,--no-undefined" LINKER_SUPPORTS_WL_NO_UNDEFINED)
|
check_linker_flag(C "-Wl,--no-undefined" LINKER_SUPPORTS_WL_NO_UNDEFINED)
|
||||||
#FIXME: originally this if had an additional "AND NOT (USE_CLANG AND WINDOWS)"
|
#FIXME: originally this if had an additional "AND NOT (USE_CLANG AND WINDOWS)"
|
||||||
@@ -634,6 +639,11 @@ if(MSVC)
|
|||||||
# Mark SDL3.dll as compatible with Control-flow Enforcement Technology (CET)
|
# Mark SDL3.dll as compatible with Control-flow Enforcement Technology (CET)
|
||||||
sdl_shared_link_options("-CETCOMPAT")
|
sdl_shared_link_options("-CETCOMPAT")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# for VS >= 17.14 targeting ARM64: inline the Interlocked funcs
|
||||||
|
if(MSVC_VERSION GREATER 1943 AND SDL_CPU_ARM64 AND NOT SDL_LIBC)
|
||||||
|
sdl_compile_options(PRIVATE "/forceInterlockedFunctions-")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||||
@@ -650,7 +660,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -mmmx")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -mmmx")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <mmintrin.h>
|
#include <mmintrin.h>
|
||||||
void ints_add(int *dest, int *a, int *b, unsigned size) {
|
void ints_add(int *dest, int *a, int *b, unsigned size) {
|
||||||
for (; size >= 2; size -= 2, dest += 2, a += 2, b += 2) {
|
for (; size >= 2; size -= 2, dest += 2, a += 2, b += 2) {
|
||||||
@@ -660,7 +670,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
ints_add((int*)0, (int*)0, (int*)0, 0);
|
ints_add((int*)0, (int*)0, (int*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_MMX)
|
}]==] COMPILER_SUPPORTS_MMX)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_MMX)
|
if(COMPILER_SUPPORTS_MMX)
|
||||||
set(HAVE_MMX TRUE)
|
set(HAVE_MMX TRUE)
|
||||||
@@ -671,7 +681,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -msse")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -msse")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <xmmintrin.h>
|
#include <xmmintrin.h>
|
||||||
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
||||||
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
||||||
@@ -681,7 +691,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
floats_add((float*)0, (float*)0, (float*)0, 0);
|
floats_add((float*)0, (float*)0, (float*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_SSE)
|
}]==] COMPILER_SUPPORTS_SSE)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_SSE)
|
if(COMPILER_SUPPORTS_SSE)
|
||||||
set(HAVE_SSE TRUE)
|
set(HAVE_SSE TRUE)
|
||||||
@@ -692,7 +702,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -msse2")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -msse2")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
void doubles_add(double *dest, double *a, double *b, unsigned size) {
|
void doubles_add(double *dest, double *a, double *b, unsigned size) {
|
||||||
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
||||||
@@ -702,7 +712,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
doubles_add((double*)0, (double*)0, (double*)0, 0);
|
doubles_add((double*)0, (double*)0, (double*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_SSE2)
|
}]==] COMPILER_SUPPORTS_SSE2)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_SSE2)
|
if(COMPILER_SUPPORTS_SSE2)
|
||||||
set(HAVE_SSE2 TRUE)
|
set(HAVE_SSE2 TRUE)
|
||||||
@@ -713,7 +723,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -msse3")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -msse3")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <pmmintrin.h>
|
#include <pmmintrin.h>
|
||||||
void ints_add(int *dest, int *a, int *b, unsigned size) {
|
void ints_add(int *dest, int *a, int *b, unsigned size) {
|
||||||
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
||||||
@@ -723,7 +733,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
ints_add((int*)0, (int*)0, (int*)0, 0);
|
ints_add((int*)0, (int*)0, (int*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_SSE3)
|
}]==] COMPILER_SUPPORTS_SSE3)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_SSE3)
|
if(COMPILER_SUPPORTS_SSE3)
|
||||||
set(HAVE_SSE3 TRUE)
|
set(HAVE_SSE3 TRUE)
|
||||||
@@ -734,7 +744,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -msse4.1")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -msse4.1")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <smmintrin.h>
|
#include <smmintrin.h>
|
||||||
void ints_mul(int *dest, int *a, int *b, unsigned size) {
|
void ints_mul(int *dest, int *a, int *b, unsigned size) {
|
||||||
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
||||||
@@ -744,7 +754,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
ints_mul((int*)0, (int*)0, (int*)0, 0);
|
ints_mul((int*)0, (int*)0, (int*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_SSE4_1)
|
}]==] COMPILER_SUPPORTS_SSE4_1)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_SSE4_1)
|
if(COMPILER_SUPPORTS_SSE4_1)
|
||||||
set(HAVE_SSE4_1 TRUE)
|
set(HAVE_SSE4_1 TRUE)
|
||||||
@@ -753,21 +763,16 @@ if(SDL_ASSEMBLY)
|
|||||||
if(SDL_SSE4_2)
|
if(SDL_SSE4_2)
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -msse4.2 -mcrc32")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -msse4.2")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <nmmintrin.h>
|
#include <nmmintrin.h>
|
||||||
unsigned calc_crc32c(const char *text, unsigned len) {
|
__m128i bitmask;
|
||||||
unsigned crc32c = ~0;
|
char data[16];
|
||||||
for (; len >= 4; len -= 4, text += 4) {
|
|
||||||
crc32c = (unsigned)_mm_crc32_u32(crc32c, *(unsigned*)text);
|
|
||||||
}
|
|
||||||
return crc32c;
|
|
||||||
}
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
calc_crc32c(\"SDL_SSE4\",8);
|
bitmask = _mm_cmpgt_epi64(_mm_set1_epi64x(0), _mm_loadu_si128((void*)data));
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_SSE4_2)
|
}]==] COMPILER_SUPPORTS_SSE4_2)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_SSE4_2)
|
if(COMPILER_SUPPORTS_SSE4_2)
|
||||||
set(HAVE_SSE4_2 TRUE)
|
set(HAVE_SSE4_2 TRUE)
|
||||||
@@ -778,7 +783,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -mavx")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -mavx")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
||||||
for (; size >= 8; size -= 8, dest += 8, a += 8, b += 8) {
|
for (; size >= 8; size -= 8, dest += 8, a += 8, b += 8) {
|
||||||
@@ -788,7 +793,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
floats_add((float*)0, (float*)0, (float*)0, 0);
|
floats_add((float*)0, (float*)0, (float*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_AVX)
|
}]==] COMPILER_SUPPORTS_AVX)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_AVX)
|
if(COMPILER_SUPPORTS_AVX)
|
||||||
set(HAVE_AVX TRUE)
|
set(HAVE_AVX TRUE)
|
||||||
@@ -799,7 +804,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -mavx2")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -mavx2")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
void ints_add(int *dest, int *a, int *b, unsigned size) {
|
void ints_add(int *dest, int *a, int *b, unsigned size) {
|
||||||
for (; size >= 8; size -= 8, dest += 8, a += 8, b += 8) {
|
for (; size >= 8; size -= 8, dest += 8, a += 8, b += 8) {
|
||||||
@@ -809,7 +814,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
ints_add((int*)0, (int*)0, (int*)0, 0);
|
ints_add((int*)0, (int*)0, (int*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_AVX2)
|
}]==] COMPILER_SUPPORTS_AVX2)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_AVX2)
|
if(COMPILER_SUPPORTS_AVX2)
|
||||||
set(HAVE_AVX2 TRUE)
|
set(HAVE_AVX2 TRUE)
|
||||||
@@ -820,7 +825,7 @@ if(SDL_ASSEMBLY)
|
|||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -mavx512f")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -mavx512f")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_x86_source_compiles([==[
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
||||||
for (; size >= 16; size -= 16, dest += 16, a += 16, b += 16) {
|
for (; size >= 16; size -= 16, dest += 16, a += 16, b += 16) {
|
||||||
@@ -830,7 +835,7 @@ if(SDL_ASSEMBLY)
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
floats_add((float*)0, (float*)0, (float*)0, 0);
|
floats_add((float*)0, (float*)0, (float*)0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}" COMPILER_SUPPORTS_AVX512F)
|
}]==] COMPILER_SUPPORTS_AVX512F)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(COMPILER_SUPPORTS_AVX512F)
|
if(COMPILER_SUPPORTS_AVX512F)
|
||||||
set(HAVE_AVX512F TRUE)
|
set(HAVE_AVX512F TRUE)
|
||||||
@@ -838,18 +843,17 @@ if(SDL_ASSEMBLY)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_ARMNEON)
|
if(SDL_ARMNEON)
|
||||||
check_c_source_compiles("
|
check_arm_source_compiles([==[
|
||||||
#include <arm_neon.h>
|
#include <arm_neon.h>
|
||||||
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
void floats_add(float *dest, float *a, float *b, unsigned size) {
|
||||||
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
|
||||||
vst1q_f32(dest, vaddq_f32(vld1q_f32(a), vld1q_f32(b)));
|
vst1q_f32(dest, vaddq_f32(vld1q_f32(a), vld1q_f32(b)));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int main(int argc, char *argv[]) {
|
}
|
||||||
floats_add((float*)0, (float*)0, (float*)0, 0);
|
int main(int argc, char *argv[]) {
|
||||||
return 0;
|
floats_add((float*)0, (float*)0, (float*)0, 0);
|
||||||
}" COMPILER_SUPPORTS_ARMNEON)
|
return 0;
|
||||||
|
}]==] COMPILER_SUPPORTS_ARMNEON)
|
||||||
if(COMPILER_SUPPORTS_ARMNEON)
|
if(COMPILER_SUPPORTS_ARMNEON)
|
||||||
set(HAVE_ARMNEON TRUE)
|
set(HAVE_ARMNEON TRUE)
|
||||||
endif()
|
endif()
|
||||||
@@ -890,7 +894,17 @@ if(SDL_ASSEMBLY)
|
|||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
|
|
||||||
if(COMPILER_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
|
if(COMPILER_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
|
||||||
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c" APPEND PROPERTY COMPILE_OPTIONS "-mlsx")
|
set_property(SOURCE
|
||||||
|
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c"
|
||||||
|
"${SDL3_SOURCE_DIR}/src/video/SDL_blit_A.c"
|
||||||
|
"${SDL3_SOURCE_DIR}/src/video/SDL_fillrect.c"
|
||||||
|
APPEND PROPERTY COMPILE_OPTIONS "-mlsx")
|
||||||
|
|
||||||
|
set_property(SOURCE
|
||||||
|
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c"
|
||||||
|
"${SDL3_SOURCE_DIR}/src/video/SDL_blit_A.c"
|
||||||
|
"${SDL3_SOURCE_DIR}/src/video/SDL_fillrect.c"
|
||||||
|
PROPERTY SKIP_PRECOMPILE_HEADERS 1)
|
||||||
set(HAVE_LSX TRUE)
|
set(HAVE_LSX TRUE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -1052,8 +1066,10 @@ if(SDL_LIBC)
|
|||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -we4244 -WX") # 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
string(APPEND CMAKE_REQUIRED_FLAGS " -we4244 -WX") # 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
||||||
else()
|
elseif(HAVE_GCC_WFLOAT_CONVERSION)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -Wfloat-conversion -Werror")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -Wfloat-conversion -Werror")
|
||||||
|
else()
|
||||||
|
string(APPEND CMAKE_REQUIRED_FLAGS " -Wconversion -Werror")
|
||||||
endif()
|
endif()
|
||||||
foreach(math_fn isinf isnan)
|
foreach(math_fn isinf isnan)
|
||||||
string(TOUPPER "${math_fn}" MATH_FN)
|
string(TOUPPER "${math_fn}" MATH_FN)
|
||||||
@@ -1090,7 +1106,10 @@ if(SDL_LIBC)
|
|||||||
check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
|
check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
|
||||||
check_symbol_exists(gethostname "unistd.h" HAVE_GETHOSTNAME)
|
check_symbol_exists(gethostname "unistd.h" HAVE_GETHOSTNAME)
|
||||||
check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE)
|
check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE)
|
||||||
|
check_symbol_exists(getresgid "unistd.h" HAVE_GETRESGID)
|
||||||
|
check_symbol_exists(getresuid "unistd.h" HAVE_GETRESUID)
|
||||||
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
||||||
|
check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT)
|
||||||
check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
|
check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
|
||||||
check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP)
|
check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP)
|
||||||
check_symbol_exists(gmtime_r "time.h" HAVE_GMTIME_R)
|
check_symbol_exists(gmtime_r "time.h" HAVE_GMTIME_R)
|
||||||
@@ -1291,8 +1310,8 @@ if(ANDROID)
|
|||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/android")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/android")
|
||||||
|
|
||||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/android/*.c")
|
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/android/*.c")
|
||||||
sdl_sources("${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c")
|
sdl_sources("${CMAKE_ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c")
|
||||||
set_property(SOURCE "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-declaration-after-statement")
|
set_property(SOURCE "${CMAKE_ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-declaration-after-statement")
|
||||||
|
|
||||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/android/*.c")
|
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/android/*.c")
|
||||||
set(HAVE_SDL_MISC TRUE)
|
set(HAVE_SDL_MISC TRUE)
|
||||||
@@ -1336,9 +1355,7 @@ if(ANDROID)
|
|||||||
set(HAVE_SDL_HAPTIC TRUE)
|
set(HAVE_SDL_HAPTIC TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_HIDAPI)
|
CheckHIDAPI()
|
||||||
CheckHIDAPI()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(SDL_JOYSTICK)
|
if(SDL_JOYSTICK)
|
||||||
set(SDL_JOYSTICK_ANDROID 1)
|
set(SDL_JOYSTICK_ANDROID 1)
|
||||||
@@ -1480,6 +1497,9 @@ if(ANDROID)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(TARGET SDL3-static)
|
||||||
|
target_link_options(SDL3-static INTERFACE "-Wl,-u,JNI_OnLoad")
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(EMSCRIPTEN)
|
elseif(EMSCRIPTEN)
|
||||||
# Hide noisy warnings that intend to aid mostly during initial stages of porting a new
|
# Hide noisy warnings that intend to aid mostly during initial stages of porting a new
|
||||||
@@ -1905,7 +1925,7 @@ elseif(WINDOWS)
|
|||||||
target_compile_options(SDL_uclibc PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:/GS-> $<$<COMPILE_LANGUAGE:C,CXX>:/Gs1048576>)
|
target_compile_options(SDL_uclibc PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:/GS-> $<$<COMPILE_LANGUAGE:C,CXX>:/Gs1048576>)
|
||||||
if(SDL_CPU_X86)
|
if(SDL_CPU_X86)
|
||||||
target_compile_options(SDL3-shared PRIVATE "/arch:SSE")
|
target_compile_options(SDL3-shared PRIVATE "/arch:SSE")
|
||||||
target_compile_options(SDL3-SDL_uclibc PRIVATE "/arch:SSE")
|
target_compile_options(SDL_uclibc PRIVATE "/arch:SSE")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -2188,6 +2208,7 @@ elseif(APPLE)
|
|||||||
set(SDL_CAMERA_DRIVER_COREMEDIA 1)
|
set(SDL_CAMERA_DRIVER_COREMEDIA 1)
|
||||||
set(HAVE_CAMERA TRUE)
|
set(HAVE_CAMERA TRUE)
|
||||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/camera/coremedia/*.m")
|
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/camera/coremedia/*.m")
|
||||||
|
set(SDL_FRAMEWORK_AVFOUNDATION 1)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -2953,7 +2974,7 @@ if(WINDOWS)
|
|||||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/process/windows/*.c")
|
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/process/windows/*.c")
|
||||||
set(SDL_PROCESS_WINDOWS 1)
|
set(SDL_PROCESS_WINDOWS 1)
|
||||||
set(HAVE_SDL_PROCESS TRUE)
|
set(HAVE_SDL_PROCESS TRUE)
|
||||||
else()
|
elseif(NOT ANDROID)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -3016,7 +3037,7 @@ if(SDL_GPU)
|
|||||||
set(SDL_GPU_D3D11 1)
|
set(SDL_GPU_D3D11 1)
|
||||||
set(HAVE_SDL_GPU TRUE)
|
set(HAVE_SDL_GPU TRUE)
|
||||||
endif()
|
endif()
|
||||||
if(SDL_RENDER_D3D12)
|
if(WINDOWS)
|
||||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/gpu/d3d12/*.c")
|
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/gpu/d3d12/*.c")
|
||||||
set(SDL_GPU_D3D12 1)
|
set(SDL_GPU_D3D12 1)
|
||||||
set(HAVE_SDL_GPU TRUE)
|
set(HAVE_SDL_GPU TRUE)
|
||||||
@@ -3143,14 +3164,15 @@ endforeach()
|
|||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt")
|
||||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt" revisions)
|
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt" revisions)
|
||||||
list(GET revisions 0 revisions_0)
|
list(GET revisions 0 revisions_0)
|
||||||
string(STRIP "${revisions_0}" SDL_REVISION)
|
string(STRIP "${revisions_0}" revisions_0_stripped)
|
||||||
|
set(SDL_REVISION "SDL-${revisions_0_stripped}")
|
||||||
else()
|
else()
|
||||||
set(SDL_REVISION "" CACHE STRING "Custom SDL revision (only used when REVISION.txt does not exist)")
|
set(SDL_REVISION "" CACHE STRING "Custom SDL revision (only used when REVISION.txt does not exist)")
|
||||||
endif()
|
endif()
|
||||||
if(NOT SDL_REVISION)
|
if(NOT SDL_REVISION)
|
||||||
# If SDL_REVISION is not overrided, use git to describe
|
# If SDL_REVISION is not overrided, use git to describe
|
||||||
git_describe(SDL_REVISION_GIT)
|
git_describe(SDL_REVISION_GIT)
|
||||||
set(SDL_REVISION "SDL3-${SDL3_VERSION}-${SDL_REVISION_GIT}")
|
set(SDL_REVISION "SDL-${SDL3_VERSION}-${SDL_REVISION_GIT}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include-revision/SDL3")
|
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include-revision/SDL3")
|
||||||
@@ -3287,7 +3309,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
sdl_include_directories(PRIVATE SYSTEM "${ANDROID_NDK}/sources/android/cpufeatures")
|
sdl_include_directories(PRIVATE SYSTEM "${CMAKE_ANDROID_NDK}/sources/android/cpufeatures")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
@@ -3459,6 +3481,8 @@ if(SDL_SHARED)
|
|||||||
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL3_SHARED TRUE)
|
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL3_SHARED TRUE)
|
||||||
set_property(TARGET SDL3-shared APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
set_property(TARGET SDL3-shared APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||||
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
|
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
|
||||||
|
set_property(TARGET SDL3-shared APPEND PROPERTY EXPORT_PROPERTIES "SDL_FULL_VERSION")
|
||||||
|
set_property(TARGET SDL3-shared PROPERTY SDL_FULL_VERSION "${PROJECT_VERSION}")
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
|
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
|
||||||
target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
|
target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
|
||||||
endif()
|
endif()
|
||||||
@@ -3483,6 +3507,8 @@ if(SDL_STATIC)
|
|||||||
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL3_SHARED FALSE)
|
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL3_SHARED FALSE)
|
||||||
set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||||
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
|
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
|
||||||
|
set_property(TARGET SDL3-static APPEND PROPERTY EXPORT_PROPERTIES "SDL_FULL_VERSION")
|
||||||
|
set_property(TARGET SDL3-static PROPERTY SDL_FULL_VERSION "${PROJECT_VERSION}")
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
|
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
|
||||||
target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
|
target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
SDL supports a number of development environments:
|
SDL supports a number of development environments:
|
||||||
- [CMake](docs/INTRO-cmake.md)
|
- [CMake](docs/INTRO-cmake.md)
|
||||||
- [Visual Studio on Windows](docs/INTRO-visualstudio.md)
|
- [Visual Studio on Windows](docs/INTRO-visualstudio.md)
|
||||||
|
- [gcc on Windows](docs/INTRO-mingw.md)
|
||||||
- [Xcode on Apple platforms](docs/INTRO-xcode.md)
|
- [Xcode on Apple platforms](docs/INTRO-xcode.md)
|
||||||
- [Android Studio](docs/INTRO-androidstudio.md)
|
- [Android Studio](docs/INTRO-androidstudio.md)
|
||||||
- [Emscripten for web](docs/INTRO-emscripten.md)
|
- [Emscripten for web](docs/INTRO-emscripten.md)
|
||||||
|
|||||||
@@ -168,8 +168,8 @@
|
|||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>
|
<Command>
|
||||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
call "$(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
|
||||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
call "$(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
|
||||||
</Command>
|
</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
@@ -781,7 +781,6 @@
|
|||||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||||
|
|||||||
@@ -108,7 +108,6 @@
|
|||||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||||
|
|||||||
@@ -627,7 +627,6 @@
|
|||||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
||||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
|
||||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||||
|
|||||||
@@ -1460,7 +1460,6 @@
|
|||||||
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c">
|
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c">
|
||||||
<Filter>sensor\windows</Filter>
|
<Filter>sensor\windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c">
|
|
||||||
<Filter>render</Filter>
|
<Filter>render</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\render\SDL_render.c">
|
<ClCompile Include="..\..\src\render\SDL_render.c">
|
||||||
|
|||||||
21
WhatsNew.txt
21
WhatsNew.txt
@@ -1,6 +1,27 @@
|
|||||||
|
|
||||||
This is a list of major changes in SDL's version history.
|
This is a list of major changes in SDL's version history.
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
3.2.22:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
* SDL_HINT_JOYSTICK_WGI is disabled by default
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
3.2.16:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
* SDL_HINT_JOYSTICK_RAWINPUT is disabled by default
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
3.2.10:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
* Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT to control whether XSelectInput() should be called on external windows to enable input events.
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
3.2.4:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
* Added SDL_StretchSurface()
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
3.2.0:
|
3.2.0:
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.2.6</string>
|
<string>3.2.31</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>3.2.6</string>
|
<string>3.2.31</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -292,7 +292,6 @@
|
|||||||
A7D8BA2523E2514400DCD162 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FC23E2514000DCD162 /* SDL_drawpoint.c */; };
|
A7D8BA2523E2514400DCD162 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FC23E2514000DCD162 /* SDL_drawpoint.c */; };
|
||||||
A7D8BA2B23E2514400DCD162 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FD23E2514000DCD162 /* SDL_blendfillrect.c */; };
|
A7D8BA2B23E2514400DCD162 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FD23E2514000DCD162 /* SDL_blendfillrect.c */; };
|
||||||
A7D8BA3123E2514400DCD162 /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8FE23E2514000DCD162 /* SDL_rotate.h */; };
|
A7D8BA3123E2514400DCD162 /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8FE23E2514000DCD162 /* SDL_rotate.h */; };
|
||||||
A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */; };
|
|
||||||
A7D8BA4923E2514400DCD162 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A90423E2514000DCD162 /* SDL_render_gles2.c */; };
|
A7D8BA4923E2514400DCD162 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A90423E2514000DCD162 /* SDL_render_gles2.c */; };
|
||||||
A7D8BA4F23E2514400DCD162 /* SDL_shaders_gles2.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A90523E2514000DCD162 /* SDL_shaders_gles2.h */; };
|
A7D8BA4F23E2514400DCD162 /* SDL_shaders_gles2.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A90523E2514000DCD162 /* SDL_shaders_gles2.h */; };
|
||||||
A7D8BA5523E2514400DCD162 /* SDL_gles2funcs.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A90623E2514000DCD162 /* SDL_gles2funcs.h */; };
|
A7D8BA5523E2514400DCD162 /* SDL_gles2funcs.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A90623E2514000DCD162 /* SDL_gles2funcs.h */; };
|
||||||
@@ -869,7 +868,6 @@
|
|||||||
A7D8A8FC23E2514000DCD162 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
|
A7D8A8FC23E2514000DCD162 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
|
||||||
A7D8A8FD23E2514000DCD162 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
|
A7D8A8FD23E2514000DCD162 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
|
||||||
A7D8A8FE23E2514000DCD162 /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
|
A7D8A8FE23E2514000DCD162 /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
|
||||||
A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_d3dmath.c; sourceTree = "<group>"; };
|
|
||||||
A7D8A90423E2514000DCD162 /* SDL_render_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles2.c; sourceTree = "<group>"; };
|
A7D8A90423E2514000DCD162 /* SDL_render_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles2.c; sourceTree = "<group>"; };
|
||||||
A7D8A90523E2514000DCD162 /* SDL_shaders_gles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gles2.h; sourceTree = "<group>"; };
|
A7D8A90523E2514000DCD162 /* SDL_shaders_gles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gles2.h; sourceTree = "<group>"; };
|
||||||
A7D8A90623E2514000DCD162 /* SDL_gles2funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gles2funcs.h; sourceTree = "<group>"; };
|
A7D8A90623E2514000DCD162 /* SDL_gles2funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gles2funcs.h; sourceTree = "<group>"; };
|
||||||
@@ -2135,7 +2133,6 @@
|
|||||||
A7D8A90C23E2514000DCD162 /* opengl */,
|
A7D8A90C23E2514000DCD162 /* opengl */,
|
||||||
A7D8A90323E2514000DCD162 /* opengles2 */,
|
A7D8A90323E2514000DCD162 /* opengles2 */,
|
||||||
A7D8A8EF23E2514000DCD162 /* software */,
|
A7D8A8EF23E2514000DCD162 /* software */,
|
||||||
A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */,
|
|
||||||
A7D8A8DC23E2514000DCD162 /* SDL_d3dmath.h */,
|
A7D8A8DC23E2514000DCD162 /* SDL_d3dmath.h */,
|
||||||
A7D8A8DB23E2514000DCD162 /* SDL_render.c */,
|
A7D8A8DB23E2514000DCD162 /* SDL_render.c */,
|
||||||
E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */,
|
E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */,
|
||||||
@@ -2833,7 +2830,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
|
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${MACOS_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${IOS_DEVICE_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${TVOS_DEVICE_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
@@ -2903,7 +2900,6 @@
|
|||||||
A7D8BBE723E2574800DCD162 /* SDL_uikitviewcontroller.m in Sources */,
|
A7D8BBE723E2574800DCD162 /* SDL_uikitviewcontroller.m in Sources */,
|
||||||
A7D8ADF223E2514100DCD162 /* SDL_blit_A.c in Sources */,
|
A7D8ADF223E2514100DCD162 /* SDL_blit_A.c in Sources */,
|
||||||
A7D8BBDD23E2574800DCD162 /* SDL_uikitmodes.m in Sources */,
|
A7D8BBDD23E2574800DCD162 /* SDL_uikitmodes.m in Sources */,
|
||||||
A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */,
|
|
||||||
F3A9AE9C2C8A13C100AAC390 /* SDL_pipeline_gpu.c in Sources */,
|
F3A9AE9C2C8A13C100AAC390 /* SDL_pipeline_gpu.c in Sources */,
|
||||||
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */,
|
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */,
|
||||||
F338A11A2D1B37E4007CDFDF /* SDL_tray.c in Sources */,
|
F338A11A2D1B37E4007CDFDF /* SDL_tray.c in Sources */,
|
||||||
@@ -3086,7 +3082,7 @@
|
|||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 201.6.0;
|
DYLIB_CURRENT_VERSION = 201.31.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;
|
||||||
@@ -3121,7 +3117,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||||
MARKETING_VERSION = 3.2.6;
|
MARKETING_VERSION = 3.2.31;
|
||||||
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
||||||
PRODUCT_NAME = SDL3;
|
PRODUCT_NAME = SDL3;
|
||||||
@@ -3138,6 +3134,8 @@
|
|||||||
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
|
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
SUPPORTS_MACCATALYST = YES;
|
SUPPORTS_MACCATALYST = YES;
|
||||||
};
|
};
|
||||||
@@ -3150,7 +3148,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 201.6.0;
|
DYLIB_CURRENT_VERSION = 201.31.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;
|
||||||
@@ -3182,7 +3180,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||||
MARKETING_VERSION = 3.2.6;
|
MARKETING_VERSION = 3.2.31;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
||||||
@@ -3200,6 +3198,8 @@
|
|||||||
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
|
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
SUPPORTS_MACCATALYST = YES;
|
SUPPORTS_MACCATALYST = YES;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Title SDL 3.2.6
|
Title SDL 3.2.31
|
||||||
Version 1
|
Version 1
|
||||||
Description SDL Library for macOS (http://www.libsdl.org)
|
Description SDL Library for macOS (http://www.libsdl.org)
|
||||||
DefaultLocation /Library/Frameworks
|
DefaultLocation /Library/Frameworks
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# SDL3 CMake configuration file:
|
# SDL3 CMake configuration file:
|
||||||
# This file is meant to be placed in Resources/CMake of a SDL3 framework
|
# This file is meant to be placed in Resources/CMake of a SDL3 framework for macOS,
|
||||||
|
# or in the CMake directory of a SDL3 framework for iOS / tvOS / visionOS.
|
||||||
|
|
||||||
# INTERFACE_LINK_OPTIONS needs CMake 3.12
|
# INTERFACE_LINK_OPTIONS needs CMake 3.12
|
||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12...4.0)
|
||||||
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
set_package_properties(SDL3 PROPERTIES
|
set_package_properties(SDL3 PROPERTIES
|
||||||
@@ -31,16 +32,31 @@ endmacro()
|
|||||||
|
|
||||||
set(SDL3_FOUND TRUE)
|
set(SDL3_FOUND TRUE)
|
||||||
|
|
||||||
# Compute the installation prefix relative to this file.
|
# Compute the installation prefix relative to this file:
|
||||||
set(_sdl3_framework_path "${CMAKE_CURRENT_LIST_DIR}") # > /SDL3.framework/Resources/CMake/
|
# search upwards for the .framework directory
|
||||||
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" REALPATH) # > /SDL3.framework/Versions/Current/Resources/CMake
|
set(_current_path "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" REALPATH) # > /SDL3.framework/Versions/A/Resources/CMake/
|
get_filename_component(_current_path "${_current_path}" REALPATH)
|
||||||
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/Versions/A/Resources/
|
set(_sdl3_framework_path "")
|
||||||
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/Versions/A/
|
|
||||||
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/Versions/
|
|
||||||
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/
|
|
||||||
get_filename_component(_sdl3_framework_parent_path "${_sdl3_framework_path}" PATH) # > /
|
|
||||||
|
|
||||||
|
while(NOT _sdl3_framework_path)
|
||||||
|
if(IS_DIRECTORY "${_current_path}" AND "${_current_path}" MATCHES "/SDL3\\.framework$")
|
||||||
|
set(_sdl3_framework_path "${_current_path}")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
get_filename_component(_next_current_path "${_current_path}" DIRECTORY)
|
||||||
|
if("${_current_path}" STREQUAL "${_next_current_path}")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
set(_current_path "${_next_current_path}")
|
||||||
|
endwhile()
|
||||||
|
unset(_current_path)
|
||||||
|
unset(_next_current_path)
|
||||||
|
|
||||||
|
if(NOT _sdl3_framework_path)
|
||||||
|
message(FATAL_ERROR "Could not find SDL3.framework root from ${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_filename_component(_sdl3_framework_parent_path "${_sdl3_framework_path}" PATH)
|
||||||
|
|
||||||
# All targets are created, even when some might not be requested though COMPONENTS.
|
# All targets are created, even when some might not be requested though COMPONENTS.
|
||||||
# This is done for compatibility with CMake generated SDL3-target.cmake files.
|
# This is done for compatibility with CMake generated SDL3-target.cmake files.
|
||||||
|
|||||||
@@ -1,16 +1,26 @@
|
|||||||
# based on the files generated by CMake's write_basic_package_version_file
|
# based on the files generated by CMake's write_basic_package_version_file
|
||||||
|
|
||||||
# SDL CMake version configuration file:
|
# SDL CMake version configuration file:
|
||||||
# This file is meant to be placed in Resources/CMake of a SDL3 framework
|
# This file is meant to be placed in Resources/CMake of a SDL3 framework for macOS,
|
||||||
|
# or in the CMake directory of a SDL3 framework for iOS / tvOS / visionOS.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12...4.0)
|
||||||
|
|
||||||
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h")
|
# Find SDL_version.h
|
||||||
message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory of SDL2.framework")
|
set(_sdl_version_h_path "")
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h")
|
||||||
|
set(_sdl_version_h_path "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h")
|
||||||
|
elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../Headers/SDL_version.h")
|
||||||
|
set(_sdl_version_h_path "${CMAKE_CURRENT_LIST_DIR}/../Headers/SDL_version.h")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT _sdl_version_h_path)
|
||||||
|
message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory or the CMake directory of SDL3.framework.")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h" _sdl_version_h)
|
file(READ "${_sdl_version_h_path}" _sdl_version_h)
|
||||||
string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}")
|
string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}")
|
||||||
set(_sdl_major "${CMAKE_MATCH_1}")
|
set(_sdl_major "${CMAKE_MATCH_1}")
|
||||||
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
|
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
|
||||||
@@ -21,9 +31,12 @@ if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
|
|||||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
||||||
else()
|
else()
|
||||||
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
unset(_sdl_version_h)
|
||||||
|
unset(_sdl_version_h_path)
|
||||||
unset(_sdl_major_re)
|
unset(_sdl_major_re)
|
||||||
unset(_sdl_major)
|
unset(_sdl_major)
|
||||||
unset(_sdl_minor_re)
|
unset(_sdl_minor_re)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ if(NOT TARGET SDL3::Headers)
|
|||||||
add_library(SDL3::Headers INTERFACE IMPORTED)
|
add_library(SDL3::Headers INTERFACE IMPORTED)
|
||||||
set_target_properties(SDL3::Headers
|
set_target_properties(SDL3::Headers
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${_sdl3_framework_parent_path}\""
|
INTERFACE_COMPILE_OPTIONS "-F${_sdl3_framework_parent_path}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set(SDL3_Headers_FOUND TRUE)
|
set(SDL3_Headers_FOUND TRUE)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ set(_sdl3_version_h "${_sdl3_framework}/Headers/SDL_version.h")
|
|||||||
|
|
||||||
if(NOT EXISTS "${_sdl3_version_h}")
|
if(NOT EXISTS "${_sdl3_version_h}")
|
||||||
message(AUTHOR_WARNING "Cannot not find ${_sdl3_framework}. This script is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework")
|
message(AUTHOR_WARNING "Cannot not find ${_sdl3_framework}. This script is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
|
|||||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
||||||
else()
|
else()
|
||||||
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ plugins {
|
|||||||
def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
|
def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "org.libsdl.app"
|
namespace = "org.libsdl.app"
|
||||||
compileSdkVersion 35
|
compileSdkVersion 35
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
@@ -14,12 +14,12 @@ android {
|
|||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
ndkBuild {
|
||||||
arguments "APP_PLATFORM=android-19"
|
arguments "APP_PLATFORM=android-21"
|
||||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
abiFilters 'arm64-v8a'
|
abiFilters 'arm64-v8a'
|
||||||
}
|
}
|
||||||
cmake {
|
cmake {
|
||||||
arguments "-DANDROID_PLATFORM=android-19", "-DANDROID_STL=c++_static"
|
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_static"
|
||||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
abiFilters 'arm64-v8a'
|
abiFilters 'arm64-v8a'
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ android {
|
|||||||
|
|
||||||
}
|
}
|
||||||
lint {
|
lint {
|
||||||
abortOnError false
|
abortOnError = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,4 @@
|
|||||||
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
|
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
|
||||||
|
|
||||||
# Min runtime API level
|
# Min runtime API level
|
||||||
APP_PLATFORM=android-16
|
APP_PLATFORM=android-21
|
||||||
|
|||||||
2
android-project/app/proguard-rules.pro
vendored
2
android-project/app/proguard-rules.pro
vendored
@@ -51,6 +51,8 @@
|
|||||||
boolean supportsRelativeMouse();
|
boolean supportsRelativeMouse();
|
||||||
int openFileDescriptor(java.lang.String, java.lang.String);
|
int openFileDescriptor(java.lang.String, java.lang.String);
|
||||||
boolean showFileDialog(java.lang.String[], boolean, boolean, int);
|
boolean showFileDialog(java.lang.String[], boolean, boolean, int);
|
||||||
|
java.lang.String getPreferredLocales();
|
||||||
|
java.lang.String formatLocale(java.util.Locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager {
|
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.LocaleList;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
@@ -60,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 3;
|
private static final int SDL_MAJOR_VERSION = 3;
|
||||||
private static final int SDL_MINOR_VERSION = 2;
|
private static final int SDL_MINOR_VERSION = 2;
|
||||||
private static final int SDL_MICRO_VERSION = 6;
|
private static final int SDL_MICRO_VERSION = 31;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
@@ -1127,6 +1128,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
int orientation_landscape = -1;
|
int orientation_landscape = -1;
|
||||||
int orientation_portrait = -1;
|
int orientation_portrait = -1;
|
||||||
|
|
||||||
|
if (w <= 1 || h <= 1) {
|
||||||
|
// Invalid width/height, ignore this request
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* 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_USER_LANDSCAPE;
|
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE;
|
||||||
@@ -2116,6 +2122,44 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
int requestCode;
|
int requestCode;
|
||||||
boolean multipleChoice;
|
boolean multipleChoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called by SDL using JNI.
|
||||||
|
*/
|
||||||
|
public static String getPreferredLocales() {
|
||||||
|
String result = "";
|
||||||
|
if (Build.VERSION.SDK_INT >= 24 /* Android 7 (N) */) {
|
||||||
|
LocaleList locales = LocaleList.getAdjustedDefault();
|
||||||
|
for (int i = 0; i < locales.size(); i++) {
|
||||||
|
if (i != 0) result += ",";
|
||||||
|
result += formatLocale(locales.get(i));
|
||||||
|
}
|
||||||
|
} else if (mCurrentLocale != null) {
|
||||||
|
result = formatLocale(mCurrentLocale);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String formatLocale(Locale locale) {
|
||||||
|
String result = "";
|
||||||
|
String lang = "";
|
||||||
|
if (locale.getLanguage() == "in") {
|
||||||
|
// Indonesian is "id" according to ISO 639.2, but on Android is "in" because of Java backwards compatibility
|
||||||
|
lang = "id";
|
||||||
|
} else if (locale.getLanguage() == "") {
|
||||||
|
// Make sure language is never empty
|
||||||
|
lang = "und";
|
||||||
|
} else {
|
||||||
|
lang = locale.getLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (locale.getCountry() == "") {
|
||||||
|
result = lang;
|
||||||
|
} else {
|
||||||
|
result = lang + "_" + locale.getCountry();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2157,7 +2201,11 @@ class SDLClipboardHandler implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean clipboardHasText() {
|
public boolean clipboardHasText() {
|
||||||
return mClipMgr.hasPrimaryClip();
|
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (P) */) {
|
||||||
|
return mClipMgr.hasPrimaryClip();
|
||||||
|
} else {
|
||||||
|
return mClipMgr.hasText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String clipboardGetText() {
|
public String clipboardGetText() {
|
||||||
@@ -2175,10 +2223,19 @@ class SDLClipboardHandler implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clipboardSetText(String string) {
|
public void clipboardSetText(String string) {
|
||||||
mClipMgr.removePrimaryClipChangedListener(this);
|
mClipMgr.removePrimaryClipChangedListener(this);
|
||||||
ClipData clip = ClipData.newPlainText(null, string);
|
if (string.isEmpty()) {
|
||||||
mClipMgr.setPrimaryClip(clip);
|
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (P) */) {
|
||||||
mClipMgr.addPrimaryClipChangedListener(this);
|
mClipMgr.clearPrimaryClip();
|
||||||
|
} else {
|
||||||
|
ClipData clip = ClipData.newPlainText(null, "");
|
||||||
|
mClipMgr.setPrimaryClip(clip);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ClipData clip = ClipData.newPlainText(null, string);
|
||||||
|
mClipMgr.setPrimaryClip(clip);
|
||||||
|
}
|
||||||
|
mClipMgr.addPrimaryClipChangedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.view.Display;
|
|||||||
import android.view.InputDevice;
|
import android.view.InputDevice;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
import android.view.PointerIcon;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
@@ -362,6 +363,16 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent android internal NullPointerException (https://github.com/libsdl-org/SDL/issues/13306)
|
||||||
|
@Override
|
||||||
|
public PointerIcon onResolvePointerIcon(MotionEvent event, int pointerIndex) {
|
||||||
|
try {
|
||||||
|
return super.onResolvePointerIcon(event, pointerIndex);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Captured pointer events for API 26.
|
// Captured pointer events for API 26.
|
||||||
public boolean onCapturedPointerEvent(MotionEvent event)
|
public boolean onCapturedPointerEvent(MotionEvent event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -542,6 +542,7 @@ class AndroidApiVersion:
|
|||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"<{self.name} ({'.'.join(str(v) for v in self.ints)})>"
|
return f"<{self.name} ({'.'.join(str(v) for v in self.ints)})>"
|
||||||
|
|
||||||
|
ANDROID_ABI_EXTRA_LINK_OPTIONS = {}
|
||||||
|
|
||||||
class Releaser:
|
class Releaser:
|
||||||
def __init__(self, release_info: dict, commit: str, revision: str, root: Path, dist_path: Path, section_printer: SectionPrinter, executer: Executer, cmake_generator: str, deps_path: Path, overwrite: bool, github: bool, fast: bool):
|
def __init__(self, release_info: dict, commit: str, revision: str, root: Path, dist_path: Path, section_printer: SectionPrinter, executer: Executer, cmake_generator: str, deps_path: Path, overwrite: bool, github: bool, fast: bool):
|
||||||
@@ -1013,6 +1014,7 @@ class Releaser:
|
|||||||
android_devel_file_tree = ArchiveFileTree()
|
android_devel_file_tree = ArchiveFileTree()
|
||||||
|
|
||||||
for android_abi in android_abis:
|
for android_abi in android_abis:
|
||||||
|
extra_link_options = ANDROID_ABI_EXTRA_LINK_OPTIONS.get(android_abi, "")
|
||||||
with self.section_printer.group(f"Building for Android {android_api} {android_abi}"):
|
with self.section_printer.group(f"Building for Android {android_api} {android_abi}"):
|
||||||
build_dir = self.root / "build-android" / f"{android_abi}-build"
|
build_dir = self.root / "build-android" / f"{android_abi}-build"
|
||||||
install_dir = self.root / "install-android" / f"{android_abi}-install"
|
install_dir = self.root / "install-android" / f"{android_abi}-install"
|
||||||
@@ -1023,8 +1025,12 @@ class Releaser:
|
|||||||
"cmake",
|
"cmake",
|
||||||
"-S", str(self.root),
|
"-S", str(self.root),
|
||||||
"-B", str(build_dir),
|
"-B", str(build_dir),
|
||||||
f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
|
# NDK 21e does not support -ffile-prefix-map
|
||||||
f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
|
# f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
|
||||||
|
# f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
|
||||||
|
f"-DANDROID_USE_LEGACY_TOOLCHAIN=0",
|
||||||
|
f"-DCMAKE_EXE_LINKER_FLAGS={extra_link_options}",
|
||||||
|
f"-DCMAKE_SHARED_LINKER_FLAGS={extra_link_options}",
|
||||||
f"-DCMAKE_TOOLCHAIN_FILE={cmake_toolchain_file}",
|
f"-DCMAKE_TOOLCHAIN_FILE={cmake_toolchain_file}",
|
||||||
f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}",
|
f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}",
|
||||||
f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH",
|
f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH",
|
||||||
@@ -1121,8 +1127,7 @@ class Releaser:
|
|||||||
for dep, depinfo in self.release_info.get("dependencies", {}).items():
|
for dep, depinfo in self.release_info.get("dependencies", {}).items():
|
||||||
startswith = depinfo["startswith"]
|
startswith = depinfo["startswith"]
|
||||||
dep_repo = depinfo["repo"]
|
dep_repo = depinfo["repo"]
|
||||||
# FIXME: dropped "--exclude-pre-releases"
|
dep_string_data = self.executer.check_output(["gh", "-R", dep_repo, "release", "list", "--exclude-drafts", "--exclude-pre-releases", "--json", "name,createdAt,tagName", "--jq", f'[.[]|select(.name|startswith("{startswith}"))]|max_by(.createdAt)']).strip()
|
||||||
dep_string_data = self.executer.check_output(["gh", "-R", dep_repo, "release", "list", "--exclude-drafts", "--json", "name,createdAt,tagName", "--jq", f'[.[]|select(.name|startswith("{startswith}"))]|max_by(.createdAt)']).strip()
|
|
||||||
dep_data = json.loads(dep_string_data)
|
dep_data = json.loads(dep_string_data)
|
||||||
dep_tag = dep_data["tagName"]
|
dep_tag = dep_data["tagName"]
|
||||||
dep_version = dep_data["name"]
|
dep_version = dep_data["name"]
|
||||||
@@ -1512,7 +1517,7 @@ def main(argv=None) -> int:
|
|||||||
if args.android_home is None or not Path(args.android_home).is_dir():
|
if args.android_home is None or not Path(args.android_home).is_dir():
|
||||||
parser.error("Invalid $ANDROID_HOME or --android-home: must be a directory containing the Android SDK")
|
parser.error("Invalid $ANDROID_HOME or --android-home: must be a directory containing the Android SDK")
|
||||||
if args.android_ndk_home is None or not Path(args.android_ndk_home).is_dir():
|
if args.android_ndk_home is None or not Path(args.android_ndk_home).is_dir():
|
||||||
parser.error("Invalid $ANDROID_NDK_HOME or --android_ndk_home: must be a directory containing the Android NDK")
|
parser.error("Invalid $ANDROID_NDK_HOME or --android-ndk-home: must be a directory containing the Android NDK")
|
||||||
if args.android_api is None:
|
if args.android_api is None:
|
||||||
with section_printer.group("Detect Android APIS"):
|
with section_printer.group("Detect Android APIS"):
|
||||||
args.android_api = releaser._detect_android_api(android_home=args.android_home)
|
args.android_api = releaser._detect_android_api(android_home=args.android_home)
|
||||||
@@ -1530,7 +1535,7 @@ def main(argv=None) -> int:
|
|||||||
parser.error("Invalid --android-api, and/or could not be detected")
|
parser.error("Invalid --android-api, and/or could not be detected")
|
||||||
android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}"
|
android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}"
|
||||||
if not android_api_path.is_dir():
|
if not android_api_path.is_dir():
|
||||||
parser.error(f"Android API directory does not exist ({android_api_path})")
|
logger.warning(f"Android API directory does not exist ({android_api_path})")
|
||||||
with section_printer.group("Android arguments"):
|
with section_printer.group("Android arguments"):
|
||||||
print(f"android_home = {args.android_home}")
|
print(f"android_home = {args.android_home}")
|
||||||
print(f"android_ndk_home = {args.android_ndk_home}")
|
print(f"android_ndk_home = {args.android_ndk_home}")
|
||||||
|
|||||||
127
build-scripts/check_elf_alignment.sh
Executable file
127
build-scripts/check_elf_alignment.sh
Executable file
@@ -0,0 +1,127 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
progname="${0##*/}"
|
||||||
|
progname="${progname%.sh}"
|
||||||
|
|
||||||
|
# usage: check_elf_alignment.sh [path to *.so files|path to *.apk]
|
||||||
|
|
||||||
|
cleanup_trap() {
|
||||||
|
if [ -n "${tmp}" -a -d "${tmp}" ]; then
|
||||||
|
rm -rf ${tmp}
|
||||||
|
fi
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Host side script to check the ELF alignment of shared libraries."
|
||||||
|
echo "Shared libraries are reported ALIGNED when their ELF regions are"
|
||||||
|
echo "16 KB or 64 KB aligned. Otherwise they are reported as UNALIGNED."
|
||||||
|
echo
|
||||||
|
echo "Usage: ${progname} [input-path|input-APK|input-APEX]"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
usage
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
case ${1} in
|
||||||
|
--help | -h | -\?)
|
||||||
|
usage
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
dir="${1}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if ! [ -f "${dir}" -o -d "${dir}" ]; then
|
||||||
|
echo "Invalid file: ${dir}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${dir}" == *.apk ]]; then
|
||||||
|
trap 'cleanup_trap' EXIT
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Recursively analyzing $dir"
|
||||||
|
echo
|
||||||
|
|
||||||
|
if { zipalign --help 2>&1 | grep -q "\-P <pagesize_kb>"; }; then
|
||||||
|
echo "=== APK zip-alignment ==="
|
||||||
|
zipalign -v -c -P 16 4 "${dir}" | egrep 'lib/arm64-v8a|lib/x86_64|Verification'
|
||||||
|
echo "========================="
|
||||||
|
else
|
||||||
|
echo "NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher."
|
||||||
|
echo " You can install the latest build-tools by running the below command"
|
||||||
|
echo " and updating your \$PATH:"
|
||||||
|
echo
|
||||||
|
echo " sdkmanager \"build-tools;35.0.0-rc3\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
dir_filename=$(basename "${dir}")
|
||||||
|
tmp=$(mktemp -d -t "${dir_filename%.apk}_out_XXXXX")
|
||||||
|
unzip "${dir}" lib/* -d "${tmp}" >/dev/null 2>&1
|
||||||
|
dir="${tmp}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${dir}" == *.apex ]]; then
|
||||||
|
trap 'cleanup_trap' EXIT
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Recursively analyzing $dir"
|
||||||
|
echo
|
||||||
|
|
||||||
|
dir_filename=$(basename "${dir}")
|
||||||
|
tmp=$(mktemp -d -t "${dir_filename%.apex}_out_XXXXX")
|
||||||
|
deapexer extract "${dir}" "${tmp}" || { echo "Failed to deapex." && exit 1; }
|
||||||
|
dir="${tmp}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
RED="\e[31m"
|
||||||
|
GREEN="\e[32m"
|
||||||
|
ENDCOLOR="\e[0m"
|
||||||
|
|
||||||
|
unaligned_libs=()
|
||||||
|
unaligned_critical_libs=()
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== ELF alignment ==="
|
||||||
|
|
||||||
|
matches="$(find "${dir}" -type f)"
|
||||||
|
IFS=$'\n'
|
||||||
|
for match in $matches; do
|
||||||
|
# We could recursively call this script or rewrite it to though.
|
||||||
|
[[ "${match}" == *".apk" ]] && echo "WARNING: doesn't recursively inspect .apk file: ${match}"
|
||||||
|
[[ "${match}" == *".apex" ]] && echo "WARNING: doesn't recursively inspect .apex file: ${match}"
|
||||||
|
|
||||||
|
[[ $(file "${match}") == *"ELF"* ]] || continue
|
||||||
|
|
||||||
|
res="$(objdump -p "${match}" | grep LOAD | awk '{ print $NF }' | head -1)"
|
||||||
|
if [[ $res =~ 2\*\*(1[4-9]|[2-9][0-9]|[1-9][0-9]{2,}) ]]; then
|
||||||
|
echo -e "${match}: ${GREEN}ALIGNED${ENDCOLOR} ($res)"
|
||||||
|
else
|
||||||
|
unaligned_libs+=("${match}")
|
||||||
|
# Check if this is a critical architecture (arm64-v8a or x86_64)
|
||||||
|
if [[ "${match}" == *"arm64-v8a"* ]] || [[ "${match}" == *"x86_64"* ]]; then
|
||||||
|
unaligned_critical_libs+=("${match}")
|
||||||
|
echo -e "${match}: ${RED}UNALIGNED${ENDCOLOR} ($res)"
|
||||||
|
else
|
||||||
|
echo -e "${match}: UNALIGNED ($res)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${#unaligned_libs[@]} -gt 0 ]; then
|
||||||
|
echo -e "Found ${#unaligned_libs[@]} unaligned libs (only arm64-v8a/x86_64 libs need to be aligned).${ENDCOLOR}"
|
||||||
|
fi
|
||||||
|
echo "====================="
|
||||||
|
|
||||||
|
# Exit with appropriate code: 1 if critical unaligned libs found, 0 otherwise
|
||||||
|
if [ ${#unaligned_critical_libs[@]} -gt 0 ]; then
|
||||||
|
echo -e "${RED}Found ${#unaligned_critical_libs[@]} critical unaligned libs.${ENDCOLOR}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}ELF Verification Successful${ENDCOLOR}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
@@ -33,9 +33,9 @@
|
|||||||
#cmakedefine SDL_VENDOR_INFO "@SDL_VENDOR_INFO@"
|
#cmakedefine SDL_VENDOR_INFO "@SDL_VENDOR_INFO@"
|
||||||
|
|
||||||
#if defined(SDL_VENDOR_INFO)
|
#if defined(SDL_VENDOR_INFO)
|
||||||
#define SDL_REVISION "@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
|
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
|
||||||
#else
|
#else
|
||||||
#define SDL_REVISION "@<@PROJECT_REVISION@>@"
|
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SDL_revision_h_ */
|
#endif /* SDL_revision_h_ */
|
||||||
|
|||||||
@@ -48,9 +48,9 @@
|
|||||||
*/
|
*/
|
||||||
#define SDL_REVISION "Some arbitrary string decided at SDL build time"
|
#define SDL_REVISION "Some arbitrary string decided at SDL build time"
|
||||||
#elif defined(SDL_VENDOR_INFO)
|
#elif defined(SDL_VENDOR_INFO)
|
||||||
#define SDL_REVISION "@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
|
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
|
||||||
#else
|
#else
|
||||||
#define SDL_REVISION "@<@PROJECT_REVISION@>@"
|
#define SDL_REVISION "SDL-@<@PROJECT_REVISION@>@"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SDL_revision_h_ */
|
#endif /* SDL_revision_h_ */
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
],
|
],
|
||||||
"api-minimum": 21,
|
"api-minimum": 21,
|
||||||
"api-target": 35,
|
"api-target": 35,
|
||||||
"ndk-minimum": 21,
|
"ndk-minimum": 28,
|
||||||
"aar-files": {
|
"aar-files": {
|
||||||
"": [
|
"": [
|
||||||
"android-project/app/proguard-rules.pro:proguard.txt",
|
"android-project/app/proguard-rules.pro:proguard.txt",
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# libtool assumes that the compiler can handle the -fPIC flag
|
|
||||||
# This isn't always true (for example, nasm can't handle it)
|
|
||||||
command=""
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
case "$1" in
|
|
||||||
-?PIC)
|
|
||||||
# Ignore -fPIC and -DPIC options
|
|
||||||
;;
|
|
||||||
-fno-common)
|
|
||||||
# Ignore -fPIC and -DPIC options
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
command="$command $1"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
echo $command
|
|
||||||
exec $command
|
|
||||||
@@ -424,7 +424,11 @@ sub dewikify_chunk {
|
|||||||
$str .= "\n```$codelang\n$code\n```\n";
|
$str .= "\n```$codelang\n$code\n```\n";
|
||||||
}
|
}
|
||||||
} elsif ($dewikify_mode eq 'manpage') {
|
} elsif ($dewikify_mode eq 'manpage') {
|
||||||
$str =~ s/\./\\[char46]/gms; # make sure these can't become control codes.
|
# make sure these can't become part of roff syntax.
|
||||||
|
$str =~ s/\./\\[char46]/gms;
|
||||||
|
$str =~ s/"/\\(dq/gms;
|
||||||
|
$str =~ s/'/\\(aq/gms;
|
||||||
|
|
||||||
if ($wikitype eq 'mediawiki') {
|
if ($wikitype eq 'mediawiki') {
|
||||||
# Dump obvious wikilinks.
|
# Dump obvious wikilinks.
|
||||||
if (defined $apiprefixregex) {
|
if (defined $apiprefixregex) {
|
||||||
@@ -449,33 +453,52 @@ sub dewikify_chunk {
|
|||||||
# bullets
|
# bullets
|
||||||
$str =~ s/^\* /\n\\\(bu /gm;
|
$str =~ s/^\* /\n\\\(bu /gm;
|
||||||
} elsif ($wikitype eq 'md') {
|
} elsif ($wikitype eq 'md') {
|
||||||
|
# bullets
|
||||||
|
$str =~ s/^\- /\n\\(bu /gm;
|
||||||
|
# merge paragraphs
|
||||||
|
$str =~ s/^[ \t]+//gm;
|
||||||
|
$str =~ s/([^\-\n])\n([^\-\n])/$1 $2/g;
|
||||||
|
$str =~ s/\n\n/\n.PP\n/g;
|
||||||
|
|
||||||
# Dump obvious wikilinks.
|
# Dump obvious wikilinks.
|
||||||
if (defined $apiprefixregex) {
|
if (defined $apiprefixregex) {
|
||||||
$str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/\n.BR $1\n/gms;
|
my $apr = $apiprefixregex;
|
||||||
|
if(!($apr =~ /\A\(.*\)\Z/s)) {
|
||||||
|
# we're relying on the apiprefixregex having a capturing group.
|
||||||
|
$apr = "(" . $apr . ")";
|
||||||
|
}
|
||||||
|
$str =~ s/(\S*?)\[\`?($apr[a-zA-Z0-9_]+)\`?\]\($apr[a-zA-Z0-9_]+\)(\S*)\s*/\n.BR "" "$1" "$2" "$5"\n/gm;
|
||||||
|
# handle cases like "[x](x), [y](y), [z](z)" being separated.
|
||||||
|
while($str =~ s/(\.BR[^\n]*)\n\n\.BR/$1\n.BR/gm) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
# links
|
# links
|
||||||
$str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\n.URL "$2" "$1"\n/g;
|
$str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\n.URL "$2" "$1"\n/g;
|
||||||
|
|
||||||
# <code></code> is also popular. :/
|
# <code></code> is also popular. :/
|
||||||
$str =~ s/\s*\`(.*?)\`\s*/\n.BR $1\n/gms;
|
$str =~ s/\s*(\S*?)\`([^\n]*?)\`(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
|
||||||
|
|
||||||
# bold+italic (this looks bad, just make it bold).
|
# bold+italic (this looks bad, just make it bold).
|
||||||
$str =~ s/\s*\*\*\*(.*?)\*\*\*\s*/\n.B $1\n/gms;
|
$str =~ s/\s*(\S*?)\*\*\*([^\n]*?)\*\*\*(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
|
||||||
|
|
||||||
# bold
|
# bold
|
||||||
$str =~ s/\s*\*\*(.*?)\*\*\s*/\n.B $1\n/gms;
|
$str =~ s/\s*(\S*?)\*\*([^\n]*?)\*\*(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
|
||||||
|
|
||||||
# italic
|
# italic
|
||||||
$str =~ s/\s*\*(.*?)\*\s*/\n.I $1\n/gms;
|
$str =~ s/\s*(\S*?)\*([^\n]*?)\*(\S*)\s*/\n.IR "" "$1" "$2" "$3"\n/gms;
|
||||||
|
|
||||||
# bullets
|
|
||||||
$str =~ s/^\- /\n\\\(bu /gm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# cleanup unnecessary quotes
|
||||||
|
$str =~ s/(\.[IB]R?)(.*?) ""\n/$1$2\n/gm;
|
||||||
|
$str =~ s/(\.[IB]R?) "" ""(.*?)\n/$1$2\n/gm;
|
||||||
|
$str =~ s/"(\S+)"/$1/gm;
|
||||||
|
# cleanup unnecessary whitespace
|
||||||
|
$str =~ s/ +\n/\n/gm;
|
||||||
|
|
||||||
if (defined $code) {
|
if (defined $code) {
|
||||||
$code =~ s/\A\n+//gms;
|
$code =~ s/\A\n+//gms;
|
||||||
$code =~ s/\n+\Z//gms;
|
$code =~ s/\n+\Z//gms;
|
||||||
|
$code =~ s/\\/\\(rs/gms;
|
||||||
if ($dewikify_manpage_code_indent) {
|
if ($dewikify_manpage_code_indent) {
|
||||||
$str .= "\n.IP\n"
|
$str .= "\n.IP\n"
|
||||||
} else {
|
} else {
|
||||||
@@ -580,7 +603,7 @@ sub dewikify {
|
|||||||
$retval .= dewikify_chunk($wikitype, $1, $2, $3);
|
$retval .= dewikify_chunk($wikitype, $1, $2, $3);
|
||||||
}
|
}
|
||||||
} elsif ($wikitype eq 'md') {
|
} elsif ($wikitype eq 'md') {
|
||||||
while ($str =~ s/\A(.*?)\n```(.*?)\n(.*?)\n```\n//ms) {
|
while ($str =~ s/\A(.*?)\n?```(.*?)\n(.*?)\n```\n//ms) {
|
||||||
$retval .= dewikify_chunk($wikitype, $1, $2, $3);
|
$retval .= dewikify_chunk($wikitype, $1, $2, $3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2765,7 +2788,6 @@ __EOF__
|
|||||||
my $wikitype = $wikitypes{$sym};
|
my $wikitype = $wikitypes{$sym};
|
||||||
my $sectionsref = $wikisyms{$sym};
|
my $sectionsref = $wikisyms{$sym};
|
||||||
my $remarks = $sectionsref->{'Remarks'};
|
my $remarks = $sectionsref->{'Remarks'};
|
||||||
my $params = $sectionsref->{'Function Parameters'};
|
|
||||||
my $returns = $sectionsref->{'Return Value'};
|
my $returns = $sectionsref->{'Return Value'};
|
||||||
my $version = $sectionsref->{'Version'};
|
my $version = $sectionsref->{'Version'};
|
||||||
my $threadsafety = $sectionsref->{'Thread Safety'};
|
my $threadsafety = $sectionsref->{'Thread Safety'};
|
||||||
@@ -2773,6 +2795,23 @@ __EOF__
|
|||||||
my $examples = $sectionsref->{'Code Examples'};
|
my $examples = $sectionsref->{'Code Examples'};
|
||||||
my $deprecated = $sectionsref->{'Deprecated'};
|
my $deprecated = $sectionsref->{'Deprecated'};
|
||||||
my $headerfile = $manpageheaderfiletext;
|
my $headerfile = $manpageheaderfiletext;
|
||||||
|
|
||||||
|
my $params = undef;
|
||||||
|
|
||||||
|
if ($symtype == -1) { # category documentation block.
|
||||||
|
# nothing to be done here.
|
||||||
|
} elsif (($symtype == 1) || (($symtype == 5))) { # we'll assume a typedef (5) with a \param is a function pointer typedef.
|
||||||
|
$params = $sectionsref->{'Function Parameters'};
|
||||||
|
} elsif ($symtype == 2) {
|
||||||
|
$params = $sectionsref->{'Macro Parameters'};
|
||||||
|
} elsif ($symtype == 3) {
|
||||||
|
$params = $sectionsref->{'Fields'};
|
||||||
|
} elsif ($symtype == 4) {
|
||||||
|
$params = $sectionsref->{'Values'};
|
||||||
|
} else {
|
||||||
|
die("Unexpected symtype $symtype");
|
||||||
|
}
|
||||||
|
|
||||||
$headerfile =~ s/\%fname\%/$headersymslocation{$sym}/g;
|
$headerfile =~ s/\%fname\%/$headersymslocation{$sym}/g;
|
||||||
$headerfile .= "\n";
|
$headerfile .= "\n";
|
||||||
|
|
||||||
@@ -2839,18 +2878,22 @@ __EOF__
|
|||||||
$str .= dewikify($wikitype, $deprecated) . "\n";
|
$str .= dewikify($wikitype, $deprecated) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $incfile = $mainincludefname;
|
||||||
if (defined $headerfile) {
|
if (defined $headerfile) {
|
||||||
$str .= ".SH HEADER FILE\n";
|
if($headerfile =~ /Defined in (.*)/) {
|
||||||
$str .= dewikify($wikitype, $headerfile) . "\n";
|
$incfile = $1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$str .= ".SH SYNOPSIS\n";
|
$str .= ".SH SYNOPSIS\n";
|
||||||
$str .= ".nf\n";
|
$str .= ".nf\n";
|
||||||
$str .= ".B #include \\(dq$mainincludefname\\(dq\n";
|
$str .= ".B #include <$incfile>\n";
|
||||||
$str .= ".PP\n";
|
$str .= ".PP\n";
|
||||||
|
|
||||||
my @decllines = split /\n/, $decl;
|
my @decllines = split /\n/, $decl;
|
||||||
foreach (@decllines) {
|
foreach (@decllines) {
|
||||||
|
$_ =~ s/\\/\\(rs/g; # fix multiline macro defs
|
||||||
|
$_ =~ s/"/\\(dq/g;
|
||||||
$str .= ".BI \"$_\n";
|
$str .= ".BI \"$_\n";
|
||||||
}
|
}
|
||||||
$str .= ".fi\n";
|
$str .= ".fi\n";
|
||||||
@@ -2938,8 +2981,11 @@ __EOF__
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (defined $returns) {
|
if (defined $returns) {
|
||||||
|
# Chop datatype in parentheses off the front.
|
||||||
|
if(!($returns =~ s/\A\([^\[]*\[[^\]]*\]\([^\)]*\)[^\)]*\) //ms)) {
|
||||||
|
$returns =~ s/\A\([^\)]*\) //ms;
|
||||||
|
}
|
||||||
$returns = dewikify($wikitype, $returns);
|
$returns = dewikify($wikitype, $returns);
|
||||||
$returns =~ s/\A\(.*?\)\s*//; # Chop datatype in parentheses off the front.
|
|
||||||
$str .= ".SH RETURN VALUE\n";
|
$str .= ".SH RETURN VALUE\n";
|
||||||
$str .= "$returns\n";
|
$str .= "$returns\n";
|
||||||
}
|
}
|
||||||
@@ -2975,6 +3021,8 @@ __EOF__
|
|||||||
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\.I\s+//; # dewikify added this, but we want to handle it.
|
||||||
|
s/\A\.PP\s*//; # dewikify added this, but we want to handle it.
|
||||||
|
s/\\\(bu//; # dewikify added this, but we want to handle it.
|
||||||
s/\A\s*[\:\*\-]\s*//;
|
s/\A\s*[\:\*\-]\s*//;
|
||||||
s/\A\s+//;
|
s/\A\s+//;
|
||||||
s/\s+\Z//;
|
s/\s+\Z//;
|
||||||
|
|||||||
@@ -164,6 +164,22 @@ function(get_git_head_revision _refspecvar _hashvar)
|
|||||||
"${GIT_DATA}/grabRef.cmake" @ONLY)
|
"${GIT_DATA}/grabRef.cmake" @ONLY)
|
||||||
include("${GIT_DATA}/grabRef.cmake")
|
include("${GIT_DATA}/grabRef.cmake")
|
||||||
|
|
||||||
|
# Fallback for reftable or other storage formats
|
||||||
|
if(NOT HEAD_HASH OR HEAD_HASH STREQUAL "")
|
||||||
|
find_package(Git QUIET)
|
||||||
|
if(GIT_FOUND)
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE HEAD_HASH
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
set(HEAD_HASH "")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(${_refspecvar}
|
set(${_refspecvar}
|
||||||
"${HEAD_REF}"
|
"${HEAD_REF}"
|
||||||
PARENT_SCOPE)
|
PARENT_SCOPE)
|
||||||
|
|||||||
@@ -25,19 +25,21 @@ if(HEAD_CONTENTS MATCHES "ref")
|
|||||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
else()
|
elseif(EXISTS "@GIT_DIR@/packed-refs")
|
||||||
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
||||||
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
||||||
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
||||||
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
||||||
endif()
|
endif()
|
||||||
|
elseif(EXISTS "@GIT_DIR@/reftable/tables.list")
|
||||||
|
configure_file("@GIT_DIR@/reftable/tables.list" "@GIT_DATA@/reftable-tables.list" COPYONLY)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# detached HEAD
|
# detached HEAD
|
||||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT HEAD_HASH)
|
if(NOT HEAD_HASH AND EXISTS "@GIT_DATA@/head-ref")
|
||||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
# Helper for Find modules
|
# Helper for Find modules
|
||||||
|
|
||||||
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||||
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
|
if(MINGW)
|
||||||
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
set(re_shared_suffix ".dll.a$")
|
||||||
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
|
||||||
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
|
||||||
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
|
||||||
else()
|
else()
|
||||||
|
set(re_shared_suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}$")
|
||||||
|
endif()
|
||||||
|
if("${_library}" MATCHES "${re_shared_suffix}")
|
||||||
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
||||||
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
||||||
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
||||||
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
|
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
|
||||||
|
else()
|
||||||
|
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
||||||
|
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
||||||
|
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
||||||
|
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# The *_LIBRARIES lists always start with the library itself
|
# The *_LIBRARIES lists always start with the library itself
|
||||||
|
|||||||
@@ -823,7 +823,7 @@ macro(CheckPTHREAD)
|
|||||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||||
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
||||||
else()
|
else()
|
||||||
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
set(PTHREAD_LDFLAGS "-pthread")
|
||||||
endif()
|
endif()
|
||||||
elseif(SYSV5)
|
elseif(SYSV5)
|
||||||
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
||||||
@@ -946,22 +946,22 @@ macro(CheckUSBHID)
|
|||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
check_library_exists(usbhid hid_init "" LIBUSBHID)
|
check_library_exists(usbhid hid_init "" LIBUSBHID)
|
||||||
if(LIBUSBHID)
|
if(LIBUSBHID)
|
||||||
check_include_file(usbhid.h HAVE_USBHID_H)
|
check_include_files("stdint.h;usbhid.h" HAVE_USBHID_H)
|
||||||
if(HAVE_USBHID_H)
|
if(HAVE_USBHID_H)
|
||||||
set(USB_CFLAGS "-DHAVE_USBHID_H")
|
set(USB_CFLAGS "-DHAVE_USBHID_H")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_include_file(libusbhid.h HAVE_LIBUSBHID_H)
|
check_include_files("stdint.h;libusbhid.h" HAVE_LIBUSBHID_H)
|
||||||
if(HAVE_LIBUSBHID_H)
|
if(HAVE_LIBUSBHID_H)
|
||||||
string(APPEND USB_CFLAGS " -DHAVE_LIBUSBHID_H")
|
string(APPEND USB_CFLAGS " -DHAVE_LIBUSBHID_H")
|
||||||
endif()
|
endif()
|
||||||
set(USB_LIBS ${USB_LIBS} usbhid)
|
set(USB_LIBS ${USB_LIBS} usbhid)
|
||||||
else()
|
else()
|
||||||
check_include_file(usb.h HAVE_USB_H)
|
check_include_files("stdint.h;usb.h" HAVE_USB_H)
|
||||||
if(HAVE_USB_H)
|
if(HAVE_USB_H)
|
||||||
set(USB_CFLAGS "-DHAVE_USB_H")
|
set(USB_CFLAGS "-DHAVE_USB_H")
|
||||||
endif()
|
endif()
|
||||||
check_include_file(libusb.h HAVE_LIBUSB_H)
|
check_include_files("stdint.h;libusb.h" HAVE_LIBUSB_H)
|
||||||
if(HAVE_LIBUSB_H)
|
if(HAVE_LIBUSB_H)
|
||||||
string(APPEND USB_CFLAGS " -DHAVE_LIBUSB_H")
|
string(APPEND USB_CFLAGS " -DHAVE_LIBUSB_H")
|
||||||
endif()
|
endif()
|
||||||
@@ -1077,6 +1077,14 @@ endmacro()
|
|||||||
|
|
||||||
# Check for HIDAPI support
|
# Check for HIDAPI support
|
||||||
macro(CheckHIDAPI)
|
macro(CheckHIDAPI)
|
||||||
|
if(ANDROID)
|
||||||
|
enable_language(CXX)
|
||||||
|
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
|
||||||
|
endif()
|
||||||
|
if(IOS OR TVOS)
|
||||||
|
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
|
||||||
|
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
|
||||||
|
endif()
|
||||||
if(SDL_HIDAPI)
|
if(SDL_HIDAPI)
|
||||||
set(HAVE_HIDAPI ON)
|
set(HAVE_HIDAPI ON)
|
||||||
if(SDL_HIDAPI_LIBUSB)
|
if(SDL_HIDAPI_LIBUSB)
|
||||||
@@ -1109,14 +1117,6 @@ macro(CheckHIDAPI)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_HIDAPI)
|
if(HAVE_HIDAPI)
|
||||||
if(ANDROID)
|
|
||||||
enable_language(CXX)
|
|
||||||
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
|
|
||||||
endif()
|
|
||||||
if(IOS OR TVOS)
|
|
||||||
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
|
|
||||||
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
|
|
||||||
endif()
|
|
||||||
set(HAVE_SDL_HIDAPI TRUE)
|
set(HAVE_SDL_HIDAPI TRUE)
|
||||||
|
|
||||||
if(SDL_JOYSTICK AND SDL_HIDAPI_JOYSTICK)
|
if(SDL_JOYSTICK AND SDL_HIDAPI_JOYSTICK)
|
||||||
@@ -1156,7 +1156,8 @@ macro(CheckRPI)
|
|||||||
set(HAVE_SDL_VIDEO TRUE)
|
set(HAVE_SDL_VIDEO TRUE)
|
||||||
set(SDL_VIDEO_DRIVER_RPI 1)
|
set(SDL_VIDEO_DRIVER_RPI 1)
|
||||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/raspberry/*.c")
|
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/raspberry/*.c")
|
||||||
sdl_link_dependency(rpi-video LIBS PkgConfig::PC_BCM_HOST PKG_CONFIG_PREFIX PC_BCM_HOST PKG_CONFIG_SPECS ${BCM_HOST_PKG_CONFIG_SPEC})
|
sdl_link_dependency(rpi-video-bcm_host LIBS PkgConfig::PC_BCM_HOST PKG_CONFIG_PREFIX PC_BCM_HOST PKG_CONFIG_SPECS ${BCM_HOST_PKG_CONFIG_SPEC})
|
||||||
|
sdl_link_dependency(rpi-video-brcmegl LIBS PkgConfig::PC_BRCMEGL PKG_CONFIG_PREFIX PC_BRCMEGL PKG_CONFIG_SPECS ${BRCMEGL_PKG_CONFIG_SPEC})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -160,3 +160,63 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(check_x86_source_compiles BODY VAR)
|
||||||
|
if(ARGN)
|
||||||
|
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
||||||
|
endif()
|
||||||
|
if(APPLE_MULTIARCH AND (SDL_CPU_X86 OR SDL_CPU_X64))
|
||||||
|
set(test_conditional 1)
|
||||||
|
else()
|
||||||
|
set(test_conditional 0)
|
||||||
|
endif()
|
||||||
|
check_c_source_compiles("
|
||||||
|
#if ${test_conditional}
|
||||||
|
# if defined(__i386__) || defined(__x86_64__)
|
||||||
|
# define test_enabled 1
|
||||||
|
# else
|
||||||
|
# define test_enabled 0 /* feign success in Apple multi-arch configs */
|
||||||
|
# endif
|
||||||
|
#else /* test normally */
|
||||||
|
# define test_enabled 1
|
||||||
|
#endif
|
||||||
|
#if test_enabled
|
||||||
|
${BODY}
|
||||||
|
#else
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif" ${VAR})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(check_arm_source_compiles BODY VAR)
|
||||||
|
if(ARGN)
|
||||||
|
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
||||||
|
endif()
|
||||||
|
if(APPLE_MULTIARCH AND (SDL_CPU_ARM32 OR SDL_CPU_ARM64))
|
||||||
|
set(test_conditional 1)
|
||||||
|
else()
|
||||||
|
set(test_conditional 0)
|
||||||
|
endif()
|
||||||
|
check_c_source_compiles("
|
||||||
|
#if ${test_conditional}
|
||||||
|
# if defined(__arm__) || defined(__aarch64__)
|
||||||
|
# define test_enabled 1
|
||||||
|
# else
|
||||||
|
# define test_enabled 0 /* feign success in Apple multi-arch configs */
|
||||||
|
# endif
|
||||||
|
#else /* test normally */
|
||||||
|
# define test_enabled 1
|
||||||
|
#endif
|
||||||
|
#if test_enabled
|
||||||
|
${BODY}
|
||||||
|
#else
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif" ${VAR})
|
||||||
|
endfunction()
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS)
|
|||||||
|
|
||||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||||
foreach(known_arch IN LISTS known_archs)
|
foreach(known_arch IN LISTS known_archs)
|
||||||
set(SDL_CPU_${known_arch} "0")
|
set(SDL_CPU_${known_arch} "0" PARENT_SCOPE)
|
||||||
endforeach()
|
endforeach()
|
||||||
set(detected_archs)
|
set(detected_archs)
|
||||||
foreach(osx_arch IN LISTS CMAKE_OSX_ARCHITECTURES)
|
foreach(osx_arch IN LISTS CMAKE_OSX_ARCHITECTURES)
|
||||||
if(osx_arch STREQUAL "x86_64")
|
if(osx_arch STREQUAL "x86_64")
|
||||||
set(SDL_CPU_X64 "1")
|
set(SDL_CPU_X64 "1" PARENT_SCOPE)
|
||||||
list(APPEND detected_archs "X64")
|
list(APPEND detected_archs "X64")
|
||||||
elseif(osx_arch STREQUAL "arm64")
|
elseif(osx_arch STREQUAL "arm64")
|
||||||
set(SDL_CPU_ARM64 "1")
|
set(SDL_CPU_ARM64 "1" PARENT_SCOPE)
|
||||||
list(APPEND detected_archs "ARM64")
|
list(APPEND detected_archs "ARM64")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ function(sdl_compile_options)
|
|||||||
target_compile_options(SDL3-static ${visibility} ${escaped_opts})
|
target_compile_options(SDL3-static ${visibility} ${escaped_opts})
|
||||||
endif()
|
endif()
|
||||||
if(NOT ARGS_NO_EXPORT AND (ARGS_PUBLIC OR ARGS_INTERFACE))
|
if(NOT ARGS_NO_EXPORT AND (ARGS_PUBLIC OR ARGS_INTERFACE))
|
||||||
set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_COMPILE_COMPILE_OPTIONS "${ARGS_UNPARSED_ARGUMENTS}")
|
set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "${ARGS_UNPARSED_ARGUMENTS}")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ SDL_LDFLAGS="$( pkg-config sdl3 --libs )"
|
|||||||
SDL_STATIC_LDFLAGS="$( pkg-config sdl3 --libs --static )"
|
SDL_STATIC_LDFLAGS="$( pkg-config sdl3 --libs --static )"
|
||||||
|
|
||||||
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $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} $SDL_LDFLAGS $LDFLAGS"
|
link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_CFLAGS $CFLAGS $SDL_LDFLAGS $LDFLAGS"
|
||||||
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
|
static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_CFLAGS $CFLAGS $SDL_STATIC_LDFLAGS $LDFLAGS"
|
||||||
|
|
||||||
echo "-- CC: $CC"
|
echo "-- CC: $CC"
|
||||||
echo "-- CFLAGS: $CFLAGS"
|
echo "-- CFLAGS: $CFLAGS"
|
||||||
echo "-- LDFLASG: $LDFLAGS"
|
echo "-- LDFLAGS: $LDFLAGS"
|
||||||
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
|
echo "-- SDL_CFLAGS: $SDL_CFLAGS"
|
||||||
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
|
echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
|
||||||
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
|
echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ The easiest way to use SDL is to include it as a subproject in your project.
|
|||||||
|
|
||||||
We'll start by creating a simple project to build and run [hello.c](hello.c)
|
We'll start by creating a simple project to build and run [hello.c](hello.c)
|
||||||
|
|
||||||
Create the file CMakeLists.txt
|
# Get a copy of the SDL source:
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/libsdl-org/SDL.git vendored/SDL
|
||||||
|
```
|
||||||
|
|
||||||
|
# Create the file CMakeLists.txt
|
||||||
```cmake
|
```cmake
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(hello)
|
project(hello)
|
||||||
@@ -25,24 +30,26 @@ add_executable(hello WIN32 hello.c)
|
|||||||
target_link_libraries(hello PRIVATE SDL3::SDL3)
|
target_link_libraries(hello PRIVATE SDL3::SDL3)
|
||||||
```
|
```
|
||||||
|
|
||||||
Build:
|
# Configure and Build:
|
||||||
```sh
|
```sh
|
||||||
cmake -S . -B build
|
cmake -S . -B build
|
||||||
cmake --build build
|
cmake --build build
|
||||||
```
|
```
|
||||||
|
|
||||||
Run:
|
# Run:
|
||||||
- On Windows the executable is in the build Debug directory:
|
The executable should be in the `build` directory:
|
||||||
```sh
|
|
||||||
cd build/Debug
|
|
||||||
./hello
|
|
||||||
```
|
|
||||||
- On other platforms the executable is in the build directory:
|
|
||||||
```sh
|
```sh
|
||||||
cd build
|
cd build
|
||||||
./hello
|
./hello
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If there wasn't an executable there despite the above Build section running successfully, it's likely because you're following this guide using the Visual Studio toolchain, it should instead be in the `build/Debug` directory:
|
||||||
|
```sh
|
||||||
|
cd build/Debug
|
||||||
|
./hello
|
||||||
|
```
|
||||||
|
|
||||||
A more complete example is available at:
|
A more complete example is available at:
|
||||||
|
|
||||||
https://github.com/Ravbug/sdl3-sample
|
https://github.com/Ravbug/sdl3-sample
|
||||||
|
|||||||
95
docs/INTRO-mingw.md
Normal file
95
docs/INTRO-mingw.md
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# Introduction to SDL with MinGW
|
||||||
|
|
||||||
|
Without getting deep into the history, MinGW is a long running project that aims to bring gcc to Windows. That said, there's many distributions, versions, and forks floating around. We recommend installing [MSYS2](https://www.msys2.org/), as it's the easiest way to get a modern toolchain with a package manager to help with dependency management. This would allow you to follow the MSYS2 section below.
|
||||||
|
|
||||||
|
Otherwise you'll want to follow the "Other Distributions" section below.
|
||||||
|
|
||||||
|
We'll start by creating a simple project to build and run [hello.c](hello.c).
|
||||||
|
|
||||||
|
# MSYS2
|
||||||
|
|
||||||
|
Open the `MSYS2 UCRT64` prompt and then ensure you've installed the following packages. This will get you working toolchain, CMake, Ninja, and of course SDL3.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-sdl3
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create the file CMakeLists.txt
|
||||||
|
```cmake
|
||||||
|
cmake_minimum_required(VERSION 3.26)
|
||||||
|
project(hello C CXX)
|
||||||
|
|
||||||
|
find_package(SDL3 REQUIRED)
|
||||||
|
|
||||||
|
add_executable(hello)
|
||||||
|
|
||||||
|
target_sources(hello
|
||||||
|
PRIVATE
|
||||||
|
hello.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(hello SDL3::SDL3)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configure and Build:
|
||||||
|
```sh
|
||||||
|
cmake -S . -B build
|
||||||
|
cmake --build build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run:
|
||||||
|
|
||||||
|
The executable is in the `build` directory:
|
||||||
|
```sh
|
||||||
|
cd build
|
||||||
|
./hello
|
||||||
|
```
|
||||||
|
|
||||||
|
# Other Distributions
|
||||||
|
|
||||||
|
Things can get quite complicated with other distributions of MinGW. If you can't follow [the cmake intro](INTRO-cmake.md), perhaps due to issues getting cmake to understand your toolchain, this section should work.
|
||||||
|
|
||||||
|
## Acquire SDL
|
||||||
|
|
||||||
|
Download the `SDL3-devel-<version>-mingw.zip` asset from [the latest release.](https://github.com/libsdl-org/SDL/releases/latest) Then extract it inside your project folder such that the output of `ls SDL3-<version>` looks like `INSTALL.md LICENSE.txt Makefile README.md cmake i686-w64-mingw32 x86_64-w64-mingw32`.
|
||||||
|
|
||||||
|
## Know your Target Architecture
|
||||||
|
|
||||||
|
It is not uncommon for folks to not realize their distribution is targeting 32bit Windows despite things like the name of the toolchain, or the fact that they're running on a 64bit system. We'll ensure we know up front what we need:
|
||||||
|
|
||||||
|
Create a file named `arch.c` with the following contents:
|
||||||
|
```c
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
int main() {
|
||||||
|
#if defined(__x86_64__) || defined(_M_X64) || defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
|
||||||
|
size_t ptr_size = sizeof(int*);
|
||||||
|
if (4 == ptr_size) puts("i686-w64-mingw32");
|
||||||
|
else if (8 == ptr_size) puts("x86_64-w64-mingw32");
|
||||||
|
else puts("Unknown Architecture");
|
||||||
|
#else
|
||||||
|
puts("Unknown Architecture");
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gcc arch.c
|
||||||
|
./a.exe
|
||||||
|
```
|
||||||
|
|
||||||
|
This should print out which library directory we'll need to use when compiling, keep this value in mind, you'll need to use it when compiling in the next section as `<arch>`. If you get "Unknown Architecture" please [report a bug](https://github.com/libsdl-org/SDL/issues).
|
||||||
|
|
||||||
|
|
||||||
|
## Build and Run
|
||||||
|
|
||||||
|
Now we should have everything needed to compile and run our program. You'll need to ensure to replace `<version>` with the version of the release of SDL3 you downloaded, as well as use the `<arch>` we learned in the previous section.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gcc hello.c -o hello.exe -I SDL3-<version>/<arch>/include -L SDL3-<version>/<arch>/lib -lSDL3 -mwindows
|
||||||
|
cp SDL3-<version>/<arch>/bin/SDL3.dll SDL3.dll
|
||||||
|
./hello.exe
|
||||||
|
```
|
||||||
@@ -5,10 +5,12 @@ The easiest way to use SDL is to include it as a subproject in your project.
|
|||||||
|
|
||||||
We'll start by creating a simple project to build and run [hello.c](hello.c)
|
We'll start by creating a simple project to build and run [hello.c](hello.c)
|
||||||
|
|
||||||
|
- Get a copy of the SDL source, you can clone the repo, or download the "Source Code" asset from [the latest release.](https://github.com/libsdl-org/SDL/releases/latest)
|
||||||
|
- If you've downloaded a release, make sure to extract the contents somewhere you can find it.
|
||||||
- Create a new project in Visual Studio, using the C++ Empty Project template
|
- Create a new project in Visual Studio, using the C++ Empty Project template
|
||||||
- Add hello.c to the Source Files
|
- Add hello.c to the Source Files
|
||||||
- Right click the solution, select add an existing project, navigate to VisualC/SDL and add SDL.vcxproj
|
- Right click the solution, select add an existing project, navigate to `VisualC/SDL` from within the source you cloned or downloaded above and add SDL.vcxproj
|
||||||
- Select your main project and go to Project -> Add Reference and select SDL3
|
- Select your main project and go to Project -> Add -> Reference and select SDL3
|
||||||
- Select your main project and go to Project -> Properties, set the filter at the top to "All Configurations" and "All Platforms", select VC++ Directories and add the SDL include directory to "Include Directories"
|
- Select your main project and go to Project -> Properties, set the filter at the top to "All Configurations" and "All Platforms", select C/C++ -> General and add the SDL include directory to "Additional Include Directories"
|
||||||
- Build and run!
|
- Build and run!
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ not give you any processing time after the events are delivered.
|
|||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
bool HandleAppEvents(void *userdata, SDL_Event *event)
|
||||||
{
|
{
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
@@ -250,12 +250,12 @@ e.g.
|
|||||||
/* Terminate the app.
|
/* Terminate the app.
|
||||||
Shut everything down before returning from this function.
|
Shut everything down before returning from this function.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_LOW_MEMORY:
|
case SDL_EVENT_LOW_MEMORY:
|
||||||
/* You will get this when your app is paused and iOS wants more memory.
|
/* You will get this when your app is paused and iOS wants more memory.
|
||||||
Release as much memory as possible.
|
Release as much memory as possible.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_WILL_ENTER_BACKGROUND:
|
case SDL_EVENT_WILL_ENTER_BACKGROUND:
|
||||||
/* Prepare your app to go into the background. Stop loops, etc.
|
/* Prepare your app to go into the background. Stop loops, etc.
|
||||||
This gets called when the user hits the home button, or gets a call.
|
This gets called when the user hits the home button, or gets a call.
|
||||||
@@ -264,15 +264,15 @@ e.g.
|
|||||||
in addition, you should set the render target to NULL, if you're using
|
in addition, you should set the render target to NULL, if you're using
|
||||||
it, e.g. call SDL_SetRenderTarget(renderer, NULL).
|
it, e.g. call SDL_SetRenderTarget(renderer, NULL).
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_DID_ENTER_BACKGROUND:
|
case SDL_EVENT_DID_ENTER_BACKGROUND:
|
||||||
/* Your app is NOT active at this point. */
|
/* Your app is NOT active at this point. */
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_WILL_ENTER_FOREGROUND:
|
case SDL_EVENT_WILL_ENTER_FOREGROUND:
|
||||||
/* This call happens when your app is coming back to the foreground.
|
/* This call happens when your app is coming back to the foreground.
|
||||||
Restore all your state here.
|
Restore all your state here.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_DID_ENTER_FOREGROUND:
|
case SDL_EVENT_DID_ENTER_FOREGROUND:
|
||||||
/* Restart your loops here.
|
/* Restart your loops here.
|
||||||
Your app is interactive and getting CPU again.
|
Your app is interactive and getting CPU again.
|
||||||
@@ -283,10 +283,10 @@ e.g.
|
|||||||
event SDL_EVENT_RENDER_DEVICE_RESET and recreate your OpenGL context and
|
event SDL_EVENT_RENDER_DEVICE_RESET and recreate your OpenGL context and
|
||||||
restore your textures when you get it, or quit the app.
|
restore your textures when you get it, or quit the app.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
default:
|
default:
|
||||||
/* No special processing, add it to the event queue */
|
/* No special processing, add it to the event queue */
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ SDL is fully supported on BSD platforms, and is built using [CMake](README-cmake
|
|||||||
|
|
||||||
If you want to run on the console, you can take a look at [KMSDRM support on BSD](README-kmsbsd.md)
|
If you want to run on the console, you can take a look at [KMSDRM support on BSD](README-kmsbsd.md)
|
||||||
|
|
||||||
|
SDL is [not designed to be used in setuid or setgid executables](README-platforms.md#setuid).
|
||||||
|
|||||||
@@ -1,32 +1,6 @@
|
|||||||
|
|
||||||
SDL 3.0 has new support for high DPI displays. Interfaces provided by SDL uses the platform's native coordinates unless otherwise specified.
|
SDL 3.0 has new support for high DPI displays. Interfaces provided by SDL uses the platform's native coordinates unless otherwise specified.
|
||||||
|
|
||||||
To reconcile platform differences in their approach to high-density scaling, SDL provides the following interfaces:
|
|
||||||
- `SDL_GetWindowSize()` retrieves the window dimensions in native coordinates.
|
|
||||||
- `SDL_GetWindowSizeInPixels()` retrieves the window dimensions in pixels-addressable.
|
|
||||||
- `SDL_GetDisplayContentScale()` retrieves the suggested amplification factor when drawing in native coordinates.
|
|
||||||
- `SDL_GetWindowDisplayScale()` retrieves the suggested amplification factor when drawing in pixels-addressable.
|
|
||||||
- `SDL_GetWindowPixelDensity()` retrieves how many addressable pixels correspond to one unit of native coordinates.
|
|
||||||
- `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` is emitted when the value retrievable from `SDL_GetWindowSizeInPixels()` changes.
|
|
||||||
- `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` is emitted when the value retrievable from `SDL_GetWindowDisplayScale()` changes.
|
|
||||||
- Windows created with `SDL_WINDOW_HIGH_PIXEL_DENSITY` will ask the platform to display addressable pixels at their natural scale.
|
|
||||||
|
|
||||||
## Numeric example
|
|
||||||
|
|
||||||
Given a fullscreen window spanning a 3840x2160 monitor set to 2x display or 200% scaling, the following tabulates the effect of creating a window with or without `SDL_WINDOW_HIGH_PIXEL_DENSITY` on MacOS and Win32:
|
|
||||||
|
|
||||||
| Value | MacOS (Default) | MacOS (HD) | Win32 (Default & HD) |
|
|
||||||
|--------------------------------|-----------------|------------|----------------------|
|
|
||||||
| `SDL_GetWindowSize()` | 1920x1080 | 1920x1080 | 3840x2160 |
|
|
||||||
| `SDL_GetWindowSizeInPixels()` | 1920x1080 | 3840x2160 | 3840x2160 |
|
|
||||||
| `SDL_GetDisplayContentScale()` | 1.0 | 1.0 | 2.0 |
|
|
||||||
| `SDL_GetWindowDisplayScale()` | 1.0 | 2.0 | 2.0 |
|
|
||||||
| `SDL_GetWindowPixelDensity()` | 1.0 | 2.0 | 1.0 |
|
|
||||||
|
|
||||||
Observe the philosophical difference between the approaches taken by MacOS and Win32:
|
|
||||||
- Win32 coordinate system always deals in physical device pixels, high DPI support is achieved by providing an advisory hint for the developer to enlarge drawn objects. Ignoring the advisory scale factor results in graphics appearing tiny.
|
|
||||||
- MacOS coordinate system always deals in physical content sizes, high DPI support is achieved by providing an optional flag for the developer to request finer granularity. Omitting the granularity request results in graphics appearing coarse.
|
|
||||||
|
|
||||||
## Explanation
|
## Explanation
|
||||||
|
|
||||||
Displays now have a content display scale, which is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability. You can query the display content scale using `SDL_GetDisplayContentScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
Displays now have a content display scale, which is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability. You can query the display content scale using `SDL_GetDisplayContentScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
||||||
@@ -34,3 +8,33 @@ Displays now have a content display scale, which is the expected scale for conte
|
|||||||
The window size is now distinct from the window pixel size, and the ratio between the two is the window pixel density. If the window is created with the `SDL_WINDOW_HIGH_PIXEL_DENSITY` flag, SDL will try to match the native pixel density for the display, otherwise it will try to have the pixel size match the window size. You can query the window pixel density using `SDL_GetWindowPixelDensity()`. You can query the window pixel size using `SDL_GetWindowSizeInPixels()`, and when this changes you get an `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event. You are guaranteed to get a `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event when a window is created and resized, and you can use this event to create and resize your graphics context for the window.
|
The window size is now distinct from the window pixel size, and the ratio between the two is the window pixel density. If the window is created with the `SDL_WINDOW_HIGH_PIXEL_DENSITY` flag, SDL will try to match the native pixel density for the display, otherwise it will try to have the pixel size match the window size. You can query the window pixel density using `SDL_GetWindowPixelDensity()`. You can query the window pixel size using `SDL_GetWindowSizeInPixels()`, and when this changes you get an `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event. You are guaranteed to get a `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event when a window is created and resized, and you can use this event to create and resize your graphics context for the window.
|
||||||
|
|
||||||
The window has a display scale, which is the scale from the pixel resolution to the desired content size, e.g. the combination of the pixel density and the content scale. For example, a 3840x2160 window displayed at 200% on Windows, and a 1920x1080 window with the high density flag on a 2x display on macOS will both have a pixel size of 3840x2160 and a display scale of 2.0. You can query the window display scale using `SDL_GetWindowDisplayScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
The window has a display scale, which is the scale from the pixel resolution to the desired content size, e.g. the combination of the pixel density and the content scale. For example, a 3840x2160 window displayed at 200% on Windows, and a 1920x1080 window with the high density flag on a 2x display on macOS will both have a pixel size of 3840x2160 and a display scale of 2.0. You can query the window display scale using `SDL_GetWindowDisplayScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
||||||
|
|
||||||
|
## Numeric example
|
||||||
|
|
||||||
|
Given a window spanning a 3840x2160 monitor set to 2x display or 200% scaling, the following tabulates the effect of creating a window with or without `SDL_WINDOW_HIGH_PIXEL_DENSITY` on macOS and Windows:
|
||||||
|
|
||||||
|
| Value | macOS (Default) | macOS (HD) | Windows (Default & HD) |
|
||||||
|
|--------------------------------|-----------------|------------|------------------------|
|
||||||
|
| `SDL_GetWindowSize()` | 1920x1080 | 1920x1080 | 3840x2160 |
|
||||||
|
| `SDL_GetWindowSizeInPixels()` | 1920x1080 | 3840x2160 | 3840x2160 |
|
||||||
|
| `SDL_GetDisplayContentScale()` | 1.0 | 1.0 | 2.0 |
|
||||||
|
| `SDL_GetWindowDisplayScale()` | 1.0 | 2.0 | 2.0 |
|
||||||
|
| `SDL_GetWindowPixelDensity()` | 1.0 | 2.0 | 1.0 |
|
||||||
|
|
||||||
|
Observe the difference between the approaches taken by macOS and Windows:
|
||||||
|
- The Windows and Android coordinate system always deals in physical device pixels, high DPI support is achieved by providing a content scale that tells the developer to draw objects larger. Ignoring this scale factor results in graphics appearing tiny.
|
||||||
|
- The macOS and iOS coordinate system always deals in window coordinates, high DPI support is achieved by providing an optional flag for the developer to request more pixels. Omitting this flag results in graphics having low detail.
|
||||||
|
- On Linux, X11 uses a similar approach to Windows and Wayland uses a similar approach to macOS.
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
|
||||||
|
Proper high DPI support takes into account both the content scale and the pixel density.
|
||||||
|
|
||||||
|
First, you'd create your window with the `SDL_WINDOW_HIGH_PIXEL_DENSITY` flag, assuming you want the highest detail possible. Then you'd get the window display scale to see how much your UI elements should be enlarged to be readable.
|
||||||
|
|
||||||
|
If you're using the SDL 2D renderer, SDL provides the function `SDL_ConvertEventToRenderCoordinates()` to convert mouse coordinates between window coordinates and rendering coordinates, and the more general functions `SDL_RenderCoordinatesFromWindow()` and `SDL_RenderCoordinatesToWindow()` to do other conversion between them.
|
||||||
|
|
||||||
|
If you're not using the 2D renderer, you can implement this yourself using `SDL_GetWindowPixelDensity()` as scale factor to convert from window coordinates to pixels.
|
||||||
|
|
||||||
|
Finally you'll want to test on both Windows and macOS if possible to make sure your high DPI support works in all environments.
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ not give you any processing time after the events are delivered.
|
|||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
bool HandleAppEvents(void *userdata, SDL_Event *event)
|
||||||
{
|
{
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
@@ -73,37 +73,37 @@ e.g.
|
|||||||
/* Terminate the app.
|
/* Terminate the app.
|
||||||
Shut everything down before returning from this function.
|
Shut everything down before returning from this function.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_LOW_MEMORY:
|
case SDL_EVENT_LOW_MEMORY:
|
||||||
/* You will get this when your app is paused and iOS wants more memory.
|
/* You will get this when your app is paused and iOS wants more memory.
|
||||||
Release as much memory as possible.
|
Release as much memory as possible.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_WILL_ENTER_BACKGROUND:
|
case SDL_EVENT_WILL_ENTER_BACKGROUND:
|
||||||
/* Prepare your app to go into the background. Stop loops, etc.
|
/* Prepare your app to go into the background. Stop loops, etc.
|
||||||
This gets called when the user hits the home button, or gets a call.
|
This gets called when the user hits the home button, or gets a call.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_DID_ENTER_BACKGROUND:
|
case SDL_EVENT_DID_ENTER_BACKGROUND:
|
||||||
/* This will get called if the user accepted whatever sent your app to the background.
|
/* This will get called if the user accepted whatever sent your app to the background.
|
||||||
If the user got a phone call and canceled it, you'll instead get an SDL_EVENT_DID_ENTER_FOREGROUND event and restart your loops.
|
If the user got a phone call and canceled it, you'll instead get an SDL_EVENT_DID_ENTER_FOREGROUND event and restart your loops.
|
||||||
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
||||||
Your app is NOT active at this point.
|
Your app is NOT active at this point.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_WILL_ENTER_FOREGROUND:
|
case SDL_EVENT_WILL_ENTER_FOREGROUND:
|
||||||
/* This call happens when your app is coming back to the foreground.
|
/* This call happens when your app is coming back to the foreground.
|
||||||
Restore all your state here.
|
Restore all your state here.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
case SDL_EVENT_DID_ENTER_FOREGROUND:
|
case SDL_EVENT_DID_ENTER_FOREGROUND:
|
||||||
/* Restart your loops here.
|
/* Restart your loops here.
|
||||||
Your app is interactive and getting CPU again.
|
Your app is interactive and getting CPU again.
|
||||||
*/
|
*/
|
||||||
return 0;
|
return false;
|
||||||
default:
|
default:
|
||||||
/* No special processing, add it to the event queue */
|
/* No special processing, add it to the event queue */
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ system does not have the XRandR libraries installed, it will be disabled
|
|||||||
at runtime, and you won't get a missing library error, at least with the
|
at runtime, and you won't get a missing library error, at least with the
|
||||||
default configuration parameters.
|
default configuration parameters.
|
||||||
|
|
||||||
|
SDL is [not designed to be used in setuid or setgid executables](README-platforms.md#setuid).
|
||||||
|
|
||||||
Build Dependencies
|
Build Dependencies
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ NSApplicationDelegate implementation:
|
|||||||
```objc
|
```objc
|
||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||||
{
|
{
|
||||||
if (SDL_GetEventState(SDL_EVENT_QUIT) == SDL_ENABLE) {
|
if (SDL_EventEnabled(SDL_EVENT_QUIT)) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
SDL_zero(event);
|
SDL_zero(event);
|
||||||
event.type = SDL_EVENT_QUIT;
|
event.type = SDL_EVENT_QUIT;
|
||||||
@@ -61,7 +61,7 @@ NSApplicationDelegate implementation:
|
|||||||
|
|
||||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||||
{
|
{
|
||||||
if (SDL_GetEventState(SDL_EVENT_DROP_FILE) == SDL_ENABLE) {
|
if (SDL_EventEnabled(SDL_EVENT_DROP_FILE)) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
SDL_zero(event);
|
SDL_zero(event);
|
||||||
event.type = SDL_EVENT_DROP_FILE;
|
event.type = SDL_EVENT_DROP_FILE;
|
||||||
@@ -73,6 +73,8 @@ NSApplicationDelegate implementation:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
SDL is [not designed to be used in setuid or setgid executables](README-platforms.md#setuid).
|
||||||
|
|
||||||
# Using the Simple DirectMedia Layer with a traditional Makefile
|
# Using the Simple DirectMedia Layer with a traditional Makefile
|
||||||
|
|
||||||
An existing build system for your SDL app has good chances to work almost
|
An existing build system for your SDL app has good chances to work almost
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
- [macOS](README-macos.md)
|
- [macOS](README-macos.md)
|
||||||
- [NetBSD](README-bsd.md)
|
- [NetBSD](README-bsd.md)
|
||||||
- [Nintendo Switch](README-switch.md)
|
- [Nintendo Switch](README-switch.md)
|
||||||
- [Nintendo 3DS](README-3ds.md)
|
- [Nintendo 3DS](README-n3ds.md)
|
||||||
- [OpenBSD](README-bsd.md)
|
- [OpenBSD](README-bsd.md)
|
||||||
- [PlayStation 2](README-ps2.md)
|
- [PlayStation 2](README-ps2.md)
|
||||||
- [PlayStation 4](README-ps4.md)
|
- [PlayStation 4](README-ps4.md)
|
||||||
@@ -38,3 +38,18 @@ All of these still work with [SDL2](/SDL2), which is an incompatible API, but an
|
|||||||
- QNX
|
- QNX
|
||||||
- WinPhone
|
- WinPhone
|
||||||
- WinRT/UWP
|
- WinRT/UWP
|
||||||
|
|
||||||
|
## General notes for Unix platforms
|
||||||
|
|
||||||
|
Some aspects of SDL functionality are common to all Unix-based platforms.
|
||||||
|
|
||||||
|
### <a name=setuid></a>Privileged processes (setuid, setgid, setcap)
|
||||||
|
|
||||||
|
SDL is not designed to be used in programs with elevated privileges,
|
||||||
|
such as setuid (`chmod u+s`) or setgid (`chmod g+s`) executables,
|
||||||
|
or executables with file-based capabilities
|
||||||
|
(`setcap cap_sys_nice+ep` or similar).
|
||||||
|
It does not make any attempt to avoid trusting environment variables
|
||||||
|
or other aspects of the inherited execution environment.
|
||||||
|
Programs running with elevated privileges in an attacker-controlled
|
||||||
|
execution environment should not call SDL functions.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ cmake --install build
|
|||||||
|
|
||||||
|
|
||||||
## Compiling a HelloWorld
|
## Compiling a HelloWorld
|
||||||
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
|
[PSP Hello World](https://pspdev.github.io/basic_programs.html#hello-world)
|
||||||
|
|
||||||
## To Do
|
## To Do
|
||||||
- PSP Screen Keyboard
|
- PSP Screen Keyboard
|
||||||
|
|||||||
@@ -1,60 +1,48 @@
|
|||||||
# Versioning
|
# Versioning
|
||||||
|
|
||||||
## Since 2.23.0
|
## Since 3.2.0
|
||||||
|
|
||||||
SDL follows an "odd/even" versioning policy, similar to GLib, GTK, Flatpak
|
SDL follows an "odd/even" versioning policy, similar to GLib, GTK, Flatpak
|
||||||
and older versions of the Linux kernel:
|
and older versions of the Linux kernel:
|
||||||
|
|
||||||
* The major version (first part) increases when backwards compatibility
|
* If the minor version (second part) and the patch version (third part) is
|
||||||
is broken, which will happen infrequently.
|
divisible by 2 (for example 3.2.6, 3.4.0), this indicates a version of
|
||||||
|
SDL that is believed to be stable and suitable for production use.
|
||||||
* If the minor version (second part) is divisible by 2
|
|
||||||
(for example 2.24.x, 2.26.x), this indicates a version of SDL that
|
|
||||||
is believed to be stable and suitable for production use.
|
|
||||||
|
|
||||||
* In stable releases, the patchlevel or micro version (third part)
|
* In stable releases, the patchlevel or micro version (third part)
|
||||||
indicates bugfix releases. Bugfix releases should not add or
|
indicates bugfix releases. Bugfix releases may add small changes
|
||||||
remove ABI, so the ".0" release (for example 2.24.0) should be
|
to the ABI, so newer patch versions are backwards-compatible but
|
||||||
forwards-compatible with all the bugfix releases from the
|
not fully forwards-compatible. For example, programs built against
|
||||||
same cycle (for example 2.24.1).
|
SDL 3.2.0 should work fine with SDL 3.2.8, but programs built against
|
||||||
|
SDL 3.2.8 may not work with 3.2.0.
|
||||||
|
|
||||||
* The minor version increases when new API or ABI is added, or when
|
* The minor version increases when significant changes are made that
|
||||||
other significant changes are made. Newer minor versions are
|
require longer development or testing time, e.g. major new functionality,
|
||||||
backwards-compatible, but not fully forwards-compatible.
|
or revamping support for a platform. Newer minor versions are
|
||||||
For example, programs built against SDL 2.24.x should work fine
|
backwards-compatible, but not fully forwards-compatible. For example,
|
||||||
with SDL 2.26.x, but programs built against SDL 2.26.x will not
|
programs built against SDL 3.2.x should work fine with SDL 3.4.x,
|
||||||
necessarily work with 2.24.x.
|
but programs built against SDL 3.4.x may not work with 3.2.x.
|
||||||
|
|
||||||
* If the minor version (second part) is not divisible by 2
|
* If the minor version (second part) or patch version (third part) is not
|
||||||
(for example 2.23.x, 2.25.x), this indicates a development prerelease
|
divisible by 2 (for example 3.2.9, 3.3.x), this indicates a development
|
||||||
of SDL that is not suitable for stable software distributions.
|
prerelease of SDL that is not suitable for stable software distributions.
|
||||||
Use with caution.
|
Use with caution.
|
||||||
|
|
||||||
* The patchlevel or micro version (third part) increases with
|
* The patchlevel or micro version (third part) increases with each prerelease.
|
||||||
each prerelease.
|
|
||||||
|
|
||||||
* Each prerelease might add new API and/or ABI.
|
|
||||||
|
|
||||||
* Prereleases are backwards-compatible with older stable branches.
|
* Prereleases are backwards-compatible with older stable branches.
|
||||||
For example, 2.25.x will be backwards-compatible with 2.24.x.
|
For example, programs built against SDL 3.2.x should work fine with
|
||||||
|
SDL 3.3.x, but programs built against SDL 3.3.x may not work with 3.2.x.
|
||||||
|
|
||||||
* Prereleases are not guaranteed to be backwards-compatible with
|
* Prereleases are not guaranteed to be backwards-compatible with each other.
|
||||||
each other. For example, new API or ABI added in 2.25.1
|
For example, new API or ABI added in 3.3.0 might be removed or changed in
|
||||||
might be removed or changed in 2.25.2.
|
3.3.1. If this would be a problem for you, please do not use prereleases.
|
||||||
If this would be a problem for you, please do not use prereleases.
|
|
||||||
|
|
||||||
* Only upgrade to a prerelease if you can guarantee that you will
|
* Only use a prerelease if you can guarantee that you will promptly upgrade
|
||||||
promptly upgrade to the stable release that follows it.
|
to the stable release that follows it. For example, do not use 3.3.x
|
||||||
For example, do not upgrade to 2.23.x unless you will be able to
|
unless you will be able to upgrade to 3.4.0 when it becomes available.
|
||||||
upgrade to 2.24.0 when it becomes available.
|
|
||||||
|
|
||||||
* Software distributions that have a freeze policy (in particular Linux
|
* Software distributions that have a freeze policy (in particular Linux
|
||||||
distributions with a release cycle, such as Debian and Fedora)
|
distributions with a release cycle, such as Debian and Fedora)
|
||||||
should usually only package stable releases, and not prereleases.
|
should only package stable releases, and not prereleases.
|
||||||
|
|
||||||
## Before 2.23.0
|
|
||||||
|
|
||||||
Older versions of SDL followed a similar policy, but instead of the
|
|
||||||
odd/even rule applying to the minor version, it applied to the patchlevel
|
|
||||||
(micro version, third part). For example, 2.0.22 was a stable release
|
|
||||||
and 2.0.21 was a prerelease.
|
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ encounter limitations or behavior that is different from other windowing systems
|
|||||||
`SDL_APP_ID` hint string, the desktop entry file name should match the application ID. For example, if your
|
`SDL_APP_ID` hint string, the desktop entry file name should match the application ID. For example, if your
|
||||||
application ID is set to `org.my_org.sdl_app`, the desktop entry file should be named `org.my_org.sdl_app.desktop`.
|
application ID is set to `org.my_org.sdl_app`, the desktop entry file should be named `org.my_org.sdl_app.desktop`.
|
||||||
|
|
||||||
|
### Keyboard grabs don't work when running under XWayland
|
||||||
|
|
||||||
|
- On GNOME based desktops, the dconf setting `org/gnome/mutter/wayland/xwayland-allow-grabs` must be enabled.
|
||||||
|
|
||||||
## Using custom Wayland windowing protocols with SDL windows
|
## Using custom Wayland windowing protocols with SDL windows
|
||||||
|
|
||||||
Under normal operation, an `SDL_Window` corresponds to an XDG toplevel window, which provides a standard desktop window.
|
Under normal operation, an `SDL_Window` corresponds to an XDG toplevel window, which provides a standard desktop window.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main include header for the SDL library, version 3.2.6
|
* Main include header for the SDL library, version 3.2.31
|
||||||
*
|
*
|
||||||
* It is almost always best to include just this one header instead of
|
* It is almost always best to include just this one header instead of
|
||||||
* picking out individual headers included here. There are exceptions to
|
* picking out individual headers included here. There are exceptions to
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
|
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
|
||||||
|
|
||||||
#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
#elif defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1310)
|
||||||
/* Don't include intrin.h here because it contains C++ code */
|
/* Don't include intrin.h here because it contains C++ code */
|
||||||
extern void __cdecl __debugbreak(void);
|
extern void __cdecl __debugbreak(void);
|
||||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||||
@@ -362,7 +362,7 @@ extern SDL_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 = { 0, 0, #condition, 0, 0, 0, 0 }; \
|
static struct SDL_AssertData sdl_assert_data = { false, 0, #condition, NULL, 0, NULL, NULL }; \
|
||||||
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. */ \
|
||||||
|
|||||||
@@ -942,7 +942,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
|||||||
* Binding a stream to a device will set its output format for playback
|
* Binding a stream to a device will set its output format for playback
|
||||||
* devices, and its input format for recording devices, so they match the
|
* devices, and its input format for recording devices, so they match the
|
||||||
* device's settings. The caller is welcome to change the other end of the
|
* device's settings. The caller is welcome to change the other end of the
|
||||||
* stream's format at any time with SDL_SetAudioStreamFormat().
|
* stream's format at any time with SDL_SetAudioStreamFormat(). If the other
|
||||||
|
* end of the stream's format has never been set (the audio stream was created
|
||||||
|
* with a NULL audio spec), this function will set it to match the device
|
||||||
|
* end's format.
|
||||||
*
|
*
|
||||||
* \param devid an audio device to bind a stream to.
|
* \param devid an audio device to bind a stream to.
|
||||||
* \param streams an array of audio streams to bind.
|
* \param streams an array of audio streams to bind.
|
||||||
@@ -1021,7 +1024,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
|
|||||||
/**
|
/**
|
||||||
* Query an audio stream for its currently-bound device.
|
* Query an audio stream for its currently-bound device.
|
||||||
*
|
*
|
||||||
* This reports the audio device that an audio stream is currently bound to.
|
* This reports the logical audio device that an audio stream is currently bound to.
|
||||||
*
|
*
|
||||||
* If not bound, or invalid, this returns zero, which is not a valid device
|
* If not bound, or invalid, this returns zero, which is not a valid device
|
||||||
* ID.
|
* ID.
|
||||||
@@ -1717,7 +1720,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
|
|||||||
* audio to the stream during this call; if needed, the request that triggered
|
* audio to the stream during this call; if needed, the request that triggered
|
||||||
* this callback will obtain the new data immediately.
|
* this callback will obtain the new data immediately.
|
||||||
*
|
*
|
||||||
* The callback's `approx_request` argument is roughly how many bytes of
|
* The callback's `additional_amount` argument is roughly how many bytes of
|
||||||
* _unconverted_ data (in the stream's input format) is needed by the caller,
|
* _unconverted_ data (in the stream's input format) is needed by the caller,
|
||||||
* although this may overestimate a little for safety. This takes into account
|
* although this may overestimate a little for safety. This takes into account
|
||||||
* how much is already in the stream and only asks for any extra necessary to
|
* how much is already in the stream and only asks for any extra necessary to
|
||||||
@@ -1762,13 +1765,13 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *
|
|||||||
* The callback can (optionally) call SDL_GetAudioStreamData() to obtain audio
|
* The callback can (optionally) call SDL_GetAudioStreamData() to obtain audio
|
||||||
* from the stream during this call.
|
* from the stream during this call.
|
||||||
*
|
*
|
||||||
* The callback's `approx_request` argument is how many bytes of _converted_
|
* The callback's `additional_amount` argument is how many bytes of
|
||||||
* data (in the stream's output format) was provided by the caller, although
|
* _converted_ data (in the stream's output format) was provided by the
|
||||||
* this may underestimate a little for safety. This value might be less than
|
* caller, although this may underestimate a little for safety. This value
|
||||||
* what is currently available in the stream, if data was already there, and
|
* might be less than what is currently available in the stream, if data was
|
||||||
* might be less than the caller provided if the stream needs to keep a buffer
|
* already there, and might be less than the caller provided if the stream
|
||||||
* to aid in resampling. Which means the callback may be provided with zero
|
* needs to keep a buffer to aid in resampling. Which means the callback may
|
||||||
* bytes, and a different amount on each call.
|
* be provided with zero bytes, and a different amount on each call.
|
||||||
*
|
*
|
||||||
* The callback may call SDL_GetAudioStreamAvailable to see the total amount
|
* The callback may call SDL_GetAudioStreamAvailable to see the total amount
|
||||||
* currently available to read from the stream, instead of the total provided
|
* currently available to read from the stream, instead of the total provided
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ typedef struct SDL_CameraSpec
|
|||||||
int width; /**< Frame width */
|
int width; /**< Frame width */
|
||||||
int height; /**< Frame height */
|
int height; /**< Frame height */
|
||||||
int framerate_numerator; /**< Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
int framerate_numerator; /**< Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||||
int framerate_denominator; /**< Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
int framerate_denominator; /**< Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||||
} SDL_CameraSpec;
|
} SDL_CameraSpec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text);
|
|||||||
/**
|
/**
|
||||||
* Get UTF-8 text from the clipboard.
|
* Get UTF-8 text from the clipboard.
|
||||||
*
|
*
|
||||||
* This functions returns an empty string if there was not enough memory left
|
* This function returns an empty string if there is not enough memory left
|
||||||
* for a copy of the clipboard's content.
|
* for a copy of the clipboard's content.
|
||||||
*
|
*
|
||||||
* \returns the clipboard text on success or an empty string on failure; call
|
* \returns the clipboard text on success or an empty string on failure; call
|
||||||
@@ -155,7 +155,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
|||||||
/**
|
/**
|
||||||
* Get UTF-8 text from the primary selection.
|
* Get UTF-8 text from the primary selection.
|
||||||
*
|
*
|
||||||
* This functions returns an empty string if there was not enough memory left
|
* This function returns an empty string if there is not enough memory left
|
||||||
* for a copy of the primary selection's content.
|
* for a copy of the primary selection's content.
|
||||||
*
|
*
|
||||||
* \returns the primary selection text on success or an empty string on
|
* \returns the primary selection text on success or an empty string on
|
||||||
@@ -194,15 +194,14 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
|
|||||||
* clipboard is cleared or new data is set. The clipboard is automatically
|
* clipboard is cleared or new data is set. The clipboard is automatically
|
||||||
* cleared in SDL_Quit().
|
* cleared in SDL_Quit().
|
||||||
*
|
*
|
||||||
* \param userdata a pointer to provided user data.
|
* \param userdata a pointer to the provided user data.
|
||||||
* \param mime_type the requested mime-type.
|
* \param mime_type the requested mime-type.
|
||||||
* \param size a pointer filled in with the length of the returned data.
|
* \param size a pointer filled in with the length of the returned data.
|
||||||
* \returns a pointer to the data for the provided mime-type. Returning NULL
|
* \returns a pointer to the data for the provided mime-type. Returning NULL
|
||||||
* or setting length to 0 will cause no data to be sent to the
|
* or setting the length to 0 will cause zero length data to be sent
|
||||||
* "receiver". It is up to the receiver to handle this. Essentially
|
* to the "receiver", which should be able to handle this. The
|
||||||
* returning no data is more or less undefined behavior and may cause
|
* returned data will not be freed, so it needs to be retained and
|
||||||
* breakage in receiving applications. The returned data will not be
|
* dealt with internally.
|
||||||
* freed so it needs to be retained and dealt with internally.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -211,10 +210,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
|
|||||||
typedef const void *(SDLCALL *SDL_ClipboardDataCallback)(void *userdata, const char *mime_type, size_t *size);
|
typedef const void *(SDLCALL *SDL_ClipboardDataCallback)(void *userdata, const char *mime_type, size_t *size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function that will be called when the clipboard is cleared, or new
|
* Callback function that will be called when the clipboard is cleared, or when new
|
||||||
* data is set.
|
* data is set.
|
||||||
*
|
*
|
||||||
* \param userdata a pointer to provided user data.
|
* \param userdata a pointer to the provided user data.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -231,7 +230,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
|||||||
* respond with the data for the requested mime-type.
|
* respond with the data for the requested mime-type.
|
||||||
*
|
*
|
||||||
* The size of text data does not include any terminator, and the text does
|
* The size of text data does not include any terminator, and the text does
|
||||||
* not need to be null terminated (e.g. you can directly copy a portion of a
|
* not need to be null-terminated (e.g., you can directly copy a portion of a
|
||||||
* document).
|
* document).
|
||||||
*
|
*
|
||||||
* \param callback a function pointer to the function that provides the
|
* \param callback a function pointer to the function that provides the
|
||||||
@@ -239,7 +238,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
|||||||
* \param cleanup a function pointer to the function that cleans up the
|
* \param cleanup a function pointer to the function that cleans up the
|
||||||
* clipboard data.
|
* clipboard data.
|
||||||
* \param userdata an opaque pointer that will be forwarded to the callbacks.
|
* \param userdata an opaque pointer that will be forwarded to the callbacks.
|
||||||
* \param mime_types a list of mime-types that are being offered.
|
* \param mime_types a list of mime-types that are being offered. SDL copies the given list.
|
||||||
* \param num_mime_types the number of mime-types in the mime_types list.
|
* \param num_mime_types the number of mime-types in the mime_types list.
|
||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
@@ -269,10 +268,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback
|
|||||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
|
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the data from clipboard for a given mime type.
|
* Get the data from the clipboard for a given mime type.
|
||||||
*
|
*
|
||||||
* The size of text data does not include the terminator, but the text is
|
* The size of text data does not include the terminator, but the text is
|
||||||
* guaranteed to be null terminated.
|
* guaranteed to be null-terminated.
|
||||||
*
|
*
|
||||||
* \param mime_type the mime type to read from the clipboard.
|
* \param mime_type the mime type to read from the clipboard.
|
||||||
* \param size a pointer filled in with the length of the returned data.
|
* \param size a pointer filled in with the length of the returned data.
|
||||||
@@ -292,8 +291,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, s
|
|||||||
/**
|
/**
|
||||||
* Query whether there is data in the clipboard for the provided mime type.
|
* Query whether there is data in the clipboard for the provided mime type.
|
||||||
*
|
*
|
||||||
* \param mime_type the mime type to check for data for.
|
* \param mime_type the mime type to check for data.
|
||||||
* \returns true if there exists data in clipboard for the provided mime type,
|
* \returns true if data exists in the clipboard for the provided mime type,
|
||||||
* false if it does not.
|
* false if it does not.
|
||||||
*
|
*
|
||||||
* \threadsafety This function should only be called on the main thread.
|
* \threadsafety This function should only be called on the main thread.
|
||||||
@@ -310,7 +309,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type);
|
|||||||
*
|
*
|
||||||
* \param num_mime_types a pointer filled with the number of mime types, may
|
* \param num_mime_types a pointer filled with the number of mime types, may
|
||||||
* be NULL.
|
* be NULL.
|
||||||
* \returns a null terminated array of strings with mime types, or NULL on
|
* \returns a null-terminated array of strings with mime types, or NULL on
|
||||||
* failure; call SDL_GetError() for more information. This should be
|
* failure; call SDL_GetError() for more information. This should be
|
||||||
* freed with SDL_free() when it is no longer needed.
|
* freed with SDL_free() when it is no longer needed.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||||
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
||||||
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
||||||
#ifdef __clang__
|
#if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch)
|
||||||
#ifndef __PRFCHWINTRIN_H
|
#ifndef __PRFCHWINTRIN_H
|
||||||
#define __PRFCHWINTRIN_H
|
#define __PRFCHWINTRIN_H
|
||||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||||
@@ -128,7 +128,7 @@ _m_prefetch(void *__P)
|
|||||||
* \sa SDL_BIG_ENDIAN
|
* \sa SDL_BIG_ENDIAN
|
||||||
*/
|
*/
|
||||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
|
#define SDL_BYTEORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
|
||||||
#elif defined(SDL_PLATFORM_LINUX)
|
#elif defined(SDL_PLATFORM_LINUX) || defined(__GLIBC__)
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#define SDL_BYTEORDER __BYTE_ORDER
|
#define SDL_BYTEORDER __BYTE_ORDER
|
||||||
#elif defined(SDL_PLATFORM_SOLARIS)
|
#elif defined(SDL_PLATFORM_SOLARIS)
|
||||||
@@ -486,7 +486,7 @@ SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { return x_but_byteswapped; }
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
SDL_FORCE_INLINE Uint32 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
|
SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swap a 16-bit value from littleendian to native byte order.
|
* Swap a 16-bit value from littleendian to native byte order.
|
||||||
|
|||||||
@@ -492,6 +492,8 @@ typedef struct SDL_MouseWheelEvent
|
|||||||
SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
||||||
float mouse_x; /**< X coordinate, relative to window */
|
float mouse_x; /**< X coordinate, relative to window */
|
||||||
float mouse_y; /**< Y coordinate, relative to window */
|
float mouse_y; /**< Y coordinate, relative to window */
|
||||||
|
Sint32 integer_x; /**< The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) */
|
||||||
|
Sint32 integer_y; /**< The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) */
|
||||||
} SDL_MouseWheelEvent;
|
} SDL_MouseWheelEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1041,7 +1043,7 @@ typedef union SDL_Event
|
|||||||
} SDL_Event;
|
} SDL_Event;
|
||||||
|
|
||||||
/* Make sure we haven't broken binary compatibility */
|
/* Make sure we haven't broken binary compatibility */
|
||||||
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding));
|
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof((SDL_static_cast(SDL_Event *, NULL))->padding));
|
||||||
|
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
|
|||||||
@@ -224,8 +224,8 @@
|
|||||||
* - `drawIndirectFirstInstance`
|
* - `drawIndirectFirstInstance`
|
||||||
*
|
*
|
||||||
* **D3D12:** Supported on Windows 10 or newer, Xbox One (GDK), and Xbox
|
* **D3D12:** Supported on Windows 10 or newer, Xbox One (GDK), and Xbox
|
||||||
* Series X|S (GDK). Requires a GPU that supports DirectX 12 Feature Level
|
* Series X|S (GDK). Requires a GPU that supports DirectX 12 Feature Level 11_0 and
|
||||||
* 11_1.
|
* Resource Binding Tier 2 or above.
|
||||||
*
|
*
|
||||||
* **Metal:** Supported on macOS 10.14+ and iOS/tvOS 13.0+. Hardware
|
* **Metal:** Supported on macOS 10.14+ and iOS/tvOS 13.0+. Hardware
|
||||||
* requirements vary by operating system:
|
* requirements vary by operating system:
|
||||||
@@ -1091,7 +1091,7 @@ typedef enum SDL_GPUCompareOp
|
|||||||
SDL_GPU_COMPAREOP_LESS_OR_EQUAL, /**< The comparison evaluates reference <= test. */
|
SDL_GPU_COMPAREOP_LESS_OR_EQUAL, /**< The comparison evaluates reference <= test. */
|
||||||
SDL_GPU_COMPAREOP_GREATER, /**< The comparison evaluates reference > test. */
|
SDL_GPU_COMPAREOP_GREATER, /**< The comparison evaluates reference > test. */
|
||||||
SDL_GPU_COMPAREOP_NOT_EQUAL, /**< The comparison evaluates reference != test. */
|
SDL_GPU_COMPAREOP_NOT_EQUAL, /**< The comparison evaluates reference != test. */
|
||||||
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, /**< The comparison evalutes reference >= test. */
|
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, /**< The comparison evaluates reference >= test. */
|
||||||
SDL_GPU_COMPAREOP_ALWAYS /**< The comparison always evaluates true. */
|
SDL_GPU_COMPAREOP_ALWAYS /**< The comparison always evaluates true. */
|
||||||
} SDL_GPUCompareOp;
|
} SDL_GPUCompareOp;
|
||||||
|
|
||||||
@@ -1549,7 +1549,7 @@ typedef struct SDL_GPUSamplerCreateInfo
|
|||||||
typedef struct SDL_GPUVertexBufferDescription
|
typedef struct SDL_GPUVertexBufferDescription
|
||||||
{
|
{
|
||||||
Uint32 slot; /**< The binding slot of the vertex buffer. */
|
Uint32 slot; /**< The binding slot of the vertex buffer. */
|
||||||
Uint32 pitch; /**< The byte pitch between consecutive elements of the vertex buffer. */
|
Uint32 pitch; /**< The size of a single element + the offset between elements. */
|
||||||
SDL_GPUVertexInputRate input_rate; /**< Whether attribute addressing is a function of the vertex index or instance index. */
|
SDL_GPUVertexInputRate input_rate; /**< Whether attribute addressing is a function of the vertex index or instance index. */
|
||||||
Uint32 instance_step_rate; /**< Reserved for future use. Must be set to 0. */
|
Uint32 instance_step_rate; /**< Reserved for future use. Must be set to 0. */
|
||||||
} SDL_GPUVertexBufferDescription;
|
} SDL_GPUVertexBufferDescription;
|
||||||
@@ -2467,9 +2467,9 @@ extern SDL_DECLSPEC SDL_GPUShader * SDLCALL SDL_CreateGPUShader(
|
|||||||
* - `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT`: (Direct3D 12 only)
|
* - `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT`: (Direct3D 12 only)
|
||||||
* if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear
|
* if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear
|
||||||
* the texture to a depth of this value. Defaults to zero.
|
* the texture to a depth of this value. Defaults to zero.
|
||||||
* - `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_UINT8`: (Direct3D 12
|
* - `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER`: (Direct3D 12
|
||||||
* only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET,
|
* only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET,
|
||||||
* clear the texture to a stencil of this value. Defaults to zero.
|
* clear the texture to a stencil of this Uint8 value. Defaults to zero.
|
||||||
* - `SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING`: a name that can be displayed
|
* - `SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING`: a name that can be displayed
|
||||||
* in debugging tools.
|
* in debugging tools.
|
||||||
*
|
*
|
||||||
@@ -2495,13 +2495,13 @@ extern SDL_DECLSPEC SDL_GPUTexture * SDLCALL SDL_CreateGPUTexture(
|
|||||||
SDL_GPUDevice *device,
|
SDL_GPUDevice *device,
|
||||||
const SDL_GPUTextureCreateInfo *createinfo);
|
const SDL_GPUTextureCreateInfo *createinfo);
|
||||||
|
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT "SDL.gpu.texture.create.d3d12.clear.r"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT "SDL.gpu.texture.create.d3d12.clear.r"
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT "SDL.gpu.texture.create.d3d12.clear.g"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT "SDL.gpu.texture.create.d3d12.clear.g"
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT "SDL.gpu.texture.create.d3d12.clear.b"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT "SDL.gpu.texture.create.d3d12.clear.b"
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT "SDL.gpu.texture.create.d3d12.clear.a"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT "SDL.gpu.texture.create.d3d12.clear.a"
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.texture.create.d3d12.clear.depth"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.texture.create.d3d12.clear.depth"
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.texture.create.d3d12.clear.stencil"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER "SDL.gpu.texture.create.d3d12.clear.stencil"
|
||||||
#define SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING "SDL.gpu.texture.create.name"
|
#define SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING "SDL.gpu.texture.create.name"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a buffer object to be used in graphics or compute workflows.
|
* Creates a buffer object to be used in graphics or compute workflows.
|
||||||
@@ -2648,7 +2648,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel(
|
|||||||
const char *text);
|
const char *text);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begins a debug group with an arbitary name.
|
* Begins a debug group with an arbitrary name.
|
||||||
*
|
*
|
||||||
* Used for denoting groups of calls when viewing the command buffer
|
* Used for denoting groups of calls when viewing the command buffer
|
||||||
* callstream in a graphics debugging tool.
|
* callstream in a graphics debugging tool.
|
||||||
@@ -3775,7 +3775,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice(
|
|||||||
* supported via SDL_WindowSupportsGPUPresentMode /
|
* supported via SDL_WindowSupportsGPUPresentMode /
|
||||||
* SDL_WindowSupportsGPUSwapchainComposition prior to calling this function.
|
* SDL_WindowSupportsGPUSwapchainComposition prior to calling this function.
|
||||||
*
|
*
|
||||||
* SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always
|
* SDL_GPU_PRESENTMODE_VSYNC with SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always
|
||||||
* supported.
|
* supported.
|
||||||
*
|
*
|
||||||
* \param device a GPU context.
|
* \param device a GPU context.
|
||||||
@@ -4145,7 +4145,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsFormat(
|
|||||||
* \param device a GPU context.
|
* \param device a GPU context.
|
||||||
* \param format the texture format to check.
|
* \param format the texture format to check.
|
||||||
* \param sample_count the sample count to check.
|
* \param sample_count the sample count to check.
|
||||||
* \returns a hardware-specific version of min(preferred, possible).
|
* \returns whether the sample count is supported for this texture format.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -595,7 +595,7 @@ extern "C" {
|
|||||||
* A variable that limits what CPU features are available.
|
* A variable that limits what CPU features are available.
|
||||||
*
|
*
|
||||||
* By default, SDL marks all features the current CPU supports as available.
|
* By default, SDL marks all features the current CPU supports as available.
|
||||||
* This hint allows to limit these to a subset.
|
* This hint allows the enabled features to be limited to a subset.
|
||||||
*
|
*
|
||||||
* When the hint is unset, or empty, SDL will enable all detected CPU
|
* When the hint is unset, or empty, SDL will enable all detected CPU
|
||||||
* features.
|
* features.
|
||||||
@@ -1074,8 +1074,8 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* By default, SDL will try all available GPU backends in a reasonable order
|
* By default, SDL will try all available GPU backends in a reasonable order
|
||||||
* until it finds one that can work, but this hint allows the app or user to
|
* until it finds one that can work, but this hint allows the app or user to
|
||||||
* force a specific target, such as "direct3d11" if, say, your hardware
|
* force a specific target, such as "direct3d12" if, say, your hardware
|
||||||
* supports D3D12 but want to try using D3D11 instead.
|
* supports Vulkan but you want to try using D3D12 instead.
|
||||||
*
|
*
|
||||||
* This hint should be set before any GPU functions are called.
|
* This hint should be set before any GPU functions are called.
|
||||||
*
|
*
|
||||||
@@ -2026,8 +2026,8 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* The variable can be set to the following values:
|
* The variable can be set to the following values:
|
||||||
*
|
*
|
||||||
* - "0": RAWINPUT drivers are not used.
|
* - "0": RAWINPUT drivers are not used. (default)
|
||||||
* - "1": RAWINPUT drivers are used. (default)
|
* - "1": RAWINPUT drivers are used.
|
||||||
*
|
*
|
||||||
* This hint should be set before SDL is initialized.
|
* This hint should be set before SDL is initialized.
|
||||||
*
|
*
|
||||||
@@ -2126,8 +2126,8 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* The variable can be set to the following values:
|
* The variable can be set to the following values:
|
||||||
*
|
*
|
||||||
* - "0": WGI is not used.
|
* - "0": WGI is not used. (default)
|
||||||
* - "1": WGI is used. (default)
|
* - "1": WGI is used.
|
||||||
*
|
*
|
||||||
* This hint should be set before SDL is initialized.
|
* This hint should be set before SDL is initialized.
|
||||||
*
|
*
|
||||||
@@ -3607,6 +3607,22 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
|
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A variable controlling whether SDL should call XSelectInput() to enable
|
||||||
|
* input events on X11 windows wrapped by SDL windows.
|
||||||
|
*
|
||||||
|
* The variable can be set to the following values:
|
||||||
|
*
|
||||||
|
* - "0": Don't call XSelectInput(), assuming the native window code has done
|
||||||
|
* it already.
|
||||||
|
* - "1": Call XSelectInput() to enable input events. (default)
|
||||||
|
*
|
||||||
|
* This hint should be set before creating a window.
|
||||||
|
*
|
||||||
|
* \since This hint is available since SDL 3.2.10.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint
|
* A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint
|
||||||
* should be used.
|
* should be used.
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ typedef Uint32 SDL_InitFlags;
|
|||||||
|
|
||||||
#define SDL_INIT_AUDIO 0x00000010u /**< `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` */
|
#define SDL_INIT_AUDIO 0x00000010u /**< `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` */
|
||||||
#define SDL_INIT_VIDEO 0x00000020u /**< `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread */
|
#define SDL_INIT_VIDEO 0x00000020u /**< `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread */
|
||||||
#define SDL_INIT_JOYSTICK 0x00000200u /**< `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD */
|
#define SDL_INIT_JOYSTICK 0x00000200u /**< `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` */
|
||||||
#define SDL_INIT_HAPTIC 0x00001000u
|
#define SDL_INIT_HAPTIC 0x00001000u
|
||||||
#define SDL_INIT_GAMEPAD 0x00002000u /**< `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` */
|
#define SDL_INIT_GAMEPAD 0x00002000u /**< `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` */
|
||||||
#define SDL_INIT_EVENTS 0x00004000u
|
#define SDL_INIT_EVENTS 0x00004000u
|
||||||
|
|||||||
@@ -280,12 +280,14 @@ _m_prefetch(void *__P)
|
|||||||
* \sa SDL_TARGETING
|
* \sa SDL_TARGETING
|
||||||
*/
|
*/
|
||||||
#define SDL_HAS_TARGET_ATTRIBS
|
#define SDL_HAS_TARGET_ATTRIBS
|
||||||
|
#elif defined(__loongarch64) && defined(__GNUC__) && (__GNUC__ >= 15)
|
||||||
|
/* LoongArch requires GCC 15+ for target attribute support */
|
||||||
|
# define SDL_HAS_TARGET_ATTRIBS
|
||||||
#elif defined(__clang__) && defined(__has_attribute)
|
#elif defined(__clang__) && defined(__has_attribute)
|
||||||
# if __has_attribute(target)
|
# if __has_attribute(target)
|
||||||
# define SDL_HAS_TARGET_ATTRIBS
|
# define SDL_HAS_TARGET_ATTRIBS
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__GNUC__) && (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4) /* gcc >= 4.9 */
|
#elif defined(__GNUC__) && !defined(__loongarch64) && (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4) /* gcc >= 4.9 */
|
||||||
# define SDL_HAS_TARGET_ATTRIBS
|
# define SDL_HAS_TARGET_ATTRIBS
|
||||||
#elif defined(__ICC) && __ICC >= 1600
|
#elif defined(__ICC) && __ICC >= 1600
|
||||||
# define SDL_HAS_TARGET_ATTRIBS
|
# define SDL_HAS_TARGET_ATTRIBS
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mut
|
|||||||
* \sa SDL_LockMutex
|
* \sa SDL_LockMutex
|
||||||
* \sa SDL_UnlockMutex
|
* \sa SDL_UnlockMutex
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
|
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(true, mutex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlock the mutex.
|
* Unlock the mutex.
|
||||||
@@ -559,7 +559,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
|
|||||||
* \sa SDL_TryLockRWLockForWriting
|
* \sa SDL_TryLockRWLockForWriting
|
||||||
* \sa SDL_UnlockRWLock
|
* \sa SDL_UnlockRWLock
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(true, rwlock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to lock a read/write lock _for writing_ without blocking.
|
* Try to lock a read/write lock _for writing_ without blocking.
|
||||||
@@ -589,7 +589,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
|||||||
* \sa SDL_TryLockRWLockForReading
|
* \sa SDL_TryLockRWLockForReading
|
||||||
* \sa SDL_UnlockRWLock
|
* \sa SDL_UnlockRWLock
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(true, rwlock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlock the read/write lock.
|
* Unlock the read/write lock.
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ typedef enum SDL_PackedLayout
|
|||||||
* ABGR32, define a platform-independent encoding into bytes in the order
|
* ABGR32, define a platform-independent encoding into bytes in the order
|
||||||
* specified. For example, in RGB24 data, each pixel is encoded in 3 bytes
|
* specified. For example, in RGB24 data, each pixel is encoded in 3 bytes
|
||||||
* (red, green, blue) in that order, and in ABGR32 data, each pixel is
|
* (red, green, blue) in that order, and in ABGR32 data, each pixel is
|
||||||
* encoded in 4 bytes alpha, blue, green, red) in that order. Use these
|
* encoded in 4 bytes (alpha, blue, green, red) in that order. Use these
|
||||||
* names if the property of a format that is important to you is the order
|
* names if the property of a format that is important to you is the order
|
||||||
* of the bytes in memory or on disk.
|
* of the bytes in memory or on disk.
|
||||||
* - Names with a bit count per component, such as ARGB8888 and XRGB1555, are
|
* - Names with a bit count per component, such as ARGB8888 and XRGB1555, are
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ typedef enum SDL_PowerState
|
|||||||
* It's possible a platform can only report battery percentage or time left
|
* It's possible a platform can only report battery percentage or time left
|
||||||
* but not both.
|
* but not both.
|
||||||
*
|
*
|
||||||
|
* On some platforms, retrieving power supply details might be expensive. If
|
||||||
|
* you want to display continuous status you could call this function every
|
||||||
|
* minute or so.
|
||||||
|
*
|
||||||
* \param seconds a pointer filled in with the seconds of battery life left,
|
* \param seconds a pointer filled in with the seconds of battery life left,
|
||||||
* or NULL to ignore. This will be filled in with -1 if we
|
* or NULL to ignore. This will be filled in with -1 if we
|
||||||
* can't determine a value or there is no battery.
|
* can't determine a value or there is no battery.
|
||||||
|
|||||||
@@ -125,10 +125,10 @@ typedef struct SDL_FRect
|
|||||||
*/
|
*/
|
||||||
SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
|
SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
|
||||||
{
|
{
|
||||||
frect->x = (float)rect->x;
|
frect->x = SDL_static_cast(float, rect->x);
|
||||||
frect->y = (float)rect->y;
|
frect->y = SDL_static_cast(float, rect->y);
|
||||||
frect->w = (float)rect->w;
|
frect->w = SDL_static_cast(float, rect->w);
|
||||||
frect->h = (float)rect->h;
|
frect->h = SDL_static_cast(float, rect->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1607,8 +1607,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, S
|
|||||||
* Return whether an explicit rectangle was set as the viewport.
|
* Return whether an explicit rectangle was set as the viewport.
|
||||||
*
|
*
|
||||||
* This is useful if you're saving and restoring the viewport and want to know
|
* This is useful if you're saving and restoring the viewport and want to know
|
||||||
* whether you should restore a specific rectangle or NULL. Note that the
|
* whether you should restore a specific rectangle or NULL.
|
||||||
* viewport is always reset when changing rendering targets.
|
|
||||||
*
|
*
|
||||||
* Each render target has its own viewport. This function checks the viewport
|
* Each render target has its own viewport. This function checks the viewport
|
||||||
* for the current render target.
|
* for the current render target.
|
||||||
@@ -2613,7 +2612,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderDebugText(SDL_Renderer *renderer, flo
|
|||||||
* Draw debug text to an SDL_Renderer.
|
* Draw debug text to an SDL_Renderer.
|
||||||
*
|
*
|
||||||
* This function will render a printf()-style format string to a renderer.
|
* This function will render a printf()-style format string to a renderer.
|
||||||
* Note that this is a convinence function for debugging, with severe
|
* Note that this is a convenience function for debugging, with severe
|
||||||
* limitations, and is not intended to be used for production apps and games.
|
* limitations, and is not intended to be used for production apps and games.
|
||||||
*
|
*
|
||||||
* For the full list of limitations and other useful information, see
|
* For the full list of limitations and other useful information, see
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ typedef enum SDL_Scancode
|
|||||||
|
|
||||||
SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
|
SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
|
||||||
* keyboards have over ANSI ones,
|
* keyboards have over ANSI ones,
|
||||||
* located between left shift and Y.
|
* located between left shift and Z.
|
||||||
* Produces GRAVE ACCENT and TILDE in a
|
* Produces GRAVE ACCENT and TILDE in a
|
||||||
* US or UK Mac layout, REVERSE SOLIDUS
|
* US or UK Mac layout, REVERSE SOLIDUS
|
||||||
* (backslash) and VERTICAL LINE in a
|
* (backslash) and VERTICAL LINE in a
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ typedef enum SDL_SensorType
|
|||||||
SDL_SENSOR_ACCEL_L, /**< Accelerometer for left Joy-Con controller and Wii nunchuk */
|
SDL_SENSOR_ACCEL_L, /**< Accelerometer for left Joy-Con controller and Wii nunchuk */
|
||||||
SDL_SENSOR_GYRO_L, /**< Gyroscope for left Joy-Con controller */
|
SDL_SENSOR_GYRO_L, /**< Gyroscope for left Joy-Con controller */
|
||||||
SDL_SENSOR_ACCEL_R, /**< Accelerometer for right Joy-Con controller */
|
SDL_SENSOR_ACCEL_R, /**< Accelerometer for right Joy-Con controller */
|
||||||
SDL_SENSOR_GYRO_R /**< Gyroscope for right Joy-Con controller */
|
SDL_SENSOR_GYRO_R, /**< Gyroscope for right Joy-Con controller */
|
||||||
|
SDL_SENSOR_COUNT
|
||||||
} SDL_SensorType;
|
} SDL_SensorType;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1164,7 +1164,7 @@ typedef struct SDL_alignment_test
|
|||||||
void *b;
|
void *b;
|
||||||
} SDL_alignment_test;
|
} SDL_alignment_test;
|
||||||
SDL_COMPILE_TIME_ASSERT(struct_alignment, sizeof(SDL_alignment_test) == (2 * sizeof(void *)));
|
SDL_COMPILE_TIME_ASSERT(struct_alignment, sizeof(SDL_alignment_test) == (2 * sizeof(void *)));
|
||||||
SDL_COMPILE_TIME_ASSERT(two_s_complement, (int)~(int)0 == (int)(-1));
|
SDL_COMPILE_TIME_ASSERT(two_s_complement, SDL_static_cast(int, ~SDL_static_cast(int, 0)) == SDL_static_cast(int, -1));
|
||||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
||||||
/** \endcond */
|
/** \endcond */
|
||||||
|
|
||||||
@@ -1299,8 +1299,11 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* If `size` is 0, it will be set to 1.
|
* If `size` is 0, it will be set to 1.
|
||||||
*
|
*
|
||||||
* If you want to allocate memory aligned to a specific alignment, consider
|
* If the allocation is successful, the returned pointer is guaranteed to be
|
||||||
* using SDL_aligned_alloc().
|
* aligned to either the *fundamental alignment* (`alignof(max_align_t)` in
|
||||||
|
* C11 and later) or `2 * sizeof(void *)`, whichever is smaller. Use
|
||||||
|
* SDL_aligned_alloc() if you need to allocate memory aligned to an alignment
|
||||||
|
* greater than this guarantee.
|
||||||
*
|
*
|
||||||
* \param size the size to allocate.
|
* \param size the size to allocate.
|
||||||
* \returns a pointer to the allocated memory, or NULL if allocation failed.
|
* \returns a pointer to the allocated memory, or NULL if allocation failed.
|
||||||
@@ -1323,6 +1326,10 @@ extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_malloc(size_t size);
|
|||||||
*
|
*
|
||||||
* If either of `nmemb` or `size` is 0, they will both be set to 1.
|
* If either of `nmemb` or `size` is 0, they will both be set to 1.
|
||||||
*
|
*
|
||||||
|
* If the allocation is successful, the returned pointer is guaranteed to be
|
||||||
|
* aligned to either the *fundamental alignment* (`alignof(max_align_t)` in
|
||||||
|
* C11 and later) or `2 * sizeof(void *)`, whichever is smaller.
|
||||||
|
*
|
||||||
* \param nmemb the number of elements in the array.
|
* \param nmemb the number of elements in the array.
|
||||||
* \param size the size of each element of the array.
|
* \param size the size of each element of the array.
|
||||||
* \returns a pointer to the allocated array, or NULL if allocation failed.
|
* \returns a pointer to the allocated array, or NULL if allocation failed.
|
||||||
@@ -1357,6 +1364,11 @@ extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void * SDLCALL SDL_calloc(s
|
|||||||
* - If it returns NULL (indicating failure), then `mem` will remain valid and
|
* - If it returns NULL (indicating failure), then `mem` will remain valid and
|
||||||
* must still be freed with SDL_free().
|
* must still be freed with SDL_free().
|
||||||
*
|
*
|
||||||
|
* If the allocation is successfully resized, the returned pointer is
|
||||||
|
* guaranteed to be aligned to either the *fundamental alignment*
|
||||||
|
* (`alignof(max_align_t)` in C11 and later) or `2 * sizeof(void *)`,
|
||||||
|
* whichever is smaller.
|
||||||
|
*
|
||||||
* \param mem a pointer to allocated memory to reallocate, or NULL.
|
* \param mem a pointer to allocated memory to reallocate, or NULL.
|
||||||
* \param size the new size of the memory.
|
* \param size the new size of the memory.
|
||||||
* \returns a pointer to the newly allocated memory, or NULL if allocation
|
* \returns a pointer to the newly allocated memory, or NULL if allocation
|
||||||
@@ -3414,7 +3426,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes
|
|||||||
* Convert an integer into a string.
|
* Convert an integer into a string.
|
||||||
*
|
*
|
||||||
* This requires a radix to specified for string format. Specifying 10
|
* This requires a radix to specified for string format. Specifying 10
|
||||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||||
* to 36.
|
* to 36.
|
||||||
*
|
*
|
||||||
* Note that this function will overflow a buffer if `str` is not large enough
|
* Note that this function will overflow a buffer if `str` is not large enough
|
||||||
@@ -3442,7 +3454,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_itoa(int value, char *str, int radix);
|
|||||||
* Convert an unsigned integer into a string.
|
* Convert an unsigned integer into a string.
|
||||||
*
|
*
|
||||||
* This requires a radix to specified for string format. Specifying 10
|
* This requires a radix to specified for string format. Specifying 10
|
||||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||||
* to 36.
|
* to 36.
|
||||||
*
|
*
|
||||||
* Note that this function will overflow a buffer if `str` is not large enough
|
* Note that this function will overflow a buffer if `str` is not large enough
|
||||||
@@ -3470,7 +3482,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_uitoa(unsigned int value, char *str, int
|
|||||||
* Convert a long integer into a string.
|
* Convert a long integer into a string.
|
||||||
*
|
*
|
||||||
* This requires a radix to specified for string format. Specifying 10
|
* This requires a radix to specified for string format. Specifying 10
|
||||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||||
* to 36.
|
* to 36.
|
||||||
*
|
*
|
||||||
* Note that this function will overflow a buffer if `str` is not large enough
|
* Note that this function will overflow a buffer if `str` is not large enough
|
||||||
@@ -3498,7 +3510,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_ltoa(long value, char *str, int radix);
|
|||||||
* Convert an unsigned long integer into a string.
|
* Convert an unsigned long integer into a string.
|
||||||
*
|
*
|
||||||
* This requires a radix to specified for string format. Specifying 10
|
* This requires a radix to specified for string format. Specifying 10
|
||||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||||
* to 36.
|
* to 36.
|
||||||
*
|
*
|
||||||
* Note that this function will overflow a buffer if `str` is not large enough
|
* Note that this function will overflow a buffer if `str` is not large enough
|
||||||
@@ -3528,7 +3540,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *str, int
|
|||||||
* Convert a long long integer into a string.
|
* Convert a long long integer into a string.
|
||||||
*
|
*
|
||||||
* This requires a radix to specified for string format. Specifying 10
|
* This requires a radix to specified for string format. Specifying 10
|
||||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||||
* to 36.
|
* to 36.
|
||||||
*
|
*
|
||||||
* Note that this function will overflow a buffer if `str` is not large enough
|
* Note that this function will overflow a buffer if `str` is not large enough
|
||||||
@@ -3556,7 +3568,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_lltoa(long long value, char *str, int rad
|
|||||||
* Convert an unsigned long long integer into a string.
|
* Convert an unsigned long long integer into a string.
|
||||||
*
|
*
|
||||||
* This requires a radix to specified for string format. Specifying 10
|
* This requires a radix to specified for string format. Specifying 10
|
||||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||||
* to 36.
|
* to 36.
|
||||||
*
|
*
|
||||||
* Note that this function will overflow a buffer if `str` is not large enough
|
* Note that this function will overflow a buffer if `str` is not large enough
|
||||||
@@ -3911,7 +3923,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str
|
|||||||
extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Searches a string for the first occurence of any character contained in a
|
* Searches a string for the first occurrence of any character contained in a
|
||||||
* breakset, and returns a pointer from the string to that character.
|
* breakset, and returns a pointer from the string to that character.
|
||||||
*
|
*
|
||||||
* \param str The null-terminated string to be searched. Must not be NULL, and
|
* \param str The null-terminated string to be searched. Must not be NULL, and
|
||||||
@@ -3919,7 +3931,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *st
|
|||||||
* \param breakset A null-terminated string containing the list of characters
|
* \param breakset A null-terminated string containing the list of characters
|
||||||
* to look for. Must not be NULL, and must not overlap with
|
* to look for. Must not be NULL, and must not overlap with
|
||||||
* `str`.
|
* `str`.
|
||||||
* \returns A pointer to the location, in str, of the first occurence of a
|
* \returns A pointer to the location, in str, of the first occurrence of a
|
||||||
* character present in the breakset, or NULL if none is found.
|
* character present in the breakset, or NULL if none is found.
|
||||||
*
|
*
|
||||||
* \threadsafety It is safe to call this function from any thread.
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
@@ -4644,7 +4656,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_atanf(float x);
|
|||||||
*
|
*
|
||||||
* Domain: `-INF <= x <= INF`, `-INF <= y <= INF`
|
* Domain: `-INF <= x <= INF`, `-INF <= y <= INF`
|
||||||
*
|
*
|
||||||
* Range: `-Pi/2 <= y <= Pi/2`
|
* Range: `-Pi <= y <= Pi`
|
||||||
*
|
*
|
||||||
* This function operates on double-precision floating point values, use
|
* This function operates on double-precision floating point values, use
|
||||||
* SDL_atan2f for single-precision floats.
|
* SDL_atan2f for single-precision floats.
|
||||||
@@ -4680,7 +4692,7 @@ extern SDL_DECLSPEC double SDLCALL SDL_atan2(double y, double x);
|
|||||||
*
|
*
|
||||||
* Domain: `-INF <= x <= INF`, `-INF <= y <= INF`
|
* Domain: `-INF <= x <= INF`, `-INF <= y <= INF`
|
||||||
*
|
*
|
||||||
* Range: `-Pi/2 <= y <= Pi/2`
|
* Range: `-Pi <= y <= Pi`
|
||||||
*
|
*
|
||||||
* This function operates on single-precision floating point values, use
|
* This function operates on single-precision floating point values, use
|
||||||
* SDL_atan2 for double-precision floats.
|
* SDL_atan2 for double-precision floats.
|
||||||
@@ -5809,7 +5821,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
|||||||
* This function converts text between encodings, reading from and writing to
|
* This function converts text between encodings, reading from and writing to
|
||||||
* a buffer.
|
* a buffer.
|
||||||
*
|
*
|
||||||
* It returns the number of succesful conversions on success. On error,
|
* It returns the number of successful conversions on success. On error,
|
||||||
* SDL_ICONV_E2BIG is returned when the output buffer is too small, or
|
* SDL_ICONV_E2BIG is returned when the output buffer is too small, or
|
||||||
* SDL_ICONV_EILSEQ is returned when an invalid input sequence is encountered,
|
* SDL_ICONV_EILSEQ is returned when an invalid input sequence is encountered,
|
||||||
* or SDL_ICONV_EINVAL is returned when an incomplete input sequence is
|
* or SDL_ICONV_EINVAL is returned when an incomplete input sequence is
|
||||||
@@ -5909,7 +5921,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
|
|||||||
*
|
*
|
||||||
* \since This macro is available since SDL 3.2.0.
|
* \since This macro is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
|
#define SDL_iconv_utf8_ucs2(S) SDL_reinterpret_cast(Uint16 *, SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a UTF-8 string to UCS-4.
|
* Convert a UTF-8 string to UCS-4.
|
||||||
@@ -5923,7 +5935,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
|
|||||||
*
|
*
|
||||||
* \since This macro is available since SDL 3.2.0.
|
* \since This macro is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
|
#define SDL_iconv_utf8_ucs4(S) SDL_reinterpret_cast(Uint32 *, SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a wchar_t string to UTF-8.
|
* Convert a wchar_t string to UTF-8.
|
||||||
@@ -5937,7 +5949,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
|
|||||||
*
|
*
|
||||||
* \since This macro is available since SDL 3.2.0.
|
* \since This macro is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
|
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", SDL_reinterpret_cast(const char *, S), (SDL_wcslen(S)+1)*sizeof(wchar_t))
|
||||||
|
|
||||||
|
|
||||||
/* force builds using Clang's static analysis tools to use literal C runtime
|
/* force builds using Clang's static analysis tools to use literal C runtime
|
||||||
@@ -5962,8 +5974,12 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
|
|||||||
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
|
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
|
||||||
|
/* not for windows: might conflict with string.h where strdup may have
|
||||||
|
* dllimport attribute: https://github.com/libsdl-org/SDL/issues/12948 */
|
||||||
char *strdup(const char *str);
|
char *strdup(const char *str);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Starting LLVM 16, the analyser errors out if these functions do not have
|
/* Starting LLVM 16, the analyser errors out if these functions do not have
|
||||||
their prototype defined (clang-diagnostic-implicit-function-declaration) */
|
their prototype defined (clang-diagnostic-implicit-function-declaration) */
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ typedef Uint32 SDL_SurfaceFlags;
|
|||||||
*/
|
*/
|
||||||
typedef enum SDL_ScaleMode
|
typedef enum SDL_ScaleMode
|
||||||
{
|
{
|
||||||
|
SDL_SCALEMODE_INVALID = -1,
|
||||||
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
|
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
|
||||||
SDL_SCALEMODE_LINEAR /**< linear filtering */
|
SDL_SCALEMODE_LINEAR /**< linear filtering */
|
||||||
} SDL_ScaleMode;
|
} SDL_ScaleMode;
|
||||||
@@ -156,6 +157,8 @@ typedef struct SDL_Surface SDL_Surface;
|
|||||||
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
||||||
* call SDL_GetError() for more information.
|
* call SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_CreateSurfaceFrom
|
* \sa SDL_CreateSurfaceFrom
|
||||||
@@ -184,6 +187,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_CreateSurface(int width, int heigh
|
|||||||
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
||||||
* call SDL_GetError() for more information.
|
* call SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_CreateSurface
|
* \sa SDL_CreateSurface
|
||||||
@@ -198,6 +203,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_CreateSurfaceFrom(int width, int h
|
|||||||
*
|
*
|
||||||
* \param surface the SDL_Surface to free.
|
* \param surface the SDL_Surface to free.
|
||||||
*
|
*
|
||||||
|
* \threadsafety No other thread should be using the surface when it is freed.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_CreateSurface
|
* \sa SDL_CreateSurface
|
||||||
@@ -233,6 +240,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
|
|||||||
* \returns a valid property ID on success or 0 on failure; call
|
* \returns a valid property ID on success or 0 on failure; call
|
||||||
* SDL_GetError() for more information.
|
* SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
|
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
|
||||||
@@ -255,6 +264,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceColorspace
|
* \sa SDL_GetSurfaceColorspace
|
||||||
@@ -272,6 +283,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface,
|
|||||||
* \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if
|
* \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if
|
||||||
* the surface is NULL.
|
* the surface is NULL.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfaceColorspace
|
* \sa SDL_SetSurfaceColorspace
|
||||||
@@ -300,6 +313,8 @@ extern SDL_DECLSPEC SDL_Colorspace SDLCALL SDL_GetSurfaceColorspace(SDL_Surface
|
|||||||
* the surface didn't have an index format); call SDL_GetError() for
|
* the surface didn't have an index format); call SDL_GetError() for
|
||||||
* more information.
|
* more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetPaletteColors
|
* \sa SDL_SetPaletteColors
|
||||||
@@ -316,6 +331,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface *
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_CreatePalette
|
* \sa SDL_CreatePalette
|
||||||
@@ -330,6 +347,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL
|
|||||||
* \returns a pointer to the palette used by the surface, or NULL if there is
|
* \returns a pointer to the palette used by the surface, or NULL if there is
|
||||||
* no palette used.
|
* no palette used.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfacePalette
|
* \sa SDL_SetSurfacePalette
|
||||||
@@ -353,6 +372,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_RemoveSurfaceAlternateImages
|
* \sa SDL_RemoveSurfaceAlternateImages
|
||||||
@@ -367,6 +388,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surfa
|
|||||||
* \param surface the SDL_Surface structure to query.
|
* \param surface the SDL_Surface structure to query.
|
||||||
* \returns true if alternate versions are available or false otherwise.
|
* \returns true if alternate versions are available or false otherwise.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_AddSurfaceAlternateImage
|
* \sa SDL_AddSurfaceAlternateImage
|
||||||
@@ -392,6 +415,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasAlternateImages(SDL_Surface *surf
|
|||||||
* failure; call SDL_GetError() for more information. This should be
|
* failure; call SDL_GetError() for more information. This should be
|
||||||
* freed with SDL_free() when it is no longer needed.
|
* freed with SDL_free() when it is no longer needed.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_AddSurfaceAlternateImage
|
* \sa SDL_AddSurfaceAlternateImage
|
||||||
@@ -408,6 +433,8 @@ extern SDL_DECLSPEC SDL_Surface ** SDLCALL SDL_GetSurfaceImages(SDL_Surface *sur
|
|||||||
*
|
*
|
||||||
* \param surface the SDL_Surface structure to update.
|
* \param surface the SDL_Surface structure to update.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_AddSurfaceAlternateImage
|
* \sa SDL_AddSurfaceAlternateImage
|
||||||
@@ -432,6 +459,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe. The locking referred to by
|
||||||
|
* this function is making the pixels available for direct
|
||||||
|
* access, not thread-safe locking.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_MUSTLOCK
|
* \sa SDL_MUSTLOCK
|
||||||
@@ -444,6 +475,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_LockSurface(SDL_Surface *surface);
|
|||||||
*
|
*
|
||||||
* \param surface the SDL_Surface structure to be unlocked.
|
* \param surface the SDL_Surface structure to be unlocked.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe. The locking referred to by
|
||||||
|
* this function is making the pixels available for direct
|
||||||
|
* access, not thread-safe locking.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_LockSurface
|
* \sa SDL_LockSurface
|
||||||
@@ -462,6 +497,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
|||||||
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
|
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
|
||||||
* SDL_GetError() for more information.
|
* SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_DestroySurface
|
* \sa SDL_DestroySurface
|
||||||
@@ -480,6 +517,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, bool
|
|||||||
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
|
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
|
||||||
* SDL_GetError() for more information.
|
* SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_DestroySurface
|
* \sa SDL_DestroySurface
|
||||||
@@ -504,6 +543,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file);
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_LoadBMP_IO
|
* \sa SDL_LoadBMP_IO
|
||||||
@@ -525,6 +566,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStre
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_LoadBMP
|
* \sa SDL_LoadBMP
|
||||||
@@ -543,6 +586,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *f
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_BlitSurface
|
* \sa SDL_BlitSurface
|
||||||
@@ -559,6 +604,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, bool en
|
|||||||
* \param surface the SDL_Surface structure to query.
|
* \param surface the SDL_Surface structure to query.
|
||||||
* \returns true if the surface is RLE enabled, false otherwise.
|
* \returns true if the surface is RLE enabled, false otherwise.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfaceRLE
|
* \sa SDL_SetSurfaceRLE
|
||||||
@@ -581,6 +628,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceColorKey
|
* \sa SDL_GetSurfaceColorKey
|
||||||
@@ -597,6 +646,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, bo
|
|||||||
* \param surface the SDL_Surface structure to query.
|
* \param surface the SDL_Surface structure to query.
|
||||||
* \returns true if the surface has a color key, false otherwise.
|
* \returns true if the surface has a color key, false otherwise.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfaceColorKey
|
* \sa SDL_SetSurfaceColorKey
|
||||||
@@ -617,6 +668,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfaceColorKey
|
* \sa SDL_SetSurfaceColorKey
|
||||||
@@ -640,6 +693,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Ui
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceColorMod
|
* \sa SDL_GetSurfaceColorMod
|
||||||
@@ -658,6 +713,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Ui
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceAlphaMod
|
* \sa SDL_GetSurfaceAlphaMod
|
||||||
@@ -678,6 +735,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Ui
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceAlphaMod
|
* \sa SDL_GetSurfaceAlphaMod
|
||||||
@@ -693,6 +752,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Ui
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceColorMod
|
* \sa SDL_GetSurfaceColorMod
|
||||||
@@ -712,6 +773,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Ui
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceBlendMode
|
* \sa SDL_GetSurfaceBlendMode
|
||||||
@@ -726,6 +789,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, S
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfaceBlendMode
|
* \sa SDL_SetSurfaceBlendMode
|
||||||
@@ -747,6 +812,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, S
|
|||||||
* \returns true if the rectangle intersects the surface, otherwise false and
|
* \returns true if the rectangle intersects the surface, otherwise false and
|
||||||
* blits will be completely clipped.
|
* blits will be completely clipped.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetSurfaceClipRect
|
* \sa SDL_GetSurfaceClipRect
|
||||||
@@ -766,6 +833,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, co
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetSurfaceClipRect
|
* \sa SDL_SetSurfaceClipRect
|
||||||
@@ -780,6 +849,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SD
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
|
extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
|
||||||
@@ -796,6 +867,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipM
|
|||||||
* \returns a copy of the surface or NULL on failure; call SDL_GetError() for
|
* \returns a copy of the surface or NULL on failure; call SDL_GetError() for
|
||||||
* more information.
|
* more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_DestroySurface
|
* \sa SDL_DestroySurface
|
||||||
@@ -815,6 +888,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_DuplicateSurface(SDL_Surface *surf
|
|||||||
* \returns a copy of the surface or NULL on failure; call SDL_GetError() for
|
* \returns a copy of the surface or NULL on failure; call SDL_GetError() for
|
||||||
* more information.
|
* more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_DestroySurface
|
* \sa SDL_DestroySurface
|
||||||
@@ -840,6 +915,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ScaleSurface(SDL_Surface *surface,
|
|||||||
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
||||||
* call SDL_GetError() for more information.
|
* call SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_ConvertSurfaceAndColorspace
|
* \sa SDL_ConvertSurfaceAndColorspace
|
||||||
@@ -866,6 +943,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface(SDL_Surface *surfac
|
|||||||
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
* \returns the new SDL_Surface structure that is created or NULL on failure;
|
||||||
* call SDL_GetError() for more information.
|
* call SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_ConvertSurface
|
* \sa SDL_ConvertSurface
|
||||||
@@ -887,6 +966,10 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Su
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety The same destination pixels should not be used from two
|
||||||
|
* threads at once. It is safe to use the same source pixels
|
||||||
|
* from multiple threads.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_ConvertPixelsAndColorspace
|
* \sa SDL_ConvertPixelsAndColorspace
|
||||||
@@ -916,6 +999,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixels(int width, int height, SDL_Pi
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety The same destination pixels should not be used from two
|
||||||
|
* threads at once. It is safe to use the same source pixels
|
||||||
|
* from multiple threads.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_ConvertPixels
|
* \sa SDL_ConvertPixels
|
||||||
@@ -940,6 +1027,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, int h
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety The same destination pixels should not be used from two
|
||||||
|
* threads at once. It is safe to use the same source pixels
|
||||||
|
* from multiple threads.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear);
|
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear);
|
||||||
@@ -955,6 +1046,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear);
|
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear);
|
||||||
@@ -975,6 +1068,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surfac
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a);
|
extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a);
|
||||||
@@ -998,6 +1093,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r,
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_FillSurfaceRects
|
* \sa SDL_FillSurfaceRects
|
||||||
@@ -1023,6 +1120,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_FillSurfaceRect
|
* \sa SDL_FillSurfaceRect
|
||||||
@@ -1036,9 +1135,6 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SD
|
|||||||
* If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
|
* If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
|
||||||
* `dst`) is copied while ensuring clipping to `dst->clip_rect`.
|
* `dst`) is copied while ensuring clipping to `dst->clip_rect`.
|
||||||
*
|
*
|
||||||
* The final blit rectangles are saved in `srcrect` and `dstrect` after all
|
|
||||||
* clipping is performed.
|
|
||||||
*
|
|
||||||
* The blit function should not be called on a locked surface.
|
* The blit function should not be called on a locked surface.
|
||||||
*
|
*
|
||||||
* The blit semantics for surfaces with and without blending and colorkey are
|
* The blit semantics for surfaces with and without blending and colorkey are
|
||||||
@@ -1096,9 +1192,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SD
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1121,9 +1216,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rec
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1146,9 +1240,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, cons
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1172,9 +1265,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const S
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1187,17 +1279,17 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src
|
|||||||
*
|
*
|
||||||
* \param src the SDL_Surface structure to be copied from.
|
* \param src the SDL_Surface structure to be copied from.
|
||||||
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
||||||
* copied, may not be NULL.
|
* copied, or NULL to copy the entire surface.
|
||||||
* \param dst the SDL_Surface structure that is the blit target.
|
* \param dst the SDL_Surface structure that is the blit target.
|
||||||
* \param dstrect the SDL_Rect structure representing the target rectangle in
|
* \param dstrect the SDL_Rect structure representing the target rectangle in
|
||||||
* the destination surface, may not be NULL.
|
* the destination surface, or NULL to fill the entire
|
||||||
|
* destination surface.
|
||||||
* \param scaleMode the SDL_ScaleMode to be used.
|
* \param scaleMode the SDL_ScaleMode to be used.
|
||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.4.0.
|
* \since This function is available since SDL 3.4.0.
|
||||||
*
|
*
|
||||||
@@ -1221,9 +1313,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_StretchSurface(SDL_Surface *src, const SDL_
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1251,9 +1342,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SD
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1288,9 +1378,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src,
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* \threadsafety The same destination surface should not be used from two
|
* \threadsafety Only one thread should be using the `src` and `dst` surfaces
|
||||||
* threads at once. It is safe to use the same source surface
|
* at any given time.
|
||||||
* from multiple threads.
|
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
@@ -1322,6 +1411,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SD
|
|||||||
* \param b the blue component of the pixel in the range 0-255.
|
* \param b the blue component of the pixel in the range 0-255.
|
||||||
* \returns a pixel value.
|
* \returns a pixel value.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_MapSurfaceRGBA
|
* \sa SDL_MapSurfaceRGBA
|
||||||
@@ -1353,6 +1444,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8
|
|||||||
* \param a the alpha component of the pixel in the range 0-255.
|
* \param a the alpha component of the pixel in the range 0-255.
|
||||||
* \returns a pixel value.
|
* \returns a pixel value.
|
||||||
*
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_MapSurfaceRGB
|
* \sa SDL_MapSurfaceRGB
|
||||||
@@ -1382,6 +1475,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||||
@@ -1406,6 +1501,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a);
|
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a);
|
||||||
@@ -1429,6 +1526,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface,
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||||
@@ -1449,6 +1548,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int
|
|||||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
|
* \threadsafety This function is not thread safe.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 3.2.0.
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);
|
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* \since This macro is available since SDL 3.2.0.
|
* \since This macro is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
#define SDL_MICRO_VERSION 6
|
#define SDL_MICRO_VERSION 31
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This macro turns the version numbers into a numeric value.
|
* This macro turns the version numbers into a numeric value.
|
||||||
|
|||||||
@@ -426,10 +426,10 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void *userdata, SDL_EGLDi
|
|||||||
*/
|
*/
|
||||||
typedef enum SDL_GLAttr
|
typedef enum SDL_GLAttr
|
||||||
{
|
{
|
||||||
SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */
|
SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 8. */
|
||||||
SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */
|
SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 8. */
|
||||||
SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */
|
SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 8. */
|
||||||
SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */
|
SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 8. */
|
||||||
SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */
|
SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */
|
||||||
SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */
|
SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */
|
||||||
SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */
|
SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */
|
||||||
@@ -1041,6 +1041,10 @@ extern SDL_DECLSPEC SDL_Window ** SDLCALL SDL_GetWindows(int *count);
|
|||||||
/**
|
/**
|
||||||
* Create a window with the specified dimensions and flags.
|
* Create a window with the specified dimensions and flags.
|
||||||
*
|
*
|
||||||
|
* The window size is a request and may be different than expected based on
|
||||||
|
* the desktop layout and window manager policies. Your application should be
|
||||||
|
* prepared to handle a window of any size.
|
||||||
|
*
|
||||||
* `flags` may be any of the following OR'd together:
|
* `flags` may be any of the following OR'd together:
|
||||||
*
|
*
|
||||||
* - `SDL_WINDOW_FULLSCREEN`: fullscreen window at desktop resolution
|
* - `SDL_WINDOW_FULLSCREEN`: fullscreen window at desktop resolution
|
||||||
@@ -1127,6 +1131,10 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, int
|
|||||||
/**
|
/**
|
||||||
* Create a child popup window of the specified parent window.
|
* Create a child popup window of the specified parent window.
|
||||||
*
|
*
|
||||||
|
* The window size is a request and may be different than expected based on
|
||||||
|
* the desktop layout and window manager policies. Your application should be
|
||||||
|
* prepared to handle a window of any size.
|
||||||
|
*
|
||||||
* The flags parameter **must** contain at least one of the following:
|
* The flags parameter **must** contain at least one of the following:
|
||||||
*
|
*
|
||||||
* - `SDL_WINDOW_TOOLTIP`: The popup window is a tooltip and will not pass any
|
* - `SDL_WINDOW_TOOLTIP`: The popup window is a tooltip and will not pass any
|
||||||
@@ -1159,6 +1167,15 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, int
|
|||||||
* Popup windows implicitly do not have a border/decorations and do not appear
|
* Popup windows implicitly do not have a border/decorations and do not appear
|
||||||
* on the taskbar/dock or in lists of windows such as alt-tab menus.
|
* on the taskbar/dock or in lists of windows such as alt-tab menus.
|
||||||
*
|
*
|
||||||
|
* By default, popup window positions will automatically be constrained to keep
|
||||||
|
* the entire window within display bounds. This can be overridden with the
|
||||||
|
* `SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN` property.
|
||||||
|
*
|
||||||
|
* By default, popup menus will automatically grab keyboard focus from the parent
|
||||||
|
* when shown. This behavior can be overridden by setting the `SDL_WINDOW_NOT_FOCUSABLE`
|
||||||
|
* flag, setting the `SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN` property to false, or
|
||||||
|
* toggling it after creation via the `SDL_SetWindowFocusable()` function.
|
||||||
|
*
|
||||||
* If a parent window is hidden or destroyed, any child popup windows will be
|
* If a parent window is hidden or destroyed, any child popup windows will be
|
||||||
* recursively hidden or destroyed as well. Child popup windows not explicitly
|
* recursively hidden or destroyed as well. Child popup windows not explicitly
|
||||||
* hidden will be restored when the parent is shown.
|
* hidden will be restored when the parent is shown.
|
||||||
@@ -1189,12 +1206,19 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren
|
|||||||
/**
|
/**
|
||||||
* Create a window with the specified properties.
|
* Create a window with the specified properties.
|
||||||
*
|
*
|
||||||
|
* The window size is a request and may be different than expected based on
|
||||||
|
* the desktop layout and window manager policies. Your application should be
|
||||||
|
* prepared to handle a window of any size.
|
||||||
|
*
|
||||||
* These are the supported properties:
|
* These are the supported properties:
|
||||||
*
|
*
|
||||||
* - `SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN`: true if the window should
|
* - `SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN`: true if the window should
|
||||||
* be always on top
|
* be always on top
|
||||||
* - `SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN`: true if the window has no
|
* - `SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN`: true if the window has no
|
||||||
* window decoration
|
* window decoration
|
||||||
|
* - `SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN`: true if the "tooltip" and
|
||||||
|
* "menu" window types should be automatically constrained to be entirely within
|
||||||
|
* display bounds (default), false if no constraints on the position are desired.
|
||||||
* - `SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN`: true if the
|
* - `SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN`: true if the
|
||||||
* window will be used with an externally managed graphics context.
|
* window will be used with an externally managed graphics context.
|
||||||
* - `SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN`: true if the window should
|
* - `SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN`: true if the window should
|
||||||
@@ -1309,6 +1333,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_Prop
|
|||||||
|
|
||||||
#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top"
|
#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top"
|
||||||
#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless"
|
#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless"
|
||||||
|
#define SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN "SDL.window.create.constrain_popup"
|
||||||
#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable"
|
#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable"
|
||||||
#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context"
|
#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context"
|
||||||
#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags"
|
#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags"
|
||||||
@@ -1448,7 +1473,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window)
|
|||||||
* - `SDL_PROP_WINDOW_COCOA_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
* - `SDL_PROP_WINDOW_COCOA_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
||||||
* NSWindow associated with the window
|
* NSWindow associated with the window
|
||||||
* - `SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
* - `SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
||||||
* assocated with metal views on the window
|
* associated with metal views on the window
|
||||||
*
|
*
|
||||||
* On OpenVR:
|
* On OpenVR:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -51,14 +51,14 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Avoid including vulkan.h, don't define VkInstance if it's already included */
|
/* Avoid including vulkan_core.h, don't define VkInstance if it's already included */
|
||||||
#ifdef VULKAN_H_
|
#ifdef VULKAN_CORE_H_
|
||||||
#define NO_SDL_VULKAN_TYPEDEFS
|
#define NO_SDL_VULKAN_TYPEDEFS
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SDL_VULKAN_TYPEDEFS
|
#ifndef NO_SDL_VULKAN_TYPEDEFS
|
||||||
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
|
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
|
||||||
|
|
||||||
#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64)
|
||||||
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
|
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
|
||||||
#else
|
#else
|
||||||
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
|
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
|
||||||
|
|||||||
@@ -174,6 +174,7 @@
|
|||||||
#cmakedefine HAVE_MEMFD_CREATE 1
|
#cmakedefine HAVE_MEMFD_CREATE 1
|
||||||
#cmakedefine HAVE_POSIX_FALLOCATE 1
|
#cmakedefine HAVE_POSIX_FALLOCATE 1
|
||||||
#cmakedefine HAVE_SIGACTION 1
|
#cmakedefine HAVE_SIGACTION 1
|
||||||
|
#cmakedefine HAVE_SIGTIMEDWAIT 1
|
||||||
#cmakedefine HAVE_SA_SIGACTION 1
|
#cmakedefine HAVE_SA_SIGACTION 1
|
||||||
#cmakedefine HAVE_ST_MTIM 1
|
#cmakedefine HAVE_ST_MTIM 1
|
||||||
#cmakedefine HAVE_SETJMP 1
|
#cmakedefine HAVE_SETJMP 1
|
||||||
@@ -194,6 +195,8 @@
|
|||||||
#cmakedefine HAVE_ELF_AUX_INFO 1
|
#cmakedefine HAVE_ELF_AUX_INFO 1
|
||||||
#cmakedefine HAVE_POLL 1
|
#cmakedefine HAVE_POLL 1
|
||||||
#cmakedefine HAVE__EXIT 1
|
#cmakedefine HAVE__EXIT 1
|
||||||
|
#cmakedefine HAVE_GETRESUID 1
|
||||||
|
#cmakedefine HAVE_GETRESGID 1
|
||||||
|
|
||||||
#endif /* HAVE_LIBC */
|
#endif /* HAVE_LIBC */
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ typedef unsigned int uintptr_t;
|
|||||||
# define SDL_DISABLE_AVX 1
|
# define SDL_DISABLE_AVX 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define HAVE_STDARG_H 1
|
||||||
|
#define HAVE_STDDEF_H 1
|
||||||
|
|
||||||
/* This can be disabled to avoid C runtime dependencies and manifest requirements */
|
/* This can be disabled to avoid C runtime dependencies and manifest requirements */
|
||||||
#ifndef HAVE_LIBC
|
#ifndef HAVE_LIBC
|
||||||
#define HAVE_LIBC 1
|
#define HAVE_LIBC 1
|
||||||
@@ -122,8 +125,6 @@ typedef unsigned int uintptr_t;
|
|||||||
#define HAVE_LIMITS_H 1
|
#define HAVE_LIMITS_H 1
|
||||||
#define HAVE_MATH_H 1
|
#define HAVE_MATH_H 1
|
||||||
#define HAVE_SIGNAL_H 1
|
#define HAVE_SIGNAL_H 1
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDDEF_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
#define HAVE_STDIO_H 1
|
||||||
#define HAVE_STDLIB_H 1
|
#define HAVE_STDLIB_H 1
|
||||||
#define HAVE_STRING_H 1
|
#define HAVE_STRING_H 1
|
||||||
@@ -153,7 +154,6 @@ typedef unsigned int uintptr_t;
|
|||||||
#define HAVE_STRCMP 1
|
#define HAVE_STRCMP 1
|
||||||
#define HAVE_STRNCMP 1
|
#define HAVE_STRNCMP 1
|
||||||
#define HAVE_STRPBRK 1
|
#define HAVE_STRPBRK 1
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
#define HAVE_VSNPRINTF 1
|
||||||
#define HAVE_ACOS 1
|
#define HAVE_ACOS 1
|
||||||
#define HAVE_ASIN 1
|
#define HAVE_ASIN 1
|
||||||
@@ -211,10 +211,7 @@ typedef unsigned int uintptr_t;
|
|||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
#define HAVE__FSEEKI64 1
|
#define HAVE__FSEEKI64 1
|
||||||
#endif
|
#endif
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
#else
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDDEF_H 1
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
/* Enable various audio drivers */
|
||||||
|
|||||||
22
src/SDL.c
22
src/SDL.c
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
// Initialization/Cleanup routines
|
// Initialization/Cleanup routines
|
||||||
#include "timer/SDL_timer_c.h"
|
#include "timer/SDL_timer_c.h"
|
||||||
#ifdef SDL_VIDEO_DRIVER_WINDOWS
|
#ifdef SDL_PLATFORM_WINDOWS
|
||||||
extern bool SDL_HelperWindowCreate(void);
|
extern bool SDL_HelperWindowCreate(void);
|
||||||
extern void SDL_HelperWindowDestroy(void);
|
extern void SDL_HelperWindowDestroy(void);
|
||||||
#endif
|
#endif
|
||||||
@@ -317,7 +317,7 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_DBus_Init();
|
SDL_DBus_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SDL_VIDEO_DRIVER_WINDOWS
|
#ifdef SDL_PLATFORM_WINDOWS
|
||||||
if (flags & (SDL_INIT_HAPTIC | SDL_INIT_JOYSTICK)) {
|
if (flags & (SDL_INIT_HAPTIC | SDL_INIT_JOYSTICK)) {
|
||||||
if (!SDL_HelperWindowCreate()) {
|
if (!SDL_HelperWindowCreate()) {
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
@@ -356,7 +356,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_VIDEO);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_VIDEO);
|
||||||
if (!SDL_VideoInit(NULL)) {
|
if (!SDL_VideoInit(NULL)) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -381,7 +383,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_AUDIO);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_AUDIO);
|
||||||
if (!SDL_InitAudio(NULL)) {
|
if (!SDL_InitAudio(NULL)) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -406,7 +410,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
||||||
if (!SDL_InitJoysticks()) {
|
if (!SDL_InitJoysticks()) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -430,7 +436,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
||||||
if (!SDL_InitGamepads()) {
|
if (!SDL_InitGamepads()) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -493,7 +501,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_CAMERA);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_CAMERA);
|
||||||
if (!SDL_CameraInit(NULL)) {
|
if (!SDL_CameraInit(NULL)) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_CAMERA);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_CAMERA);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -511,7 +521,11 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
return SDL_ClearError();
|
return SDL_ClearError();
|
||||||
|
|
||||||
quit_and_error:
|
quit_and_error:
|
||||||
SDL_QuitSubSystem(flags_initialized);
|
{
|
||||||
|
SDL_PushError();
|
||||||
|
SDL_QuitSubSystem(flags_initialized);
|
||||||
|
SDL_PopError();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,7 +653,7 @@ void SDL_Quit(void)
|
|||||||
SDL_bInMainQuit = true;
|
SDL_bInMainQuit = true;
|
||||||
|
|
||||||
// Quit all subsystems
|
// Quit all subsystems
|
||||||
#ifdef SDL_VIDEO_DRIVER_WINDOWS
|
#ifdef SDL_PLATFORM_WINDOWS
|
||||||
SDL_HelperWindowDestroy();
|
SDL_HelperWindowDestroy();
|
||||||
#endif
|
#endif
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
|
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
|
||||||
|
|||||||
@@ -34,15 +34,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
// older Emscriptens don't have this, but we need to for wasm64 compatibility.
|
|
||||||
#ifndef MAIN_THREAD_EM_ASM_PTR
|
|
||||||
#ifdef __wasm64__
|
|
||||||
#error You need to upgrade your Emscripten compiler to support wasm64
|
|
||||||
#else
|
|
||||||
#define MAIN_THREAD_EM_ASM_PTR MAIN_THREAD_EM_ASM_INT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The size of the stack buffer to use for rendering assert messages.
|
// The size of the stack buffer to use for rendering assert messages.
|
||||||
@@ -252,7 +244,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
bool okay = true;
|
bool okay = true;
|
||||||
/* *INDENT-OFF* */ // clang-format off
|
/* *INDENT-OFF* */ // clang-format off
|
||||||
char *buf = (char *) MAIN_THREAD_EM_ASM_PTR({
|
int reply = MAIN_THREAD_EM_ASM_INT({
|
||||||
var str =
|
var str =
|
||||||
UTF8ToString($0) + '\n\n' +
|
UTF8ToString($0) + '\n\n' +
|
||||||
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
|
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
|
||||||
@@ -260,26 +252,32 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
|
|||||||
if (reply === null) {
|
if (reply === null) {
|
||||||
reply = "i";
|
reply = "i";
|
||||||
}
|
}
|
||||||
return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL);
|
return reply.length === 1 ? reply.charCodeAt(0) : -1;
|
||||||
}, message);
|
}, message);
|
||||||
/* *INDENT-ON* */ // clang-format on
|
/* *INDENT-ON* */ // clang-format on
|
||||||
|
|
||||||
if (SDL_strcmp(buf, "a") == 0) {
|
switch (reply) {
|
||||||
|
case 'a':
|
||||||
state = SDL_ASSERTION_ABORT;
|
state = SDL_ASSERTION_ABORT;
|
||||||
|
break;
|
||||||
#if 0 // (currently) no break functionality on Emscripten
|
#if 0 // (currently) no break functionality on Emscripten
|
||||||
} else if (SDL_strcmp(buf, "b") == 0) {
|
case 'b':
|
||||||
state = SDL_ASSERTION_BREAK;
|
state = SDL_ASSERTION_BREAK;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
} else if (SDL_strcmp(buf, "r") == 0) {
|
case 'r':
|
||||||
state = SDL_ASSERTION_RETRY;
|
state = SDL_ASSERTION_RETRY;
|
||||||
} else if (SDL_strcmp(buf, "i") == 0) {
|
break;
|
||||||
|
case 'i':
|
||||||
state = SDL_ASSERTION_IGNORE;
|
state = SDL_ASSERTION_IGNORE;
|
||||||
} else if (SDL_strcmp(buf, "A") == 0) {
|
break;
|
||||||
|
case 'A':
|
||||||
state = SDL_ASSERTION_ALWAYS_IGNORE;
|
state = SDL_ASSERTION_ALWAYS_IGNORE;
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
okay = false;
|
okay = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
free(buf); // This should NOT be SDL_free()
|
|
||||||
|
|
||||||
if (okay) {
|
if (okay) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -46,4 +46,16 @@ typedef struct SDL_error
|
|||||||
// Defined in SDL_thread.c
|
// Defined in SDL_thread.c
|
||||||
extern SDL_error *SDL_GetErrBuf(bool create);
|
extern SDL_error *SDL_GetErrBuf(bool create);
|
||||||
|
|
||||||
|
// Macros to save and restore error values
|
||||||
|
#define SDL_PushError() \
|
||||||
|
char *saved_error = SDL_strdup(SDL_GetError())
|
||||||
|
|
||||||
|
#define SDL_PopError() \
|
||||||
|
do { \
|
||||||
|
if (saved_error) { \
|
||||||
|
SDL_SetError("%s", saved_error); \
|
||||||
|
SDL_free(saved_error); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif // SDL_error_c_h_
|
#endif // SDL_error_c_h_
|
||||||
|
|||||||
@@ -22,6 +22,10 @@
|
|||||||
|
|
||||||
#include "SDL_hints_c.h"
|
#include "SDL_hints_c.h"
|
||||||
|
|
||||||
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
|
#include "core/android/SDL_android.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct SDL_HintWatch
|
typedef struct SDL_HintWatch
|
||||||
{
|
{
|
||||||
SDL_HintCallback callback;
|
SDL_HintCallback callback;
|
||||||
@@ -147,6 +151,13 @@ bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriori
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
|
if (SDL_strcmp(name, SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY) == 0) {
|
||||||
|
// Special handling for this hint, which needs to persist outside the normal application flow
|
||||||
|
Android_SetAllowRecreateActivity(SDL_GetStringBoolean(value, false));
|
||||||
|
}
|
||||||
|
#endif // SDL_PLATFORM_ANDROID
|
||||||
|
|
||||||
SDL_UnlockProperties(hints);
|
SDL_UnlockProperties(hints);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -185,6 +196,17 @@ bool SDL_ResetHint(const char *name)
|
|||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
|
if (SDL_strcmp(name, SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY) == 0) {
|
||||||
|
// Special handling for this hint, which needs to persist outside the normal application flow
|
||||||
|
if (env) {
|
||||||
|
Android_SetAllowRecreateActivity(SDL_GetStringBoolean(env, false));
|
||||||
|
} else {
|
||||||
|
Android_SetAllowRecreateActivity(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SDL_PLATFORM_ANDROID
|
||||||
|
|
||||||
SDL_UnlockProperties(hints);
|
SDL_UnlockProperties(hints);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -210,6 +232,17 @@ static void SDLCALL ResetHintsCallback(void *userdata, SDL_PropertiesID hints, c
|
|||||||
SDL_free(hint->value);
|
SDL_free(hint->value);
|
||||||
hint->value = NULL;
|
hint->value = NULL;
|
||||||
hint->priority = SDL_HINT_DEFAULT;
|
hint->priority = SDL_HINT_DEFAULT;
|
||||||
|
|
||||||
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
|
if (SDL_strcmp(name, SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY) == 0) {
|
||||||
|
// Special handling for this hint, which needs to persist outside the normal application flow
|
||||||
|
if (env) {
|
||||||
|
Android_SetAllowRecreateActivity(SDL_GetStringBoolean(env, false));
|
||||||
|
} else {
|
||||||
|
Android_SetAllowRecreateActivity(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SDL_PLATFORM_ANDROID
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDL_ResetHints(void)
|
void SDL_ResetHints(void)
|
||||||
|
|||||||
@@ -265,6 +265,12 @@ extern "C" {
|
|||||||
#include "SDL_utils_c.h"
|
#include "SDL_utils_c.h"
|
||||||
#include "SDL_hashtable.h"
|
#include "SDL_hashtable.h"
|
||||||
|
|
||||||
|
#define PUSH_SDL_ERROR() \
|
||||||
|
{ char *_error = SDL_strdup(SDL_GetError());
|
||||||
|
|
||||||
|
#define POP_SDL_ERROR() \
|
||||||
|
SDL_SetError("%s", _error); SDL_free(_error); }
|
||||||
|
|
||||||
// Do any initialization that needs to happen before threads are started
|
// Do any initialization that needs to happen before threads are started
|
||||||
extern void SDL_InitMainThread(void);
|
extern void SDL_InitMainThread(void);
|
||||||
|
|
||||||
|
|||||||
@@ -597,15 +597,21 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If message truncated, allocate and re-render
|
// If message truncated, allocate and re-render
|
||||||
if (len >= sizeof(stack_buf) && SDL_size_add_check_overflow(len, 1, &len_plus_term)) {
|
if (len >= sizeof(stack_buf)) {
|
||||||
// Allocate exactly what we need, including the zero-terminator
|
if (SDL_size_add_check_overflow(len, 1, &len_plus_term)) {
|
||||||
message = (char *)SDL_malloc(len_plus_term);
|
// Allocate exactly what we need, including the zero-terminator
|
||||||
if (!message) {
|
message = (char *)SDL_malloc(len_plus_term);
|
||||||
return;
|
if (!message) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
va_copy(aq, ap);
|
||||||
|
len = SDL_vsnprintf(message, len_plus_term, fmt, aq);
|
||||||
|
va_end(aq);
|
||||||
|
} else {
|
||||||
|
// Allocation would overflow, use truncated message
|
||||||
|
message = stack_buf;
|
||||||
|
len = sizeof(stack_buf);
|
||||||
}
|
}
|
||||||
va_copy(aq, ap);
|
|
||||||
len = SDL_vsnprintf(message, len_plus_term, fmt, aq);
|
|
||||||
va_end(aq);
|
|
||||||
} else {
|
} else {
|
||||||
message = stack_buf;
|
message = stack_buf;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -403,6 +403,10 @@ const char *SDL_GetPersistentString(const char *string)
|
|||||||
static int PrefixMatch(const char *a, const char *b)
|
static int PrefixMatch(const char *a, const char *b)
|
||||||
{
|
{
|
||||||
int matchlen = 0;
|
int matchlen = 0;
|
||||||
|
// Fixes the "HORI HORl Taiko No Tatsujin Drum Controller"
|
||||||
|
if (SDL_strncmp(a, "HORI ", 5) == 0 && SDL_strncmp(b, "HORl ", 5) == 0) {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
while (*a && *b) {
|
while (*a && *b) {
|
||||||
if (SDL_tolower((unsigned char)*a++) == SDL_tolower((unsigned char)*b++)) {
|
if (SDL_tolower((unsigned char)*a++) == SDL_tolower((unsigned char)*b++)) {
|
||||||
++matchlen;
|
++matchlen;
|
||||||
@@ -424,8 +428,8 @@ char *SDL_CreateDeviceName(Uint16 vendor, Uint16 product, const char *vendor_nam
|
|||||||
{ "ASTRO Gaming", "ASTRO" },
|
{ "ASTRO Gaming", "ASTRO" },
|
||||||
{ "Bensussen Deutsch & Associates,Inc.(BDA)", "BDA" },
|
{ "Bensussen Deutsch & Associates,Inc.(BDA)", "BDA" },
|
||||||
{ "Guangzhou Chicken Run Network Technology Co., Ltd.", "GameSir" },
|
{ "Guangzhou Chicken Run Network Technology Co., Ltd.", "GameSir" },
|
||||||
{ "HORI CO.,LTD", "HORI" },
|
|
||||||
{ "HORI CO.,LTD.", "HORI" },
|
{ "HORI CO.,LTD.", "HORI" },
|
||||||
|
{ "HORI CO.,LTD", "HORI" },
|
||||||
{ "Mad Catz Inc.", "Mad Catz" },
|
{ "Mad Catz Inc.", "Mad Catz" },
|
||||||
{ "Nintendo Co., Ltd.", "Nintendo" },
|
{ "Nintendo Co., Ltd.", "Nintendo" },
|
||||||
{ "NVIDIA Corporation ", "" },
|
{ "NVIDIA Corporation ", "" },
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ static SDL_LogicalAudioDevice *ObtainLogicalAudioDevice(SDL_AudioDeviceID devid,
|
|||||||
SDL_LockRWLockForReading(current_audio.device_hash_lock);
|
SDL_LockRWLockForReading(current_audio.device_hash_lock);
|
||||||
SDL_FindInHashTable(current_audio.device_hash, (const void *) (uintptr_t) devid, (const void **) &logdev);
|
SDL_FindInHashTable(current_audio.device_hash, (const void *) (uintptr_t) devid, (const void **) &logdev);
|
||||||
if (logdev) {
|
if (logdev) {
|
||||||
|
SDL_assert(logdev->instance_id == devid);
|
||||||
device = logdev->physical_device;
|
device = logdev->physical_device;
|
||||||
SDL_assert(device != NULL);
|
SDL_assert(device != NULL);
|
||||||
RefPhysicalAudioDevice(device); // reference it, in case the logical device migrates to a new default.
|
RefPhysicalAudioDevice(device); // reference it, in case the logical device migrates to a new default.
|
||||||
@@ -459,6 +460,7 @@ static SDL_AudioDevice *ObtainPhysicalAudioDevice(SDL_AudioDeviceID devid) // !
|
|||||||
} else {
|
} else {
|
||||||
SDL_LockRWLockForReading(current_audio.device_hash_lock);
|
SDL_LockRWLockForReading(current_audio.device_hash_lock);
|
||||||
SDL_FindInHashTable(current_audio.device_hash, (const void *) (uintptr_t) devid, (const void **) &device);
|
SDL_FindInHashTable(current_audio.device_hash, (const void *) (uintptr_t) devid, (const void **) &device);
|
||||||
|
SDL_assert(device->instance_id == devid);
|
||||||
SDL_UnlockRWLock(current_audio.device_hash_lock);
|
SDL_UnlockRWLock(current_audio.device_hash_lock);
|
||||||
|
|
||||||
if (!device) {
|
if (!device) {
|
||||||
@@ -883,6 +885,7 @@ static bool SDLCALL FindLowestDeviceID(void *userdata, const SDL_HashTable *tabl
|
|||||||
if (isphysical && (devid_recording == data->recording) && (devid < data->highest)) {
|
if (isphysical && (devid_recording == data->recording) && (devid < data->highest)) {
|
||||||
data->highest = devid;
|
data->highest = devid;
|
||||||
data->result = (SDL_AudioDevice *) value;
|
data->result = (SDL_AudioDevice *) value;
|
||||||
|
SDL_assert(data->result->instance_id == devid);
|
||||||
}
|
}
|
||||||
return true; // keep iterating.
|
return true; // keep iterating.
|
||||||
}
|
}
|
||||||
@@ -1051,7 +1054,10 @@ static bool SDLCALL DestroyOnePhysicalAudioDevice(void *userdata, const SDL_Hash
|
|||||||
const SDL_AudioDeviceID devid = (SDL_AudioDeviceID) (uintptr_t) key;
|
const SDL_AudioDeviceID devid = (SDL_AudioDeviceID) (uintptr_t) key;
|
||||||
const bool isphysical = !!(devid & (1<<1));
|
const bool isphysical = !!(devid & (1<<1));
|
||||||
if (isphysical) {
|
if (isphysical) {
|
||||||
DestroyPhysicalAudioDevice((SDL_AudioDevice *) value);
|
SDL_AudioDevice *dev = (SDL_AudioDevice *) value;
|
||||||
|
|
||||||
|
SDL_assert(dev->instance_id == devid);
|
||||||
|
DestroyPhysicalAudioDevice(dev);
|
||||||
}
|
}
|
||||||
return true; // keep iterating.
|
return true; // keep iterating.
|
||||||
}
|
}
|
||||||
@@ -1147,7 +1153,10 @@ bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device)
|
|||||||
// We should have updated this elsewhere if the format changed!
|
// We should have updated this elsewhere if the format changed!
|
||||||
SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &device->spec, NULL, NULL));
|
SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &device->spec, NULL, NULL));
|
||||||
|
|
||||||
|
SDL_assert(stream->src_spec.format != SDL_AUDIO_UNKNOWN);
|
||||||
|
|
||||||
const int br = SDL_GetAtomicInt(&logdev->paused) ? 0 : SDL_GetAudioStreamDataAdjustGain(stream, device_buffer, buffer_size, logdev->gain);
|
const int br = SDL_GetAtomicInt(&logdev->paused) ? 0 : SDL_GetAudioStreamDataAdjustGain(stream, device_buffer, buffer_size, logdev->gain);
|
||||||
|
|
||||||
if (br < 0) { // Probably OOM. Kill the audio device; the whole thing is likely dying soon anyhow.
|
if (br < 0) { // Probably OOM. Kill the audio device; the whole thing is likely dying soon anyhow.
|
||||||
failed = true;
|
failed = true;
|
||||||
SDL_memset(device_buffer, device->silence_value, buffer_size); // just supply silence to the device before we die.
|
SDL_memset(device_buffer, device->silence_value, buffer_size); // just supply silence to the device before we die.
|
||||||
@@ -1189,6 +1198,8 @@ bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device)
|
|||||||
// We should have updated this elsewhere if the format changed!
|
// We should have updated this elsewhere if the format changed!
|
||||||
SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &outspec, NULL, NULL));
|
SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &outspec, NULL, NULL));
|
||||||
|
|
||||||
|
SDL_assert(stream->src_spec.format != SDL_AUDIO_UNKNOWN);
|
||||||
|
|
||||||
/* this will hold a lock on `stream` while getting. We don't explicitly lock the streams
|
/* this will hold a lock on `stream` while getting. We don't explicitly lock the streams
|
||||||
for iterating here because the binding linked list can only change while the device lock is held.
|
for iterating here because the binding linked list can only change while the device lock is held.
|
||||||
(we _do_ lock the stream during binding/unbinding to make sure that two threads can't try to bind
|
(we _do_ lock the stream during binding/unbinding to make sure that two threads can't try to bind
|
||||||
@@ -1243,7 +1254,11 @@ void SDL_PlaybackAudioThreadShutdown(SDL_AudioDevice *device)
|
|||||||
const int frames = device->buffer_size / SDL_AUDIO_FRAMESIZE(device->spec);
|
const int frames = device->buffer_size / SDL_AUDIO_FRAMESIZE(device->spec);
|
||||||
// Wait for the audio to drain if device didn't die.
|
// Wait for the audio to drain if device didn't die.
|
||||||
if (!SDL_GetAtomicInt(&device->zombie)) {
|
if (!SDL_GetAtomicInt(&device->zombie)) {
|
||||||
SDL_Delay(((frames * 1000) / device->spec.freq) * 2);
|
int delay = ((frames * 1000) / device->spec.freq) * 2;
|
||||||
|
if (delay > 100) {
|
||||||
|
delay = 100;
|
||||||
|
}
|
||||||
|
SDL_Delay(delay);
|
||||||
}
|
}
|
||||||
current_audio.impl.ThreadDeinit(device);
|
current_audio.impl.ThreadDeinit(device);
|
||||||
SDL_AudioThreadFinalize(device);
|
SDL_AudioThreadFinalize(device);
|
||||||
@@ -1256,11 +1271,11 @@ static int SDLCALL PlaybackAudioThread(void *devicep) // thread entry point
|
|||||||
SDL_assert(!device->recording);
|
SDL_assert(!device->recording);
|
||||||
SDL_PlaybackAudioThreadSetup(device);
|
SDL_PlaybackAudioThreadSetup(device);
|
||||||
|
|
||||||
do {
|
while (SDL_PlaybackAudioThreadIterate(device)) {
|
||||||
if (!device->WaitDevice(device)) {
|
if (!device->WaitDevice(device)) {
|
||||||
SDL_AudioDeviceDisconnected(device); // doh. (but don't break out of the loop, just be a zombie for now!)
|
SDL_AudioDeviceDisconnected(device); // doh. (but don't break out of the loop, just be a zombie for now!)
|
||||||
}
|
}
|
||||||
} while (SDL_PlaybackAudioThreadIterate(device));
|
}
|
||||||
|
|
||||||
SDL_PlaybackAudioThreadShutdown(device);
|
SDL_PlaybackAudioThreadShutdown(device);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1324,6 +1339,7 @@ bool SDL_RecordingAudioThreadIterate(SDL_AudioDevice *device)
|
|||||||
SDL_assert(stream->src_spec.format == ((logdev->postmix || (logdev->gain != 1.0f)) ? SDL_AUDIO_F32 : device->spec.format));
|
SDL_assert(stream->src_spec.format == ((logdev->postmix || (logdev->gain != 1.0f)) ? SDL_AUDIO_F32 : device->spec.format));
|
||||||
SDL_assert(stream->src_spec.channels == device->spec.channels);
|
SDL_assert(stream->src_spec.channels == device->spec.channels);
|
||||||
SDL_assert(stream->src_spec.freq == device->spec.freq);
|
SDL_assert(stream->src_spec.freq == device->spec.freq);
|
||||||
|
SDL_assert(stream->dst_spec.format != SDL_AUDIO_UNKNOWN);
|
||||||
|
|
||||||
void *final_buf = output_buffer;
|
void *final_buf = output_buffer;
|
||||||
|
|
||||||
@@ -1385,6 +1401,7 @@ static int SDLCALL RecordingAudioThread(void *devicep) // thread entry point
|
|||||||
typedef struct CountAudioDevicesData
|
typedef struct CountAudioDevicesData
|
||||||
{
|
{
|
||||||
int devs_seen;
|
int devs_seen;
|
||||||
|
int devs_skipped;
|
||||||
const int num_devices;
|
const int num_devices;
|
||||||
SDL_AudioDeviceID *result;
|
SDL_AudioDeviceID *result;
|
||||||
const bool recording;
|
const bool recording;
|
||||||
@@ -1400,7 +1417,13 @@ static bool SDLCALL CountAudioDevices(void *userdata, const SDL_HashTable *table
|
|||||||
const bool isphysical = !!(devid & (1<<1));
|
const bool isphysical = !!(devid & (1<<1));
|
||||||
if (isphysical && (devid_recording == data->recording)) {
|
if (isphysical && (devid_recording == data->recording)) {
|
||||||
SDL_assert(data->devs_seen < data->num_devices);
|
SDL_assert(data->devs_seen < data->num_devices);
|
||||||
data->result[data->devs_seen++] = devid;
|
SDL_AudioDevice *device = (SDL_AudioDevice *) value; // this is normally risky, but we hold the device_hash_lock here.
|
||||||
|
const bool zombie = SDL_GetAtomicInt(&device->zombie) != 0;
|
||||||
|
if (zombie) {
|
||||||
|
data->devs_skipped++;
|
||||||
|
} else {
|
||||||
|
data->result[data->devs_seen++] = devid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true; // keep iterating.
|
return true; // keep iterating.
|
||||||
}
|
}
|
||||||
@@ -1416,10 +1439,11 @@ static SDL_AudioDeviceID *GetAudioDevices(int *count, bool recording)
|
|||||||
num_devices = SDL_GetAtomicInt(recording ? ¤t_audio.recording_device_count : ¤t_audio.playback_device_count);
|
num_devices = SDL_GetAtomicInt(recording ? ¤t_audio.recording_device_count : ¤t_audio.playback_device_count);
|
||||||
result = (SDL_AudioDeviceID *) SDL_malloc((num_devices + 1) * sizeof (SDL_AudioDeviceID));
|
result = (SDL_AudioDeviceID *) SDL_malloc((num_devices + 1) * sizeof (SDL_AudioDeviceID));
|
||||||
if (result) {
|
if (result) {
|
||||||
CountAudioDevicesData data = { 0, num_devices, result, recording };
|
CountAudioDevicesData data = { 0, 0, num_devices, result, recording };
|
||||||
SDL_IterateHashTable(current_audio.device_hash, CountAudioDevices, &data);
|
SDL_IterateHashTable(current_audio.device_hash, CountAudioDevices, &data);
|
||||||
SDL_assert(data.devs_seen == num_devices);
|
SDL_assert((data.devs_seen + data.devs_skipped) == num_devices);
|
||||||
result[data.devs_seen] = 0; // null-terminated.
|
num_devices = data.devs_seen; // might be less if we skipped any.
|
||||||
|
result[num_devices] = 0; // null-terminated.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SDL_UnlockRWLock(current_audio.device_hash_lock);
|
SDL_UnlockRWLock(current_audio.device_hash_lock);
|
||||||
@@ -1464,6 +1488,7 @@ static bool SDLCALL FindAudioDeviceByCallback(void *userdata, const SDL_HashTabl
|
|||||||
SDL_AudioDevice *device = (SDL_AudioDevice *) value;
|
SDL_AudioDevice *device = (SDL_AudioDevice *) value;
|
||||||
if (data->callback(device, data->userdata)) { // found it?
|
if (data->callback(device, data->userdata)) { // found it?
|
||||||
data->retval = device;
|
data->retval = device;
|
||||||
|
SDL_assert(data->retval->instance_id == devid);
|
||||||
return false; // stop iterating, we found it.
|
return false; // stop iterating, we found it.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1502,12 +1527,33 @@ SDL_AudioDevice *SDL_FindPhysicalAudioDeviceByHandle(void *handle)
|
|||||||
|
|
||||||
const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid)
|
const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid)
|
||||||
{
|
{
|
||||||
|
// bit #1 of devid is set for physical devices and unset for logical.
|
||||||
|
const bool islogical = !(devid & (1<<1));
|
||||||
const char *result = NULL;
|
const char *result = NULL;
|
||||||
SDL_AudioDevice *device = ObtainPhysicalAudioDevice(devid);
|
const void *vdev = NULL;
|
||||||
if (device) {
|
|
||||||
result = SDL_GetPersistentString(device->name);
|
if (!SDL_GetCurrentAudioDriver()) {
|
||||||
|
SDL_SetError("Audio subsystem is not initialized");
|
||||||
|
} else {
|
||||||
|
// This does not call ObtainPhysicalAudioDevice() because the device's name never changes, so
|
||||||
|
// it doesn't have to lock the whole device. However, just to make sure the device pointer itself
|
||||||
|
// remains valid (in case the device is unplugged at the wrong moment), we hold the
|
||||||
|
// device_hash_lock while we copy the string.
|
||||||
|
SDL_LockRWLockForReading(current_audio.device_hash_lock);
|
||||||
|
SDL_FindInHashTable(current_audio.device_hash, (const void *) (uintptr_t) devid, &vdev);
|
||||||
|
if (!vdev) {
|
||||||
|
SDL_SetError("Invalid audio device instance ID");
|
||||||
|
} else if (islogical) {
|
||||||
|
const SDL_LogicalAudioDevice *logdev = (const SDL_LogicalAudioDevice *) vdev;
|
||||||
|
SDL_assert(logdev->instance_id == devid);
|
||||||
|
result = SDL_GetPersistentString(logdev->physical_device->name);
|
||||||
|
} else {
|
||||||
|
const SDL_AudioDevice *device = (const SDL_AudioDevice *) vdev;
|
||||||
|
SDL_assert(device->instance_id == devid);
|
||||||
|
result = SDL_GetPersistentString(device->name);
|
||||||
|
}
|
||||||
|
SDL_UnlockRWLock(current_audio.device_hash_lock);
|
||||||
}
|
}
|
||||||
ReleaseAudioDevice(device);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1539,7 +1585,9 @@ int *SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count)
|
|||||||
SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid);
|
SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid);
|
||||||
if (device) {
|
if (device) {
|
||||||
channels = device->spec.channels;
|
channels = device->spec.channels;
|
||||||
result = SDL_ChannelMapDup(device->chmap, channels);
|
if (channels > 0 && device->chmap) {
|
||||||
|
result = SDL_ChannelMapDup(device->chmap, channels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ReleaseAudioDevice(device);
|
ReleaseAudioDevice(device);
|
||||||
|
|
||||||
@@ -1715,13 +1763,18 @@ static bool OpenPhysicalAudioDevice(SDL_AudioDevice *device, const SDL_AudioSpec
|
|||||||
SDL_copyp(&spec, inspec ? inspec : &device->default_spec);
|
SDL_copyp(&spec, inspec ? inspec : &device->default_spec);
|
||||||
PrepareAudioFormat(device->recording, &spec);
|
PrepareAudioFormat(device->recording, &spec);
|
||||||
|
|
||||||
/* We allow the device format to change if it's better than the current settings (by various definitions of "better"). This prevents
|
/* We impose a simple minimum on device formats. This prevents something low quality, like an old game using S8/8000Hz audio,
|
||||||
something low quality, like an old game using S8/8000Hz audio, from ruining a music thing playing at CD quality that tries to open later.
|
from ruining a music thing playing at CD quality that tries to open later, or some VoIP library that opens for mono output
|
||||||
(or some VoIP library that opens for mono output ruining your surround-sound game because it got there first).
|
ruining your surround-sound game because it got there first.
|
||||||
These are just requests! The backend may change any of these values during OpenDevice method! */
|
These are just requests! The backend may change any of these values during OpenDevice method! */
|
||||||
device->spec.format = (SDL_AUDIO_BITSIZE(device->default_spec.format) >= SDL_AUDIO_BITSIZE(spec.format)) ? device->default_spec.format : spec.format;
|
|
||||||
device->spec.freq = SDL_max(device->default_spec.freq, spec.freq);
|
const SDL_AudioFormat minimum_format = device->recording ? DEFAULT_AUDIO_RECORDING_FORMAT : DEFAULT_AUDIO_PLAYBACK_FORMAT;
|
||||||
device->spec.channels = SDL_max(device->default_spec.channels, spec.channels);
|
const int minimum_channels = device->recording ? DEFAULT_AUDIO_RECORDING_CHANNELS : DEFAULT_AUDIO_PLAYBACK_CHANNELS;
|
||||||
|
const int minimum_freq = device->recording ? DEFAULT_AUDIO_RECORDING_FREQUENCY : DEFAULT_AUDIO_PLAYBACK_FREQUENCY;
|
||||||
|
|
||||||
|
device->spec.format = (SDL_AUDIO_BITSIZE(minimum_format) >= SDL_AUDIO_BITSIZE(spec.format)) ? minimum_format : spec.format;
|
||||||
|
device->spec.channels = SDL_max(minimum_channels, spec.channels);
|
||||||
|
device->spec.freq = SDL_max(minimum_freq, spec.freq);
|
||||||
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq);
|
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq);
|
||||||
SDL_UpdatedAudioDeviceFormat(device); // start this off sane.
|
SDL_UpdatedAudioDeviceFormat(device); // start this off sane.
|
||||||
|
|
||||||
@@ -1932,10 +1985,6 @@ bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream * const *stre
|
|||||||
} else if (logdev->simplified) {
|
} else if (logdev->simplified) {
|
||||||
result = SDL_SetError("Cannot change stream bindings on device opened with SDL_OpenAudioDeviceStream");
|
result = SDL_SetError("Cannot change stream bindings on device opened with SDL_OpenAudioDeviceStream");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// !!! FIXME: We'll set the device's side's format below, but maybe we should refuse to bind a stream if the app's side doesn't have a format set yet.
|
|
||||||
// !!! FIXME: Actually, why do we allow there to be an invalid format, again?
|
|
||||||
|
|
||||||
// make sure start of list is sane.
|
// make sure start of list is sane.
|
||||||
SDL_assert(!logdev->bound_streams || (logdev->bound_streams->prev_binding == NULL));
|
SDL_assert(!logdev->bound_streams || (logdev->bound_streams->prev_binding == NULL));
|
||||||
|
|
||||||
@@ -1970,9 +2019,17 @@ bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream * const *stre
|
|||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
// Now that everything is verified, chain everything together.
|
// Now that everything is verified, chain everything together.
|
||||||
|
const bool recording = device->recording;
|
||||||
for (int i = 0; i < num_streams; i++) {
|
for (int i = 0; i < num_streams; i++) {
|
||||||
SDL_AudioStream *stream = streams[i];
|
SDL_AudioStream *stream = streams[i];
|
||||||
if (stream) { // shouldn't be NULL, but just in case...
|
if (stream) { // shouldn't be NULL, but just in case...
|
||||||
|
// if the stream never had its non-device-end format set, just set it to the device end's format.
|
||||||
|
if (recording && (stream->dst_spec.format == SDL_AUDIO_UNKNOWN)) {
|
||||||
|
SDL_copyp(&stream->dst_spec, &device->spec);
|
||||||
|
} else if (!recording && (stream->src_spec.format == SDL_AUDIO_UNKNOWN)) {
|
||||||
|
SDL_copyp(&stream->src_spec, &device->spec);
|
||||||
|
}
|
||||||
|
|
||||||
stream->bound_device = logdev;
|
stream->bound_device = logdev;
|
||||||
stream->prev_binding = NULL;
|
stream->prev_binding = NULL;
|
||||||
stream->next_binding = logdev->bound_streams;
|
stream->next_binding = logdev->bound_streams;
|
||||||
|
|||||||
@@ -22,6 +22,10 @@
|
|||||||
|
|
||||||
#include "SDL_sysaudio.h"
|
#include "SDL_sysaudio.h"
|
||||||
|
|
||||||
|
#ifdef SDL_NEON_INTRINSICS
|
||||||
|
#include <fenv.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DIVBY2147483648 0.0000000004656612873077392578125f // 0x1p-31f
|
#define DIVBY2147483648 0.0000000004656612873077392578125f // 0x1p-31f
|
||||||
|
|
||||||
// start fallback scalar converters
|
// start fallback scalar converters
|
||||||
@@ -527,9 +531,29 @@ static void SDL_TARGETING("ssse3") SDL_Convert_Swap32_SSSE3(Uint32* dst, const U
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SDL_NEON_INTRINSICS
|
#ifdef SDL_NEON_INTRINSICS
|
||||||
|
|
||||||
|
// C99 requires that all code modifying floating point environment should
|
||||||
|
// be guarded by the STDC FENV_ACCESS pragma; otherwise, it's undefined
|
||||||
|
// behavior. However, the compiler support for this pragma is bad.
|
||||||
|
#if defined(__clang__)
|
||||||
|
#if __clang_major__ >= 12
|
||||||
|
#if defined(__aarch64__)
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#pragma fenv_access (on)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
// GCC does not support the pragma at all
|
||||||
|
#else
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
|
#endif
|
||||||
|
|
||||||
static void SDL_Convert_S8_to_F32_NEON(float *dst, const Sint8 *src, int num_samples)
|
static void SDL_Convert_S8_to_F32_NEON(float *dst, const Sint8 *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("S8", "F32 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("S8", "F32 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
CONVERT_16_REV({
|
CONVERT_16_REV({
|
||||||
vst1_lane_f32(&dst[i], vcvt_n_f32_s32(vdup_n_s32(src[i]), 7), 0);
|
vst1_lane_f32(&dst[i], vcvt_n_f32_s32(vdup_n_s32(src[i]), 7), 0);
|
||||||
@@ -549,11 +573,14 @@ static void SDL_Convert_S8_to_F32_NEON(float *dst, const Sint8 *src, int num_sam
|
|||||||
vst1q_f32(&dst[i + 8], floats2);
|
vst1q_f32(&dst[i + 8], floats2);
|
||||||
vst1q_f32(&dst[i + 12], floats3);
|
vst1q_f32(&dst[i + 12], floats3);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_U8_to_F32_NEON(float *dst, const Uint8 *src, int num_samples)
|
static void SDL_Convert_U8_to_F32_NEON(float *dst, const Uint8 *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("U8", "F32 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("U8", "F32 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
uint8x16_t flipper = vdupq_n_u8(0x80);
|
uint8x16_t flipper = vdupq_n_u8(0x80);
|
||||||
|
|
||||||
@@ -575,11 +602,14 @@ static void SDL_Convert_U8_to_F32_NEON(float *dst, const Uint8 *src, int num_sam
|
|||||||
vst1q_f32(&dst[i + 8], floats2);
|
vst1q_f32(&dst[i + 8], floats2);
|
||||||
vst1q_f32(&dst[i + 12], floats3);
|
vst1q_f32(&dst[i + 12], floats3);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_S16_to_F32_NEON(float *dst, const Sint16 *src, int num_samples)
|
static void SDL_Convert_S16_to_F32_NEON(float *dst, const Sint16 *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("S16", "F32 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("S16", "F32 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
CONVERT_16_REV({
|
CONVERT_16_REV({
|
||||||
vst1_lane_f32(&dst[i], vcvt_n_f32_s32(vdup_n_s32(src[i]), 15), 0);
|
vst1_lane_f32(&dst[i], vcvt_n_f32_s32(vdup_n_s32(src[i]), 15), 0);
|
||||||
@@ -597,11 +627,14 @@ static void SDL_Convert_S16_to_F32_NEON(float *dst, const Sint16 *src, int num_s
|
|||||||
vst1q_f32(&dst[i + 8], floats2);
|
vst1q_f32(&dst[i + 8], floats2);
|
||||||
vst1q_f32(&dst[i + 12], floats3);
|
vst1q_f32(&dst[i + 12], floats3);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_S32_to_F32_NEON(float *dst, const Sint32 *src, int num_samples)
|
static void SDL_Convert_S32_to_F32_NEON(float *dst, const Sint32 *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("S32", "F32 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("S32", "F32 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
CONVERT_16_FWD({
|
CONVERT_16_FWD({
|
||||||
vst1_lane_f32(&dst[i], vcvt_n_f32_s32(vld1_dup_s32(&src[i]), 31), 0);
|
vst1_lane_f32(&dst[i], vcvt_n_f32_s32(vld1_dup_s32(&src[i]), 31), 0);
|
||||||
@@ -621,11 +654,14 @@ static void SDL_Convert_S32_to_F32_NEON(float *dst, const Sint32 *src, int num_s
|
|||||||
vst1q_f32(&dst[i + 8], floats2);
|
vst1q_f32(&dst[i + 8], floats2);
|
||||||
vst1q_f32(&dst[i + 12], floats3);
|
vst1q_f32(&dst[i + 12], floats3);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_F32_to_S8_NEON(Sint8 *dst, const float *src, int num_samples)
|
static void SDL_Convert_F32_to_S8_NEON(Sint8 *dst, const float *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("F32", "S8 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("F32", "S8 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
CONVERT_16_FWD({
|
CONVERT_16_FWD({
|
||||||
vst1_lane_s8(&dst[i], vreinterpret_s8_s32(vcvt_n_s32_f32(vld1_dup_f32(&src[i]), 31)), 3);
|
vst1_lane_s8(&dst[i], vreinterpret_s8_s32(vcvt_n_s32_f32(vld1_dup_f32(&src[i]), 31)), 3);
|
||||||
@@ -647,11 +683,14 @@ static void SDL_Convert_F32_to_S8_NEON(Sint8 *dst, const float *src, int num_sam
|
|||||||
|
|
||||||
vst1q_s8(&dst[i], bytes);
|
vst1q_s8(&dst[i], bytes);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_F32_to_U8_NEON(Uint8 *dst, const float *src, int num_samples)
|
static void SDL_Convert_F32_to_U8_NEON(Uint8 *dst, const float *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("F32", "U8 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("F32", "U8 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
uint8x16_t flipper = vdupq_n_u8(0x80);
|
uint8x16_t flipper = vdupq_n_u8(0x80);
|
||||||
|
|
||||||
@@ -679,11 +718,14 @@ static void SDL_Convert_F32_to_U8_NEON(Uint8 *dst, const float *src, int num_sam
|
|||||||
|
|
||||||
vst1q_u8(&dst[i], bytes);
|
vst1q_u8(&dst[i], bytes);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_F32_to_S16_NEON(Sint16 *dst, const float *src, int num_samples)
|
static void SDL_Convert_F32_to_S16_NEON(Sint16 *dst, const float *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("F32", "S16 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("F32", "S16 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
CONVERT_16_FWD({
|
CONVERT_16_FWD({
|
||||||
vst1_lane_s16(&dst[i], vreinterpret_s16_s32(vcvt_n_s32_f32(vld1_dup_f32(&src[i]), 31)), 1);
|
vst1_lane_s16(&dst[i], vreinterpret_s16_s32(vcvt_n_s32_f32(vld1_dup_f32(&src[i]), 31)), 1);
|
||||||
@@ -704,11 +746,14 @@ static void SDL_Convert_F32_to_S16_NEON(Sint16 *dst, const float *src, int num_s
|
|||||||
vst1q_s16(&dst[i], shorts0);
|
vst1q_s16(&dst[i], shorts0);
|
||||||
vst1q_s16(&dst[i + 8], shorts1);
|
vst1q_s16(&dst[i + 8], shorts1);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_F32_to_S32_NEON(Sint32 *dst, const float *src, int num_samples)
|
static void SDL_Convert_F32_to_S32_NEON(Sint32 *dst, const float *src, int num_samples)
|
||||||
{
|
{
|
||||||
LOG_DEBUG_AUDIO_CONVERT("F32", "S32 (using NEON)");
|
LOG_DEBUG_AUDIO_CONVERT("F32", "S32 (using NEON)");
|
||||||
|
fenv_t fenv;
|
||||||
|
feholdexcept(&fenv);
|
||||||
|
|
||||||
CONVERT_16_FWD({
|
CONVERT_16_FWD({
|
||||||
vst1_lane_s32(&dst[i], vcvt_n_s32_f32(vld1_dup_f32(&src[i]), 31), 0);
|
vst1_lane_s32(&dst[i], vcvt_n_s32_f32(vld1_dup_f32(&src[i]), 31), 0);
|
||||||
@@ -728,6 +773,7 @@ static void SDL_Convert_F32_to_S32_NEON(Sint32 *dst, const float *src, int num_s
|
|||||||
vst1q_s32(&dst[i + 8], ints2);
|
vst1q_s32(&dst[i + 8], ints2);
|
||||||
vst1q_s32(&dst[i + 12], ints3);
|
vst1q_s32(&dst[i + 12], ints3);
|
||||||
})
|
})
|
||||||
|
fesetenv(&fenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_Convert_Swap16_NEON(Uint16* dst, const Uint16* src, int num_samples)
|
static void SDL_Convert_Swap16_NEON(Uint16* dst, const Uint16* src, int num_samples)
|
||||||
@@ -767,6 +813,21 @@ static void SDL_Convert_Swap32_NEON(Uint32* dst, const Uint32* src, int num_samp
|
|||||||
vst1q_u8((Uint8*)&dst[i + 12], ints3);
|
vst1q_u8((Uint8*)&dst[i + 12], ints3);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#if __clang_major__ >= 12
|
||||||
|
#if defined(__aarch64__)
|
||||||
|
#pragma STDC FENV_ACCESS DEFAULT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#pragma fenv_access (off)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
//
|
||||||
|
#else
|
||||||
|
#pragma STDC FENV_ACCESS DEFAULT
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef CONVERT_16_FWD
|
#undef CONVERT_16_FWD
|
||||||
|
|||||||
@@ -1775,6 +1775,7 @@ static bool WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uin
|
|||||||
int result;
|
int result;
|
||||||
Uint32 chunkcount = 0;
|
Uint32 chunkcount = 0;
|
||||||
Uint32 chunkcountlimit = 10000;
|
Uint32 chunkcountlimit = 10000;
|
||||||
|
const Sint64 flen = SDL_GetIOSize(src); // this might be -1 if the IOStream can't determine the total size.
|
||||||
const char *hint;
|
const char *hint;
|
||||||
Sint64 RIFFstart, RIFFend, lastchunkpos;
|
Sint64 RIFFstart, RIFFend, lastchunkpos;
|
||||||
bool RIFFlengthknown = false;
|
bool RIFFlengthknown = false;
|
||||||
@@ -1883,6 +1884,14 @@ static bool WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uin
|
|||||||
fmtchunk = *chunk;
|
fmtchunk = *chunk;
|
||||||
}
|
}
|
||||||
} else if (chunk->fourcc == DATA) {
|
} else if (chunk->fourcc == DATA) {
|
||||||
|
/* If the data chunk is bigger than the file, it might be corrupt
|
||||||
|
or the file is truncated. Try to recover by clamping the file
|
||||||
|
size. This also means a malicious file can't allocate 4 gigabytes
|
||||||
|
for the chunks without actually supplying a 4 gigabyte file. */
|
||||||
|
if ((flen > 0) && ((chunk->position + chunk->length) > flen)) {
|
||||||
|
chunk->length = (Uint32) (flen - chunk->position);
|
||||||
|
}
|
||||||
|
|
||||||
/* Only use the first data chunk. Handling the wavl list madness
|
/* Only use the first data chunk. Handling the wavl list madness
|
||||||
* may require a different approach.
|
* may require a different approach.
|
||||||
*/
|
*/
|
||||||
@@ -2114,8 +2123,8 @@ bool SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8
|
|||||||
result = WaveLoad(src, &file, spec, audio_buf, audio_len);
|
result = WaveLoad(src, &file, spec, audio_buf, audio_len);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
SDL_free(*audio_buf);
|
SDL_free(*audio_buf);
|
||||||
audio_buf = NULL;
|
*audio_buf = NULL;
|
||||||
audio_len = 0;
|
*audio_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
|
|||||||
@@ -308,6 +308,12 @@ static bool BuildAAudioStream(SDL_AudioDevice *device)
|
|||||||
ctx.AAudioStreamBuilder_setFormat(builder, format);
|
ctx.AAudioStreamBuilder_setFormat(builder, format);
|
||||||
ctx.AAudioStreamBuilder_setSampleRate(builder, device->spec.freq);
|
ctx.AAudioStreamBuilder_setSampleRate(builder, device->spec.freq);
|
||||||
ctx.AAudioStreamBuilder_setChannelCount(builder, device->spec.channels);
|
ctx.AAudioStreamBuilder_setChannelCount(builder, device->spec.channels);
|
||||||
|
|
||||||
|
// If no specific buffer size has been requested, the device will pick the optimal
|
||||||
|
if(SDL_GetHint(SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES)) {
|
||||||
|
ctx.AAudioStreamBuilder_setBufferCapacityInFrames(builder, 2 * device->sample_frames); // AAudio requires that the buffer capacity is at least
|
||||||
|
ctx.AAudioStreamBuilder_setFramesPerDataCallback(builder, device->sample_frames); // twice the size of the data callback buffer size
|
||||||
|
}
|
||||||
|
|
||||||
const aaudio_direction_t direction = (recording ? AAUDIO_DIRECTION_INPUT : AAUDIO_DIRECTION_OUTPUT);
|
const aaudio_direction_t direction = (recording ? AAUDIO_DIRECTION_INPUT : AAUDIO_DIRECTION_OUTPUT);
|
||||||
ctx.AAudioStreamBuilder_setDirection(builder, direction);
|
ctx.AAudioStreamBuilder_setDirection(builder, direction);
|
||||||
@@ -366,7 +372,7 @@ static bool BuildAAudioStream(SDL_AudioDevice *device)
|
|||||||
hidden->processed_bytes = 0;
|
hidden->processed_bytes = 0;
|
||||||
hidden->callback_bytes = 0;
|
hidden->callback_bytes = 0;
|
||||||
|
|
||||||
hidden->semaphore = SDL_CreateSemaphore(recording ? 0 : hidden->num_buffers);
|
hidden->semaphore = SDL_CreateSemaphore(recording ? 0 : hidden->num_buffers - 1);
|
||||||
if (!hidden->semaphore) {
|
if (!hidden->semaphore) {
|
||||||
LOGI("SDL Failed SDL_CreateSemaphore %s recording:%d", SDL_GetError(), recording);
|
LOGI("SDL Failed SDL_CreateSemaphore %s recording:%d", SDL_GetError(), recording);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSamplesPerFrame, (AAudioStreamBuild
|
|||||||
SDL_PROC(void, AAudioStreamBuilder_setFormat, (AAudioStreamBuilder * builder, aaudio_format_t format))
|
SDL_PROC(void, AAudioStreamBuilder_setFormat, (AAudioStreamBuilder * builder, aaudio_format_t format))
|
||||||
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSharingMode, (AAudioStreamBuilder * builder, aaudio_sharing_mode_t sharingMode))
|
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSharingMode, (AAudioStreamBuilder * builder, aaudio_sharing_mode_t sharingMode))
|
||||||
SDL_PROC(void, AAudioStreamBuilder_setDirection, (AAudioStreamBuilder * builder, aaudio_direction_t direction))
|
SDL_PROC(void, AAudioStreamBuilder_setDirection, (AAudioStreamBuilder * builder, aaudio_direction_t direction))
|
||||||
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setBufferCapacityInFrames, (AAudioStreamBuilder * builder, int32_t numFrames))
|
SDL_PROC(void, AAudioStreamBuilder_setBufferCapacityInFrames, (AAudioStreamBuilder * builder, int32_t numFrames))
|
||||||
SDL_PROC(void, AAudioStreamBuilder_setPerformanceMode, (AAudioStreamBuilder * builder, aaudio_performance_mode_t mode))
|
SDL_PROC(void, AAudioStreamBuilder_setPerformanceMode, (AAudioStreamBuilder * builder, aaudio_performance_mode_t mode))
|
||||||
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setUsage, (AAudioStreamBuilder * builder, aaudio_usage_t usage)) // API 28
|
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setUsage, (AAudioStreamBuilder * builder, aaudio_usage_t usage)) // API 28
|
||||||
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setContentType, (AAudioStreamBuilder * builder, aaudio_content_type_t contentType)) // API 28
|
SDL_PROC_UNUSED(void, AAudioStreamBuilder_setContentType, (AAudioStreamBuilder * builder, aaudio_content_type_t contentType)) // API 28
|
||||||
|
|||||||
@@ -461,8 +461,6 @@ static void ALSA_CloseDevice(SDL_AudioDevice *device)
|
|||||||
{
|
{
|
||||||
if (device->hidden) {
|
if (device->hidden) {
|
||||||
if (device->hidden->pcm) {
|
if (device->hidden->pcm) {
|
||||||
// Wait for the submitted audio to drain. ALSA_snd_pcm_drop() can hang, so don't use that.
|
|
||||||
SDL_Delay(((device->sample_frames * 1000) / device->spec.freq) * 2);
|
|
||||||
ALSA_snd_pcm_close(device->hidden->pcm);
|
ALSA_snd_pcm_close(device->hidden->pcm);
|
||||||
}
|
}
|
||||||
SDL_free(device->hidden->mixbuf);
|
SDL_free(device->hidden->mixbuf);
|
||||||
@@ -1156,7 +1154,7 @@ static bool ALSA_OpenDevice(SDL_AudioDevice *device)
|
|||||||
#if SDL_ALSA_DEBUG
|
#if SDL_ALSA_DEBUG
|
||||||
snd_pcm_uframes_t bufsize;
|
snd_pcm_uframes_t bufsize;
|
||||||
ALSA_snd_pcm_hw_params_get_buffer_size(cfg_ctx.hwparams, &bufsize);
|
ALSA_snd_pcm_hw_params_get_buffer_size(cfg_ctx.hwparams, &bufsize);
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_AUDIO,
|
SDL_LogDebug(SDL_LOG_CATEGORY_AUDIO,
|
||||||
"ALSA: period size = %ld, periods = %u, buffer size = %lu",
|
"ALSA: period size = %ld, periods = %u, buffer size = %lu",
|
||||||
cfg_ctx.persize, cfg_ctx.periods, bufsize);
|
cfg_ctx.persize, cfg_ctx.periods, bufsize);
|
||||||
#endif
|
#endif
|
||||||
@@ -1187,7 +1185,6 @@ static bool ALSA_OpenDevice(SDL_AudioDevice *device)
|
|||||||
ALSA_snd_pcm_nonblock(cfg_ctx.device->hidden->pcm, 0);
|
ALSA_snd_pcm_nonblock(cfg_ctx.device->hidden->pcm, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ALSA_snd_pcm_start(cfg_ctx.device->hidden->pcm);
|
|
||||||
return true; // We're ready to rock and roll. :-)
|
return true; // We're ready to rock and roll. :-)
|
||||||
|
|
||||||
err_cleanup_ctx:
|
err_cleanup_ctx:
|
||||||
@@ -1200,6 +1197,13 @@ err_free_device_hidden:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ALSA_ThreadInit(SDL_AudioDevice *device)
|
||||||
|
{
|
||||||
|
SDL_SetCurrentThreadPriority(device->recording ? SDL_THREAD_PRIORITY_HIGH : SDL_THREAD_PRIORITY_TIME_CRITICAL);
|
||||||
|
// do snd_pcm_start as close to the first time we PlayDevice as possible to prevent an underrun at startup.
|
||||||
|
ALSA_snd_pcm_start(device->hidden->pcm);
|
||||||
|
}
|
||||||
|
|
||||||
static ALSA_Device *hotplug_devices = NULL;
|
static ALSA_Device *hotplug_devices = NULL;
|
||||||
|
|
||||||
static int hotplug_device_process(snd_ctl_t *ctl, snd_ctl_card_info_t *ctl_card_info, int dev_idx,
|
static int hotplug_device_process(snd_ctl_t *ctl, snd_ctl_card_info_t *ctl_card_info, int dev_idx,
|
||||||
@@ -1497,6 +1501,7 @@ static bool ALSA_Init(SDL_AudioDriverImpl *impl)
|
|||||||
|
|
||||||
impl->DetectDevices = ALSA_DetectDevices;
|
impl->DetectDevices = ALSA_DetectDevices;
|
||||||
impl->OpenDevice = ALSA_OpenDevice;
|
impl->OpenDevice = ALSA_OpenDevice;
|
||||||
|
impl->ThreadInit = ALSA_ThreadInit;
|
||||||
impl->WaitDevice = ALSA_WaitDevice;
|
impl->WaitDevice = ALSA_WaitDevice;
|
||||||
impl->GetDeviceBuf = ALSA_GetDeviceBuf;
|
impl->GetDeviceBuf = ALSA_GetDeviceBuf;
|
||||||
impl->PlayDevice = ALSA_PlayDevice;
|
impl->PlayDevice = ALSA_PlayDevice;
|
||||||
|
|||||||
@@ -420,7 +420,8 @@ static bool UpdateAudioSession(SDL_AudioDevice *device, bool open, bool allow_pl
|
|||||||
|
|
||||||
hint = SDL_GetHint(SDL_HINT_AUDIO_CATEGORY);
|
hint = SDL_GetHint(SDL_HINT_AUDIO_CATEGORY);
|
||||||
if (hint) {
|
if (hint) {
|
||||||
if (SDL_strcasecmp(hint, "AVAudioSessionCategoryAmbient") == 0) {
|
if (SDL_strcasecmp(hint, "AVAudioSessionCategoryAmbient") == 0 ||
|
||||||
|
SDL_strcasecmp(hint, "ambient") == 0) {
|
||||||
category = AVAudioSessionCategoryAmbient;
|
category = AVAudioSessionCategoryAmbient;
|
||||||
} else if (SDL_strcasecmp(hint, "AVAudioSessionCategorySoloAmbient") == 0) {
|
} else if (SDL_strcasecmp(hint, "AVAudioSessionCategorySoloAmbient") == 0) {
|
||||||
category = AVAudioSessionCategorySoloAmbient;
|
category = AVAudioSessionCategorySoloAmbient;
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ static void DSOUND_DetectDevices(SDL_AudioDevice **default_playback, SDL_AudioDe
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_MMDEVICEAPI_H
|
#ifdef HAVE_MMDEVICEAPI_H
|
||||||
if (SupportsIMMDevice) {
|
if (SupportsIMMDevice) {
|
||||||
SDL_IMMDevice_EnumerateEndpoints(default_playback, default_recording);
|
SDL_IMMDevice_EnumerateEndpoints(default_playback, default_recording, SDL_AUDIO_UNKNOWN);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ static bool EMSCRIPTENAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// limit to native freq
|
// limit to native freq
|
||||||
device->spec.freq = EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
device->spec.freq = MAIN_THREAD_EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
||||||
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq) * 2; // double the buffer size, some browsers need more, and we'll just have to live with the latency.
|
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq) * 2; // double the buffer size, some browsers need more, and we'll just have to live with the latency.
|
||||||
|
|
||||||
SDL_UpdatedAudioDeviceFormat(device);
|
SDL_UpdatedAudioDeviceFormat(device);
|
||||||
|
|||||||
@@ -426,28 +426,33 @@ static void OPENSLES_DestroyPCMPlayer(SDL_AudioDevice *device)
|
|||||||
|
|
||||||
static bool OPENSLES_CreatePCMPlayer(SDL_AudioDevice *device)
|
static bool OPENSLES_CreatePCMPlayer(SDL_AudioDevice *device)
|
||||||
{
|
{
|
||||||
/* If we want to add floating point audio support (requires API level 21)
|
/* according to https://developer.android.com/ndk/guides/audio/opensl/opensl-for-android,
|
||||||
it can be done as described here:
|
Android's OpenSL ES only supports Uint8 and _littleendian_ Sint16.
|
||||||
https://developer.android.com/ndk/guides/audio/opensl/android-extensions.html#floating-point
|
(and float32, with an extension we use, below.) */
|
||||||
*/
|
|
||||||
if (SDL_GetAndroidSDKVersion() >= 21) {
|
if (SDL_GetAndroidSDKVersion() >= 21) {
|
||||||
const SDL_AudioFormat *closefmts = SDL_ClosestAudioFormats(device->spec.format);
|
const SDL_AudioFormat *closefmts = SDL_ClosestAudioFormats(device->spec.format);
|
||||||
SDL_AudioFormat test_format;
|
SDL_AudioFormat test_format;
|
||||||
while ((test_format = *(closefmts++)) != 0) {
|
while ((test_format = *(closefmts++)) != 0) {
|
||||||
if (SDL_AUDIO_ISSIGNED(test_format)) {
|
switch (test_format) {
|
||||||
|
case SDL_AUDIO_U8:
|
||||||
|
case SDL_AUDIO_S16LE:
|
||||||
|
case SDL_AUDIO_F32:
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!test_format) {
|
if (!test_format) {
|
||||||
// Didn't find a compatible format :
|
// Didn't find a compatible format :
|
||||||
LOGI("No compatible audio format, using signed 16-bit audio");
|
LOGI("No compatible audio format, using signed 16-bit LE audio");
|
||||||
test_format = SDL_AUDIO_S16;
|
test_format = SDL_AUDIO_S16LE;
|
||||||
}
|
}
|
||||||
device->spec.format = test_format;
|
device->spec.format = test_format;
|
||||||
} else {
|
} else {
|
||||||
// Just go with signed 16-bit audio as it's the most compatible
|
// Just go with signed 16-bit audio as it's the most compatible
|
||||||
device->spec.format = SDL_AUDIO_S16;
|
device->spec.format = SDL_AUDIO_S16LE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the fragment size as size in bytes
|
// Update the fragment size as size in bytes
|
||||||
|
|||||||
@@ -1118,7 +1118,13 @@ static bool PIPEWIRE_OpenDevice(SDL_AudioDevice *device)
|
|||||||
|
|
||||||
stream_name = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME);
|
stream_name = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME);
|
||||||
if (!stream_name || *stream_name == '\0') {
|
if (!stream_name || *stream_name == '\0') {
|
||||||
stream_name = "Audio Stream";
|
if (app_name) {
|
||||||
|
stream_name = app_name;
|
||||||
|
} else if (app_id) {
|
||||||
|
stream_name = app_id;
|
||||||
|
} else {
|
||||||
|
stream_name = "SDL Audio Stream";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1187,7 +1193,11 @@ static bool PIPEWIRE_OpenDevice(SDL_AudioDevice *device)
|
|||||||
PIPEWIRE_pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%u/%i", device->sample_frames, device->spec.freq);
|
PIPEWIRE_pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%u/%i", device->sample_frames, device->spec.freq);
|
||||||
PIPEWIRE_pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", device->spec.freq);
|
PIPEWIRE_pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", device->spec.freq);
|
||||||
PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_ALWAYS_PROCESS, "true");
|
PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_ALWAYS_PROCESS, "true");
|
||||||
PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_DONT_RECONNECT, "true"); // Requesting a specific device, don't migrate to new default hardware.
|
|
||||||
|
// UPDATE: This prevents users from moving the audio to a new sink (device) using standard tools. This is slightly in conflict
|
||||||
|
// with how SDL wants to manage audio devices, but if people want to do it, we should let them, so this is commented out
|
||||||
|
// for now. We might revisit later.
|
||||||
|
//PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_DONT_RECONNECT, "true"); // Requesting a specific device, don't migrate to new default hardware.
|
||||||
|
|
||||||
if (node_id != PW_ID_ANY) {
|
if (node_id != PW_ID_ANY) {
|
||||||
PIPEWIRE_pw_thread_loop_lock(hotplug_loop);
|
PIPEWIRE_pw_thread_loop_lock(hotplug_loop);
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ static bool PSPAUDIO_PlayDevice(SDL_AudioDevice *device, const Uint8 *buffer, in
|
|||||||
} else {
|
} else {
|
||||||
rc = sceAudioOutputPannedBlocking(device->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, (void *) buffer);
|
rc = sceAudioOutputPannedBlocking(device->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, (void *) buffer);
|
||||||
}
|
}
|
||||||
return (rc == 0);
|
return (rc >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool PSPAUDIO_WaitDevice(SDL_AudioDevice *device)
|
static bool PSPAUDIO_WaitDevice(SDL_AudioDevice *device)
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ static bool PULSEAUDIO_WaitDevice(SDL_AudioDevice *device)
|
|||||||
struct SDL_PrivateAudioData *h = device->hidden;
|
struct SDL_PrivateAudioData *h = device->hidden;
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
||||||
//SDL_Log("PULSEAUDIO PLAYDEVICE START! mixlen=%d", available);
|
//SDL_Log("PULSEAUDIO WAITDEVICE START! mixlen=%d", available);
|
||||||
|
|
||||||
PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop);
|
PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop);
|
||||||
|
|
||||||
@@ -595,6 +595,71 @@ static void PulseStreamStateChangeCallback(pa_stream *stream, void *userdata)
|
|||||||
PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); // just signal any waiting code, it can look up the details.
|
PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); // just signal any waiting code, it can look up the details.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Channel maps that match the order in SDL_Audio.h
|
||||||
|
static const pa_channel_position_t Pulse_map_1[] = { PA_CHANNEL_POSITION_MONO };
|
||||||
|
static const pa_channel_position_t Pulse_map_2[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT };
|
||||||
|
|
||||||
|
static const pa_channel_position_t Pulse_map_3[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_LFE };
|
||||||
|
|
||||||
|
static const pa_channel_position_t Pulse_map_4[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT };
|
||||||
|
|
||||||
|
static const pa_channel_position_t Pulse_map_5[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_LFE,
|
||||||
|
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT };
|
||||||
|
|
||||||
|
static const pa_channel_position_t Pulse_map_6[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_FRONT_CENTER, PA_CHANNEL_POSITION_LFE,
|
||||||
|
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT };
|
||||||
|
|
||||||
|
static const pa_channel_position_t Pulse_map_7[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_FRONT_CENTER, PA_CHANNEL_POSITION_LFE,
|
||||||
|
PA_CHANNEL_POSITION_REAR_CENTER,
|
||||||
|
PA_CHANNEL_POSITION_SIDE_LEFT, PA_CHANNEL_POSITION_SIDE_RIGHT };
|
||||||
|
|
||||||
|
static const pa_channel_position_t Pulse_map_8[] = { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_FRONT_CENTER, PA_CHANNEL_POSITION_LFE,
|
||||||
|
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
|
||||||
|
PA_CHANNEL_POSITION_SIDE_LEFT, PA_CHANNEL_POSITION_SIDE_RIGHT };
|
||||||
|
|
||||||
|
#define COPY_CHANNEL_MAP(c) SDL_memcpy(pacmap->map, Pulse_map_##c, sizeof(Pulse_map_##c))
|
||||||
|
|
||||||
|
static void PulseCreateChannelMap(pa_channel_map *pacmap, uint8_t channels)
|
||||||
|
{
|
||||||
|
SDL_assert(channels <= PA_CHANNELS_MAX);
|
||||||
|
|
||||||
|
pacmap->channels = channels;
|
||||||
|
|
||||||
|
switch (channels) {
|
||||||
|
case 1:
|
||||||
|
COPY_CHANNEL_MAP(1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
COPY_CHANNEL_MAP(2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
COPY_CHANNEL_MAP(3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
COPY_CHANNEL_MAP(4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
COPY_CHANNEL_MAP(5);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
COPY_CHANNEL_MAP(6);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
COPY_CHANNEL_MAP(7);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
COPY_CHANNEL_MAP(8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
|
static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
|
||||||
{
|
{
|
||||||
const bool recording = device->recording;
|
const bool recording = device->recording;
|
||||||
@@ -672,7 +737,8 @@ static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
paspec.rate = device->spec.freq;
|
paspec.rate = device->spec.freq;
|
||||||
|
|
||||||
// Reduced prebuffering compared to the defaults.
|
// Reduced prebuffering compared to the defaults.
|
||||||
paattr.fragsize = device->buffer_size; // despite the name, this is only used for recording devices, according to PulseAudio docs!
|
|
||||||
|
paattr.fragsize = device->buffer_size * 2; // despite the name, this is only used for recording devices, according to PulseAudio docs! (times 2 because we want _more_ than our buffer size sent from the server at a time, which helps some drivers).
|
||||||
paattr.tlength = device->buffer_size;
|
paattr.tlength = device->buffer_size;
|
||||||
paattr.prebuf = -1;
|
paattr.prebuf = -1;
|
||||||
paattr.maxlength = -1;
|
paattr.maxlength = -1;
|
||||||
@@ -682,9 +748,8 @@ static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop);
|
PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop);
|
||||||
|
|
||||||
const char *name = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME);
|
const char *name = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME);
|
||||||
// The SDL ALSA output hints us that we use Windows' channel mapping
|
|
||||||
// https://bugzilla.libsdl.org/show_bug.cgi?id=110
|
PulseCreateChannelMap(&pacmap, device->spec.channels);
|
||||||
PULSEAUDIO_pa_channel_map_init_auto(&pacmap, device->spec.channels, PA_CHANNEL_MAP_WAVEEX);
|
|
||||||
|
|
||||||
h->stream = PULSEAUDIO_pa_stream_new(
|
h->stream = PULSEAUDIO_pa_stream_new(
|
||||||
pulseaudio_context,
|
pulseaudio_context,
|
||||||
@@ -701,7 +766,10 @@ static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
PULSEAUDIO_pa_stream_set_state_callback(h->stream, PulseStreamStateChangeCallback, NULL);
|
PULSEAUDIO_pa_stream_set_state_callback(h->stream, PulseStreamStateChangeCallback, NULL);
|
||||||
|
|
||||||
// SDL manages device moves if the default changes, so don't ever let Pulse automatically migrate this stream.
|
// SDL manages device moves if the default changes, so don't ever let Pulse automatically migrate this stream.
|
||||||
flags |= PA_STREAM_DONT_MOVE;
|
// UPDATE: This prevents users from moving the audio to a new sink (device) using standard tools. This is slightly in conflict
|
||||||
|
// with how SDL wants to manage audio devices, but if people want to do it, we should let them, so this is commented out
|
||||||
|
// for now. We might revisit later.
|
||||||
|
//flags |= PA_STREAM_DONT_MOVE;
|
||||||
|
|
||||||
const char *device_path = ((PulseDeviceHandle *) device->handle)->device_path;
|
const char *device_path = ((PulseDeviceHandle *) device->handle)->device_path;
|
||||||
if (recording) {
|
if (recording) {
|
||||||
|
|||||||
@@ -130,7 +130,8 @@ static bool VITAAUD_OpenDevice(SDL_AudioDevice *device)
|
|||||||
|
|
||||||
static bool VITAAUD_PlayDevice(SDL_AudioDevice *device, const Uint8 *buffer, int buffer_size)
|
static bool VITAAUD_PlayDevice(SDL_AudioDevice *device, const Uint8 *buffer, int buffer_size)
|
||||||
{
|
{
|
||||||
return (sceAudioOutOutput(device->hidden->port, buffer) == 0);
|
// sceAudioOutOutput returns amount of samples queued or < 0 on error
|
||||||
|
return (sceAudioOutOutput(device->hidden->port, buffer) >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function waits until it is possible to write a full sound buffer
|
// This function waits until it is possible to write a full sound buffer
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ typedef struct
|
|||||||
static bool mgmtthrtask_DetectDevices(void *userdata)
|
static bool mgmtthrtask_DetectDevices(void *userdata)
|
||||||
{
|
{
|
||||||
mgmtthrtask_DetectDevicesData *data = (mgmtthrtask_DetectDevicesData *)userdata;
|
mgmtthrtask_DetectDevicesData *data = (mgmtthrtask_DetectDevicesData *)userdata;
|
||||||
SDL_IMMDevice_EnumerateEndpoints(data->default_playback, data->default_recording);
|
SDL_IMMDevice_EnumerateEndpoints(data->default_playback, data->default_recording, SDL_AUDIO_F32);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -814,7 +814,7 @@ static void ANDROIDCAMERA_Deinitialize(void)
|
|||||||
static bool ANDROIDCAMERA_Init(SDL_CameraDriverImpl *impl)
|
static bool ANDROIDCAMERA_Init(SDL_CameraDriverImpl *impl)
|
||||||
{
|
{
|
||||||
// !!! FIXME: slide this off into a subroutine
|
// !!! FIXME: slide this off into a subroutine
|
||||||
// system libraries are in android-24 and later; we currently target android-16 and later, so check if they exist at runtime.
|
// system libraries are in android-24 and later; we currently target android-21 and later, so check if they exist at runtime.
|
||||||
void *libcamera2 = dlopen("libcamera2ndk.so", RTLD_NOW | RTLD_LOCAL);
|
void *libcamera2 = dlopen("libcamera2ndk.so", RTLD_NOW | RTLD_LOCAL);
|
||||||
if (!libcamera2) {
|
if (!libcamera2) {
|
||||||
SDL_Log("CAMERA: libcamera2ndk.so can't be loaded: %s", dlerror());
|
SDL_Log("CAMERA: libcamera2ndk.so can't be loaded: %s", dlerror());
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ static SDL_CameraFrameResult EMSCRIPTENCAMERA_AcquireFrame(SDL_Camera *device, S
|
|||||||
|
|
||||||
SDL3.camera.ctx2d.drawImage(SDL3.camera.video, 0, 0, w, h);
|
SDL3.camera.ctx2d.drawImage(SDL3.camera.video, 0, 0, w, h);
|
||||||
const imgrgba = SDL3.camera.ctx2d.getImageData(0, 0, w, h).data;
|
const imgrgba = SDL3.camera.ctx2d.getImageData(0, 0, w, h).data;
|
||||||
Module.HEAPU8.set(imgrgba, rgba);
|
HEAPU8.set(imgrgba, rgba);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}, device->actual_spec.width, device->actual_spec.height, rgba);
|
}, device->actual_spec.width, device->actual_spec.height, rgba);
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ static bool pipewire_initialized = false;
|
|||||||
|
|
||||||
// Pipewire entry points
|
// Pipewire entry points
|
||||||
static const char *(*PIPEWIRE_pw_get_library_version)(void);
|
static const char *(*PIPEWIRE_pw_get_library_version)(void);
|
||||||
|
#if PW_CHECK_VERSION(0, 3, 75)
|
||||||
static bool (*PIPEWIRE_pw_check_library_version)(int major, int minor, int micro);
|
static bool (*PIPEWIRE_pw_check_library_version)(int major, int minor, int micro);
|
||||||
|
#endif
|
||||||
static void (*PIPEWIRE_pw_init)(int *, char ***);
|
static void (*PIPEWIRE_pw_init)(int *, char ***);
|
||||||
static void (*PIPEWIRE_pw_deinit)(void);
|
static void (*PIPEWIRE_pw_deinit)(void);
|
||||||
static struct pw_main_loop *(*PIPEWIRE_pw_main_loop_new)(const struct spa_dict *loop);
|
static struct pw_main_loop *(*PIPEWIRE_pw_main_loop_new)(const struct spa_dict *loop);
|
||||||
@@ -151,7 +153,9 @@ static void unload_pipewire_library(void)
|
|||||||
static bool load_pipewire_syms(void)
|
static bool load_pipewire_syms(void)
|
||||||
{
|
{
|
||||||
SDL_PIPEWIRE_SYM(pw_get_library_version);
|
SDL_PIPEWIRE_SYM(pw_get_library_version);
|
||||||
|
#if PW_CHECK_VERSION(0, 3, 75)
|
||||||
SDL_PIPEWIRE_SYM(pw_check_library_version);
|
SDL_PIPEWIRE_SYM(pw_check_library_version);
|
||||||
|
#endif
|
||||||
SDL_PIPEWIRE_SYM(pw_init);
|
SDL_PIPEWIRE_SYM(pw_init);
|
||||||
SDL_PIPEWIRE_SYM(pw_deinit);
|
SDL_PIPEWIRE_SYM(pw_deinit);
|
||||||
SDL_PIPEWIRE_SYM(pw_main_loop_new);
|
SDL_PIPEWIRE_SYM(pw_main_loop_new);
|
||||||
@@ -1024,7 +1028,11 @@ static bool hotplug_loop_init(void)
|
|||||||
|
|
||||||
spa_list_init(&hotplug.global_list);
|
spa_list_init(&hotplug.global_list);
|
||||||
|
|
||||||
|
#if PW_CHECK_VERSION(0, 3, 75)
|
||||||
hotplug.have_1_0_5 = PIPEWIRE_pw_check_library_version(1,0,5);
|
hotplug.have_1_0_5 = PIPEWIRE_pw_check_library_version(1,0,5);
|
||||||
|
#else
|
||||||
|
hotplug.have_1_0_5 = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
hotplug.loop = PIPEWIRE_pw_thread_loop_new("SDLPwCameraPlug", NULL);
|
hotplug.loop = PIPEWIRE_pw_thread_loop_new("SDLPwCameraPlug", NULL);
|
||||||
if (!hotplug.loop) {
|
if (!hotplug.loop) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user