Compare commits
646 Commits
preview-3.
...
preview-3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22422f7748 | ||
|
|
d7b10d05b1 | ||
|
|
4290fc8bda | ||
|
|
6b38d250aa | ||
|
|
bba066c44c | ||
|
|
0bc370dfba | ||
|
|
6934c910b3 | ||
|
|
0176a19aee | ||
|
|
0180ca541e | ||
|
|
8ec576ddab | ||
|
|
748f0b3201 | ||
|
|
ba1a980535 | ||
|
|
28389f1c38 | ||
|
|
ef52a4d4df | ||
|
|
8d8649b33f | ||
|
|
f8b13dadd7 | ||
|
|
1167cf54e1 | ||
|
|
8a9b7ae8d1 | ||
|
|
fb4ec07119 | ||
|
|
b674b715f5 | ||
|
|
1e1442ed4a | ||
|
|
d8c7006a42 | ||
|
|
6473de59b7 | ||
|
|
c7584df999 | ||
|
|
1f54b228ff | ||
|
|
7c9f6c6313 | ||
|
|
19ddb29d2d | ||
|
|
d16f76e3d4 | ||
|
|
742f2a2fad | ||
|
|
2b375d9704 | ||
|
|
dcc645e413 | ||
|
|
ece6a6ed8f | ||
|
|
7f9ee31024 | ||
|
|
16ad3e5af6 | ||
|
|
0ae57f1d90 | ||
|
|
6a0405b933 | ||
|
|
9f2186ad52 | ||
|
|
181995b44f | ||
|
|
8509041a09 | ||
|
|
344e394bf4 | ||
|
|
d8c679416b | ||
|
|
b6dc44b133 | ||
|
|
7673b84f52 | ||
|
|
a58bc3eaf4 | ||
|
|
0a5d2f3da2 | ||
|
|
3519ef3b3b | ||
|
|
56d7cc7a02 | ||
|
|
04f3bdb118 | ||
|
|
18c6958cae | ||
|
|
522682cd6e | ||
|
|
a4cd17cce5 | ||
|
|
efba42a67b | ||
|
|
156b3b4a8c | ||
|
|
53aaf8c26b | ||
|
|
9b40d43b1f | ||
|
|
85851459d6 | ||
|
|
db97da4ccb | ||
|
|
5579010b6a | ||
|
|
2d37903323 | ||
|
|
ef21ccf080 | ||
|
|
49663bfb58 | ||
|
|
a8c41135aa | ||
|
|
8b83a57847 | ||
|
|
e484182765 | ||
|
|
011454b237 | ||
|
|
efc390d7e2 | ||
|
|
c077b7a918 | ||
|
|
0b520cd4b4 | ||
|
|
9f7b2c3595 | ||
|
|
2c0a8363a5 | ||
|
|
95d44f11c7 | ||
|
|
16dfaca728 | ||
|
|
32ab09ba21 | ||
|
|
1461f893c3 | ||
|
|
a63052db96 | ||
|
|
dd6b484359 | ||
|
|
ecf8dd054d | ||
|
|
4797970bfa | ||
|
|
6b4b9b5f2b | ||
|
|
8ea4b326b3 | ||
|
|
67ea67f191 | ||
|
|
c6b5c21aaf | ||
|
|
f8f8d87bfa | ||
|
|
b713e7581b | ||
|
|
54752f8d1c | ||
|
|
3842384a38 | ||
|
|
6cf6b160cd | ||
|
|
62bc2c4c92 | ||
|
|
4fccfb142e | ||
|
|
4fbf59ac3a | ||
|
|
578ac0ef52 | ||
|
|
31a4c92ee5 | ||
|
|
02e85a153f | ||
|
|
9955e1dc0d | ||
|
|
0281071243 | ||
|
|
c68ed04a06 | ||
|
|
2b1d809b21 | ||
|
|
6d554a9ea3 | ||
|
|
9fbc767d4f | ||
|
|
e43aa12b49 | ||
|
|
c0e5901c42 | ||
|
|
f2074d7af3 | ||
|
|
3197e27b59 | ||
|
|
f18e023317 | ||
|
|
54d4e48539 | ||
|
|
6575b8157b | ||
|
|
30a22d3fed | ||
|
|
d666c2d189 | ||
|
|
196e2c6662 | ||
|
|
b902b0527b | ||
|
|
a767952617 | ||
|
|
54c555e394 | ||
|
|
8b155708ff | ||
|
|
1d417ab27f | ||
|
|
643281d022 | ||
|
|
2be89f0dd1 | ||
|
|
a37f993a07 | ||
|
|
65e0fed5b3 | ||
|
|
dd83908109 | ||
|
|
99ad53ec3f | ||
|
|
df97ccf283 | ||
|
|
4f0a056b95 | ||
|
|
18fc13c20d | ||
|
|
6d20b65a9e | ||
|
|
3cd3c9317e | ||
|
|
6ca2a48595 | ||
|
|
fa9c3331d5 | ||
|
|
cd1bd0ac2e | ||
|
|
0be5b8070d | ||
|
|
1c04ebe423 | ||
|
|
d4d5faedab | ||
|
|
8704ab8422 | ||
|
|
60deaf5f0f | ||
|
|
5340f2e3fe | ||
|
|
e91c37f4dd | ||
|
|
f3cbd04a81 | ||
|
|
5f25691c85 | ||
|
|
8cc4735d74 | ||
|
|
2d91f096ca | ||
|
|
78c1dc3e2c | ||
|
|
0410328b15 | ||
|
|
d5f08b8f4b | ||
|
|
543f244965 | ||
|
|
c2121dd9a2 | ||
|
|
5c84d38822 | ||
|
|
6e1177ac03 | ||
|
|
c030e6f782 | ||
|
|
0ad3a18937 | ||
|
|
f6143da617 | ||
|
|
774e38d073 | ||
|
|
5acd7fe208 | ||
|
|
c714b1a38b | ||
|
|
cf439d5c63 | ||
|
|
ec29d3fd66 | ||
|
|
92b7054870 | ||
|
|
1a466b5548 | ||
|
|
ec8a780ad4 | ||
|
|
cc723c9e4b | ||
|
|
0cb4a94c88 | ||
|
|
4ffcb8ebab | ||
|
|
49153ebfc4 | ||
|
|
1b99467c71 | ||
|
|
0be6dc5734 | ||
|
|
4fbd6cba60 | ||
|
|
e25cc7a88f | ||
|
|
38dd6bcd32 | ||
|
|
f1232de3d2 | ||
|
|
2664d36faf | ||
|
|
609b147432 | ||
|
|
cc24518c41 | ||
|
|
a0e537b9c0 | ||
|
|
df1f1c2e12 | ||
|
|
af3d97dcac | ||
|
|
bc448fa445 | ||
|
|
599b4ef254 | ||
|
|
1c52e290a3 | ||
|
|
9a4d29699d | ||
|
|
75a24116b5 | ||
|
|
22f6eed1d9 | ||
|
|
c148837546 | ||
|
|
82a1e9f6df | ||
|
|
ba5cf2b152 | ||
|
|
567b828e18 | ||
|
|
1701208f32 | ||
|
|
622c3ebb94 | ||
|
|
0461180e25 | ||
|
|
ff139fe71b | ||
|
|
e9290eeedf | ||
|
|
578509c326 | ||
|
|
05932e05da | ||
|
|
e2323c1367 | ||
|
|
f5fbdf7ed5 | ||
|
|
a5e8fc21b2 | ||
|
|
80c39f2ff4 | ||
|
|
e3c99e3bd3 | ||
|
|
1413bfb185 | ||
|
|
948b16533c | ||
|
|
cd1bb6247b | ||
|
|
a773558517 | ||
|
|
50fbae9302 | ||
|
|
c744c8fc0b | ||
|
|
a8d585aac3 | ||
|
|
ca17d19f90 | ||
|
|
7bbe6025be | ||
|
|
ffed1c50c0 | ||
|
|
1a6e139dde | ||
|
|
cf220ea4f1 | ||
|
|
17ef0c1237 | ||
|
|
8fde28813e | ||
|
|
17df3fe836 | ||
|
|
eb1be89e70 | ||
|
|
7647f16ae1 | ||
|
|
eadc64973a | ||
|
|
b2c2a483e8 | ||
|
|
fe39509b85 | ||
|
|
b8036bdd41 | ||
|
|
ca4f5dd40d | ||
|
|
b7dac5072b | ||
|
|
0becdad392 | ||
|
|
5bf742daa6 | ||
|
|
bed16f77d1 | ||
|
|
b2178857dc | ||
|
|
f40a530fd9 | ||
|
|
cf946e32ba | ||
|
|
4c70aa33ae | ||
|
|
76920a230f | ||
|
|
01b9b0edb7 | ||
|
|
17a029502a | ||
|
|
a27c139b12 | ||
|
|
aa817a67d1 | ||
|
|
8653a5821b | ||
|
|
60dce94583 | ||
|
|
440d5754f8 | ||
|
|
052cb5773e | ||
|
|
42c67756cc | ||
|
|
286cc2ebd0 | ||
|
|
c2508d5d99 | ||
|
|
f2b7495adc | ||
|
|
ade829d7ca | ||
|
|
e73d98ad72 | ||
|
|
7f1c9c9053 | ||
|
|
6f462e244f | ||
|
|
ddd7d0f927 | ||
|
|
483e79bf82 | ||
|
|
ed75d9d22a | ||
|
|
024e5da6fb | ||
|
|
8a0f649363 | ||
|
|
af2dbbcb53 | ||
|
|
4d301b88d6 | ||
|
|
5a2eb60389 | ||
|
|
969f03d9f0 | ||
|
|
7a22076a7c | ||
|
|
3a1810f9a9 | ||
|
|
49610fd1e8 | ||
|
|
62124e2c28 | ||
|
|
18115ef6bd | ||
|
|
8691408baf | ||
|
|
37b87f79fb | ||
|
|
9a43c08146 | ||
|
|
225c0e2ad9 | ||
|
|
4add7e2005 | ||
|
|
3ac28bae6a | ||
|
|
da37e1541b | ||
|
|
ecea3471f6 | ||
|
|
f8d8bf8066 | ||
|
|
a33144fbc9 | ||
|
|
2e4dc9c109 | ||
|
|
80c1b1e1a0 | ||
|
|
478ac0b9bf | ||
|
|
03d6e4b69e | ||
|
|
ca4ffc8a00 | ||
|
|
8475c496b4 | ||
|
|
56cf8d8dc9 | ||
|
|
f0fad41f2c | ||
|
|
4d8f5758cf | ||
|
|
c080bb8417 | ||
|
|
33442701ca | ||
|
|
7e298f50fe | ||
|
|
34974d4d2b | ||
|
|
cadeec9cc9 | ||
|
|
f37eef948c | ||
|
|
d07bb0e679 | ||
|
|
c44fa5bb07 | ||
|
|
1025087c2e | ||
|
|
a47b62d1fe | ||
|
|
f3c194f39a | ||
|
|
7e8576fd19 | ||
|
|
f7580374a1 | ||
|
|
232c2970d3 | ||
|
|
5ec5f23fff | ||
|
|
b815123cf2 | ||
|
|
819e1cc95b | ||
|
|
b2eb23a617 | ||
|
|
0b401137d2 | ||
|
|
b83dd793fd | ||
|
|
a0864799f2 | ||
|
|
5d9ccb6296 | ||
|
|
e992522cb2 | ||
|
|
b2c15a8c2a | ||
|
|
0f9e86fe1c | ||
|
|
c9e22d4672 | ||
|
|
ff366fba87 | ||
|
|
e46d8756e5 | ||
|
|
401c8f8e4e | ||
|
|
2f9a45af60 | ||
|
|
0c42891826 | ||
|
|
3ce68f80bc | ||
|
|
7c8171da92 | ||
|
|
4bfc8f84f7 | ||
|
|
8c849ecc6c | ||
|
|
fce922b66c | ||
|
|
d6a95ae198 | ||
|
|
42de2ac6a9 | ||
|
|
e08f34c3be | ||
|
|
6e0df0af24 | ||
|
|
519923ea80 | ||
|
|
624a4d5f26 | ||
|
|
5c0f8dc179 | ||
|
|
345cab1e36 | ||
|
|
35a9d156a6 | ||
|
|
3739749404 | ||
|
|
10f868abf4 | ||
|
|
f81472d767 | ||
|
|
3001c61de0 | ||
|
|
835b6e0c1a | ||
|
|
da80b9bce5 | ||
|
|
2ce21d1fed | ||
|
|
0ca8027205 | ||
|
|
4d9e7a2a68 | ||
|
|
b5eea03d1e | ||
|
|
7dd523fbb1 | ||
|
|
48a0adb2ac | ||
|
|
4d4a2786bb | ||
|
|
6abebca943 | ||
|
|
1d0e28a5b3 | ||
|
|
5608bf5866 | ||
|
|
0fbcd0d586 | ||
|
|
e957840d34 | ||
|
|
684098fac3 | ||
|
|
bc9c86bcc2 | ||
|
|
b58e6d7274 | ||
|
|
c9ab8ad8d9 | ||
|
|
d38c09e5c4 | ||
|
|
6730cf7bed | ||
|
|
2f68efda83 | ||
|
|
19bdc01b8c | ||
|
|
eda0261c4e | ||
|
|
6fa6297441 | ||
|
|
b84f150d06 | ||
|
|
c52a96ca8e | ||
|
|
080b3002c6 | ||
|
|
d0d1414836 | ||
|
|
a92eade183 | ||
|
|
0bb42cb023 | ||
|
|
483ceb5355 | ||
|
|
35360ec4d7 | ||
|
|
576f13ac7c | ||
|
|
ff96c59df4 | ||
|
|
b108b54c6a | ||
|
|
639855b7e5 | ||
|
|
a4a1dff219 | ||
|
|
b9c062c858 | ||
|
|
76e7bc4c04 | ||
|
|
3fa0537565 | ||
|
|
79316ca36e | ||
|
|
9aca97f4e7 | ||
|
|
c0803f7683 | ||
|
|
a55686ce61 | ||
|
|
eb3fc0684c | ||
|
|
6cc9ce183d | ||
|
|
8b6d3c88cf | ||
|
|
313d522f39 | ||
|
|
ac2edad809 | ||
|
|
9a9616894d | ||
|
|
9628549c7c | ||
|
|
80b9986418 | ||
|
|
1944bc7407 | ||
|
|
63a498c966 | ||
|
|
ce9dddfde2 | ||
|
|
43a61fec91 | ||
|
|
61511c48a4 | ||
|
|
e0cee83a3a | ||
|
|
2635239bbc | ||
|
|
ce7cb10541 | ||
|
|
cf59fc797f | ||
|
|
af6c641b8c | ||
|
|
4c86511035 | ||
|
|
ff82238172 | ||
|
|
c5acbef3bf | ||
|
|
6fe09e3aa4 | ||
|
|
a1e8d5c327 | ||
|
|
3ee39f6c3f | ||
|
|
bbd4eeb287 | ||
|
|
f45ce45603 | ||
|
|
3f425b6f20 | ||
|
|
1fbb8e1824 | ||
|
|
e6e468d0c4 | ||
|
|
962268ca21 | ||
|
|
ac92af02ea | ||
|
|
be5fba963a | ||
|
|
7c5c88a3ad | ||
|
|
d4225070ad | ||
|
|
48b6b93fb6 | ||
|
|
5447cb6d38 | ||
|
|
e4215a04d9 | ||
|
|
fb71b44231 | ||
|
|
0370b92d80 | ||
|
|
5c020b9930 | ||
|
|
279836d259 | ||
|
|
1d5d948ccf | ||
|
|
19cc04a162 | ||
|
|
b5c05b6e29 | ||
|
|
1e7c7c69c5 | ||
|
|
09428688b9 | ||
|
|
972c6d0b82 | ||
|
|
5d09656afa | ||
|
|
72895a6994 | ||
|
|
f64e9a52dc | ||
|
|
ddb1e66d90 | ||
|
|
caf0348b26 | ||
|
|
900627f7fc | ||
|
|
6d1dac1404 | ||
|
|
d25cdc0fef | ||
|
|
df48af22d4 | ||
|
|
08de6656fc | ||
|
|
2ac62d8c67 | ||
|
|
846eb9a886 | ||
|
|
7278399366 | ||
|
|
d0f1910918 | ||
|
|
2c4fc2e549 | ||
|
|
8d8578785c | ||
|
|
fa5f84fb6e | ||
|
|
47429227ab | ||
|
|
0f228de48a | ||
|
|
ffb9b30e84 | ||
|
|
1a5b0796b4 | ||
|
|
d1b8fcd692 | ||
|
|
9b82d46259 | ||
|
|
5229b520af | ||
|
|
b79e3ac830 | ||
|
|
90efb63e52 | ||
|
|
e50dc7265b | ||
|
|
7ddda4fe18 | ||
|
|
3060105cfa | ||
|
|
2e5208f353 | ||
|
|
c49f4ceeb2 | ||
|
|
23828b62d4 | ||
|
|
bc4185c685 | ||
|
|
fffa6c7a2b | ||
|
|
235e5c6a6c | ||
|
|
9f8157f42c | ||
|
|
a0b8b57afe | ||
|
|
951ca96dc9 | ||
|
|
58f8e259d1 | ||
|
|
56da4e81d8 | ||
|
|
9784e10a75 | ||
|
|
5bfece34f9 | ||
|
|
045e31178f | ||
|
|
a74693c9a5 | ||
|
|
a4852f3a10 | ||
|
|
dc5a2ddfd0 | ||
|
|
efb59bd0bf | ||
|
|
45869d6177 | ||
|
|
d8eb68a6c5 | ||
|
|
24ed947cc3 | ||
|
|
31128b6cdd | ||
|
|
123306b18c | ||
|
|
d320d7143d | ||
|
|
830b132cd4 | ||
|
|
4ac78706bf | ||
|
|
2ad5836d02 | ||
|
|
31d09909b6 | ||
|
|
1377cdb3f2 | ||
|
|
46f43c2e6e | ||
|
|
4745aa3324 | ||
|
|
3ca629ceb5 | ||
|
|
022a6a9f97 | ||
|
|
e79ce2a200 | ||
|
|
7293c18314 | ||
|
|
401187eb6c | ||
|
|
b7a31ead08 | ||
|
|
9fb8661684 | ||
|
|
6aab5a089d | ||
|
|
65c9a58f5e | ||
|
|
ec2ef5f9b5 | ||
|
|
2762644e96 | ||
|
|
068d9cc7d6 | ||
|
|
2f59a1ce44 | ||
|
|
acf0f09320 | ||
|
|
3a1d76d298 | ||
|
|
ce573b01f8 | ||
|
|
d53241a299 | ||
|
|
5cd188bdbc | ||
|
|
7099de4ae8 | ||
|
|
bf9fa38920 | ||
|
|
f5ad66ef4b | ||
|
|
3303e9843f | ||
|
|
f852038384 | ||
|
|
16113374ff | ||
|
|
c0f1fe8e7f | ||
|
|
f022501d52 | ||
|
|
b8233aff8e | ||
|
|
b8bbd29ce9 | ||
|
|
bbc9c75618 | ||
|
|
5c8bed3780 | ||
|
|
03d15c031b | ||
|
|
d55e6dfc5e | ||
|
|
3c13bae64f | ||
|
|
e0e61775b8 | ||
|
|
6fab61b69d | ||
|
|
e9fdcf6c60 | ||
|
|
1720fc77fe | ||
|
|
a07a88c1b4 | ||
|
|
c508396e33 | ||
|
|
7a3f5ef129 | ||
|
|
10e2ce9ba4 | ||
|
|
88926f2b73 | ||
|
|
e14d939ead | ||
|
|
bbe843fd80 | ||
|
|
79f6f766d4 | ||
|
|
fdafa266d8 | ||
|
|
61ba8010d3 | ||
|
|
212f0dcdb1 | ||
|
|
41b0d36a6c | ||
|
|
f9ddb0bdea | ||
|
|
7bf3cae02e | ||
|
|
51637495e4 | ||
|
|
566f3dc138 | ||
|
|
b02285d495 | ||
|
|
97ddc9adf2 | ||
|
|
465881d560 | ||
|
|
c135386f58 | ||
|
|
615c935d11 | ||
|
|
848fd1eab4 | ||
|
|
0007451222 | ||
|
|
3a2b595c4f | ||
|
|
e94ba6e700 | ||
|
|
631c30527b | ||
|
|
2e70944c44 | ||
|
|
df73cae2b0 | ||
|
|
a4006e654e | ||
|
|
5ee4d176f1 | ||
|
|
a0591ec4a3 | ||
|
|
fef001cb48 | ||
|
|
e770b4e266 | ||
|
|
795ceae520 | ||
|
|
ecae3789ab | ||
|
|
587384756f | ||
|
|
2b744c7df3 | ||
|
|
932bb968d7 | ||
|
|
1413848f41 | ||
|
|
35e6c92c3c | ||
|
|
4fb955c80b | ||
|
|
aa352837d5 | ||
|
|
18b7a2315c | ||
|
|
014196d98d | ||
|
|
7a074f582e | ||
|
|
d2dc0fa920 | ||
|
|
0c53d9a1ee | ||
|
|
d8f8cf3e99 | ||
|
|
184da780f5 | ||
|
|
70fe38bcb2 | ||
|
|
e027b85cc4 | ||
|
|
bd57cfdb55 | ||
|
|
0f9e551d71 | ||
|
|
af6ce629c4 | ||
|
|
2b10a040ff | ||
|
|
572cc7af63 | ||
|
|
7d7ee43ddb | ||
|
|
e9f7a1b359 | ||
|
|
25390d6c21 | ||
|
|
e0166256ff | ||
|
|
8657fa8b3b | ||
|
|
f8468d580d | ||
|
|
eaef956a9a | ||
|
|
b54f6044a5 | ||
|
|
b43b333d25 | ||
|
|
7f14eb33c6 | ||
|
|
b71151a697 | ||
|
|
e4778d53d3 | ||
|
|
d48d4c8c48 | ||
|
|
f0b61c69e7 | ||
|
|
fe3566ca46 | ||
|
|
7959b08a4d | ||
|
|
6ca8269b96 | ||
|
|
0f9505256d | ||
|
|
140aba9e5d | ||
|
|
68c2cf84f6 | ||
|
|
1a311bc638 | ||
|
|
e67ae274a5 | ||
|
|
7c5a2cd462 | ||
|
|
95c8a1cf7c | ||
|
|
7007b4762b | ||
|
|
6049ca4fb1 | ||
|
|
c021c75737 | ||
|
|
d20936b544 | ||
|
|
3877bf55a3 | ||
|
|
c26dda10e0 | ||
|
|
9a4ae4b9ed | ||
|
|
20cd4290d7 | ||
|
|
dcf6dd19c3 | ||
|
|
6c99a4b783 | ||
|
|
a85f0b49f4 | ||
|
|
5a74aadac9 | ||
|
|
32cc92dceb | ||
|
|
119b4fa5f5 | ||
|
|
fc12cc6dfd | ||
|
|
559223ff9d | ||
|
|
332fd824f0 | ||
|
|
1ed1bc1d5d | ||
|
|
8a2cac7aaa | ||
|
|
54ff1f35bd | ||
|
|
37b49c98dc | ||
|
|
dbe82e685d | ||
|
|
3e2ef64c98 | ||
|
|
b0140fb1b4 | ||
|
|
97dac37373 | ||
|
|
6836ef8fd2 | ||
|
|
908bd84c5e | ||
|
|
1ea4edddec | ||
|
|
588e32ea5a | ||
|
|
ecfd143a26 | ||
|
|
908b42f2b9 | ||
|
|
028194286c | ||
|
|
0ef7a1d901 | ||
|
|
ed943318e2 | ||
|
|
27b828754a | ||
|
|
5a7b75607a | ||
|
|
c1246e31a4 | ||
|
|
d3b882b4f9 | ||
|
|
fb2145f731 | ||
|
|
96729e745a | ||
|
|
683991ab71 | ||
|
|
6823e3f005 | ||
|
|
458f616c53 | ||
|
|
73e0e8cf5b | ||
|
|
8026866994 | ||
|
|
cacfdc8cfa | ||
|
|
7031b240df | ||
|
|
c56a3f60fe | ||
|
|
615d2dcd5b | ||
|
|
e001a309be | ||
|
|
27f69c772c | ||
|
|
87dade4421 | ||
|
|
0508f100e2 | ||
|
|
927d297161 |
26
.github/workflows/create-test-plan.py
vendored
@@ -46,6 +46,7 @@ class SdlPlatform(Enum):
|
||||
Tvos = "tvos"
|
||||
Msvc = "msvc"
|
||||
N3ds = "n3ds"
|
||||
PowerPC = "powerpc"
|
||||
PowerPC64 = "powerpc64"
|
||||
Ps2 = "ps2"
|
||||
Psp = "psp"
|
||||
@@ -126,10 +127,11 @@ JOB_SPECS = {
|
||||
"android-cmake-lean": JobSpec(name="Android (CMake, lean)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-lean-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, lean=True, ),
|
||||
"android-mk": JobSpec(name="Android (Android.mk)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_mk=True, ),
|
||||
"android-gradle": JobSpec(name="Android (Gradle)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_gradle=True, ),
|
||||
"emscripten": JobSpec(name="Emscripten", os=JobOs.UbuntuLatest, platform=SdlPlatform.Emscripten, artifact="SDL-emscripten", ),
|
||||
"emscripten": JobSpec(name="Emscripten", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Emscripten, artifact="SDL-emscripten", ),
|
||||
"haiku": JobSpec(name="Haiku", os=JobOs.UbuntuLatest, platform=SdlPlatform.Haiku, artifact="SDL-haiku-x64", container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ),
|
||||
"loongarch64": JobSpec(name="LoongArch64", os=JobOs.UbuntuLatest, platform=SdlPlatform.LoongArch64, artifact="SDL-loongarch64", ),
|
||||
"n3ds": JobSpec(name="Nintendo 3DS", os=JobOs.UbuntuLatest, platform=SdlPlatform.N3ds, artifact="SDL-n3ds", container="devkitpro/devkitarm:latest", ),
|
||||
"ppc": JobSpec(name="PowerPC", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC, artifact="SDL-ppc", container="dockcross/linux-ppc:latest", ),
|
||||
"ppc64": JobSpec(name="PowerPC64", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC64, artifact="SDL-ppc64le", container="dockcross/linux-ppc64le:latest", ),
|
||||
"ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ),
|
||||
"psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ),
|
||||
@@ -203,7 +205,8 @@ class JobDetails:
|
||||
msys2_env: str = ""
|
||||
msys2_no_perl: bool = False
|
||||
werror: bool = True
|
||||
msvc_vcvars: str = ""
|
||||
msvc_vcvars_arch: str = ""
|
||||
msvc_vcvars_sdk: str = ""
|
||||
msvc_project: str = ""
|
||||
msvc_project_flags: list[str] = dataclasses.field(default_factory=list)
|
||||
setup_ninja: bool = False
|
||||
@@ -265,7 +268,8 @@ class JobDetails:
|
||||
"android-mk": self.android_mk,
|
||||
"werror": self.werror,
|
||||
"sudo": self.sudo,
|
||||
"msvc-vcvars": self.msvc_vcvars,
|
||||
"msvc-vcvars-arch": self.msvc_vcvars_arch,
|
||||
"msvc-vcvars-sdk": self.msvc_vcvars_sdk,
|
||||
"msvc-project": self.msvc_project,
|
||||
"msvc-project-flags": my_shlex_join(self.msvc_project_flags),
|
||||
"setup-ninja": self.setup_ninja,
|
||||
@@ -389,14 +393,15 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
job.msvc_project_flags.append(f"-p:Platform={msvc_platform}")
|
||||
match spec.msvc_arch:
|
||||
case MsvcArch.X86:
|
||||
job.msvc_vcvars = "x64_x86"
|
||||
job.msvc_vcvars_arch = "x64_x86"
|
||||
case MsvcArch.X64:
|
||||
job.msvc_vcvars = "x64"
|
||||
job.msvc_vcvars_arch = "x64"
|
||||
case MsvcArch.Arm32:
|
||||
job.msvc_vcvars = "x64_arm"
|
||||
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:
|
||||
job.msvc_vcvars = "x64_arm64"
|
||||
job.msvc_vcvars_arch = "x64_arm64"
|
||||
job.run_tests = False
|
||||
if spec.gdk:
|
||||
job.setup_gdk_folder = "VisualC-GDK"
|
||||
@@ -451,7 +456,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
case SdlPlatform.Ios | SdlPlatform.Tvos:
|
||||
job.brew_packages.extend([
|
||||
"ninja",
|
||||
"pkg-config",
|
||||
])
|
||||
job.clang_tidy = False
|
||||
job.run_tests = False
|
||||
@@ -497,8 +501,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
job.static_lib = StaticLibType.A
|
||||
job.apt_packages = []
|
||||
job.brew_packages.append("ninja")
|
||||
if job.test_pkg_config:
|
||||
job.brew_packages.append("pkg-config")
|
||||
if job.clang_tidy:
|
||||
job.brew_packages.append("llvm")
|
||||
if spec.xcode:
|
||||
@@ -618,7 +620,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
))
|
||||
job.shared_lib = SharedLibType.SO_0
|
||||
job.static_lib = StaticLibType.A
|
||||
case SdlPlatform.PowerPC64:
|
||||
case SdlPlatform.PowerPC64 | SdlPlatform.PowerPC:
|
||||
# FIXME: Enable SDL_WERROR
|
||||
job.werror = False
|
||||
job.clang_tidy = False
|
||||
@@ -689,7 +691,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
match spec.platform:
|
||||
case SdlPlatform.FreeBSD:
|
||||
job.cpactions_os = "freebsd"
|
||||
job.cpactions_version = "13.3"
|
||||
job.cpactions_version = "14.2"
|
||||
job.cpactions_arch = "x86-64"
|
||||
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"
|
||||
|
||||
17
.github/workflows/generic.yml
vendored
@@ -90,7 +90,8 @@ jobs:
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
if: ${{ matrix.platform.platform == 'msvc' }}
|
||||
with:
|
||||
arch: ${{ matrix.platform.msvc-vcvars }}
|
||||
arch: ${{ matrix.platform.msvc-vcvars-arch }}
|
||||
sdk: ${{ matrix.platform.msvc-vcvars-sdk }}
|
||||
- name: 'Set up Windows GDK Desktop'
|
||||
uses: ./.github/actions/setup-gdk-desktop
|
||||
if: ${{ matrix.platform.setup-gdk-folder != '' }}
|
||||
@@ -206,7 +207,7 @@ jobs:
|
||||
ctest -VV --test-dir build/ -j2
|
||||
- name: "Build test apk's (CMake)"
|
||||
id: apks
|
||||
if: ${{ steps.build.outcome == 'success' && matrix.platform.android-apks != '' }}
|
||||
if: ${{ always() && steps.build.outcome == 'success' && matrix.platform.android-apks != '' }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
@@ -217,7 +218,7 @@ jobs:
|
||||
-- ${{ matrix.platform.cmake-build-arguments }}
|
||||
- name: 'Install (CMake)'
|
||||
id: install
|
||||
if: ${{ steps.build.outcome == 'success' }}
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
${{ matrix.platform.source-cmd }}
|
||||
@@ -226,7 +227,7 @@ jobs:
|
||||
( cd prefix; find . ) | LC_ALL=C sort -u
|
||||
- name: 'Package (CPack)'
|
||||
id: package
|
||||
if: ${{ steps.build.outcome == 'success' }}
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
# shell: ${{ matrix.platform.shell }}
|
||||
run: |
|
||||
# DMG creation on macOS occasionally fails, so try multiple times
|
||||
@@ -280,11 +281,11 @@ jobs:
|
||||
- name: 'Build (cross-platform-actions, BSD)'
|
||||
id: cpactions
|
||||
if: ${{ matrix.platform.cpactions }}
|
||||
uses: cross-platform-actions/action@v0.25.0
|
||||
uses: cross-platform-actions/action@v0.26.0
|
||||
with:
|
||||
operating_system: ${{ matrix.platform.cpactions-os }}
|
||||
architecture: ${{ matrix.platform.cpactions-arch }}
|
||||
version: ${{ matrix.platform.cpactions-version }}
|
||||
operating_system: '${{ matrix.platform.cpactions-os }}'
|
||||
architecture: '${{ matrix.platform.cpactions-arch }}'
|
||||
version: '${{ matrix.platform.cpactions-version }}'
|
||||
run: |
|
||||
${{ matrix.platform.cpactions-setup-cmd }}
|
||||
${{ matrix.platform.cpactions-install-cmd }}
|
||||
|
||||
1
.github/workflows/release.yml
vendored
@@ -600,7 +600,6 @@ jobs:
|
||||
-DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
|
||||
-DANDROID_ABI=${android_abi} \
|
||||
-Werror=dev \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-B "${android_abi}"
|
||||
echo "Building ${android_abi}..."
|
||||
|
||||
@@ -3,7 +3,7 @@ projectshortname = SDL
|
||||
incsubdir = include/SDL3
|
||||
wikisubdir =
|
||||
readmesubdir = docs
|
||||
apiprefixregex = (SDL_|SDLK_)
|
||||
apiprefixregex = (SDL_|SDLK_|[US]int\d+)
|
||||
mainincludefname = SDL3/SDL.h
|
||||
versionfname = include/SDL3/SDL_version.h
|
||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
||||
@@ -21,3 +21,10 @@ manpageheaderfiletext = Defined in SDL3/%fname%
|
||||
# All SDL_test_* headers become undefined categories, everything else just converts like SDL_audio.h -> Audio
|
||||
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
|
||||
headercategoryeval = s/\ASDL_test_?.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
||||
|
||||
quickrefenabled = 1
|
||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Clipboard,Dialog,GPU,Messagebox,Vulkan,Metal,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
|
||||
quickreftitle = SDL3 API Quick Reference
|
||||
quickrefurl = https://libsdl.org/
|
||||
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
|
||||
quickrefmacroregex = \A(SDL_PLATFORM_.*|SDL_.*_INTRINSICS|SDL_Atomic...Ref|SDL_assert.*?|SDL_COMPILE_TIME_ASSERT|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast)\Z
|
||||
|
||||
@@ -30,11 +30,13 @@ LOCAL_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
|
||||
$(LOCAL_PATH)/src/dialog/SDL_dialog.c \
|
||||
$(LOCAL_PATH)/src/dialog/SDL_dialog_utils.c \
|
||||
$(LOCAL_PATH)/src/dialog/android/SDL_androiddialog.c \
|
||||
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/file/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/file/generic/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/gpu/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/gpu/vulkan/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
|
||||
@@ -76,6 +78,8 @@ LOCAL_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/src/time/unix/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/tray/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/tray/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c))
|
||||
|
||||
167
CMakeLists.txt
@@ -1,7 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||
set(cmake_build_type_undefined 1)
|
||||
endif()
|
||||
|
||||
# See docs/release_checklist.md
|
||||
project(SDL3 LANGUAGES C VERSION "3.1.6")
|
||||
project(SDL3 LANGUAGES C VERSION "3.1.8")
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
set(SDL3_SUBPROJECT OFF)
|
||||
@@ -9,6 +13,23 @@ else()
|
||||
set(SDL3_SUBPROJECT ON)
|
||||
endif()
|
||||
|
||||
# By default, configure SDL3 in RelWithDebInfo configuration
|
||||
if(NOT SDL3_SUBPROJECT)
|
||||
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(is_multi_config)
|
||||
# The first item in CMAKE_CONFIGURATION_TYPES is the default configuration
|
||||
if(DEFINED CMAKE_CONFIGURATION_TYPES AND "RelWithDebInfo" IN_LIST CMAKE_CONFIGURATION_TYPES)
|
||||
list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES "RelWithDebInfo")
|
||||
list(INSERT CMAKE_CONFIGURATION_TYPES 0 "RelWithDebInfo")
|
||||
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "CMake configuration types" FORCE)
|
||||
endif()
|
||||
else()
|
||||
if(cmake_build_type_undefined)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "CMake build type" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
|
||||
# CMake 3.24+ emits a warning when not set.
|
||||
unset(OFF)
|
||||
@@ -151,6 +172,11 @@ if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
set(SDL_SYSTEM_ICONV_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
set(SDL_RELOCATABLE_DEFAULT OFF)
|
||||
if(MSVC)
|
||||
set(SDL_RELOCATABLE_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(NOT SDL_LIBC)
|
||||
# Make sure /RTC1 is disabled, otherwise it will use functions from the CRT
|
||||
@@ -255,12 +281,18 @@ if(COMMAND SDL_Preseed_CMakeCache)
|
||||
set(SDL_PRESEED_AVAILABLE ON)
|
||||
endif()
|
||||
|
||||
set(SDL_X11_XRANDR_DEFAULT ON)
|
||||
if(SOLARIS)
|
||||
set(SDL_X11_XRANDR_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
# Allow some projects to be built conditionally.
|
||||
set_option(SDL_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT})
|
||||
set_option(SDL_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT})
|
||||
cmake_dependent_option(SDL_DISABLE_INSTALL_CPACK "Create binary SDL3 archive using CPack" ${SDL3_SUBPROJECT} "NOT SDL_DISABLE_INSTALL" ON)
|
||||
cmake_dependent_option(SDL_DISABLE_INSTALL_DOCS "Install docs for SDL3" ON "NOT SDL_DISABLE_INSTALL;NOT SDL_FRAMEWORK" ON)
|
||||
set_option(SDL_DISABLE_UNINSTALL "Disable uninstallation of SDL3" OFF)
|
||||
set_option(SDL_DISABLE_UNINSTALL "Disable uninstallation of SDL3" OFF)
|
||||
cmake_dependent_option(SDL_PRESEED "Preseed CMake cache to speed up configuration" ON "${SDL_PRESEED_AVAILABLE}" OFF)
|
||||
cmake_dependent_option(SDL_RELOCATABLE "Create relocatable SDL package" ${SDL_RELOCATABLE_DEFAULT} "NOT SDL_DISABLE_INSTALL" OFF)
|
||||
|
||||
cmake_dependent_option(SDL_DISABLE_ANDROID_JAR "Disable creation of SDL3.jar" ${SDL3_SUBPROJECT} "ANDROID" ON)
|
||||
|
||||
@@ -286,6 +318,7 @@ set_option(SDL_SYSTEM_ICONV "Use iconv() from system-installed libraries"
|
||||
set_option(SDL_LIBICONV "Prefer iconv() from libiconv, if available, over libc version" OFF)
|
||||
set_option(SDL_GCC_ATOMICS "Use gcc builtin atomics" ${SDL_GCC_ATOMICS_DEFAULT})
|
||||
dep_option(SDL_DBUS "Enable D-Bus support" ON "${UNIX_SYS}" OFF)
|
||||
dep_option(SDL_LIBURING "Enable liburing support" ON "${UNIX_SYS}" OFF)
|
||||
dep_option(SDL_DISKAUDIO "Support the disk writer audio driver" ON "SDL_AUDIO" OFF)
|
||||
dep_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON "SDL_AUDIO" OFF)
|
||||
dep_option(SDL_DUMMYVIDEO "Use dummy video driver" ON "SDL_VIDEO" OFF)
|
||||
@@ -309,11 +342,14 @@ set_option(SDL_RPATH "Use an rpath when linking SDL" ${SDL_RPATH_D
|
||||
set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${SDL_CLOCK_GETTIME_DEFAULT})
|
||||
dep_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS} "SDL_VIDEO" OFF)
|
||||
dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF)
|
||||
set(SDL_X11_OPTIONS Xcursor Xdbe XInput Xfixes Xrandr Xscrnsaver XShape)
|
||||
foreach(_SUB ${SDL_X11_OPTIONS})
|
||||
string(TOUPPER "SDL_X11_${_SUB}" _OPT)
|
||||
dep_option(${_OPT} "Enable ${_SUB} support" ON "SDL_X11" OFF)
|
||||
endforeach()
|
||||
dep_option(SDL_X11_XCURSOR "Enable Xcursor support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XDBE "Enable Xdbe support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XINPUT "Enable XInput support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XFIXES "Enable Xfixes support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XRANDR "Enable Xrandr support" "${SDL_X11_XRANDR_DEFAULT}" SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSCRNSAVER "Enable Xscrnsaver support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSHAPE "Enable XShape support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_X11_XSYNC "Enable Xsync support" ON SDL_X11 OFF)
|
||||
dep_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS} "SDL_VIDEO" OFF)
|
||||
dep_option(SDL_WAYLAND_SHARED "Dynamically load Wayland support" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR "Use client-side window decorations on Wayland" ON "SDL_WAYLAND" OFF)
|
||||
@@ -462,16 +498,21 @@ else()
|
||||
sdl_include_directories(NO_EXPORT SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src/video/khronos>")
|
||||
endif()
|
||||
|
||||
if(MSVC AND TARGET SDL3-shared)
|
||||
if(MSVC AND TARGET SDL3-shared AND NOT SDL_LIBC)
|
||||
if(SDL_CPU_X64)
|
||||
enable_language(ASM_MASM)
|
||||
set(asm_src "${SDL3_SOURCE_DIR}/src/stdlib/SDL_mslibc_x64.masm")
|
||||
target_compile_options(SDL3-shared PRIVATE "$<$<COMPILE_LANGUAGE:ASM_MASM>:/nologo>")
|
||||
set_property(SOURCE "${asm_src}" PROPERTY LANGUAGE "ASM_MASM")
|
||||
target_sources(SDL3-shared PRIVATE "${asm_src}")
|
||||
elseif(SDL_CPU_ARM32 OR SDL_CPU_ARM64)
|
||||
# FIXME: ARM assembler (armasm.exe/armasm64.exe) is NOT ASM_MASM, and does currently not work with CMake
|
||||
# (https://gitlab.kitware.com/cmake/cmake/-/issues/18912)
|
||||
elseif(SDL_CPU_ARM64)
|
||||
enable_language(ASM_MARMASM)
|
||||
set(asm_src "${SDL3_SOURCE_DIR}/src/stdlib/SDL_mslibc_arm64.masm")
|
||||
target_compile_options(SDL3-shared PRIVATE "$<$<COMPILE_LANGUAGE:ASM_MARMASM>:/nologo>")
|
||||
set_property(SOURCE "${asm_src}" PROPERTY LANGUAGE "ASM_MARMASM")
|
||||
target_sources(SDL3-shared PRIVATE "${asm_src}")
|
||||
elseif(SDL_CPU_ARM32)
|
||||
# FIXME
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -915,7 +956,7 @@ endif()
|
||||
set(SDL_DISABLE_ALLOCA 0)
|
||||
check_include_file("alloca.h" "HAVE_ALLOCA_H")
|
||||
if(MSVC)
|
||||
check_include_file("malloc.h" "HAVE_MALLOC")
|
||||
check_include_file("malloc.h" "HAVE_MALLOC_H")
|
||||
check_symbol_exists("_alloca" "malloc.h" _ALLOCA_IN_MALLOC_H)
|
||||
if(NOT HAVE_ALLOCA_H AND NOT _ALLOCA_IN_MALLOC_H)
|
||||
set(SDL_DISABLE_ALLOCA 1)
|
||||
@@ -961,15 +1002,15 @@ if(SDL_LIBC)
|
||||
set(symbols_to_check
|
||||
abs acos acosf asin asinf atan atan2 atan2f atanf atof atoi
|
||||
bcopy
|
||||
calloc ceil ceilf copysign copysignf cos cosf
|
||||
ceil ceilf copysign copysignf cos cosf
|
||||
_Exit exp expf
|
||||
fabs fabsf floor floorf fmod fmodf fopen64 free fseeko fseeko64
|
||||
fabs fabsf floor floorf fmod fmodf fopen64 fseeko fseeko64
|
||||
getenv
|
||||
_i64toa index itoa
|
||||
log log10 log10f logf lround lroundf _ltoa
|
||||
malloc memcmp memcpy memmove memset modf modff
|
||||
pow powf putenv
|
||||
realloc rindex round roundf
|
||||
rindex round roundf
|
||||
scalbn scalbnf setenv sin sinf sqr sqrt sqrtf sscanf strchr
|
||||
strcmp strlcat strlcpy strlen strncmp strnlen strpbrk
|
||||
strrchr strstr strnstr strtod strtok_r strtol strtoll strtoul strtoull
|
||||
@@ -980,7 +1021,7 @@ if(SDL_LIBC)
|
||||
)
|
||||
if(WINDOWS)
|
||||
list(APPEND symbols_to_check
|
||||
_strrev _ui64toa _uitoa _ultoa _wcsdup
|
||||
_copysign _fseeki64 _strrev _ui64toa _uitoa _ultoa _wcsdup
|
||||
)
|
||||
else()
|
||||
list(APPEND symbols_to_check
|
||||
@@ -1119,6 +1160,7 @@ sdl_glob_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/dynapi/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/events/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/file/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/file/generic/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/filesystem/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/gpu/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/joystick/*.c"
|
||||
@@ -1295,7 +1337,6 @@ if(ANDROID)
|
||||
set(SDL_JOYSTICK_ANDROID 1)
|
||||
sdl_glob_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/joystick/android/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/joystick/steam/*.c"
|
||||
)
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
endif()
|
||||
@@ -1545,6 +1586,9 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
CheckVivante()
|
||||
CheckVulkan()
|
||||
CheckQNXScreen()
|
||||
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/tray/unix/*.c")
|
||||
set(HAVE_SDL_TRAY TRUE)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -1657,6 +1701,16 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
set(SDL_USE_IME 1)
|
||||
endif()
|
||||
|
||||
if(SDL_LIBURING)
|
||||
pkg_search_module(LIBURING liburing-ffi)
|
||||
find_path(HAVE_LIBURING_H NAMES liburing.h)
|
||||
if(LIBURING_FOUND AND HAVE_LIBURING_H)
|
||||
set(HAVE_LIBURING_LIBURING_H TRUE)
|
||||
sdl_include_directories(PRIVATE SYSTEM ${LIBURING_INCLUDE_DIRS})
|
||||
set(HAVE_LIBURING TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if((FREEBSD OR NETBSD) AND NOT HAVE_INOTIFY)
|
||||
set(LibInotify_PKG_CONFIG_SPEC libinotify)
|
||||
pkg_check_modules(PC_LIBINOTIFY IMPORTED_TARGET ${LibInotify_PKG_CONFIG_SPEC})
|
||||
@@ -1720,6 +1774,10 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBURING_H)
|
||||
sdl_sources("${SDL3_SOURCE_DIR}/src/file/io_uring/SDL_asyncio_liburing.c")
|
||||
endif()
|
||||
|
||||
# Always compiled for Linux, unconditionally:
|
||||
sdl_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev_capabilities.c"
|
||||
@@ -1741,7 +1799,6 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
set(SDL_JOYSTICK_LINUX 1)
|
||||
sdl_glob_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/joystick/linux/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/joystick/steam/*.c"
|
||||
)
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
endif()
|
||||
@@ -1837,8 +1894,10 @@ elseif(WINDOWS)
|
||||
if(TARGET SDL3-shared AND MSVC AND NOT SDL_LIBC)
|
||||
# Prevent codegen that would use the VC runtime libraries.
|
||||
target_compile_options(SDL3-shared 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)
|
||||
target_compile_options(SDL3-shared PRIVATE "/arch:SSE")
|
||||
target_compile_options(SDL3-SDL_uclibc PRIVATE "/arch:SSE")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -2040,6 +2099,9 @@ elseif(WINDOWS)
|
||||
set(HAVE_RENDER_VULKAN TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/tray/windows/*.c")
|
||||
set(HAVE_SDL_TRAY TRUE)
|
||||
endif()
|
||||
|
||||
if(SDL_HIDAPI)
|
||||
@@ -2113,8 +2175,6 @@ elseif(APPLE)
|
||||
set(HAVE_SDL_MAIN_CALLBACKS TRUE)
|
||||
endif()
|
||||
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/file/cocoa/*.m")
|
||||
|
||||
if(SDL_CAMERA)
|
||||
if(MACOS OR IOS)
|
||||
set(SDL_CAMERA_DRIVER_COREMEDIA 1)
|
||||
@@ -2146,7 +2206,6 @@ elseif(APPLE)
|
||||
if(SDL_JOYSTICK)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/apple/*.m")
|
||||
if(IOS OR TVOS OR VISIONOS OR WATCHOS)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/steam/*.c")
|
||||
set(SDL_JOYSTICK_MFI 1)
|
||||
if(IOS OR VISIONOS OR WATCHOS)
|
||||
set(SDL_FRAMEWORK_COREMOTION 1)
|
||||
@@ -2319,6 +2378,11 @@ elseif(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MACOS)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/tray/cocoa/*.m")
|
||||
set(HAVE_SDL_TRAY TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Minimum version for $<LINK_LIBRARY:feature,library-list>
|
||||
@@ -2334,6 +2398,7 @@ elseif(APPLE)
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COCOA)
|
||||
sdl_link_dependency(cocoa LIBS "$<LINK_LIBRARY:FRAMEWORK,Cocoa>" PKG_CONFIG_LINK_OPTIONS "-Wl,-framework,Cocoa")
|
||||
sdl_link_dependency(uniformtypeidentifiers LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,UniformTypeIdentifiers>" PKG_CONFIG_LINK_OPTIONS "-Wl,-weak_framework,UniformTypeIdentifiers")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_IOKIT)
|
||||
sdl_link_dependency(iokit LIBS "$<LINK_LIBRARY:FRAMEWORK,IOKit>" PKG_CONFIG_LINK_OPTIONS "-Wl,-framework,IOKit")
|
||||
@@ -2675,7 +2740,9 @@ elseif(PSP)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/psp/*.c")
|
||||
set(HAVE_SDL_FILESYSTEM TRUE)
|
||||
|
||||
# !!! FIXME: do we need a FSops implementation for this?
|
||||
set(SDL_FSOPS_POSIX 1)
|
||||
sdl_sources("${SDL3_SOURCE_DIR}/src/filesystem/posix/SDL_sysfsops.c")
|
||||
set(HAVE_SDL_FSOPS TRUE)
|
||||
|
||||
if(SDL_JOYSTICK)
|
||||
set(SDL_JOYSTICK_PSP 1)
|
||||
@@ -2698,6 +2765,9 @@ elseif(PSP)
|
||||
)
|
||||
set(HAVE_SDL_THREADS TRUE)
|
||||
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/locale/psp/*.c")
|
||||
set(HAVE_SDL_LOCALE TRUE)
|
||||
|
||||
set(SDL_TIME_PSP 1)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/time/psp/*.c")
|
||||
set(HAVE_SDL_TIME TRUE)
|
||||
@@ -2729,10 +2799,6 @@ elseif(PSP)
|
||||
)
|
||||
|
||||
elseif(PS2)
|
||||
sdl_compile_definitions(PRIVATE "PS2" "__PS2__")
|
||||
sdl_include_directories(PRIVATE SYSTEM "$ENV{PS2SDK}/ports/include" "$ENV{PS2DEV}/gsKit/include")
|
||||
target_include_directories(SDL_uclibc PRIVATE "$ENV{PS2SDK}/ports/include" "$ENV{PS2DEV}/gsKit/include")
|
||||
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/ps2/*.c")
|
||||
|
||||
if(SDL_AUDIO)
|
||||
@@ -2745,7 +2811,9 @@ elseif(PS2)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/ps2/*.c")
|
||||
set(HAVE_SDL_FILESYSTEM TRUE)
|
||||
|
||||
# !!! FIXME: do we need a FSops implementation for this?
|
||||
set(SDL_FSOPS_POSIX 1)
|
||||
sdl_sources("${SDL3_SOURCE_DIR}/src/filesystem/posix/SDL_sysfsops.c")
|
||||
set(HAVE_SDL_FSOPS TRUE)
|
||||
|
||||
if(SDL_JOYSTICK)
|
||||
set(SDL_JOYSTICK_PS2 1)
|
||||
@@ -2854,6 +2922,7 @@ elseif(N3DS)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/file/n3ds/*.c")
|
||||
endif()
|
||||
|
||||
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/SDL_dialog.c)
|
||||
if (SDL_DIALOG)
|
||||
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/SDL_dialog_utils.c)
|
||||
if(ANDROID)
|
||||
@@ -2872,7 +2941,6 @@ if (SDL_DIALOG)
|
||||
set(HAVE_SDL_DIALOG TRUE)
|
||||
elseif(MACOS)
|
||||
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/cocoa/SDL_cocoadialog.m)
|
||||
sdl_link_dependency(uniformtypeidentifiers LIBS "$<LINK_LIBRARY:WEAK_FRAMEWORK,UniformTypeIdentifiers>" PKG_CONFIG_LINK_OPTIONS "-Wl,-weak_framework,UniformTypeIdentifiers")
|
||||
set(HAVE_SDL_DIALOG TRUE)
|
||||
endif()
|
||||
endif()
|
||||
@@ -2937,6 +3005,8 @@ if(SDL_VIDEO)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
sdl_glob_sources(${SDL3_SOURCE_DIR}/src/tray/*.c)
|
||||
|
||||
if(SDL_GPU)
|
||||
if(HAVE_D3D11_H)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/gpu/d3d11/*.c")
|
||||
@@ -3019,6 +3089,10 @@ if(NOT HAVE_SDL_PROCESS)
|
||||
set(SDL_PROCESS_DUMMY 1)
|
||||
sdl_glob_sources(${SDL3_SOURCE_DIR}/src/process/dummy/*.c)
|
||||
endif()
|
||||
if(NOT HAVE_SDL_TRAY)
|
||||
set(SDL_TRAY_DUMMY 1)
|
||||
sdl_glob_sources(${SDL3_SOURCE_DIR}/src/tray/dummy/*.c)
|
||||
endif()
|
||||
if(NOT HAVE_CAMERA)
|
||||
set(SDL_CAMERA_DRIVER_DUMMY 1)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/camera/dummy/*.c")
|
||||
@@ -3063,15 +3137,17 @@ endforeach()
|
||||
|
||||
# If REVISION.txt exists, then we are building from a SDL release.
|
||||
# SDL_revision.h(.cmake) in source releases have SDL_REVISION baked into them.
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt")
|
||||
set(SDL_REVISION "" CACHE STRING "Custom SDL revision")
|
||||
if(SDL_REVISION)
|
||||
set(SDL_REVISION_CENTER "${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_MICRO}-${SDL_REVISION}")
|
||||
else()
|
||||
# If SDL_REVISION is not overrided, use git to describe
|
||||
git_describe(SDL_REVISION_CENTER)
|
||||
endif()
|
||||
set(SDL_REVISION "SDL3-${SDL_REVISION_CENTER}")
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt")
|
||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt" revisions)
|
||||
list(GET revisions 0 revisions_0)
|
||||
string(STRIP "${revisions_0}" SDL_REVISION)
|
||||
else()
|
||||
set(SDL_REVISION "" CACHE STRING "Custom SDL revision (only used when REVISION.txt does not exist)")
|
||||
endif()
|
||||
if(NOT SDL_REVISION)
|
||||
# If SDL_REVISION is not overrided, use git to describe
|
||||
git_describe(SDL_REVISION_GIT)
|
||||
set(SDL_REVISION "SDL3-${SDL3_VERSION}-${SDL_REVISION_GIT}")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include-revision/SDL3")
|
||||
@@ -3319,6 +3395,17 @@ if(SDL_SHARED)
|
||||
# (__rt_sdiv, __rt_udiv, __rt_sdiv64, _rt_udiv64, __dtou64, __u64tod, __i64tos)
|
||||
target_link_libraries(SDL3-shared PRIVATE msvcrt.lib)
|
||||
endif()
|
||||
find_library(HAVE_ONECORE_LIB NAMES "onecore.lib")
|
||||
if(HAVE_ONECORE_LIB)
|
||||
# SDL_malloc.c: __imp_MapViewOfFileNuma2 referenced in function MapViewOfFile2
|
||||
target_link_libraries(SDL3-shared PRIVATE onecore.lib)
|
||||
endif()
|
||||
find_library(HAVE_VOLATILEACCESSU_LIB NAMES "volatileaccessu.lib")
|
||||
if(HAVE_VOLATILEACCESSU_LIB)
|
||||
# SDL_malloc.c : RtlSetVolatileMemory referenced in function RtlFillVolatileMemory
|
||||
# SDL_malloc.c : RtlFillDeviceMemory referenced in function RtlZeroDeviceMemory
|
||||
target_link_libraries(SDL3-shared PRIVATE volatileaccessu.lib)
|
||||
endif()
|
||||
endif()
|
||||
if(HAS_Q_NO_USE_LIBIRC)
|
||||
target_compile_options(SDL3-shared PRIVATE /Q_no-use-libirc)
|
||||
@@ -3435,7 +3522,7 @@ endif()
|
||||
if(WINDOWS AND NOT MINGW)
|
||||
set(SDL_INSTALL_CMAKEDIR_ROOT_DEFAULT "cmake")
|
||||
else()
|
||||
set(SDL_INSTALL_CMAKEDIR_ROOT_DEFAULT "${CMAKE_INSTALL_LIBDIR}/cmake")
|
||||
set(SDL_INSTALL_CMAKEDIR_ROOT_DEFAULT "${CMAKE_INSTALL_LIBDIR}/cmake/SDL3")
|
||||
endif()
|
||||
set(SDL_INSTALL_CMAKEDIR_ROOT "${SDL_INSTALL_CMAKEDIR_ROOT_DEFAULT}" CACHE STRING "Root folder where to install SDL3Config.cmake related files (SDL3 subfolder for MSVC projects)")
|
||||
|
||||
@@ -3455,7 +3542,7 @@ elseif(SDL_FRAMEWORK)
|
||||
set(SDL_INSTALL_LICENSEDIR "Resources")
|
||||
set(SDL_INSTALL_HEADERSDIR "Headers")
|
||||
else()
|
||||
set(SDL_INSTALL_CMAKEDIR "${SDL_INSTALL_CMAKEDIR_ROOT}/SDL3")
|
||||
set(SDL_INSTALL_CMAKEDIR "${SDL_INSTALL_CMAKEDIR_ROOT}")
|
||||
set(SDL_INSTALL_LICENSEDIR "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${PROJECT_NAME}")
|
||||
set(SDL_INSTALL_HEADERSDIR "${CMAKE_INSTALL_INCLUDEDIR}/SDL3")
|
||||
endif()
|
||||
|
||||
@@ -6,10 +6,14 @@ Read ./docs/README-visualc.md
|
||||
|
||||
## Windows building with mingw-w64 for x86:
|
||||
|
||||
Read [README-windows.md](docs/README-windows.md) for more information on building with MinGW64.
|
||||
|
||||
Run: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-i686.cmake && cmake --build build && cmake --install build`
|
||||
|
||||
## Windows building with mingw-w64 for x64:
|
||||
|
||||
Read [README-windows.md](docs/README-windows.md).
|
||||
|
||||
Run: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-x86_64.cmake && cmake --build build && cmake --install build`
|
||||
|
||||
## macOS with Xcode:
|
||||
@@ -26,7 +30,7 @@ Run: `cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" && cmake --bu
|
||||
|
||||
## Linux and other UNIX systems:
|
||||
|
||||
Run: `cmake -S . -B build && cmake --build build && cmake --install build`
|
||||
Run: `cmake -S . -B build && cmake --build build --parallel $(nproc) && cmake --install build`
|
||||
|
||||
## Android:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -102,10 +102,10 @@
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
|
||||
<IncludePath>$(SolutionDir)/../src;$(IncludePath)</IncludePath>
|
||||
<IncludePath>$(ProjectDir)../../src;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
|
||||
<IncludePath>$(SolutionDir)/../src;$(IncludePath)</IncludePath>
|
||||
<IncludePath>$(ProjectDir)../../src;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
|
||||
<Midl>
|
||||
@@ -165,8 +165,10 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir)</Command>
|
||||
<Command>$(SolutionDir)..\src\gpu\d3d12\compile_shaders_xbox.bat $(SolutionDir)</Command>
|
||||
<Command>
|
||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox Series)</Message>
|
||||
@@ -200,8 +202,10 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir) one</Command>
|
||||
<Command>$(SolutionDir)..\src\gpu\d3d12\compile_shaders_xbox.bat $(SolutionDir) one</Command>
|
||||
<Command>
|
||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox One)</Message>
|
||||
@@ -267,8 +271,10 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir)</Command>
|
||||
<Command>$(SolutionDir)..\src\gpu\d3d12\compile_shaders_xbox.bat $(SolutionDir)</Command>
|
||||
<Command>
|
||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox Series)</Message>
|
||||
@@ -303,8 +309,10 @@
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir) one</Command>
|
||||
<Command>$(SolutionDir)..\src\gpu\d3d12\compile_shaders_xbox.bat $(SolutionDir) one</Command>
|
||||
<Command>
|
||||
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
||||
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox One)</Message>
|
||||
@@ -339,6 +347,7 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_keyboard.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_keycode.h" />
|
||||
@@ -432,6 +441,8 @@
|
||||
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
|
||||
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
|
||||
<ClInclude Include="..\..\src\file\SDL_asyncio_c.h" />
|
||||
<ClInclude Include="..\..\src\file\SDL_sysasyncio.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
|
||||
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
|
||||
@@ -514,9 +525,13 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
|
||||
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
|
||||
<ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c" />
|
||||
<ClCompile Include="..\..\src\file\SDL_asyncio.c" />
|
||||
<ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c" />
|
||||
<ClCompile Include="..\..\src\main\gdk\SDL_sysmain_runapp.cpp" />
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
||||
@@ -577,6 +592,7 @@
|
||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
||||
@@ -616,7 +632,6 @@
|
||||
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
|
||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
||||
@@ -725,31 +740,7 @@
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_atan2.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_exp.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_fmod.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_log.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_log10.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_pow.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_cos.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_sin.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_tan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_atan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_copysign.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_cos.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_fabs.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_floor.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isinf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isinff.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isnan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isnanf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_modf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_sin.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_tan.c" />
|
||||
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
|
||||
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
|
||||
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
|
||||
@@ -837,6 +828,17 @@
|
||||
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
|
||||
<ClCompile Include="..\..\src\time\SDL_time.c" />
|
||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
|
||||
<ClCompile Include="..\..\src\tray\dummy\SDL_tray.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
|
||||
@@ -865,6 +867,7 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
|
||||
@@ -884,7 +887,6 @@
|
||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
|
||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
|
||||
|
||||
@@ -4,15 +4,6 @@
|
||||
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp" />
|
||||
<ClCompile Include="..\..\src\core\windows\pch.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c">
|
||||
<Filter>dialog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c">
|
||||
<Filter>filesystem</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c">
|
||||
<Filter>filesystem\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp" />
|
||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxone.cpp" />
|
||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxseries.cpp" />
|
||||
@@ -35,7 +26,6 @@
|
||||
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
|
||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
||||
@@ -58,7 +48,6 @@
|
||||
<ClCompile Include="..\..\src\file\SDL_iostream.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp" />
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
|
||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
|
||||
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
|
||||
@@ -96,31 +85,7 @@
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_atan2.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_exp.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_fmod.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_log.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_log10.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_pow.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_cos.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_sin.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_tan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_atan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_copysign.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_cos.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_fabs.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_floor.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isinf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isinff.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isnan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isnanf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_modf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_sin.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_tan.c" />
|
||||
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
|
||||
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
|
||||
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
|
||||
@@ -191,12 +156,6 @@
|
||||
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
|
||||
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
|
||||
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
|
||||
<ClCompile Include="..\..\src\time\SDL_time.c">
|
||||
<Filter>time</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c">
|
||||
<Filter>time\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
|
||||
@@ -222,6 +181,7 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
|
||||
@@ -237,8 +197,33 @@
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
|
||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
|
||||
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
|
||||
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
|
||||
<ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c" />
|
||||
<ClCompile Include="..\..\src\file\SDL_asyncio.c" />
|
||||
<ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c" />
|
||||
<ClCompile Include="..\..\src\dialog\dummy\SDL_dummydialog.c" />
|
||||
<ClCompile Include="..\..\src\dialog\windows\SDL_windowsdialog.c" />
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c" />
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c" />
|
||||
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
|
||||
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c" />
|
||||
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
|
||||
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
|
||||
<ClCompile Include="..\..\src\time\SDL_time.c" />
|
||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
|
||||
<ClCompile Include="..\..\src\tray\dummy\SDL_tray.c" />
|
||||
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c" />
|
||||
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />
|
||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
|
||||
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h" />
|
||||
@@ -350,9 +335,6 @@
|
||||
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
|
||||
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
|
||||
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h">
|
||||
<Filter>filesystem</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
|
||||
@@ -457,6 +439,7 @@
|
||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
||||
@@ -476,6 +459,21 @@
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_camera.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
|
||||
<ClInclude Include="..\..\src\camera\SDL_camera_c.h" />
|
||||
<ClInclude Include="..\..\src\camera\SDL_syscamera.h" />
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
|
||||
<ClInclude Include="..\..\src\file\SDL_asyncio_c.h" />
|
||||
<ClInclude Include="..\..\src\file\SDL_sysasyncio.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_internal.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx_func.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -71,7 +71,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-read-and-draw", "example
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "game", "game", "{D1BF59F6-22DC-493B-BDEB-451A50DA793D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-snake", "examples\game\01-snake\01-snake.vcxproj", "{7820969A-5B7B-4046-BB0A-82905D457FC5}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-snake", "examples\demo\01-snake\01-snake.vcxproj", "{7820969A-5B7B-4046-BB0A-82905D457FC5}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pen", "pen", "{F2247885-8EE8-42F4-A702-4155587620E0}"
|
||||
EndProject
|
||||
@@ -111,9 +111,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18-debug-text", "examples\r
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-load-wav", "examples\audio\03-load-wav\03-load-wav.vcxproj", "{608C6C67-7766-471F-BBFF-8B00086039AF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-woodeneye-008", "examples\game\02-woodeneye-008\02-woodeneye-008.vcxproj", "{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-woodeneye-008", "examples\demo\02-woodeneye-008\02-woodeneye-008.vcxproj", "{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-infinite-monkeys", "examples\game\03-infinite-monkeys\03-infinite-monkeys.vcxproj", "{75AEE75A-C016-4497-960B-D767B822237D}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-infinite-monkeys", "examples\demo\03-infinite-monkeys\03-infinite-monkeys.vcxproj", "{75AEE75A-C016-4497-960B-D767B822237D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@@ -113,13 +112,14 @@
|
||||
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -144,13 +144,14 @@
|
||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -179,13 +180,14 @@
|
||||
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -211,13 +213,14 @@
|
||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -259,6 +262,7 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_keyboard.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_keycode.h" />
|
||||
@@ -352,6 +356,8 @@
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
|
||||
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
|
||||
<ClInclude Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h" />
|
||||
<ClInclude Include="..\..\src\file\SDL_asyncio_c.h" />
|
||||
<ClInclude Include="..\..\src\file\SDL_sysasyncio.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
|
||||
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
|
||||
@@ -409,13 +415,16 @@
|
||||
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
|
||||
<ClCompile Include="..\..\src\camera\mediafoundation\SDL_camera_mediafoundation.c" />
|
||||
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
|
||||
<ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c" />
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
|
||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
|
||||
<ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c" />
|
||||
<ClCompile Include="..\..\src\file\SDL_asyncio.c" />
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\main\SDL_runapp.c" />
|
||||
@@ -483,6 +492,7 @@
|
||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
||||
@@ -522,7 +532,6 @@
|
||||
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
|
||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
||||
@@ -585,31 +594,7 @@
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_atan2.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_exp.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_fmod.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_log.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_log10.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_pow.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
|
||||
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_cos.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_sin.c" />
|
||||
<ClCompile Include="..\..\src\libm\k_tan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_atan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_copysign.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_cos.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_fabs.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_floor.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isinf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isinff.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isnan.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_isnanf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_modf.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_sin.c" />
|
||||
<ClCompile Include="..\..\src\libm\s_tan.c" />
|
||||
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
|
||||
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
|
||||
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
|
||||
@@ -665,9 +650,6 @@
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_memmove.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
|
||||
<MASM Condition="'$(Platform)'=='x64'" Include="..\..\src\stdlib\SDL_mslibc_x64.masm">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</MASM>
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_murmur3.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_random.c" />
|
||||
@@ -690,6 +672,8 @@
|
||||
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
|
||||
<ClCompile Include="..\..\src\time\SDL_time.c" />
|
||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
|
||||
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c" />
|
||||
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
|
||||
@@ -720,6 +704,7 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
|
||||
@@ -744,6 +729,5 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
||||
@@ -211,6 +211,12 @@
|
||||
<Filter Include="main\windows">
|
||||
<UniqueIdentifier>{00009d5ded166cc6c6680ec771a30000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="file\generic">
|
||||
<UniqueIdentifier>{00004d6806b6238cae0ed62db5440000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="file\windows">
|
||||
<UniqueIdentifier>{000028b2ea36d7190d13777a4dc70000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h">
|
||||
@@ -279,6 +285,9 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
@@ -438,6 +447,12 @@
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h">
|
||||
<Filter>filesystem</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\file\SDL_asyncio_c.h">
|
||||
<Filter>file</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\file\SDL_sysasyncio.h">
|
||||
<Filter>file</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h">
|
||||
<Filter>main</Filter>
|
||||
</ClInclude>
|
||||
@@ -501,9 +516,6 @@
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_unsupported.h">
|
||||
<Filter>dynapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\events\SDL_categories.h">
|
||||
<Filter>events</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h">
|
||||
<Filter>events</Filter>
|
||||
</ClInclude>
|
||||
@@ -678,6 +690,9 @@
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
@@ -923,6 +938,9 @@
|
||||
<ClInclude Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h">
|
||||
<Filter>gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
|
||||
<ClInclude Include="..\..\src\events\SDL_categories_c.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
@@ -935,6 +953,9 @@
|
||||
<ClCompile Include="..\..\src\camera\SDL_camera.c">
|
||||
<Filter>camera</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog.c">
|
||||
<Filter>dialog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c">
|
||||
<Filter>dialog</Filter>
|
||||
</ClCompile>
|
||||
@@ -944,6 +965,15 @@
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c">
|
||||
<Filter>filesystem\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c">
|
||||
<Filter>file\generic</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\file\SDL_asyncio.c">
|
||||
<Filter>file</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c">
|
||||
<Filter>file\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c">
|
||||
<Filter>main\generic</Filter>
|
||||
</ClCompile>
|
||||
@@ -1079,81 +1109,9 @@
|
||||
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c">
|
||||
<Filter>joystick</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_atan2.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_exp.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_fmod.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_log.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_log10.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_pow.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_sqrt.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_rem_pio2.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\k_cos.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\k_rem_pio2.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\k_sin.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\k_tan.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_atan.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_copysign.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_cos.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_fabs.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_floor.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_isinf.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_isinff.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_isnan.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_isnanf.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_modf.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_scalbn.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_sin.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\s_tan.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c">
|
||||
<Filter>loadso\windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -1178,9 +1136,6 @@
|
||||
<ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c">
|
||||
<Filter>audio\dummy</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c">
|
||||
<Filter>audio\wasapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c">
|
||||
<Filter>audio\wasapi</Filter>
|
||||
</ClCompile>
|
||||
@@ -1277,6 +1232,12 @@
|
||||
<ClCompile Include="..\..\src\time\windows\SDL_systime.c">
|
||||
<Filter>time\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
@@ -1349,6 +1310,9 @@
|
||||
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c">
|
||||
<Filter>video\dummy</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -1499,15 +1463,6 @@
|
||||
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c">
|
||||
<Filter>render\direct3d11</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c">
|
||||
<Filter>render\gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c">
|
||||
<Filter>render\gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c">
|
||||
<Filter>render\gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c">
|
||||
<Filter>render\opengl</Filter>
|
||||
</ClCompile>
|
||||
@@ -1550,12 +1505,6 @@
|
||||
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c">
|
||||
<Filter>power\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\process\SDL_process.c">
|
||||
<Filter>process</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\process\windows\SDL_windowsprocess.c">
|
||||
<Filter>process\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\SDL_log.c" />
|
||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12.c">
|
||||
<Filter>render\direct3d12</Filter>
|
||||
@@ -1601,15 +1550,20 @@
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\process\SDL_process.c" />
|
||||
<ClCompile Include="..\..\src\process\windows\SDL_windowsprocess.c" />
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c" />
|
||||
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c" />
|
||||
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
|
||||
<ClCompile Include="..\..\src\storage\steam\SDL_steamstorage.c" />
|
||||
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ItemGroup>
|
||||
<None Include="$(SolutionDir)\..\examples\game\01-snake\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\game\01-snake\*.c" />
|
||||
<None Include="$(SolutionDir)\..\examples\demo\01-snake\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\demo\01-snake\*.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
@@ -6,8 +6,8 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ItemGroup>
|
||||
<None Include="$(SolutionDir)\..\examples\game\01-snake\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\game\01-snake\snake.c" />
|
||||
<None Include="$(SolutionDir)\..\examples\demo\01-snake\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\demo\01-snake\snake.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
@@ -6,8 +6,8 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ItemGroup>
|
||||
<None Include="$(SolutionDir)\..\examples\game\02-woodeneye-008\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\game\02-woodeneye-008\woodeneye-008.c" />
|
||||
<None Include="$(SolutionDir)\..\examples\demo\02-woodeneye-008\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\demo\02-woodeneye-008\woodeneye-008.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
@@ -6,8 +6,8 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ItemGroup>
|
||||
<None Include="$(SolutionDir)\..\examples\game\03-infinite-monkeys\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\game\03-infinite-monkeys\infinite-monkeys.c" />
|
||||
<None Include="$(SolutionDir)\..\examples\demo\03-infinite-monkeys\README.txt" />
|
||||
<ClCompile Include="$(SolutionDir)\..\examples\demo\03-infinite-monkeys\infinite-monkeys.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
@@ -19,10 +19,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.1.6</string>
|
||||
<string>3.1.8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SDLX</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3.1.6</string>
|
||||
<string>3.1.8</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Title SDL 3.1.6
|
||||
Title SDL 3.1.8
|
||||
Version 1
|
||||
Description SDL Library for macOS (http://www.libsdl.org)
|
||||
DefaultLocation /Library/Frameworks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -112,7 +112,7 @@ if(NOT TARGET SDL3::SDL3-shared)
|
||||
set_target_properties(SDL3::SDL3-shared
|
||||
PROPERTIES
|
||||
FRAMEWORK "TRUE"
|
||||
IMPORTED_LOCATION "${_sdl3_framework_path}/SDL3"
|
||||
IMPORTED_LOCATION "${_sdl3_framework_path}"
|
||||
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -6,10 +6,10 @@ def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
|
||||
|
||||
android {
|
||||
namespace "org.libsdl.app"
|
||||
compileSdkVersion 34
|
||||
compileSdkVersion 35
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 34
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 35
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
externalNativeBuild {
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Replace com.test.game with the identifier of your game below, e.g.
|
||||
com.gamemaker.game
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
|
||||
@@ -470,7 +470,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
|
||||
// Only register controller with the native side once it has been fully configured
|
||||
if (!isRegistered()) {
|
||||
Log.v(TAG, "Registering Steam Controller with ID: " + getId());
|
||||
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0);
|
||||
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0, true);
|
||||
setRegistered();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ public class HIDDeviceManager {
|
||||
HIDDeviceUSB device = new HIDDeviceUSB(this, usbDevice, interface_index);
|
||||
int id = device.getId();
|
||||
mDevicesById.put(id, device);
|
||||
HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol());
|
||||
HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -679,7 +679,7 @@ public class HIDDeviceManager {
|
||||
private native void HIDDeviceRegisterCallback();
|
||||
private native void HIDDeviceReleaseCallback();
|
||||
|
||||
native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol);
|
||||
native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol, boolean bBluetooth);
|
||||
native void HIDDeviceOpenPending(int deviceID);
|
||||
native void HIDDeviceOpenResult(int deviceID, boolean opened);
|
||||
native void HIDDeviceDisconnected(int deviceID);
|
||||
|
||||
@@ -154,6 +154,11 @@ class HIDDeviceUSB implements HIDDevice {
|
||||
|
||||
@Override
|
||||
public int writeReport(byte[] report, boolean feature) {
|
||||
if (mConnection == null) {
|
||||
Log.w(TAG, "writeReport() called with no device connection");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (feature) {
|
||||
int res = -1;
|
||||
int offset = 0;
|
||||
@@ -201,6 +206,11 @@ class HIDDeviceUSB implements HIDDevice {
|
||||
boolean skipped_report_id = false;
|
||||
byte report_number = report[0];
|
||||
|
||||
if (mConnection == null) {
|
||||
Log.w(TAG, "readReport() called with no device connection");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (report_number == 0x0) {
|
||||
/* Offset the return buffer by 1, so that the report ID
|
||||
will remain in byte 0. */
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 3;
|
||||
private static final int SDL_MINOR_VERSION = 1;
|
||||
private static final int SDL_MICRO_VERSION = 6;
|
||||
private static final int SDL_MICRO_VERSION = 8;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
@@ -223,7 +223,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
protected static SDLClipboardHandler mClipboardHandler;
|
||||
protected static Hashtable<Integer, PointerIcon> mCursors;
|
||||
protected static int mLastCursorID;
|
||||
protected static SDLGenericMotionListener_API12 mMotionListener;
|
||||
protected static SDLGenericMotionListener_API14 mMotionListener;
|
||||
protected static HIDDeviceManager mHIDDeviceManager;
|
||||
|
||||
// This is what SDL runs in. It invokes SDL_main(), eventually
|
||||
@@ -232,14 +232,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
protected static boolean mActivityCreated = false;
|
||||
private static SDLFileDialogState mFileDialogState = null;
|
||||
|
||||
protected static SDLGenericMotionListener_API12 getMotionListener() {
|
||||
protected static SDLGenericMotionListener_API14 getMotionListener() {
|
||||
if (mMotionListener == null) {
|
||||
if (Build.VERSION.SDK_INT >= 26 /* Android 8.0 (O) */) {
|
||||
mMotionListener = new SDLGenericMotionListener_API26();
|
||||
} else if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||
mMotionListener = new SDLGenericMotionListener_API24();
|
||||
} else {
|
||||
mMotionListener = new SDLGenericMotionListener_API12();
|
||||
mMotionListener = new SDLGenericMotionListener_API14();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -928,6 +928,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
|
||||
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */ &&
|
||||
Build.VERSION.SDK_INT < 35 /* Android 15 */) {
|
||||
SDLActivity.onNativeInsetsChanged(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "error handling message, getContext() returned no Activity");
|
||||
@@ -1059,6 +1063,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
public static native void onNativeTouch(int touchDevId, int pointerFingerId,
|
||||
int action, float x,
|
||||
float y, float p);
|
||||
public static native void onNativePen(int penId, int button, int action, float x, float y, float p);
|
||||
public static native void onNativeAccel(float x, float y, float z);
|
||||
public static native void onNativeClipboardChanged();
|
||||
public static native void onNativeSurfaceCreated();
|
||||
|
||||
@@ -662,44 +662,61 @@ class SDLHapticHandler {
|
||||
}
|
||||
}
|
||||
|
||||
class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
|
||||
class SDLGenericMotionListener_API14 implements View.OnGenericMotionListener {
|
||||
// Generic Motion (mouse hover, joystick...) events go here
|
||||
@Override
|
||||
public boolean onGenericMotion(View v, MotionEvent event) {
|
||||
if (event.getSource() == InputDevice.SOURCE_JOYSTICK)
|
||||
return SDLControllerManager.handleJoystickMotionEvent(event);
|
||||
|
||||
float x, y;
|
||||
int action;
|
||||
int action = event.getActionMasked();
|
||||
int pointerCount = event.getPointerCount();
|
||||
boolean consumed = false;
|
||||
|
||||
switch ( event.getSource() ) {
|
||||
case InputDevice.SOURCE_JOYSTICK:
|
||||
return SDLControllerManager.handleJoystickMotionEvent(event);
|
||||
for (int i = 0; i < pointerCount; i++) {
|
||||
int toolType = event.getToolType(i);
|
||||
|
||||
case InputDevice.SOURCE_MOUSE:
|
||||
action = event.getActionMasked();
|
||||
if (toolType == MotionEvent.TOOL_TYPE_MOUSE) {
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, i);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, i);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
consumed = true;
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
x = event.getX(0);
|
||||
y = event.getY(0);
|
||||
x = getEventX(event, i);
|
||||
y = getEventY(event, i);
|
||||
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
SDLActivity.onNativeMouse(0, action, x, y, checkRelativeEvent(event));
|
||||
consumed = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} else if (toolType == MotionEvent.TOOL_TYPE_STYLUS || toolType == MotionEvent.TOOL_TYPE_ERASER) {
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_HOVER_ENTER:
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
case MotionEvent.ACTION_HOVER_EXIT:
|
||||
x = event.getX(i);
|
||||
y = event.getY(i);
|
||||
float p = event.getPressure(i);
|
||||
|
||||
default:
|
||||
break;
|
||||
// BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4
|
||||
int buttons = event.getButtonState() >> 4;
|
||||
|
||||
SDLActivity.onNativePen(event.getPointerId(i), buttons, action, x, y, p);
|
||||
consumed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Event was not managed
|
||||
return false;
|
||||
return consumed;
|
||||
}
|
||||
|
||||
public boolean supportsRelativeMouse() {
|
||||
@@ -714,46 +731,29 @@ class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void reclaimRelativeMouseModeIfNeeded()
|
||||
{
|
||||
public void reclaimRelativeMouseModeIfNeeded() {
|
||||
|
||||
}
|
||||
|
||||
public float getEventX(MotionEvent event) {
|
||||
return event.getX(0);
|
||||
public boolean checkRelativeEvent(MotionEvent event) {
|
||||
return inRelativeMode();
|
||||
}
|
||||
|
||||
public float getEventY(MotionEvent event) {
|
||||
return event.getY(0);
|
||||
public float getEventX(MotionEvent event, int pointerIndex) {
|
||||
return event.getX(pointerIndex);
|
||||
}
|
||||
|
||||
public float getEventY(MotionEvent event, int pointerIndex) {
|
||||
return event.getY(pointerIndex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API12 {
|
||||
class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API14 {
|
||||
// Generic Motion (mouse hover, joystick...) events go here
|
||||
|
||||
private boolean mRelativeModeEnabled;
|
||||
|
||||
@Override
|
||||
public boolean onGenericMotion(View v, MotionEvent event) {
|
||||
|
||||
// Handle relative mouse mode
|
||||
if (mRelativeModeEnabled) {
|
||||
if (event.getSource() == InputDevice.SOURCE_MOUSE) {
|
||||
int action = event.getActionMasked();
|
||||
if (action == MotionEvent.ACTION_HOVER_MOVE) {
|
||||
float x = event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
|
||||
float y = event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Event was not managed, call SDLGenericMotionListener_API12 method
|
||||
return super.onGenericMotion(v, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRelativeMouse() {
|
||||
return true;
|
||||
@@ -771,20 +771,20 @@ class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API12 {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEventX(MotionEvent event) {
|
||||
if (mRelativeModeEnabled) {
|
||||
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
|
||||
public float getEventX(MotionEvent event, int pointerIndex) {
|
||||
if (mRelativeModeEnabled && event.getToolType(pointerIndex) == MotionEvent.TOOL_TYPE_MOUSE) {
|
||||
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_X, pointerIndex);
|
||||
} else {
|
||||
return event.getX(0);
|
||||
return event.getX(pointerIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEventY(MotionEvent event) {
|
||||
if (mRelativeModeEnabled) {
|
||||
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
|
||||
public float getEventY(MotionEvent event, int pointerIndex) {
|
||||
if (mRelativeModeEnabled && event.getToolType(pointerIndex) == MotionEvent.TOOL_TYPE_MOUSE) {
|
||||
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y, pointerIndex);
|
||||
} else {
|
||||
return event.getY(0);
|
||||
return event.getY(pointerIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -793,65 +793,6 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
||||
// Generic Motion (mouse hover, joystick...) events go here
|
||||
private boolean mRelativeModeEnabled;
|
||||
|
||||
@Override
|
||||
public boolean onGenericMotion(View v, MotionEvent event) {
|
||||
float x, y;
|
||||
int action;
|
||||
|
||||
switch ( event.getSource() ) {
|
||||
case InputDevice.SOURCE_JOYSTICK:
|
||||
return SDLControllerManager.handleJoystickMotionEvent(event);
|
||||
|
||||
case InputDevice.SOURCE_MOUSE:
|
||||
// DeX desktop mouse cursor is a separate non-standard input type.
|
||||
case InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN:
|
||||
action = event.getActionMasked();
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
x = event.getX(0);
|
||||
y = event.getY(0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case InputDevice.SOURCE_MOUSE_RELATIVE:
|
||||
action = event.getActionMasked();
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
x = event.getX(0);
|
||||
y = event.getY(0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, true);
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Event was not managed
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRelativeMouse() {
|
||||
return (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */);
|
||||
@@ -878,22 +819,26 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reclaimRelativeMouseModeIfNeeded()
|
||||
{
|
||||
public void reclaimRelativeMouseModeIfNeeded() {
|
||||
if (mRelativeModeEnabled && !SDLActivity.isDeXMode()) {
|
||||
SDLActivity.getContentView().requestPointerCapture();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEventX(MotionEvent event) {
|
||||
// Relative mouse in capture mode will only have relative for X/Y
|
||||
return event.getX(0);
|
||||
public boolean checkRelativeEvent(MotionEvent event) {
|
||||
return event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEventY(MotionEvent event) {
|
||||
public float getEventX(MotionEvent event, int pointerIndex) {
|
||||
// Relative mouse in capture mode will only have relative for X/Y
|
||||
return event.getY(0);
|
||||
return event.getX(pointerIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEventY(MotionEvent event, int pointerIndex) {
|
||||
// Relative mouse in capture mode will only have relative for X/Y
|
||||
return event.getY(pointerIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,93 +239,64 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
int touchDevId = event.getDeviceId();
|
||||
final int pointerCount = event.getPointerCount();
|
||||
int action = event.getActionMasked();
|
||||
int pointerFingerId;
|
||||
int i = -1;
|
||||
int pointerId;
|
||||
int i = 0;
|
||||
float x,y,p;
|
||||
|
||||
// 12290 = Samsung DeX mode desktop mouse
|
||||
// 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
|
||||
// 0x2 = SOURCE_CLASS_POINTER
|
||||
if (event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN)) {
|
||||
int mouseButton = 1;
|
||||
try {
|
||||
Object object = event.getClass().getMethod("getButtonState").invoke(event);
|
||||
if (object != null) {
|
||||
mouseButton = (Integer) object;
|
||||
if (action == MotionEvent.ACTION_POINTER_UP || action == MotionEvent.ACTION_POINTER_DOWN)
|
||||
i = event.getActionIndex();
|
||||
|
||||
do {
|
||||
int toolType = event.getToolType(i);
|
||||
|
||||
if (toolType == MotionEvent.TOOL_TYPE_MOUSE) {
|
||||
int buttonState = event.getButtonState();
|
||||
boolean relative = false;
|
||||
|
||||
// We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
|
||||
// if we are. We'll leverage our existing mouse motion listener
|
||||
SDLGenericMotionListener_API14 motionListener = SDLActivity.getMotionListener();
|
||||
x = motionListener.getEventX(event, i);
|
||||
y = motionListener.getEventY(event, i);
|
||||
relative = motionListener.inRelativeMode();
|
||||
|
||||
SDLActivity.onNativeMouse(buttonState, action, x, y, relative);
|
||||
} else if (toolType == MotionEvent.TOOL_TYPE_STYLUS || toolType == MotionEvent.TOOL_TYPE_ERASER) {
|
||||
pointerId = event.getPointerId(i);
|
||||
x = event.getX(i);
|
||||
y = event.getY(i);
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
// see the documentation of getPressure(i)
|
||||
p = 1.0f;
|
||||
}
|
||||
} catch(Exception ignored) {
|
||||
|
||||
// BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4, and apply SDL_PEN_INPUT_DOWN/SDL_PEN_INPUT_ERASER_TIP
|
||||
int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
|
||||
|
||||
SDLActivity.onNativePen(pointerId, buttonState, action, x, y, p);
|
||||
} else if (toolType == MotionEvent.TOOL_TYPE_FINGER) {
|
||||
pointerId = event.getPointerId(i);
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
// see the documentation of getPressure(i)
|
||||
p = 1.0f;
|
||||
}
|
||||
|
||||
SDLActivity.onNativeTouch(touchDevId, pointerId, action, x, y, p);
|
||||
}
|
||||
|
||||
// We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
|
||||
// if we are. We'll leverage our existing mouse motion listener
|
||||
SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();
|
||||
x = motionListener.getEventX(event);
|
||||
y = motionListener.getEventY(event);
|
||||
|
||||
SDLActivity.onNativeMouse(mouseButton, action, x, y, motionListener.inRelativeMode());
|
||||
} else {
|
||||
switch(action) {
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
for (i = 0; i < pointerCount; i++) {
|
||||
pointerFingerId = event.getPointerId(i);
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
// see the documentation of getPressure(i)
|
||||
p = 1.0f;
|
||||
}
|
||||
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
|
||||
}
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
// Primary pointer up/down, the index is always zero
|
||||
i = 0;
|
||||
/* fallthrough */
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
// Non primary pointer up/down
|
||||
if (i == -1) {
|
||||
i = event.getActionIndex();
|
||||
}
|
||||
|
||||
pointerFingerId = event.getPointerId(i);
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
// see the documentation of getPressure(i)
|
||||
p = 1.0f;
|
||||
}
|
||||
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
for (i = 0; i < pointerCount; i++) {
|
||||
pointerFingerId = event.getPointerId(i);
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
// see the documentation of getPressure(i)
|
||||
p = 1.0f;
|
||||
}
|
||||
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Non-primary up/down
|
||||
if (action == MotionEvent.ACTION_POINTER_UP || action == MotionEvent.ACTION_POINTER_DOWN)
|
||||
break;
|
||||
} while (++i < pointerCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Sensor events
|
||||
public void enableSensor(int sensortype, boolean enabled) {
|
||||
@@ -395,39 +366,42 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
public boolean onCapturedPointerEvent(MotionEvent event)
|
||||
{
|
||||
int action = event.getActionMasked();
|
||||
int pointerCount = event.getPointerCount();
|
||||
|
||||
float x, y;
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
for (int i = 0; i < pointerCount; i++) {
|
||||
float x, y;
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, i);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, i);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
||||
return true;
|
||||
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
x = event.getX(0);
|
||||
y = event.getY(0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, true);
|
||||
return true;
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
x = event.getX(i);
|
||||
y = event.getY(i);
|
||||
SDLActivity.onNativeMouse(0, action, x, y, true);
|
||||
return true;
|
||||
|
||||
case MotionEvent.ACTION_BUTTON_PRESS:
|
||||
case MotionEvent.ACTION_BUTTON_RELEASE:
|
||||
case MotionEvent.ACTION_BUTTON_PRESS:
|
||||
case MotionEvent.ACTION_BUTTON_RELEASE:
|
||||
|
||||
// Change our action value to what SDL's code expects.
|
||||
if (action == MotionEvent.ACTION_BUTTON_PRESS) {
|
||||
action = MotionEvent.ACTION_DOWN;
|
||||
} else { /* MotionEvent.ACTION_BUTTON_RELEASE */
|
||||
action = MotionEvent.ACTION_UP;
|
||||
}
|
||||
// Change our action value to what SDL's code expects.
|
||||
if (action == MotionEvent.ACTION_BUTTON_PRESS) {
|
||||
action = MotionEvent.ACTION_DOWN;
|
||||
} else { /* MotionEvent.ACTION_BUTTON_RELEASE */
|
||||
action = MotionEvent.ACTION_UP;
|
||||
}
|
||||
|
||||
x = event.getX(0);
|
||||
y = event.getY(0);
|
||||
int button = event.getButtonState();
|
||||
x = event.getX(i);
|
||||
y = event.getY(i);
|
||||
int button = event.getButtonState();
|
||||
|
||||
SDLActivity.onNativeMouse(button, action, x, y, true);
|
||||
return true;
|
||||
}
|
||||
SDLActivity.onNativeMouse(button, action, x, y, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ buildscript {
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.1.1'
|
||||
classpath 'com.android.tools.build:gradle:8.7.3'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Thu Nov 11 18:20:34 PST 2021
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1081,7 +1081,7 @@ typedef SDL_GameControllerButton, SDL_GamepadButton;
|
||||
@@
|
||||
@@
|
||||
- SDL_GameControllerFromInstanceID
|
||||
+ SDL_GetGamepadFromInstanceID
|
||||
+ SDL_GetGamepadFromID
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
@@ -1318,7 +1318,7 @@ typedef SDL_GameControllerButton, SDL_GamepadButton;
|
||||
@@
|
||||
@@
|
||||
- SDL_JoystickFromInstanceID
|
||||
+ SDL_GetJoystickFromInstanceID
|
||||
+ SDL_GetJoystickFromID
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
@@ -1398,7 +1398,7 @@ typedef SDL_GameControllerButton, SDL_GamepadButton;
|
||||
@@
|
||||
@@
|
||||
- SDL_JoystickInstanceID
|
||||
+ SDL_GetJoystickInstanceID
|
||||
+ SDL_GetJoystickID
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
@@ -1807,7 +1807,7 @@ expression e2;
|
||||
@@
|
||||
@@
|
||||
- SDL_SensorFromInstanceID
|
||||
+ SDL_GetSensorFromInstanceID
|
||||
+ SDL_GetSensorFromID
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
@@ -1817,7 +1817,7 @@ expression e2;
|
||||
@@
|
||||
@@
|
||||
- SDL_SensorGetInstanceID
|
||||
+ SDL_GetSensorInstanceID
|
||||
+ SDL_GetSensorID
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
@@ -3731,3 +3731,11 @@ typedef SDL_bool, bool;
|
||||
@@
|
||||
- SDL_GLattr
|
||||
+ SDL_GLAttr
|
||||
@@
|
||||
@@
|
||||
- SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE
|
||||
+ SDL_HINT_JOYSTICK_ENHANCED_REPORTS
|
||||
@@
|
||||
@@
|
||||
- SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE
|
||||
+ SDL_HINT_JOYSTICK_ENHANCED_REPORTS
|
||||
|
||||
@@ -37,6 +37,8 @@ logger = logging.getLogger(__name__)
|
||||
GIT_HASH_FILENAME = ".git-hash"
|
||||
REVISION_TXT = "REVISION.txt"
|
||||
|
||||
RE_ILLEGAL_MINGW_LIBRARIES = re.compile(r"(?:lib)?(?:gcc|(?:std)?c[+][+]|(?:win)?pthread).*", flags=re.I)
|
||||
|
||||
|
||||
def safe_isotime_to_datetime(str_isotime: str) -> datetime.datetime:
|
||||
try:
|
||||
@@ -328,6 +330,10 @@ def configure_text(text: str, context: dict[str, str]) -> str:
|
||||
return text
|
||||
|
||||
|
||||
def configure_text_list(text_list: list[str], context: dict[str, str]) -> list[str]:
|
||||
return [configure_text(text=e, context=context) for e in text_list]
|
||||
|
||||
|
||||
class ArchiveFileTree:
|
||||
def __init__(self):
|
||||
self._tree: dict[str, NodeInArchive] = {}
|
||||
@@ -335,6 +341,12 @@ class ArchiveFileTree:
|
||||
def add_file(self, file: NodeInArchive):
|
||||
self._tree[file.arcpath] = file
|
||||
|
||||
def __iter__(self) -> typing.Iterable[NodeInArchive]:
|
||||
yield from self._tree.values()
|
||||
|
||||
def __contains__(self, value: str) -> bool:
|
||||
return value in self._tree
|
||||
|
||||
def get_latest_mod_time(self) -> datetime.datetime:
|
||||
return max(item.time for item in self._tree.values() if item.time)
|
||||
|
||||
@@ -343,13 +355,12 @@ class ArchiveFileTree:
|
||||
added_files = dict()
|
||||
|
||||
def calculate_symlink_target(s: NodeInArchive) -> str:
|
||||
dest_dir = os.path.dirname(s.path)
|
||||
dest_dir = os.path.dirname(s.arcpath)
|
||||
if dest_dir:
|
||||
dest_dir += "/"
|
||||
target = dest_dir + s.symtarget
|
||||
while True:
|
||||
new_target, n = re.subn(r"([^/]+/+[.]{2}/)", "", target)
|
||||
print(f"{target=} {new_target=}")
|
||||
target = new_target
|
||||
if not n:
|
||||
break
|
||||
@@ -357,12 +368,15 @@ class ArchiveFileTree:
|
||||
|
||||
# Add files in first pass
|
||||
for arcpath, node in self._tree.items():
|
||||
assert node is not None, f"{arcpath} -> node"
|
||||
if node.data is not None:
|
||||
archiver.add_file_data(arcpath=arc_join(archive_base, arcpath), data=node.data, time=node.time, mode=node.mode)
|
||||
added_files[node.path] = node
|
||||
assert node.arcpath is not None, f"{node=}"
|
||||
added_files[node.arcpath] = node
|
||||
elif node.path is not None:
|
||||
archiver.add_file_path(arcpath=arc_join(archive_base, arcpath), path=node.path)
|
||||
added_files[node.path] = node
|
||||
assert node.arcpath is not None, f"{node=}"
|
||||
added_files[node.arcpath] = node
|
||||
elif node.symtarget is not None:
|
||||
remaining_symlinks.add(node)
|
||||
elif node.directory:
|
||||
@@ -370,6 +384,8 @@ class ArchiveFileTree:
|
||||
else:
|
||||
raise ValueError(f"Invalid Archive Node: {repr(node)}")
|
||||
|
||||
assert None not in added_files
|
||||
|
||||
# Resolve symlinks in second pass: zipfile does not support symlinks, so add files to zip archive
|
||||
while True:
|
||||
if not remaining_symlinks:
|
||||
@@ -380,18 +396,18 @@ class ArchiveFileTree:
|
||||
symlink_files_for_zip = {}
|
||||
symlink_target_path = calculate_symlink_target(symlink)
|
||||
if symlink_target_path in added_files:
|
||||
symlink_files_for_zip[symlink.path] = added_files[symlink_target_path]
|
||||
symlink_files_for_zip[symlink.arcpath] = added_files[symlink_target_path]
|
||||
else:
|
||||
symlink_target_path_slash = symlink_target_path + "/"
|
||||
for added_file in added_files:
|
||||
if added_file.startswith(symlink_target_path_slash):
|
||||
path_in_symlink = symlink.path + "/" + added_file.removeprefix(symlink_target_path_slash)
|
||||
path_in_symlink = symlink.arcpath + "/" + added_file.removeprefix(symlink_target_path_slash)
|
||||
symlink_files_for_zip[path_in_symlink] = added_files[added_file]
|
||||
if symlink_files_for_zip:
|
||||
symlinks_this_time.add(symlink)
|
||||
extra_added_files.update(symlink_files_for_zip)
|
||||
files_for_zip = [{"arcpath": f"{archive_base}/{sym_path}", "data": sym_info.data, "mode": sym_info.mode} for sym_path, sym_info in symlink_files_for_zip.items()]
|
||||
archiver.add_symlink(arcpath=f"{archive_base}/{symlink.path}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip)
|
||||
archiver.add_symlink(arcpath=f"{archive_base}/{symlink.arcpath}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip)
|
||||
# if not symlinks_this_time:
|
||||
# logger.info("files added: %r", set(path for path in added_files.keys()))
|
||||
assert symlinks_this_time, f"No targets found for symlinks: {remaining_symlinks}"
|
||||
@@ -545,6 +561,7 @@ class Releaser:
|
||||
"PROJECT_VERSION": self.version,
|
||||
"PROJECT_COMMIT": self.commit,
|
||||
"PROJECT_REVISION": self.revision,
|
||||
"PROJECT_ROOT": str(self.root),
|
||||
}
|
||||
if extra_context:
|
||||
ctx.update(extra_context)
|
||||
@@ -577,12 +594,22 @@ class Releaser:
|
||||
def create_source_archives(self) -> None:
|
||||
source_collector = SourceCollector(root=self.root, commit=self.commit, executer=self.executer, filter=self._path_filter)
|
||||
print(f"Collecting sources of {self.project}...")
|
||||
archive_tree = source_collector.get_archive_file_tree()
|
||||
archive_tree: ArchiveFileTree = source_collector.get_archive_file_tree()
|
||||
latest_mod_time = archive_tree.get_latest_mod_time()
|
||||
archive_tree.add_file(NodeInArchive.from_text(arcpath=REVISION_TXT, text=f"{self.revision}\n", time=latest_mod_time))
|
||||
archive_tree.add_file(NodeInArchive.from_text(arcpath=f"{GIT_HASH_FILENAME}", text=f"{self.commit}\n", time=latest_mod_time))
|
||||
archive_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["source"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=latest_mod_time)
|
||||
|
||||
if "Makefile.am" in archive_tree:
|
||||
patched_time = latest_mod_time + datetime.timedelta(minutes=1)
|
||||
print(f"Makefile.am detected -> touching aclocal.m4, */Makefile.in, configure")
|
||||
for node_data in archive_tree:
|
||||
arc_name = os.path.basename(node_data.arcpath)
|
||||
arc_name_we, arc_name_ext = os.path.splitext(arc_name)
|
||||
if arc_name in ("aclocal.m4", "configure", "Makefile.in"):
|
||||
print(f"Bumping time of {node_data.arcpath}")
|
||||
node_data.time = patched_time
|
||||
|
||||
archive_base = f"{self.project}-{self.version}"
|
||||
zip_path = self.dist_path / f"{archive_base}.zip"
|
||||
tgz_path = self.dist_path / f"{archive_base}.tar.gz"
|
||||
@@ -659,6 +686,15 @@ class Releaser:
|
||||
def git_hash_data(self) -> bytes:
|
||||
return f"{self.commit}\n".encode()
|
||||
|
||||
def verify_mingw_library(self, triplet: str, path: Path):
|
||||
objdump_output = self.executer.check_output([f"{triplet}-objdump", "-p", str(path)])
|
||||
libraries = re.findall(r"DLL Name: ([^\n]+)", objdump_output)
|
||||
logger.info("%s (%s) libraries: %r", path, triplet, libraries)
|
||||
illegal_libraries = list(filter(RE_ILLEGAL_MINGW_LIBRARIES.match, libraries))
|
||||
logger.error("Detected 'illegal' libraries: %r", illegal_libraries)
|
||||
if illegal_libraries:
|
||||
raise Exception(f"{path} links to illegal libraries: {illegal_libraries}")
|
||||
|
||||
def create_mingw_archives(self) -> None:
|
||||
build_type = "Release"
|
||||
build_parent_dir = self.root / "build-mingw"
|
||||
@@ -741,23 +777,38 @@ class Releaser:
|
||||
install_path = build_parent_dir / f"install-{triplet}"
|
||||
shutil.rmtree(install_path, ignore_errors=True)
|
||||
build_path.mkdir(parents=True, exist_ok=True)
|
||||
context = self.get_context({
|
||||
"ARCH": arch,
|
||||
"DEP_PREFIX": str(mingw_deps_path / triplet),
|
||||
})
|
||||
extra_args = configure_text_list(text_list=self.release_info["mingw"]["autotools"]["args"], context=context)
|
||||
|
||||
with self.section_printer.group(f"Configuring MinGW {triplet} (autotools)"):
|
||||
extra_args = [arg.replace("@DEP_PREFIX@", str(mingw_deps_path / triplet)) for arg in self.release_info["mingw"]["autotools"]["args"]]
|
||||
assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})"
|
||||
self.executer.run([
|
||||
self.root / "configure",
|
||||
f"--prefix={install_path}",
|
||||
f"--includedir={install_path}/include",
|
||||
f"--libdir={install_path}/lib",
|
||||
f"--bindir={install_path}/bin",
|
||||
f"--includedir=${{prefix}}/include",
|
||||
f"--libdir=${{prefix}}/lib",
|
||||
f"--bindir=${{prefix}}/bin",
|
||||
f"--host={triplet}",
|
||||
f"--build=x86_64-none-linux-gnu",
|
||||
"CFLAGS=-O2",
|
||||
"CXXFLAGS=-O2",
|
||||
"LDFLAGS=-Wl,-s",
|
||||
] + extra_args, cwd=build_path, env=new_env)
|
||||
with self.section_printer.group(f"Build MinGW {triplet} (autotools)"):
|
||||
self.executer.run(["make", f"-j{self.cpu_count}"], cwd=build_path, env=new_env)
|
||||
with self.section_printer.group(f"Install MinGW {triplet} (autotools)"):
|
||||
self.executer.run(["make", "install"], cwd=build_path, env=new_env)
|
||||
archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path)
|
||||
self.verify_mingw_library(triplet=ARCH_TO_TRIPLET[arch], path=install_path / "bin" / f"{self.project}.dll")
|
||||
archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time)
|
||||
|
||||
print("Recording arch-dependent extra files for MinGW development archive ...")
|
||||
extra_context = {
|
||||
"TRIPLET": ARCH_TO_TRIPLET[arch],
|
||||
}
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"]["autotools"].get("files", {}), file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time)
|
||||
|
||||
if "cmake" in self.release_info["mingw"]:
|
||||
assert self.release_info["mingw"]["cmake"]["shared-static"] in ("args", "both")
|
||||
@@ -770,6 +821,12 @@ class Releaser:
|
||||
assert arch not in mingw_archs
|
||||
mingw_archs.add(arch)
|
||||
|
||||
context = self.get_context({
|
||||
"ARCH": arch,
|
||||
"DEP_PREFIX": str(mingw_deps_path / triplet),
|
||||
})
|
||||
extra_args = configure_text_list(text_list=self.release_info["mingw"]["cmake"]["args"], context=context)
|
||||
|
||||
build_path = build_parent_dir / f"build-{triplet}"
|
||||
install_path = build_parent_dir / f"install-{triplet}"
|
||||
shutil.rmtree(install_path, ignore_errors=True)
|
||||
@@ -780,7 +837,6 @@ class Releaser:
|
||||
args_for_shared_static = (["-DBUILD_SHARED_LIBS=ON"], ["-DBUILD_SHARED_LIBS=OFF"])
|
||||
for arg_for_shared_static in args_for_shared_static:
|
||||
with self.section_printer.group(f"Configuring MinGW {triplet} (CMake)"):
|
||||
extra_args = [arg.replace("@DEP_PREFIX@", str(mingw_deps_path / triplet)) for arg in self.release_info["mingw"]["cmake"]["args"]]
|
||||
assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})"
|
||||
self.executer.run([
|
||||
f"cmake",
|
||||
@@ -801,8 +857,16 @@ class Releaser:
|
||||
self.executer.run(["cmake", "--build", str(build_path), "--verbose", "--config", build_type], cwd=build_path, env=new_env)
|
||||
with self.section_printer.group(f"Install MinGW {triplet} (CMake)"):
|
||||
self.executer.run(["cmake", "--install", str(build_path)], cwd=build_path, env=new_env)
|
||||
self.verify_mingw_library(triplet=ARCH_TO_TRIPLET[arch], path=install_path / "bin" / f"{self.project}.dll")
|
||||
archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time)
|
||||
|
||||
print("Recording arch-dependent extra files for MinGW development archive ...")
|
||||
extra_context = {
|
||||
"TRIPLET": ARCH_TO_TRIPLET[arch],
|
||||
}
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"]["cmake"].get("files", {}), file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time)
|
||||
print("... done")
|
||||
|
||||
print("Recording extra files for MinGW development archive ...")
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=self.arc_time)
|
||||
print("... done")
|
||||
@@ -1231,6 +1295,10 @@ class Releaser:
|
||||
zip_path = self.dist_path / f"{self.project}-devel-{self.version}-VC.zip"
|
||||
arc_root = f"{self.project}-{self.version}"
|
||||
|
||||
def copy_files_devel(ctx):
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["files-devel"], file_mapping_root=self.root, context=ctx, time=self.arc_time)
|
||||
|
||||
|
||||
logger.info("Collecting files...")
|
||||
archive_file_tree = ArchiveFileTree()
|
||||
if "msbuild" in self.release_info["msvc"]:
|
||||
@@ -1238,12 +1306,13 @@ class Releaser:
|
||||
arch_platform = self._arch_to_vs_platform(arch=arch)
|
||||
platform_context = self.get_context(arch_platform.extra_context())
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["msbuild"]["files-devel"], file_mapping_root=self.root, context=platform_context, time=self.arc_time)
|
||||
copy_files_devel(ctx=platform_context)
|
||||
if "cmake" in self.release_info["msvc"]:
|
||||
for arch in self.release_info["msvc"]["cmake"]["archs"]:
|
||||
arch_platform = self._arch_to_vs_platform(arch=arch)
|
||||
platform_context = self.get_context(arch_platform.extra_context())
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["cmake"]["files-devel"], file_mapping_root=self._arch_platform_to_install_path(arch_platform), context=platform_context, time=self.arc_time)
|
||||
archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["files-devel"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time)
|
||||
copy_files_devel(ctx=platform_context)
|
||||
|
||||
with Archiver(zip_path=zip_path) as archiver:
|
||||
archive_file_tree.add_to_archiver(archive_base="", archiver=archiver)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Simple DirectMedia Layer
|
||||
# Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
@@ -71,6 +71,62 @@ sub build_latest {
|
||||
}
|
||||
}
|
||||
|
||||
sub get_category_description {
|
||||
my $category = shift;
|
||||
my $retval = ucfirst($category);
|
||||
|
||||
if (open(my $fh, '<', "$examples_dir/$category/description.txt")) {
|
||||
$retval = <$fh>;
|
||||
chomp($retval);
|
||||
close($fh);
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
sub get_categories {
|
||||
my @categories = ();
|
||||
|
||||
if (open(my $fh, '<', "$examples_dir/categories.txt")) {
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
s/\A\s+//;
|
||||
s/\s+\Z//;
|
||||
next if $_ eq '';
|
||||
next if /\A\#/;
|
||||
push @categories, $_;
|
||||
}
|
||||
close($fh);
|
||||
} else {
|
||||
opendir(my $dh, $examples_dir) or die("Couldn't opendir '$examples_dir': $!\n");
|
||||
foreach my $dir (sort readdir $dh) {
|
||||
next if ($dir eq '.') || ($dir eq '..'); # obviously skip current and parent entries.
|
||||
next if not -d "$examples_dir/$dir"; # only care about subdirectories.
|
||||
push @categories, $dir;
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
return @categories;
|
||||
}
|
||||
|
||||
sub get_examples_for_category {
|
||||
my $category = shift;
|
||||
|
||||
my @examples = ();
|
||||
|
||||
opendir(my $dh, "$examples_dir/$category") or die("Couldn't opendir '$examples_dir/$category': $!\n");
|
||||
foreach my $dir (sort readdir $dh) {
|
||||
next if ($dir eq '.') || ($dir eq '..'); # obviously skip current and parent entries.
|
||||
next if not -d "$examples_dir/$category/$dir"; # only care about subdirectories.
|
||||
|
||||
push @examples, $dir;
|
||||
}
|
||||
closedir($dh);
|
||||
|
||||
return @examples;
|
||||
}
|
||||
|
||||
sub handle_example_dir {
|
||||
my $category = shift;
|
||||
my $example = shift;
|
||||
@@ -99,25 +155,43 @@ sub handle_example_dir {
|
||||
$basefname = "$category-$basefname";
|
||||
my $jsfname = "$basefname.js";
|
||||
my $wasmfname = "$basefname.wasm";
|
||||
my $thumbnailfname = 'thumbnail.png';
|
||||
my $onmouseoverfname = 'onmouseover.webp';
|
||||
my $jssrc = "$compile_dir/examples/$jsfname";
|
||||
my $wasmsrc = "$compile_dir/examples/$wasmfname";
|
||||
my $thumbnailsrc = "$examples_dir/$category/$example/$thumbnailfname";
|
||||
my $onmouseoversrc = "$examples_dir/$category/$example/$onmouseoverfname";
|
||||
my $jsdst = "$dst/$jsfname";
|
||||
my $wasmdst = "$dst/$wasmfname";
|
||||
my $thumbnaildst = "$dst/$thumbnailfname";
|
||||
my $onmouseoverdst = "$dst/$onmouseoverfname";
|
||||
|
||||
my $description = '';
|
||||
my $has_paragraph = 0;
|
||||
if (open(my $readmetxth, '<', "$examples_dir/$category/$example/README.txt")) {
|
||||
while (<$readmetxth>) {
|
||||
chomp;
|
||||
s/\A\s+//;
|
||||
s/\s+\Z//;
|
||||
$description .= "$_<br/>";
|
||||
if (($_ eq '') && ($description ne '')) {
|
||||
$has_paragraph = 1;
|
||||
} else {
|
||||
if ($has_paragraph) {
|
||||
$description .= "\n<br/>\n<br/>\n";
|
||||
$has_paragraph = 0;
|
||||
}
|
||||
$description .= "$_ ";
|
||||
}
|
||||
}
|
||||
close($readmetxth);
|
||||
$description =~ s/\s+\Z//;
|
||||
}
|
||||
|
||||
do_mkdir($dst);
|
||||
do_copy($jssrc, $jsdst);
|
||||
do_copy($wasmsrc, $wasmdst);
|
||||
do_copy($thumbnailsrc, $thumbnaildst) if ( -f $thumbnailsrc );
|
||||
do_copy($onmouseoversrc, $onmouseoverdst) if ( -f $onmouseoversrc );
|
||||
|
||||
my $highlight_cmd = "highlight '--outdir=$dst' --style-outfile=highlight.css --fragment --enclose-pre --stdout --syntax=c '--plug-in=$examples_dir/highlight-plugin.lua'";
|
||||
print("$highlight_cmd\n");
|
||||
@@ -146,16 +220,27 @@ sub handle_example_dir {
|
||||
|
||||
waitpid($pid, 0);
|
||||
|
||||
my $other_examples_html = "<ul>";
|
||||
foreach my $example (get_examples_for_category($category)) {
|
||||
$other_examples_html .= "<li><a href='/$project/$category/$example'>$category/$example</a></li>";
|
||||
}
|
||||
$other_examples_html .= "</ul>";
|
||||
|
||||
my $category_description = get_category_description($category);
|
||||
my $preview_image = get_example_thumbnail($project, $category, $example);
|
||||
|
||||
my $html = '';
|
||||
open my $htmltemplate, '<', "$examples_dir/template.html" or die("Couldn't open '$examples_dir/template.html': $!\n");
|
||||
while (<$htmltemplate>) {
|
||||
s/\@project_name\@/$project/g;
|
||||
s/\@category_name\@/$category/g;
|
||||
s/\@category_description\@/$category_description/g;
|
||||
s/\@example_name\@/$example/g;
|
||||
s/\@javascript_file\@/$jsfname/g;
|
||||
s/\@htmlified_source_code\@/$htmlified_source_code/g;
|
||||
s/\@description\@/$description/g;
|
||||
s/\@preview_image\@/$preview_image/g;
|
||||
s/\@other_examples_html\@/$other_examples_html/g;
|
||||
$html .= $_;
|
||||
}
|
||||
close($htmltemplate);
|
||||
@@ -165,11 +250,61 @@ sub handle_example_dir {
|
||||
close($htmloutput);
|
||||
}
|
||||
|
||||
sub get_example_thumbnail {
|
||||
my $project = shift;
|
||||
my $category = shift;
|
||||
my $example = shift;
|
||||
|
||||
if ( -f "$examples_dir/$category/$example/thumbnail.png" ) {
|
||||
return "/$project/$category/$example/thumbnail.png";
|
||||
} elsif ( -f "$examples_dir/$category/thumbnail.png" ) {
|
||||
return "/$project/$category/thumbnail.png";
|
||||
}
|
||||
|
||||
return "/$project/thumbnail.png";
|
||||
}
|
||||
|
||||
sub generate_example_thumbnail {
|
||||
my $project = shift;
|
||||
my $category = shift;
|
||||
my $example = shift;
|
||||
|
||||
my $example_no_num = "$example";
|
||||
$example_no_num =~ s/\A\d+\-//;
|
||||
|
||||
my $example_image_url = get_example_thumbnail($project, $category, $example);
|
||||
|
||||
my $example_mouseover_html = '';
|
||||
if ( -f "$examples_dir/$category/$example/onmouseover.webp" ) {
|
||||
$example_mouseover_html = "onmouseover=\"this.src='/$project/$category/$example/onmouseover.webp'\" onmouseout=\"this.src='$example_image_url';\"";
|
||||
} elsif ( -f "$examples_dir/$category/onmouseover.webp" ) {
|
||||
$example_mouseover_html = "onmouseover=\"this.src='/$project/$category/onmouseover.webp'\" onmouseout=\"this.src='$example_image_url';\"";
|
||||
}
|
||||
|
||||
return "
|
||||
<a href='/$project/$category/$example'>
|
||||
<div>
|
||||
<img src='$example_image_url' $example_mouseover_html />
|
||||
<div>$example_no_num</div>
|
||||
</div>
|
||||
</a>"
|
||||
;
|
||||
}
|
||||
|
||||
sub generate_example_thumbnails_for_category {
|
||||
my $project = shift;
|
||||
my $category = shift;
|
||||
my @examples = get_examples_for_category($category);
|
||||
my $retval = '';
|
||||
foreach my $example (@examples) {
|
||||
$retval .= generate_example_thumbnail($project, $category, $example);
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
|
||||
sub handle_category_dir {
|
||||
my $category = shift;
|
||||
|
||||
# !!! FIXME: this needs to generate a preview page for all the examples things in the category.
|
||||
|
||||
print("Category $category ...\n");
|
||||
|
||||
do_mkdir("$output_dir/$category");
|
||||
@@ -183,6 +318,36 @@ sub handle_category_dir {
|
||||
}
|
||||
|
||||
closedir($dh);
|
||||
|
||||
my $examples_list_html = generate_example_thumbnails_for_category($project, $category);
|
||||
|
||||
my $dst = "$output_dir/$category";
|
||||
|
||||
do_copy("$examples_dir/$category/thumbnail.png", "$dst/thumbnail.png") if ( -f "$examples_dir/$category/thumbnail.png" );
|
||||
do_copy("$examples_dir/$category/onmouseover.webp", "$dst/onmouseover.webp") if ( -f "$examples_dir/$category/onmouseover.webp" );
|
||||
|
||||
my $category_description = get_category_description($category);
|
||||
my $preview_image = "/$project/thumbnail.png";
|
||||
if ( -f "$examples_dir/$category/thumbnail.png" ) {
|
||||
$preview_image = "/$project/$category/thumbnail.png";
|
||||
}
|
||||
|
||||
# write category page
|
||||
my $html = '';
|
||||
open my $htmltemplate, '<', "$examples_dir/template-category.html" or die("Couldn't open '$examples_dir/template-category.html': $!\n");
|
||||
while (<$htmltemplate>) {
|
||||
s/\@project_name\@/$project/g;
|
||||
s/\@category_name\@/$category/g;
|
||||
s/\@category_description\@/$category_description/g;
|
||||
s/\@examples_list_html\@/$examples_list_html/g;
|
||||
s/\@preview_image\@/$preview_image/g;
|
||||
$html .= $_;
|
||||
}
|
||||
close($htmltemplate);
|
||||
|
||||
open my $htmloutput, '>', "$dst/index.html" or die("Couldn't open '$dst/index.html': $!\n");
|
||||
print $htmloutput $html;
|
||||
close($htmloutput);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +375,9 @@ do_mkdir($output_dir);
|
||||
|
||||
build_latest();
|
||||
|
||||
do_copy("$examples_dir/template.css", "$output_dir/examples.css");
|
||||
do_copy("$examples_dir/template-placeholder.png", "$output_dir/thumbnail.png");
|
||||
|
||||
opendir(my $dh, $examples_dir) or die("Couldn't opendir '$examples_dir': $!\n");
|
||||
|
||||
while (readdir($dh)) {
|
||||
@@ -221,6 +389,32 @@ while (readdir($dh)) {
|
||||
|
||||
closedir($dh);
|
||||
|
||||
# write homepage
|
||||
my $homepage_list_html = "";
|
||||
foreach my $category (get_categories()) {
|
||||
my $category_description = get_category_description($category);
|
||||
$homepage_list_html .= "<h2>$category_description</h2>";
|
||||
$homepage_list_html .= "<div class='list'>";
|
||||
$homepage_list_html .= generate_example_thumbnails_for_category($project, $category);
|
||||
$homepage_list_html .= "</div>";
|
||||
}
|
||||
|
||||
my $preview_image = "/$project/thumbnail.png";
|
||||
|
||||
my $dst = "$output_dir/";
|
||||
my $html = '';
|
||||
open my $htmltemplate, '<', "$examples_dir/template-homepage.html" or die("Couldn't open '$examples_dir/template-category.html': $!\n");
|
||||
while (<$htmltemplate>) {
|
||||
s/\@project_name\@/$project/g;
|
||||
s/\@homepage_list_html\@/$homepage_list_html/g;
|
||||
s/\@preview_image\@/$preview_image/g;
|
||||
$html .= $_;
|
||||
}
|
||||
close($htmltemplate);
|
||||
|
||||
open my $htmloutput, '>', "$dst/index.html" or die("Couldn't open '$dst/index.html': $!\n");
|
||||
print $htmloutput $html;
|
||||
close($htmloutput);
|
||||
|
||||
print("All examples built successfully!\n");
|
||||
exit(0); # success!
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Simple DirectMedia Layer
|
||||
# Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -23,18 +23,20 @@ def determine_remote() -> str:
|
||||
def main():
|
||||
default_remote = determine_remote()
|
||||
|
||||
current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()
|
||||
|
||||
parser = argparse.ArgumentParser(allow_abbrev=False)
|
||||
parser.add_argument("--ref", required=True, help=f"Name of branch or tag containing release.yml")
|
||||
parser.add_argument("--remote", "-R", default=default_remote, help=f"Remote repo (default={default_remote})")
|
||||
parser.add_argument("--commit", default=current_commit, help=f"Commit (default={current_commit})")
|
||||
parser.add_argument("--commit", help=f"Input 'commit' of release.yml (default is the hash of the ref)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.commit is None:
|
||||
args.commit = subprocess.check_output(["git", "rev-parse", args.ref], cwd=ROOT, text=True).strip()
|
||||
|
||||
|
||||
print(f"Running release.yml workflow:")
|
||||
print(f" commit = {args.commit}")
|
||||
print(f" remote = {args.remote}")
|
||||
print(f" ref = {args.ref}")
|
||||
print(f" commit = {args.commit}")
|
||||
|
||||
subprocess.check_call(["gh", "-R", args.remote, "workflow", "run", "release.yml", "--ref", args.ref, "-f", f"commit={args.commit}"], cwd=ROOT)
|
||||
|
||||
|
||||
@@ -90,11 +90,15 @@ foreach my $release (@releases) {
|
||||
my $tag = $fulltags{$release};
|
||||
my $blobname = "$tag:src/dynapi/SDL_dynapi_overrides.h";
|
||||
|
||||
if ($release =~ /\A3\.[01]\.\d+/) { # make everything up to the first SDL3 prerelease look like 3.1.3 (ABI lock version).
|
||||
if ($release =~ /\A3\.(0\.\d+|1\.[0123])/) { # make everything up to the first SDL3 prerelease look like 3.1.3 (ABI lock version).
|
||||
$release = '3.1.3';
|
||||
}
|
||||
|
||||
else { $release = '3.2.0'; } # !!! FIXME: REMOVE ME WHEN 3.2.0 SHIPS!
|
||||
# !!! FIXME: REMOVE ME WHEN 3.2.0 SHIPS!
|
||||
elsif (not $release =~ /\A3\.1\.\d+/) { # a couple of releases after the initial 3.1.3, let them through.
|
||||
$release = '3.2.0';
|
||||
}
|
||||
# !!! FIXME: REMOVE ME WHEN 3.2.0 SHIPS!
|
||||
|
||||
open(PIPEFH, '-|', "git show '$blobname'") or die "Failed to read git blob '$blobname': $!\n";
|
||||
while (<PIPEFH>) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -406,7 +406,7 @@ int main(void)
|
||||
printf(
|
||||
"/*\n"
|
||||
" Simple DirectMedia Layer\n"
|
||||
" Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
"\n"
|
||||
" This software is provided 'as-is', without any express or implied\n"
|
||||
" warranty. In no event will the authors be held liable for any damages\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Simple DirectMedia Layer
|
||||
# Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
@@ -36,7 +36,7 @@ my $mem_used = 0;
|
||||
print <<__EOF__;
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken\@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken\@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SDL CMake configuration file:
|
||||
# This file is meant to be placed in lib/cmake/SDL3 subfolder of a reconstructed Android SDL3 SDK
|
||||
|
||||
cmake_minimum_required(VERSION 3.0...3.5)
|
||||
cmake_minimum_required(VERSION 3.0...3.28)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(SDL3 PROPERTIES
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# @<@PROJECT_NAME@>@ CMake configuration file:
|
||||
# This file is meant to be placed in a cmake subfolder of @<@PROJECT_NAME@>@-devel-@<@PROJECT_VERSION@>@-VC.zip
|
||||
|
||||
cmake_minimum_required(VERSION 3.0...3.5)
|
||||
cmake_minimum_required(VERSION 3.0...3.28)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(SDL3 PROPERTIES
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -36,9 +36,10 @@
|
||||
"-DSDL_SHARED=ON",
|
||||
"-DSDL_STATIC=OFF",
|
||||
"-DSDL_DISABLE_INSTALL_DOCS=ON",
|
||||
"-DSDL_RELOCATABLE=ON",
|
||||
"-DSDL_TEST_LIBRARY=ON",
|
||||
"-DSDL_VENDOR_INFO=libsdl.org",
|
||||
"-DSDL_TESTS=OFF"
|
||||
"-DSDL_TESTS=OFF",
|
||||
"-DSDL_VENDOR_INFO=libsdl.org"
|
||||
],
|
||||
"shared-static": "args"
|
||||
},
|
||||
@@ -100,6 +101,7 @@
|
||||
"-DSDL_TEST_LIBRARY=ON",
|
||||
"-DSDL_TESTS=OFF",
|
||||
"-DSDL_DISABLE_INSTALL_DOCS=ON",
|
||||
"-DSDL_RELOCATABLE=ON",
|
||||
"-DSDL_VENDOR_INFO=libsdl.org"
|
||||
],
|
||||
"files-lib": {
|
||||
|
||||
@@ -113,7 +113,6 @@ RENAMED_MACROS = {
|
||||
"__LINUX__": "SDL_PLATFORM_LINUX",
|
||||
"__OS2__": "SDL_PLATFORM_OS2",
|
||||
# "__ANDROID__": "SDL_PLATFORM_ANDROID,
|
||||
"__NGAGE__": "SDL_PLATFORM_NGAGE",
|
||||
"__APPLE__": "SDL_PLATFORM_APPLE",
|
||||
"__TVOS__": "SDL_PLATFORM_TVOS",
|
||||
"__IPHONEOS__": "SDL_PLATFORM_IOS",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Simple DirectMedia Layer
|
||||
# Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
# Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
@@ -51,6 +51,12 @@ my $wikipreamble = undef;
|
||||
my $wikiheaderfiletext = 'Defined in %fname%';
|
||||
my $manpageheaderfiletext = 'Defined in %fname%';
|
||||
my $headercategoryeval = undef;
|
||||
my $quickrefenabled = 0;
|
||||
my @quickrefcategoryorder;
|
||||
my $quickreftitle = undef;
|
||||
my $quickrefurl = undef;
|
||||
my $quickrefdesc = undef;
|
||||
my $quickrefmacroregex = undef;
|
||||
my $changeformat = undef;
|
||||
my $manpath = undef;
|
||||
my $gitrev = undef;
|
||||
@@ -122,6 +128,12 @@ if (defined $optionsfname) {
|
||||
$wikiheaderfiletext = $val, next if $key eq 'wikiheaderfiletext';
|
||||
$manpageheaderfiletext = $val, next if $key eq 'manpageheaderfiletext';
|
||||
$headercategoryeval = $val, next if $key eq 'headercategoryeval';
|
||||
$quickrefenabled = int($val), next if $key eq 'quickrefenabled';
|
||||
@quickrefcategoryorder = split(/,/, $val), next if $key eq 'quickrefcategoryorder';
|
||||
$quickreftitle = $val, next if $key eq 'quickreftitle';
|
||||
$quickrefurl = $val, next if $key eq 'quickrefurl';
|
||||
$quickrefdesc = $val, next if $key eq 'quickrefdesc';
|
||||
$quickrefmacroregex = $val, next if $key eq 'quickrefmacroregex';
|
||||
}
|
||||
}
|
||||
close(OPTIONS);
|
||||
@@ -647,6 +659,7 @@ my %headersymsrettype = (); # $headersymsrettype{"SDL_OpenAudio"} -> string of C
|
||||
my %wikitypes = (); # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki'
|
||||
my %wikisyms = (); # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikisyms{"SDL_OpenAudio"}{"Remarks"}.
|
||||
my %wikisectionorder = (); # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
|
||||
my %quickreffuncorder = (); # contains references to array, each array item being a key to a category with functions in the order they appear in the headers, like $quickreffuncorder{"Audio"}[0] == 'SDL_GetNumAudioDrivers'
|
||||
|
||||
my %referenceonly = (); # $referenceonly{"Y"} -> symbol name that this symbol is bound to. This makes wiki pages that say "See X" where "X" is a typedef and "Y" is a define attached to it. These pages are generated in the wiki only and do not bridge to the headers or manpages.
|
||||
|
||||
@@ -720,6 +733,279 @@ sub sanitize_c_typename {
|
||||
return $str;
|
||||
}
|
||||
|
||||
my %big_ascii = (
|
||||
'A' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'B' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'C' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'D' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'E' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{255D}\x{20}\x{20}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'F' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{255D}\x{20}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{20}\x{20}\x{20}" ],
|
||||
'G' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'H' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'I' => [ "\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}" ],
|
||||
'J' => [ "\x{20}\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'K' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'L' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'M' => [ "\x{2588}\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2554}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{255A}\x{2588}\x{2588}\x{2554}\x{255D}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{255A}\x{2550}\x{255D}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{20}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'N' => [ "\x{2588}\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2554}\x{2588}\x{2588}\x{2557}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{255A}\x{2588}\x{2588}\x{2557}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'O' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'P' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{20}\x{20}\x{20}" ],
|
||||
'Q' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{2584}\x{2584}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2580}\x{2580}\x{2550}\x{255D}\x{20}" ],
|
||||
'R' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'S' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'T' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{255D}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{20}" ],
|
||||
'U' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'V' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2557}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{20}\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}\x{20}" ],
|
||||
'W' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{20}\x{2588}\x{2557}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}\x{2588}\x{2588}\x{2588}\x{2557}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2554}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{255D}\x{255A}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'X' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2588}\x{2588}\x{2557}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{20}\x{2588}\x{2588}\x{2554}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{255D}\x{20}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'Y' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2588}\x{2588}\x{2557}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{20}\x{20}\x{255A}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{20}" ],
|
||||
'Z' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{20}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{20}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}\x{20}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
' ' => [ "\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}" ],
|
||||
'.' => [ "\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{255D}" ],
|
||||
',' => [ "\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}", "\x{2584}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{255D}" ],
|
||||
'/' => [ "\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{20}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}\x{20}", "\x{2588}\x{2588}\x{2554}\x{255D}\x{20}\x{20}\x{20}", "\x{255A}\x{2550}\x{255D}\x{20}\x{20}\x{20}\x{20}" ],
|
||||
'!' => [ "\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{255D}", "\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{255D}" ],
|
||||
'_' => [ "\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}\x{20}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'0' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{2588}\x{2588}\x{2554}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'1' => [ "\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2588}\x{2588}\x{2551}", "\x{20}\x{2588}\x{2588}\x{2551}", "\x{20}\x{2588}\x{2588}\x{2551}", "\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'2' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'3' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'4' => [ "\x{2588}\x{2588}\x{2557}\x{20}\x{20}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2551}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}", "\x{20}\x{20}\x{20}\x{20}\x{20}\x{255A}\x{2550}\x{255D}" ],
|
||||
'5' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}" ],
|
||||
'6' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}", "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'7' => [ "\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{20}\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2554}\x{255D}\x{20}", "\x{20}\x{20}\x{20}\x{2588}\x{2588}\x{2551}\x{20}\x{20}", "\x{20}\x{20}\x{20}\x{255A}\x{2550}\x{255D}\x{20}\x{20}" ],
|
||||
'8' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
'9' => [ "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2557}\x{20}", "\x{2588}\x{2588}\x{2554}\x{2550}\x{2550}\x{2588}\x{2588}\x{2557}", "\x{255A}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2551}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2588}\x{2588}\x{2551}", "\x{20}\x{2588}\x{2588}\x{2588}\x{2588}\x{2588}\x{2554}\x{255D}", "\x{20}\x{255A}\x{2550}\x{2550}\x{2550}\x{2550}\x{255D}\x{20}" ],
|
||||
);
|
||||
|
||||
sub print_big_ascii_string {
|
||||
my $fh = shift;
|
||||
my $str = shift;
|
||||
my $comment = shift;
|
||||
my $lowascii = shift;
|
||||
$comment = '' if not defined $comment;
|
||||
$lowascii = 0 if not defined $lowascii;
|
||||
|
||||
my @chars = split //, $str;
|
||||
my $charcount = scalar(@chars);
|
||||
|
||||
binmode($fh, ":utf8");
|
||||
|
||||
my $maxrows = $lowascii ? 5 : 6;
|
||||
|
||||
for(my $rownum = 0; $rownum < $maxrows; $rownum++){
|
||||
print $fh $comment;
|
||||
my $charidx = 0;
|
||||
foreach my $ch (@chars) {
|
||||
my $rowsref = $big_ascii{uc($ch)};
|
||||
die("Don't have a big ascii entry for '$ch'!\n") if not defined $rowsref;
|
||||
my $row = @$rowsref[$rownum];
|
||||
|
||||
if ($lowascii) {
|
||||
my @x = split //, $row;
|
||||
foreach (@x) {
|
||||
my $v = ($_ eq "\x{2588}") ? 'X' : ' ';
|
||||
print $fh $v;
|
||||
}
|
||||
} else {
|
||||
print $fh $row;
|
||||
}
|
||||
|
||||
$charidx++;
|
||||
|
||||
if ($charidx < $charcount) {
|
||||
print $fh " ";
|
||||
}
|
||||
}
|
||||
print $fh "\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub generate_quickref {
|
||||
my $briefsref = shift;
|
||||
my $path = shift;
|
||||
my $lowascii = shift;
|
||||
|
||||
# !!! FIXME: this gitrev and majorver/etc stuff is copy/pasted a few times now.
|
||||
if (!$gitrev) {
|
||||
$gitrev = `cd "$srcpath" ; git rev-list HEAD~..`;
|
||||
chomp($gitrev);
|
||||
}
|
||||
|
||||
# !!! FIXME
|
||||
open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n");
|
||||
my $majorver = 0;
|
||||
my $minorver = 0;
|
||||
my $microver = 0;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
if (/$versionmajorregex/) {
|
||||
$majorver = int($1);
|
||||
} elsif (/$versionminorregex/) {
|
||||
$minorver = int($1);
|
||||
} elsif (/$versionmicroregex/) {
|
||||
$microver = int($1);
|
||||
}
|
||||
}
|
||||
close(FH);
|
||||
my $fullversion = "$majorver.$minorver.$microver";
|
||||
|
||||
my $tmppath = "$path.tmp";
|
||||
open(my $fh, '>', $tmppath) or die("Can't open '$tmppath': $!\n");
|
||||
|
||||
if (not @quickrefcategoryorder) {
|
||||
@quickrefcategoryorder = sort keys %headercategorydocs;
|
||||
}
|
||||
|
||||
#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
|
||||
#my $datestr = sprintf("%04d-%02d-%02d %02d:%02d:%02d GMT", $year+1900, $mon+1, $mday, $hour, $min, $sec);
|
||||
|
||||
print $fh "<!-- DO NOT EDIT THIS PAGE ON THE WIKI. IT WILL BE OVERWRITTEN BY WIKIHEADERS AND CHANGES WILL BE LOST! -->\n\n";
|
||||
|
||||
# Just something to test big_ascii output.
|
||||
#print_big_ascii_string($fh, "ABCDEFGHIJ", '', $lowascii);
|
||||
#print_big_ascii_string($fh, "KLMNOPQRST", '', $lowascii);
|
||||
#print_big_ascii_string($fh, "UVWXYZ0123", '', $lowascii);
|
||||
#print_big_ascii_string($fh, "456789JT3A", '', $lowascii);
|
||||
#print_big_ascii_string($fh, "hello, _a.b/c_!!", '', $lowascii);
|
||||
|
||||
# Dan Bechard's work was on an SDL2 cheatsheet:
|
||||
# https://blog.theprogrammingjunkie.com/post/sdl2-cheatsheet/
|
||||
|
||||
if ($lowascii) {
|
||||
print $fh "# QuickReferenceNoUnicode\n\n";
|
||||
print $fh "If you want to paste this into a text editor that can handle\n";
|
||||
print $fh "fancy Unicode section headers, try using\n";
|
||||
print $fh "[QuickReference](QuickReference) instead.\n\n";
|
||||
} else {
|
||||
print $fh "# QuickReference\n\n";
|
||||
print $fh "If you want to paste this into a text editor that can't handle\n";
|
||||
print $fh "the fancy Unicode section headers, try using\n";
|
||||
print $fh "[QuickReferenceNoUnicode](QuickReferenceNoUnicode) instead.\n\n";
|
||||
}
|
||||
|
||||
print $fh "```c\n";
|
||||
print $fh "// $quickreftitle\n" if defined $quickreftitle;
|
||||
print $fh "//\n";
|
||||
print $fh "// $quickrefurl\n//\n" if defined $quickrefurl;
|
||||
print $fh "// $quickrefdesc\n" if defined $quickrefdesc;
|
||||
#print $fh "// When this document was written: $datestr\n";
|
||||
print $fh "// Based on $projectshortname version $fullversion\n";
|
||||
#print $fh "// git revision $gitrev\n";
|
||||
print $fh "//\n";
|
||||
print $fh "// This can be useful in an IDE with search and syntax highlighting.\n";
|
||||
print $fh "//\n";
|
||||
print $fh "// Original idea for this document came from Dan Bechard (thanks!)\n";
|
||||
print $fh "// ASCII art generated by: https://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow (with modified 'S' for readability)\n\n";
|
||||
|
||||
foreach (@quickrefcategoryorder) {
|
||||
my $cat = $_;
|
||||
my $maxlen = 0;
|
||||
my @csigs = ();
|
||||
my $funcorderref = $quickreffuncorder{$cat};
|
||||
next if not defined $funcorderref;
|
||||
|
||||
foreach (@$funcorderref) {
|
||||
my $sym = $_;
|
||||
my $csig = '';
|
||||
|
||||
if ($headersymstype{$sym} == 1) { # function
|
||||
$csig = "${headersymsrettype{$sym}} $sym";
|
||||
my $fnsigparams = $headersymsparaminfo{$sym};
|
||||
if (not defined($fnsigparams)) {
|
||||
$csig .= '(void);';
|
||||
} else {
|
||||
my $sep = '(';
|
||||
for (my $i = 0; $i < scalar(@$fnsigparams); $i += 2) {
|
||||
my $paramname = @$fnsigparams[$i];
|
||||
my $paramtype = @$fnsigparams[$i+1];
|
||||
my $spc = ($paramtype =~ /\*\Z/) ? '' : ' ';
|
||||
$csig .= "$sep$paramtype$spc$paramname";
|
||||
$sep = ', ';
|
||||
}
|
||||
$csig .= ");";
|
||||
}
|
||||
} elsif ($headersymstype{$sym} == 2) { # macro
|
||||
next if defined $quickrefmacroregex && not $sym =~ /$quickrefmacroregex/;
|
||||
|
||||
$csig = (split /\n/, $headerdecls{$sym})[0]; # get the first line from a multiline string.
|
||||
if (not $csig =~ s/\A(\#define [a-zA-Z0-9_]*\(.*?\))(\s+.*)?\Z/$1/) {
|
||||
$csig =~ s/\A(\#define [a-zA-Z0-9_]*)(\s+.*)?\Z/$1/;
|
||||
}
|
||||
chomp($csig);
|
||||
}
|
||||
|
||||
my $len = length($csig);
|
||||
$maxlen = $len if $len > $maxlen;
|
||||
|
||||
push @csigs, $sym;
|
||||
push @csigs, $csig;
|
||||
}
|
||||
|
||||
$maxlen += 2;
|
||||
|
||||
next if (not @csigs);
|
||||
|
||||
print $fh "\n";
|
||||
print_big_ascii_string($fh, $cat, '// ', $lowascii);
|
||||
print $fh "\n";
|
||||
|
||||
while (@csigs) {
|
||||
my $sym = shift @csigs;
|
||||
my $csig = shift @csigs;
|
||||
my $brief = $$briefsref{$sym};
|
||||
if (defined $brief) {
|
||||
$brief = "$brief";
|
||||
chomp($brief);
|
||||
my $thiswikitype = defined $wikitypes{$sym} ? $wikitypes{$sym} : 'md'; # default to MarkDown for new stuff.
|
||||
$brief = dewikify($thiswikitype, $brief);
|
||||
my $spaces = ' ' x ($maxlen - length($csig));
|
||||
$brief = "$spaces// $brief";
|
||||
} else {
|
||||
$brief = '';
|
||||
}
|
||||
print $fh "$csig$brief\n";
|
||||
}
|
||||
}
|
||||
|
||||
print $fh "```\n\n";
|
||||
|
||||
close($fh);
|
||||
|
||||
# # Don't overwrite the file if nothing has changed besides the timestamp
|
||||
# # and git revision.
|
||||
# my $matches = 1;
|
||||
# if ( not -f $path ) {
|
||||
# $matches = 0; # always write if the file hasn't been created yet.
|
||||
# } else {
|
||||
# open(my $fh_a, '<', $tmppath) or die("Can't open '$tmppath': $!\n");
|
||||
# open(my $fh_b, '<', $path) or die("Can't open '$path': $!\n");
|
||||
# while (1) {
|
||||
# my $a = <$fh_a>;
|
||||
# my $b = <$fh_b>;
|
||||
# $matches = 0, last if ((not defined $a) != (not defined $b));
|
||||
# last if ((not defined $a) || (not defined $b));
|
||||
# if ($a ne $b) {
|
||||
# next if ($a =~ /\A\/\/ When this document was written:/);
|
||||
# next if ($a =~ /\A\/\/ git revision /);
|
||||
# $matches = 0;
|
||||
# last;
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# close($fh_a);
|
||||
# close($fh_b);
|
||||
# }
|
||||
#
|
||||
# if ($matches) {
|
||||
# unlink($tmppath); # it's the same file except maybe the date/gitrev. Don't overwrite it.
|
||||
# } else {
|
||||
# rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n");
|
||||
# }
|
||||
rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n");
|
||||
}
|
||||
|
||||
|
||||
my $incpath = "$srcpath";
|
||||
$incpath .= "/$incsubdir" if $incsubdir ne '';
|
||||
|
||||
@@ -749,10 +1035,12 @@ while (my $d = readdir(DH)) {
|
||||
}
|
||||
|
||||
my @contents = ();
|
||||
my @function_order = ();
|
||||
my $ignoring_lines = 0;
|
||||
my $header_comment = -1;
|
||||
my $saw_category_doxygen = -1;
|
||||
my $lineno = 0;
|
||||
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
$lineno++;
|
||||
@@ -1073,7 +1361,6 @@ while (my $d = readdir(DH)) {
|
||||
}
|
||||
}
|
||||
$decl .= $additional_decl;
|
||||
|
||||
} elsif ($symtype == 2) { # a macro
|
||||
if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)\s+/) {
|
||||
$sym = $1;
|
||||
@@ -1301,6 +1588,7 @@ while (my $d = readdir(DH)) {
|
||||
$headersymstype{$sym} = $symtype;
|
||||
$headersymsparaminfo{$sym} = \@paraminfo if (scalar(@paraminfo) > 0);
|
||||
$headersymsrettype{$sym} = $rettype if (defined($rettype));
|
||||
push @function_order, $sym if ($symtype == 1) || ($symtype == 2);
|
||||
push @contents, join("\n", @templines);
|
||||
push @contents, join("\n", @decllines) if (scalar(@decllines) > 0);
|
||||
}
|
||||
@@ -1309,6 +1597,7 @@ while (my $d = readdir(DH)) {
|
||||
close(FH);
|
||||
|
||||
$headers{$dent} = \@contents;
|
||||
$quickreffuncorder{$current_wiki_category} = \@function_order if defined $current_wiki_category;
|
||||
}
|
||||
closedir(DH);
|
||||
|
||||
@@ -1785,6 +2074,8 @@ if ($copy_direction == 1) { # --copy-to-headers
|
||||
|
||||
} elsif ($copy_direction == -1) { # --copy-to-wiki
|
||||
|
||||
my %briefs = (); # $briefs{'SDL_OpenAudio'} -> the \brief string for the function.
|
||||
|
||||
if (defined $changeformat) {
|
||||
$dewikify_mode = $changeformat;
|
||||
$wordwrap_mode = $changeformat;
|
||||
@@ -1856,6 +2147,8 @@ if ($copy_direction == 1) { # --copy-to-headers
|
||||
$sections{'Remarks'} = "$remarks\n" if $remarks ne '';
|
||||
$sections{'Syntax'} = $syntax;
|
||||
|
||||
$briefs{$sym} = $brief;
|
||||
|
||||
my %params = (); # have to parse these and build up the wiki tables after, since Markdown needs to know the length of the largest string. :/
|
||||
my @paramsorder = ();
|
||||
my $fnsigparams = $headersymsparaminfo{$sym};
|
||||
@@ -2415,6 +2708,11 @@ __EOF__
|
||||
}
|
||||
}
|
||||
|
||||
# Write out quick reference pages...
|
||||
if ($quickrefenabled) {
|
||||
generate_quickref(\%briefs, "$wikipath/QuickReference.md", 0);
|
||||
generate_quickref(\%briefs, "$wikipath/QuickReferenceNoUnicode.md", 1);
|
||||
}
|
||||
} elsif ($copy_direction == -2) { # --copy-to-manpages
|
||||
# This only takes from the wiki data, since it has sections we omit from the headers, like code examples.
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ This module will set the following variables in your project:
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
cmake_minimum_required(VERSION 3.7...3.28)
|
||||
|
||||
if(NOT PROJECT_NAME MATCHES "^SDL.*")
|
||||
message(WARNING "This module is internal to SDL and is currently not supported.")
|
||||
|
||||
@@ -52,7 +52,7 @@ This module responds to the flags:
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
cmake_minimum_required(VERSION 3.7...3.28)
|
||||
|
||||
if(NOT PROJECT_NAME MATCHES "^SDL.*")
|
||||
message(WARNING "This module is internal to SDL and is currently not supported.")
|
||||
|
||||
@@ -55,7 +55,7 @@ This module responds to the flags:
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
cmake_minimum_required(VERSION 3.7...3.28)
|
||||
|
||||
if(NOT PROJECT_NAME MATCHES "^SDL.*")
|
||||
message(WARNING "This module is internal to SDL and is currently not supported.")
|
||||
|
||||
@@ -5,7 +5,7 @@ It is (currently) limited to packaging binaries for a single architecture.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
cmake_minimum_required(VERSION 3.7...3.28)
|
||||
|
||||
if(NOT PROJECT_NAME MATCHES "^SDL.*")
|
||||
message(WARNING "This module is internal to SDL and is currently not supported.")
|
||||
|
||||
@@ -6,7 +6,7 @@ Because
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
cmake_minimum_required(VERSION 3.16...3.28)
|
||||
|
||||
if(NOT CMAKE_SCRIPT_MODE_FILE)
|
||||
message(FATAL_ERROR "This file can only be used in CMake script mode")
|
||||
|
||||
@@ -307,15 +307,13 @@ macro(CheckX11)
|
||||
find_file(HAVE_XRANDR_H NAMES "X11/extensions/Xrandr.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XFIXES_H_ NAMES "X11/extensions/Xfixes.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XRENDER_H NAMES "X11/extensions/Xrender.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XSYNC_H NAMES "X11/extensions/sync.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XSS_H NAMES "X11/extensions/scrnsaver.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XSHAPE_H NAMES "X11/extensions/shape.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XDBE_H NAMES "X11/extensions/Xdbe.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XEXT_H NAMES "X11/extensions/Xext.h" HINTS "${X11_INCLUDEDIR}")
|
||||
|
||||
if(X11_LIB)
|
||||
if(NOT HAVE_XEXT_H)
|
||||
message(FATAL_ERROR "Missing Xext.h, maybe you need to install the libxext-dev package?")
|
||||
endif()
|
||||
if(X11_LIB AND HAVE_XEXT_H)
|
||||
|
||||
set(HAVE_X11 TRUE)
|
||||
set(HAVE_SDL_VIDEO TRUE)
|
||||
@@ -445,6 +443,11 @@ macro(CheckX11)
|
||||
set(HAVE_X11_XFIXES TRUE)
|
||||
endif()
|
||||
|
||||
if(SDL_X11_XSYNC AND HAVE_XSYNC_H AND XEXT_LIB)
|
||||
set(SDL_VIDEO_DRIVER_X11_XSYNC 1)
|
||||
set(HAVE_X11_XSYNC TRUE)
|
||||
endif()
|
||||
|
||||
if(SDL_X11_XRANDR AND HAVE_XRANDR_H AND XRANDR_LIB)
|
||||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
|
||||
@@ -623,6 +626,7 @@ macro(CheckCOCOA)
|
||||
endif()
|
||||
if(HAVE_COCOA)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/cocoa/*.m")
|
||||
set(SDL_FRAMEWORK_IOKIT 1)
|
||||
set(SDL_VIDEO_DRIVER_COCOA 1)
|
||||
set(HAVE_SDL_VIDEO TRUE)
|
||||
endif()
|
||||
@@ -816,7 +820,11 @@ macro(CheckPTHREAD)
|
||||
set(PTHREAD_LDFLAGS "-lpthread")
|
||||
elseif(SOLARIS)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
||||
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
||||
else()
|
||||
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
||||
endif()
|
||||
elseif(SYSV5)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
||||
set(PTHREAD_LDFLAGS "")
|
||||
|
||||
@@ -34,7 +34,7 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
cmake_push_check_state()
|
||||
check_c_compiler_flag("/W3" COMPILER_SUPPORTS_W3)
|
||||
if(COMPILER_SUPPORTS_W3)
|
||||
target_compile_options(${TARGET} PRIVATE "/W3")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:/W3>")
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
@@ -131,7 +131,7 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
if(MSVC)
|
||||
check_c_compiler_flag(/WX HAVE_WX)
|
||||
if(HAVE_WX)
|
||||
target_compile_options(${TARGET} PRIVATE "/WX")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:/WX>")
|
||||
endif()
|
||||
elseif(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QNX)
|
||||
check_c_compiler_flag(-Werror HAVE_WERROR)
|
||||
|
||||
@@ -61,8 +61,8 @@ const char *arch_${known_arch} = \"INFO<${known_arch}=\" ARCH_${known_arch} \">\
|
||||
|
||||
set(src_arch_detect "${src_vars}
|
||||
int main(int argc, char *argv[]) {
|
||||
(void)argv;
|
||||
int result = 0;
|
||||
(void)argv;
|
||||
${src_main}
|
||||
return result;
|
||||
}")
|
||||
|
||||
@@ -338,13 +338,17 @@ function(configure_sdl3_pc)
|
||||
message(STATUS "\"pkg-config --static --libs sdl3\" will return invalid information")
|
||||
endif()
|
||||
|
||||
# Calculate prefix relative to location of sdl3.pc
|
||||
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
|
||||
if(SDL_RELOCATABLE)
|
||||
# Calculate prefix relative to location of sdl3.pc
|
||||
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
file(RELATIVE_PATH SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/${SDL_PKGCONFIG_INSTALLDIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||
string(REGEX REPLACE "[/]+$" "" SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
set(SDL_PKGCONFIG_PREFIX "\${pcfiledir}/${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
else()
|
||||
set(SDL_PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
file(RELATIVE_PATH SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/${SDL_PKGCONFIG_INSTALLDIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||
string(REGEX REPLACE "[/]+$" "" SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
set(SDL_PKGCONFIG_PREFIX "\${pcfiledir}/${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
|
||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(INCLUDEDIR_FOR_PKG_CONFIG "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
@@ -10,7 +10,7 @@ The rest of this README covers the Android gradle style build process.
|
||||
Requirements
|
||||
================================================================================
|
||||
|
||||
Android SDK (version 34 or later)
|
||||
Android SDK (version 35 or later)
|
||||
https://developer.android.com/sdk/index.html
|
||||
|
||||
Android NDK r15c or later
|
||||
@@ -37,7 +37,7 @@ dispatches to native functions implemented in the SDL library:
|
||||
src/core/android/SDL_android.c
|
||||
|
||||
|
||||
Building an app
|
||||
Building a simple app
|
||||
================================================================================
|
||||
|
||||
For simple projects you can use the script located at build-scripts/create-android-project.py
|
||||
@@ -67,40 +67,38 @@ Finally, a word of caution: re running create-android-project.py wipes any chang
|
||||
done in the build directory for the app!
|
||||
|
||||
|
||||
Building a more complex app
|
||||
================================================================================
|
||||
|
||||
For more complex projects, follow these instructions:
|
||||
|
||||
1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT).
|
||||
1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location in your project.
|
||||
|
||||
(The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.)
|
||||
The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.
|
||||
|
||||
2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory
|
||||
2. If you are _not_ already building SDL as a part of your project (e.g. via CMake add_subdirectory() or FetchContent) move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the 'android-project/app/jni' directory. Alternatively you can [use the SDL3 Android Archive (.aar)](#using-the-sdl3-android-archive-aar), see bellow for more details.
|
||||
|
||||
(This is needed as the source of SDL has to be compiled by the Android compiler)
|
||||
This is needed as SDL has to be compiled by the Android compiler.
|
||||
|
||||
3. Edit "YOURPROJECT/app/jni/src/Android.mk" to include your source files.
|
||||
3. Edit 'android-project/app/build.gradle' to include any assets that your app needs by adding 'assets.srcDirs' in 'sourceSets.main'.
|
||||
|
||||
(They should be separated by spaces after the "LOCAL_SRC_FILES := " declaration)
|
||||
For example: `assets.srcDirs = ['../../assets', '../../shaders']`
|
||||
|
||||
4a. If you want to use Android Studio, simply open your 'YOURPROJECT' directory and start building.
|
||||
If using CMake:
|
||||
|
||||
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
|
||||
4. Edit 'android-project/app/build.gradle' to set 'buildWithCMake' to true and set 'externalNativeBuild' cmake path to your top level CMakeLists.txt.
|
||||
|
||||
For example: `path '../../CMakeLists.txt'`
|
||||
|
||||
If you already have a project that uses CMake, the instructions change somewhat:
|
||||
5. Change the target containing your main function to be built as a shared library called "main" when compiling for Android. (e.g. add_executable(MyGame main.c) should become add_library(main SHARED main.c) on Android)
|
||||
|
||||
1. Do points 1 and 2 from the instruction above.
|
||||
2. Edit "YOURPROJECT/app/build.gradle" to comment out or remove sections containing ndk-build
|
||||
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
|
||||
3. Edit "YOURPROJECT/app/jni/CMakeLists.txt" to include your project (it defaults to
|
||||
adding the "src" subdirectory). Note that you'll have SDL3 and SDL3-static
|
||||
as targets in your project, so you should have "target_link_libraries(yourgame SDL3)"
|
||||
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
|
||||
add_executable() for the target containing your "main" function.
|
||||
If using Android Makefiles:
|
||||
|
||||
If you wish to use Android Studio, you can skip the last step.
|
||||
4. Edit 'android-project/app/jni/src/Android.mk' to include your source files. They should be separated by spaces after the 'LOCAL_SRC_FILES := ' declaration.
|
||||
|
||||
4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any
|
||||
connected Android device
|
||||
To build your app, run `./gradlew installDebug` or `./gradlew installRelease` in the project directory. It will build and install your .apk on any connected Android device. If you want to use Android Studio, simply open your 'android-project' directory and start building.
|
||||
|
||||
Additionally the [SDL_helloworld](https://github.com/libsdl-org/SDL_helloworld) project contains a small example program with a functional Android port that you can use as a reference.
|
||||
|
||||
Here's an explanation of the files in the Android project, so you can customize them:
|
||||
|
||||
@@ -170,13 +168,13 @@ build-scripts/create-android-project.py --variant aar com.yourcompany.yourapp <
|
||||
Customizing your application name
|
||||
================================================================================
|
||||
|
||||
To customize your application name, edit AndroidManifest.xml and replace
|
||||
To customize your application name, edit AndroidManifest.xml and build.gradle to replace
|
||||
"org.libsdl.app" with an identifier for your product package.
|
||||
|
||||
Then create a Java class extending SDLActivity and place it in a directory
|
||||
under src matching your package, e.g.
|
||||
|
||||
src/com/gamemaker/game/MyGame.java
|
||||
app/src/main/java/com/gamemaker/game/MyGame.java
|
||||
|
||||
Here's an example of a minimal class file:
|
||||
|
||||
@@ -316,6 +314,17 @@ You can control activity re-creation (eg. onCreate()) behaviour. This allows you
|
||||
to choose whether to keep or re-initialize java and native static datas, see
|
||||
SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY in SDL_hints.h.
|
||||
|
||||
|
||||
Insets and Safe Areas
|
||||
================================================================================
|
||||
|
||||
As of Android 15, SDL windows cover the entire screen, extending under notches
|
||||
and system bars. The OS expects you to take those into account when displaying
|
||||
content and SDL provides the function SDL_GetWindowSafeArea() so you know what
|
||||
area is available for interaction. Outside of the safe area can be potentially
|
||||
covered by system bars or used by OS gestures.
|
||||
|
||||
|
||||
Mouse / Touch events
|
||||
================================================================================
|
||||
|
||||
@@ -325,6 +334,7 @@ To enable/disable this behavior, see SDL_hints.h:
|
||||
- SDL_HINT_TOUCH_MOUSE_EVENTS
|
||||
- SDL_HINT_MOUSE_TOUCH_EVENTS
|
||||
|
||||
|
||||
Misc
|
||||
================================================================================
|
||||
|
||||
@@ -334,6 +344,7 @@ before creating a window:
|
||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
|
||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
|
||||
|
||||
|
||||
Threads and the Java VM
|
||||
================================================================================
|
||||
|
||||
@@ -359,6 +370,7 @@ in your native thread.
|
||||
see:
|
||||
https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
|
||||
|
||||
|
||||
Using STL
|
||||
================================================================================
|
||||
|
||||
@@ -526,15 +538,6 @@ The Tegra Graphics Debugger is available from NVidia here:
|
||||
https://developer.nvidia.com/tegra-graphics-debugger
|
||||
|
||||
|
||||
Why is API level 19 the minimum required?
|
||||
================================================================================
|
||||
|
||||
The latest NDK toolchain doesn't support targeting earlier than API level 19.
|
||||
As of this writing, according to https://www.composables.com/tools/distribution-chart
|
||||
about 99.7% of the Android devices accessing Google Play support API level 19 or
|
||||
higher (August 2023).
|
||||
|
||||
|
||||
A note regarding the use of the "dirty rectangles" rendering technique
|
||||
================================================================================
|
||||
|
||||
@@ -545,12 +548,6 @@ This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
|
||||
contexts, in particular the use of the eglSwapBuffers function. As stated in the
|
||||
documentation for the function "The contents of ancillary buffers are always
|
||||
undefined after calling eglSwapBuffers".
|
||||
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
|
||||
is not possible for SDL as it requires EGL 1.4, available only on the API level
|
||||
17+, so the only workaround available on this platform is to redraw the entire
|
||||
screen each frame.
|
||||
|
||||
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
|
||||
|
||||
|
||||
Ending your application
|
||||
@@ -570,12 +567,14 @@ Don't call exit() as it stops the activity badly.
|
||||
NB: "Back button" can be handled as a SDL_EVENT_KEY_DOWN/UP events, with Keycode
|
||||
SDLK_AC_BACK, for any purpose.
|
||||
|
||||
|
||||
Known issues
|
||||
================================================================================
|
||||
|
||||
- The number of buttons reported for each joystick is hardcoded to be 36, which
|
||||
is the current maximum number of buttons Android can report.
|
||||
|
||||
|
||||
Building the SDL tests
|
||||
================================================================================
|
||||
|
||||
@@ -651,4 +650,4 @@ There is also a convenience target which will build, install and start a test:
|
||||
cmake --build . --target build-install-start-testsprite
|
||||
```
|
||||
|
||||
Not all tests provide a GUI. For those, you can use `adb logcat` to read the output of stdout.
|
||||
Not all tests provide a GUI. For those, you can use `adb logcat` to read the output.
|
||||
|
||||
@@ -242,6 +242,15 @@ wikiheaders will complain loudly if you don't do this, and exit with an
|
||||
error message.
|
||||
|
||||
|
||||
## Don't repeat type names in `\param` and `\returns` sections.
|
||||
|
||||
Wikiheaders will explicitly mention the datatype for each parameter and the
|
||||
return value, linking to the datatype's wikipage. Users reading the headers
|
||||
can see the types in the function signature right below the documentation
|
||||
comment. So don't mention the type a second time in the documentation if
|
||||
possible. It looks cluttered and repetitive to do so.
|
||||
|
||||
|
||||
## Code examples go in the wiki.
|
||||
|
||||
We don't want the headers cluttered up with code examples. These live on the
|
||||
|
||||
@@ -146,18 +146,9 @@ From iOS 17 onward, the key now defaults to true.
|
||||
Notes -- Reading and Writing files
|
||||
==============================================================================
|
||||
|
||||
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
||||
Each application installed on iPhone resides in a sandbox which includes its own application home directory. Your application may not access files outside this directory.
|
||||
|
||||
Once your application is installed its directory tree looks like:
|
||||
|
||||
MySDLApp Home/
|
||||
MySDLApp.app
|
||||
Documents/
|
||||
Library/
|
||||
Preferences/
|
||||
tmp/
|
||||
|
||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle, where your application resources are stored. You cannot write to this directory. Instead, you should write document files to the directory returned by SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS) and preferences to the directory returned by SDL_GetPrefPath().
|
||||
|
||||
More information on this subject is available here:
|
||||
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
||||
@@ -176,7 +167,7 @@ This target requires Xcode 11 or later. The target will simply fail to build if
|
||||
|
||||
In addition, on Apple platforms, main() cannot be in a dynamically loaded library.
|
||||
However, unlike in SDL2, in SDL3 SDL_main is implemented inline in SDL_main.h, so you don't need to link against a static libSDL3main.lib, and you don't need to copy a .c file from the SDL3 source either.
|
||||
This means that iOS apps which used the statically-linked libSDL3.lib and now link with the xcframwork can just `#include <SDL3/SDL_main.h>` in the source file that contains their standard `int main(int argc; char *argv[])` function to get a header-only SDL_main implementation that calls the `SDL_RunApp()` with your standard main function.
|
||||
This means that iOS apps which used the statically-linked libSDL3.lib and now link with the xcframwork can just `#include <SDL3/SDL_main.h>` in the source file that contains their standard `int main(int argc, char *argv[])` function to get a header-only SDL_main implementation that calls the `SDL_RunApp()` with your standard main function.
|
||||
|
||||
Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected:
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Ubuntu 18.04, all available features enabled:
|
||||
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
|
||||
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
||||
|
||||
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libwayland-dev libdecor-0-dev` to that command line.
|
||||
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev` to that command line.
|
||||
|
||||
Fedora 35, all available features enabled:
|
||||
|
||||
@@ -34,6 +34,8 @@ Fedora 35, all available features enabled:
|
||||
libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \
|
||||
pipewire-jack-audio-connection-kit-devel \
|
||||
|
||||
Fedora 39+ can also add `liburing-devel` to that command line.
|
||||
|
||||
NOTES:
|
||||
- The sndio audio target is unavailable on Fedora (but probably not what you
|
||||
should want to use anyhow).
|
||||
|
||||
@@ -204,3 +204,33 @@ data, as this pointer will not be provided to your app again.
|
||||
|
||||
The SDL_AppResult value that terminated the app is provided here, in case
|
||||
it's useful to know if this was a successful or failing run of the app.
|
||||
|
||||
|
||||
## Summary and Best Practices
|
||||
|
||||
- **Always Include SDL_main.h in One Source File:** When working with SDL,
|
||||
remember that SDL_main.h must only be included in one source file in your
|
||||
project. Including it in multiple files will lead to conflicts and undefined
|
||||
behavior.
|
||||
|
||||
- **Avoid Redefining main:** If you're using SDL's entry point system (which
|
||||
renames `main` to `SDL_main`), do not define `main` yourself. SDL takes care
|
||||
of this for you, and redefining it can cause issues, especially when linking
|
||||
with SDL libraries.
|
||||
|
||||
- **Using SDL's Callback System:** If you're working with more complex
|
||||
scenarios, such as requiring more control over your application's flow
|
||||
(e.g., with games or apps that need extensive event handling), consider
|
||||
using SDL's callback system. Define the necessary callbacks and SDL will
|
||||
handle initialization, event processing, and cleanup automatically.
|
||||
|
||||
- **Platform-Specific Considerations:** On platforms like Windows, SDL handles
|
||||
the platform-specific entry point (like `WinMain`) automatically. This means
|
||||
you don't need to worry about writing platform-specific entry code when
|
||||
using SDL.
|
||||
|
||||
- **When to Skip SDL_main.h:** If you do not require SDL's custom entry point
|
||||
(for example, if you're integrating SDL into an existing application or a
|
||||
scripting environment), you can omit SDL_main.h. However, this will limit
|
||||
SDL's ability to abstract away platform-specific entry point details.
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ SDL_AudioDeviceID now represents both an open audio device's handle (a "logical"
|
||||
|
||||
Devices are opened by physical device instance ID, and a new logical instance ID is generated by the open operation; This allows any device to be opened multiple times, possibly by unrelated pieces of code. SDL will manage the logical devices to provide a single stream of audio to the physical device behind the scenes.
|
||||
|
||||
Devices are not opened by an arbitrary string name anymore, but by device instance ID (or magic numbers to request a reasonable default, like a NULL string in SDL2). In SDL2, the string was used to open both a standard list of system devices, but also allowed for arbitrary devices, such as hostnames of network sound servers. In SDL3, many of the backends that supported arbitrary device names are obsolete and have been removed; of those that remain, arbitrary devices will be opened with a default device ID and an SDL_hint, so specific end-users can set an environment variable to fit their needs and apps don't have to concern themselves with it.
|
||||
Devices are not opened by an arbitrary string name anymore, but by device instance ID (or magic numbers to request a reasonable default, like a NULL string would do in SDL2). In SDL2, the string was used to open both a standard list of system devices, but also allowed for arbitrary devices, such as hostnames of network sound servers. In SDL3, many of the backends that supported arbitrary device names are obsolete and have been removed; of those that remain, arbitrary devices will be opened with a default device ID and an SDL_hint, so specific end-users can set an environment variable to fit their needs and apps don't have to concern themselves with it.
|
||||
|
||||
Many functions that would accept a device index and an `iscapture` parameter now just take an SDL_AudioDeviceID, as they are unique across all devices, instead of separate indices into playback and recording device lists.
|
||||
|
||||
@@ -214,7 +214,7 @@ SDL_QueueAudio(), SDL_DequeueAudio, and SDL_ClearQueuedAudio and SDL_GetQueuedAu
|
||||
|
||||
APIs that use channel counts used to use a Uint8 for the channel; now they use int.
|
||||
|
||||
SDL_AudioSpec has been reduced; now it only holds format, channel, and sample rate. SDL_GetSilenceValueForFormat() can provide the information from the SDL_AudioSpec's `silence` field. The other SDL2 SDL_AudioSpec fields aren't relevant anymore.
|
||||
SDL_AudioSpec has been reduced; now it only holds format, channel, and sample rate. SDL_GetSilenceValueForFormat() can provide the information from the SDL_AudioSpec's removed `silence` field. SDL3 now manages the removed `samples` field; apps that want more control over device latency and throughput can force a newly-opened device's sample count with the SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES hint, but most apps should not risk messing with the defaults. The other SDL2 SDL_AudioSpec fields aren't relevant anymore.
|
||||
|
||||
SDL_GetAudioDeviceSpec() is removed; use SDL_GetAudioDeviceFormat() instead.
|
||||
|
||||
@@ -399,8 +399,6 @@ should be changed to:
|
||||
SDL_Keymod mod = event.key.mod;
|
||||
```
|
||||
|
||||
The keycode in key events is affected by modifiers by default. e.g. pressing the A key would generate the keycode `SDLK_A`, or 'a', and pressing it while holding the shift key would generate the keycode `SDLK_A`, or 'A'. This behavior can be customized with `SDL_HINT_KEYCODE_OPTIONS`.
|
||||
|
||||
The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor.
|
||||
|
||||
The mouseX and mouseY fields of SDL_MouseWheelEvent have been renamed mouse_x and mouse_y.
|
||||
@@ -805,27 +803,31 @@ The environment variables SDL_VIDEO_X11_WMCLASS and SDL_VIDEO_WAYLAND_WMCLASS ha
|
||||
The environment variable AUDIODEV is used exclusively to specify the audio device for the OSS and NetBSD audio drivers. Its use in the ALSA driver has been replaced with the hint SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE and in the sndio driver with the environment variable AUDIODEVICE.
|
||||
|
||||
The following hints have been renamed:
|
||||
* SDL_HINT_VIDEODRIVER => SDL_HINT_VIDEO_DRIVER
|
||||
* SDL_HINT_AUDIODRIVER => SDL_HINT_AUDIO_DRIVER
|
||||
* SDL_HINT_ALLOW_TOPMOST => SDL_HINT_WINDOW_ALLOW_TOPMOST
|
||||
* SDL_HINT_AUDIODRIVER => SDL_HINT_AUDIO_DRIVER
|
||||
* SDL_HINT_DIRECTINPUT_ENABLED => SDL_HINT_JOYSTICK_DIRECTINPUT
|
||||
* SDL_HINT_GDK_TEXTINPUT_DEFAULT => SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
|
||||
* SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE
|
||||
* SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => SDL_HINT_JOYSTICK_ENHANCED_REPORTS
|
||||
* SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => SDL_HINT_JOYSTICK_ENHANCED_REPORTS
|
||||
* SDL_HINT_LINUX_DIGITAL_HATS => SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS
|
||||
* SDL_HINT_LINUX_HAT_DEADZONES => SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
|
||||
* SDL_HINT_LINUX_JOYSTICK_CLASSIC => SDL_HINT_JOYSTICK_LINUX_CLASSIC
|
||||
* SDL_HINT_LINUX_JOYSTICK_DEADZONES => SDL_HINT_JOYSTICK_LINUX_DEADZONES
|
||||
* SDL_HINT_VIDEODRIVER => SDL_HINT_VIDEO_DRIVER
|
||||
* SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE
|
||||
|
||||
The following hints have been removed:
|
||||
* SDL_HINT_ACCELEROMETER_AS_JOYSTICK
|
||||
* SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO - the audio will be paused when the application is paused, and SDL_HINT_ANDROID_BLOCK_ON_PAUSE can be used to control that
|
||||
* SDL_HINT_AUDIO_DEVICE_APP_NAME - replaced by either using the appname param to SDL_SetAppMetadata() or setting SDL_PROP_APP_METADATA_NAME_STRING with SDL_SetAppMetadataProperty()
|
||||
* SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS - gamepad buttons are always positional
|
||||
* SDL_HINT_GRAB_KEYBOARD - use SDL_SetWindowKeyboardGrab() instead
|
||||
* SDL_HINT_IDLE_TIMER_DISABLED - use SDL_DisableScreenSaver() instead
|
||||
* SDL_HINT_IME_INTERNAL_EDITING - replaced with SDL_HINT_IME_IMPLEMENTED_UI
|
||||
* SDL_HINT_IME_SHOW_UI - replaced with SDL_HINT_IME_IMPLEMENTED_UI
|
||||
* SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text
|
||||
* SDL_HINT_MOUSE_RELATIVE_MODE_WARP - relative mode is always implemented at the hardware level or reported as unavailable
|
||||
* SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer
|
||||
* SDL_HINT_PS2_DYNAMIC_VSYNC - use SDL_SetRenderVSync(renderer, -1) instead
|
||||
* SDL_HINT_RENDER_BATCHING - Render batching is always enabled, apps should call SDL_FlushRenderer() before calling into a lower-level graphics API.
|
||||
@@ -848,7 +850,6 @@ The following hints have been removed:
|
||||
* SDL_HINT_WINRT_PRIVACY_POLICY_LABEL - WinRT support was removed in SDL3.
|
||||
* SDL_HINT_WINRT_PRIVACY_POLICY_URL - WinRT support was removed in SDL3.
|
||||
* SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING
|
||||
* SDL_HINT_AUDIO_DEVICE_APP_NAME - replaced by either using the appname param to SDL_SetAppMetadata() or setting SDL_PROP_APP_METADATA_NAME_STRING with SDL_SetAppMetadataProperty()
|
||||
|
||||
The following environment variables have been renamed:
|
||||
* SDL_AUDIODRIVER => SDL_AUDIO_DRIVER
|
||||
@@ -1290,7 +1291,6 @@ The following platform preprocessor macros have been renamed:
|
||||
| `__LINUX__` | `SDL_PLATFORM_LINUX` |
|
||||
| `__MACOSX__` | `SDL_PLATFORM_MACOS` |
|
||||
| `__NETBSD__` | `SDL_PLATFORM_NETBSD` |
|
||||
| `__NGAGE__` | `SDL_PLATFORM_NGAGE` |
|
||||
| `__OPENBSD__` | `SDL_PLATFORM_OPENBSD` |
|
||||
| `__OS2__` | `SDL_PLATFORM_OS2` |
|
||||
| `__OSF__` | `SDL_PLATFORM_OSF` |
|
||||
@@ -2210,21 +2210,24 @@ The following functions have been renamed:
|
||||
* SDL_SetWindowDisplayMode() => SDL_SetWindowFullscreenMode(), returns bool
|
||||
|
||||
The following functions have been removed:
|
||||
* SDL_GetClosestFullscreenDisplayMode()
|
||||
* SDL_GetDisplayDPI() - not reliable across platforms, approximately replaced by multiplying SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms.
|
||||
* SDL_GetDisplayMode()
|
||||
* SDL_GetNumDisplayModes() - replaced with SDL_GetFullscreenDisplayModes()
|
||||
* SDL_GetNumVideoDisplays() - replaced with SDL_GetDisplays()
|
||||
* SDL_SetWindowGrab() - use SDL_SetWindowMouseGrab() instead, along with SDL_SetWindowKeyboardGrab() if you also set SDL_HINT_GRAB_KEYBOARD.
|
||||
* SDL_GetWindowGrab() - use SDL_GetWindowMouseGrab() instead, along with SDL_GetWindowKeyboardGrab() if you also set SDL_HINT_GRAB_KEYBOARD.
|
||||
* SDL_GetWindowData() - use SDL_GetWindowProperties() instead
|
||||
* SDL_SetWindowData() - use SDL_GetWindowProperties() instead
|
||||
* SDL_GetWindowData() - use SDL_GetPointerProperty() instead, along with SDL_GetWindowProperties()
|
||||
* SDL_SetWindowData() - use SDL_SetPointerProperty() instead, along with SDL_GetWindowProperties()
|
||||
* SDL_CreateWindowFrom() - use SDL_CreateWindowWithProperties() with the properties that allow you to wrap an existing window
|
||||
* SDL_SetWindowInputFocus() - use SDL_RaiseWindow() instead
|
||||
* SDL_SetWindowModalFor() - use SDL_SetWindowParent() with SDL_SetWindowModal() instead
|
||||
|
||||
The SDL_Window id type is named SDL_WindowID
|
||||
|
||||
The following environment variables have been removed:
|
||||
* SDL_VIDEO_GL_DRIVER - replaced with the hint SDL_HINT_OPENGL_LIBRARY
|
||||
* SDL_VIDEO_EGL_DRIVER - replaced with the hint SDL_HINT_EGL_LIBRARY
|
||||
|
||||
The following symbols have been renamed:
|
||||
* SDL_DISPLAYEVENT_DISCONNECTED => SDL_EVENT_DISPLAY_REMOVED
|
||||
* SDL_DISPLAYEVENT_MOVED => SDL_EVENT_DISPLAY_MOVED
|
||||
|
||||
@@ -1,44 +1,5 @@
|
||||
Nokia N-Gage
|
||||
============
|
||||
Support for the Nokia N-Gage has been removed from SDL3 (but will make a
|
||||
comeback when newer compilers are available for the platform).
|
||||
|
||||
SDL port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
|
||||
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
|
||||
SDL2 still supports this platform.
|
||||
|
||||
Compiling
|
||||
---------
|
||||
|
||||
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
|
||||
The library is included in the
|
||||
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
|
||||
sub-module.
|
||||
|
||||
A complete example project based on SDL can be found in the GitHub
|
||||
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
|
||||
|
||||
Current level of implementation
|
||||
-------------------------------
|
||||
|
||||
The video driver currently provides full screen video support with
|
||||
keyboard input.
|
||||
|
||||
At the moment only the software renderer works.
|
||||
|
||||
Audio is not yet implemented.
|
||||
|
||||
Acknowledgements
|
||||
----------------
|
||||
|
||||
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
|
||||
valuable insight into Symbian programming. Without the SDL 1.2 port
|
||||
which was specially developed for CDoom (Doom for the Nokia 9210), this
|
||||
adaptation would not have been possible.
|
||||
|
||||
I would like to thank my friends
|
||||
[Razvan](https://twitter.com/bewarerazvan) and [Dan
|
||||
Whelan](https://danwhelan.ie/), for their continuous support. Without
|
||||
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
|
||||
have lost my patience long ago.
|
||||
|
||||
Last but not least, I would like to thank the development team of
|
||||
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
|
||||
patience and support in troubleshooting helped me a lot.
|
||||
|
||||
@@ -3,27 +3,35 @@ Raspberry Pi
|
||||
|
||||
Requirements:
|
||||
|
||||
Raspbian (other Linux distros may work as well).
|
||||
Raspberry Pi OS (other Linux distros may work as well).
|
||||
|
||||
Features
|
||||
--------
|
||||
In modern times, the Raspberry Pi works mostly like any other Linux device:
|
||||
for video, you can use X11, Wayland, or KMSDRM. For audio, you can use ALSA,
|
||||
PulseAudio, or PipeWire, etc. OpenGL, OpenGL ES, and Vulkan are known to work.
|
||||
|
||||
* Works without X11
|
||||
* Hardware accelerated OpenGL ES 2.x
|
||||
* Sound via ALSA
|
||||
* Input (mouse/keyboard/joystick) via EVDEV
|
||||
* Hotplugging of input devices via UDEV
|
||||
There is a video backend in SDL called "rpi" that uses a deprecated Broadcom
|
||||
interface (named "dispmanx") to draw directly to the console without X11.
|
||||
Newer Raspberry Pi OS releases don't support this (and work fine with our
|
||||
"kmsdrm" backend for the same purposes, a standard Linux interface). Don't
|
||||
panic if you can't use this backend, or CMake says it can't find libraries it
|
||||
needs for this.
|
||||
|
||||
SDL has, in past times, worked on the original Raspberry Pi and the RPi 2, but
|
||||
these devices are no longer targets we actively test; if they broke, please
|
||||
report bugs or send patches!
|
||||
|
||||
The Raspberry Pi 3 and later (in 32-bit and 64-bit mode) are still known to
|
||||
work well at the time of this writing. The Raspberry Pi Zero and Zero 2 are
|
||||
also known to work well.
|
||||
|
||||
|
||||
Raspbian Build Dependencies
|
||||
---------------------------
|
||||
## Documentation Out Of Date
|
||||
|
||||
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
||||
The rest of this document is likely out of date; a lot has changed in recent
|
||||
years in both SDL and the Raspberry Pi universe, and this document has not
|
||||
been updated to reflect those details. Take the rest of this information with
|
||||
a grain of salt!
|
||||
|
||||
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
||||
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
|
||||
|
||||
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
||||
|
||||
|
||||
NEON
|
||||
@@ -31,8 +39,8 @@ NEON
|
||||
|
||||
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
|
||||
that SDL will select some otherwise-disabled highly-optimized code. The
|
||||
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
|
||||
definitely does.
|
||||
original Pi and Pi Zero units don't have NEON; everything from the Pi2/PiZero2
|
||||
and later do.
|
||||
|
||||
|
||||
Cross compiling from x86 Linux
|
||||
|
||||
@@ -14,7 +14,7 @@ Works out of box.
|
||||
Windows:
|
||||
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
|
||||
|
||||
===========================================================================
|
||||
|
||||
Events
|
||||
===========================================================================
|
||||
SDL_EVENT_FINGER_DOWN:
|
||||
@@ -39,7 +39,6 @@ Fields:
|
||||
Same as SDL_EVENT_FINGER_DOWN.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Functions
|
||||
===========================================================================
|
||||
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Using SDL with Microsoft Visual C++
|
||||
===================================
|
||||
|
||||
### by Lion Kimbro with additions by James Turk
|
||||
#### by Lion Kimbro with additions by James Turk
|
||||
|
||||
You can either use the precompiled libraries from the [SDL](https://www.libsdl.org/download.php) web site, or you can build SDL
|
||||
yourself.
|
||||
@@ -39,10 +39,10 @@ _Note for the `x64` versions, just replace `Win32` in the path with `x64`_
|
||||
- Create a C++ file for your project.
|
||||
|
||||
- Set the C runtime to `Multi-threaded DLL` in the menu:
|
||||
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
|
||||
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
|
||||
|
||||
- Add the SDL `include` directory to your list of includes in the menu:
|
||||
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
|
||||
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
|
||||
|
||||
*VC7 Specific: Instead of doing this, I find it easier to add the
|
||||
include and library directories to the list that VC7 keeps. Do this by
|
||||
@@ -75,27 +75,27 @@ and type the names of the libraries to link with in the "Additional Options:" bo
|
||||
|
||||
Here's a sample SDL snippet to verify everything is setup in your IDE:
|
||||
|
||||
```c
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h> // only include this one in the source file with main()!
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
const int WIDTH = 640;
|
||||
const int HEIGHT = 480;
|
||||
SDL_Window* window = NULL;
|
||||
SDL_Renderer* renderer = NULL;
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
window = SDL_CreateWindow("Hello SDL", WIDTH, HEIGHT, 0);
|
||||
renderer = SDL_CreateRenderer(window, NULL);
|
||||
|
||||
SDL_DestroyRenderer(renderer);
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h> // only include this one in the source file with main()!
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
const int WIDTH = 640;
|
||||
const int HEIGHT = 480;
|
||||
SDL_Window* window = NULL;
|
||||
SDL_Renderer* renderer = NULL;
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
window = SDL_CreateWindow("Hello SDL", WIDTH, HEIGHT, 0);
|
||||
renderer = SDL_CreateRenderer(window, NULL);
|
||||
|
||||
SDL_DestroyRenderer(renderer);
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### That's it!
|
||||
|
||||
@@ -110,4 +110,4 @@ This document was originally called "VisualC.txt", and was written by [Sam Lanti
|
||||
|
||||
Later, it was converted to HTML and expanded into the document that you see today by [Lion Kimbro](mailto:snowlion@sprynet.com).
|
||||
|
||||
Minor Fixes and Visual C++ 7 Information (In Green) was added by [James Turk](mailto:james@conceptofzero.net)
|
||||
Minor Fixes and Visual C++ 7 Information (in italic) was added by [James Turk](mailto:james@conceptofzero.net)
|
||||
|
||||
@@ -16,6 +16,60 @@ Studio solution.
|
||||
|
||||
Details are here: https://github.com/libsdl-org/SDL/issues/5186
|
||||
|
||||
## MinGW-w64 compiler support
|
||||
|
||||
SDL can be built with MinGW-w64 and CMake. First, you need to install and set up the MSYS2 environment, which provides the MinGW-w64 toolchain. Install MSYS2, typically to `C:\msys64`, and follow the instructions on the MSYS2 wiki to use the MinGW-w64 shell to update all components in the MSYS2 environment. This generally amounts to running `pacman -Syuu` from the mingw64 shell, but refer to MSYS2's documentation for more details. Once the MSYS2 environment has been updated, install the x86_64 MinGW toolchain from the mingw64 shell with the command `pacman -S mingw-w64-x86_64-toolchain`. (You can additionally install `mingw-w64-i686-toolchain` if you intend to build 32-bit binaries as well. The remainder of this section assumes you only want to build 64-bit binaries.)
|
||||
|
||||
To build and install SDL, you can use PowerShell or any CMake-compatible IDE. First, install CMake, Ninja, and Git. These tools can be installed using any number of tools, such as the MSYS2's `pacman`, `winget`, `Chocolatey`, or by manually downloading and running the installers. Clone SDL to an appropriate location with `git` and run the following commands from the root of the cloned repository:
|
||||
|
||||
```sh
|
||||
mkdir build
|
||||
cmake -S . -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-x86_64.cmake
|
||||
cmake --build build --parallel
|
||||
cmake --install build --prefix C:/Libraries
|
||||
```
|
||||
|
||||
This installs SDL to `C:\Libraries`. You can specify another directory of your choice as desired. Ensure that your `CMAKE_PREFIX_PATH` includes `C:\Libraries` when you want to build against this copy of SDL. The simplest way to do this is to pass it to CMake as an option at configuration time:
|
||||
|
||||
```sh
|
||||
cmake .. -G Ninja -DCMAKE_PREFIX_PATH=C:/Libraries
|
||||
```
|
||||
|
||||
You will also need to configure CMake to use the MinGW-w64 toolchain to build your own project. Here is a minimal toolchain file that you could use for this purpose:
|
||||
|
||||
```
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc REQUIRED)
|
||||
find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++ REQUIRED)
|
||||
find_program(CMAKE_RC_COMPILER NAMES x86_64-w64-mingw32-windres windres REQUIRED)
|
||||
```
|
||||
|
||||
Save this in your project and refer to it at configuration time with the option `-DCMAKE_TOOLCHAIN_FILE`.
|
||||
|
||||
On Windows, you also need to copy `SDL3.dll` to an appropriate directory so that the game can find it at runtime. For guidance, see [README-cmake.md](README-cmake.md#how-do-i-copy-a-sdl3-dynamic-library-to-another-location).
|
||||
|
||||
Below is a minimal `CMakeLists.txt` file to build your game linked against a system SDL that was built with the MinGW-w64 toolchain. See [README-cmake.md](README-cmake.md) for more details on including SDL in your CMake project.
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(mygame)
|
||||
|
||||
find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3-shared)
|
||||
|
||||
add_executable(mygame WIN32 mygame.c)
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3)
|
||||
|
||||
# On Windows, copy SDL3.dll to the build directory
|
||||
if(WIN32)
|
||||
add_custom_command(
|
||||
TARGET mygame POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:SDL3::SDL3-shared> $<TARGET_FILE_DIR:mygame>
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
```
|
||||
|
||||
## OpenGL ES 2.x support
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
# Release checklist
|
||||
|
||||
* Run `build-scripts/create-release.py -R libsdl-org/SDL --ref <git-ref>` to command
|
||||
GitHub Actions to start creating release assets.
|
||||
It's advisable to run this script regularly, and also prior to any release step.
|
||||
When creating the release assets, `<git-ref>` must be the release tag
|
||||
This makes sure the revision string baked into the archives is correct.
|
||||
* Run `build-scripts/create-release.py -R libsdl-org/SDL --ref <branch>` to do
|
||||
a dry run creating the release assets. Verify that the archives are correct.
|
||||
|
||||
* When changing the version, run `build-scripts/update-version.sh X Y Z`,
|
||||
where `X Y Z` are the major version, minor version, and patch level. So
|
||||
`3 8 1` means "change the version to 3.8.1". This script does much of the
|
||||
mechanical work.
|
||||
* Tag the release, e.g. `git tag release-3.8.0; git push --tags`
|
||||
|
||||
* Run `build-scripts/create-release.py -R libsdl-org/SDL --ref <release-tag>`
|
||||
to have GitHub Actions create release assets. This makes sure the revision
|
||||
string baked into the archives is correct.
|
||||
|
||||
* Verify that the source archive REVISION.txt has the correct release tag.
|
||||
|
||||
* Sign the source archives and upload everything to libsdl.org
|
||||
|
||||
* Create a GitHub release and attach the archives you just generated.
|
||||
|
||||
## New feature release
|
||||
|
||||
@@ -22,14 +25,16 @@
|
||||
|
||||
* Do the release
|
||||
|
||||
* Immediately create a branch for patch releases, e.g. `git branch release-3.EVEN.x`
|
||||
|
||||
* Bump version number from 3.EVEN.0 to 3.(EVEN+1).0
|
||||
|
||||
* `./build-scripts/update-version.sh 3 EVEN+1 0`
|
||||
|
||||
* Update the website file include/header.inc.php to reflect the new version
|
||||
|
||||
## New bugfix release
|
||||
|
||||
* Check that no new API/ABI was added
|
||||
|
||||
* If it was, do a new feature release (see above) instead
|
||||
|
||||
* Bump version number from 3.Y.Z to 3.Y.(Z+1) (Y is even)
|
||||
|
||||
* `./build-scripts/update-version.sh 3 Y Z+1`
|
||||
@@ -38,14 +43,6 @@
|
||||
|
||||
* Update the website file include/header.inc.php to reflect the new version
|
||||
|
||||
## After a feature release
|
||||
|
||||
* Create a branch like `release-3.4.x`
|
||||
|
||||
* Bump version number to 3.ODD.0 for next development branch
|
||||
|
||||
* `./build-scripts/update-version.sh 3 ODD 0`
|
||||
|
||||
## New development prerelease
|
||||
|
||||
* Bump version number from 3.Y.Z to 3.Y.(Z+1) (Y is odd)
|
||||
|
||||
@@ -110,6 +110,7 @@ macro(add_sdl_example_executable TARGET)
|
||||
target_link_libraries(${TARGET} PRIVATE GL)
|
||||
elseif(EMSCRIPTEN)
|
||||
set_property(TARGET ${TARGET} PROPERTY SUFFIX ".html")
|
||||
target_link_options(${TARGET} PRIVATE -sALLOW_MEMORY_GROWTH=1)
|
||||
endif()
|
||||
|
||||
if(OPENGL_FOUND)
|
||||
@@ -138,11 +139,16 @@ add_sdl_example_executable(renderer-debug-text SOURCES renderer/18-debug-text/de
|
||||
add_sdl_example_executable(audio-simple-playback SOURCES audio/01-simple-playback/simple-playback.c)
|
||||
add_sdl_example_executable(audio-simple-playback-callback SOURCES audio/02-simple-playback-callback/simple-playback-callback.c)
|
||||
add_sdl_example_executable(audio-load-wav SOURCES audio/03-load-wav/load-wav.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.wav)
|
||||
add_sdl_example_executable(audio-multiple-streams SOURCES audio/04-multiple-streams/multiple-streams.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.wav ${CMAKE_CURRENT_SOURCE_DIR}/../test/sword.wav)
|
||||
add_sdl_example_executable(input-joystick-polling SOURCES input/01-joystick-polling/joystick-polling.c)
|
||||
add_sdl_example_executable(input-joystick-events SOURCES input/02-joystick-events/joystick-events.c)
|
||||
add_sdl_example_executable(camera-read-and-draw SOURCES camera/01-read-and-draw/read-and-draw.c)
|
||||
add_sdl_example_executable(pen-drawing-lines SOURCES pen/01-drawing-lines/drawing-lines.c)
|
||||
add_sdl_example_executable(game-snake SOURCES game/01-snake/snake.c)
|
||||
add_sdl_example_executable(game-woodeneye-008 SOURCES game/02-woodeneye-008/woodeneye-008.c)
|
||||
add_sdl_example_executable(game-infinite-monkeys SOURCES game/03-infinite-monkeys/infinite-monkeys.c)
|
||||
add_sdl_example_executable(asyncio-load-bitmaps SOURCES asyncio/01-load-bitmaps/load-bitmaps.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp ${CMAKE_CURRENT_SOURCE_DIR}/../test/gamepad_front.bmp ${CMAKE_CURRENT_SOURCE_DIR}/../test/speaker.bmp ${CMAKE_CURRENT_SOURCE_DIR}/../test/icon2x.bmp)
|
||||
add_sdl_example_executable(demo-snake SOURCES demo/01-snake/snake.c)
|
||||
add_sdl_example_executable(demo-woodeneye-008 SOURCES demo/02-woodeneye-008/woodeneye-008.c)
|
||||
add_sdl_example_executable(demo-infinite-monkeys SOURCES demo/03-infinite-monkeys/infinite-monkeys.c)
|
||||
add_sdl_example_executable(demo-bytepusher SOURCES demo/04-bytepusher/bytepusher.c)
|
||||
|
||||
# When you add an example, remember to add the Visual Studio project as well:
|
||||
# - Add a new example in examples/
|
||||
|
||||
6
examples/asyncio/01-load-bitmaps/README.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
This example code loads a few bitmap files from disk using the asynchronous
|
||||
i/o, and then draws it to the window. It uses a task group to watch multiple
|
||||
reads and deal with them in whatever order they finish.
|
||||
|
||||
Note that for a single tiny file like this, you'd probably not want to bother
|
||||
with async i/o in real life, but this is just an example of how to do it.
|
||||
125
examples/asyncio/01-load-bitmaps/load-bitmaps.c
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* This example code loads a bitmap with asynchronous i/o and renders it.
|
||||
*
|
||||
* This code is public domain. Feel free to use it for any purpose!
|
||||
*/
|
||||
|
||||
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
/* We will use this renderer to draw into this window every frame. */
|
||||
static SDL_Window *window = NULL;
|
||||
static SDL_Renderer *renderer = NULL;
|
||||
static SDL_AsyncIOQueue *queue = NULL;
|
||||
|
||||
#define TOTAL_TEXTURES 4
|
||||
static const char * const bmps[TOTAL_TEXTURES] = { "sample.bmp", "gamepad_front.bmp", "speaker.bmp", "icon2x.bmp" };
|
||||
static SDL_Texture *textures[TOTAL_TEXTURES];
|
||||
static const SDL_FRect texture_rects[TOTAL_TEXTURES] = {
|
||||
{ 116, 156, 408, 167 },
|
||||
{ 20, 200, 96, 60 },
|
||||
{ 525, 180, 96, 96 },
|
||||
{ 288, 375, 64, 64 }
|
||||
};
|
||||
|
||||
/* This function runs once at startup. */
|
||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!SDL_CreateWindowAndRenderer("examples/asyncio/load-bitmaps", 640, 480, 0, &window, &renderer)) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
queue = SDL_CreateAsyncIOQueue();
|
||||
if (!queue) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create async i/o queue!", SDL_GetError(), NULL);
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
/* Load some .bmp files asynchronously from wherever the app is being run from, put them in the same queue. */
|
||||
for (i = 0; i < SDL_arraysize(bmps); i++) {
|
||||
char *path = NULL;
|
||||
SDL_asprintf(&path, "%s%s", SDL_GetBasePath(), bmps[i]); /* allocate a string of the full file path */
|
||||
/* you _should) check for failure, but we'll just go on without files here. */
|
||||
SDL_LoadFileAsync(path, queue, (void *) bmps[i]); /* attach the filename as app-specific data, so we can see it later. */
|
||||
SDL_free(path);
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
|
||||
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
{
|
||||
if (event->type == SDL_EVENT_QUIT) {
|
||||
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once per frame, and is the heart of the program. */
|
||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
||||
{
|
||||
SDL_AsyncIOOutcome outcome;
|
||||
int i;
|
||||
|
||||
if (SDL_GetAsyncIOResult(queue, &outcome)) { /* a .bmp file load has finished? */
|
||||
if (outcome.result == SDL_ASYNCIO_COMPLETE) {
|
||||
/* this might be _any_ of the bmps; they might finish loading in any order. */
|
||||
for (i = 0; i < SDL_arraysize(bmps); i++) {
|
||||
/* this doesn't need a strcmp because we gave the pointer from this array to SDL_LoadFileAsync */
|
||||
if (outcome.userdata == bmps[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < SDL_arraysize(bmps)) { /* (just in case.) */
|
||||
SDL_Surface *surface = SDL_LoadBMP_IO(SDL_IOFromConstMem(outcome.buffer, (size_t) outcome.bytes_transferred), true);
|
||||
if (surface) { /* the renderer is not multithreaded, so create the texture here once the data loads. */
|
||||
textures[i] = SDL_CreateTextureFromSurface(renderer, surface);
|
||||
if (!textures[i]) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create texture!", SDL_GetError(), NULL);
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
SDL_DestroySurface(surface);
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_free(outcome.buffer);
|
||||
}
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
for (i = 0; i < SDL_arraysize(textures); i++) {
|
||||
SDL_RenderTexture(renderer, textures[i], NULL, &texture_rects[i]);
|
||||
}
|
||||
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once at shutdown. */
|
||||
void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
{
|
||||
int i;
|
||||
|
||||
SDL_DestroyAsyncIOQueue(queue);
|
||||
|
||||
for (i = 0; i < SDL_arraysize(textures); i++) {
|
||||
SDL_DestroyTexture(textures[i]);
|
||||
}
|
||||
|
||||
/* SDL will clean up the window/renderer for us. */
|
||||
}
|
||||
|
||||
BIN
examples/asyncio/01-load-bitmaps/thumbnail.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
1
examples/asyncio/description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Asynchronous I/O
|
||||
5
examples/audio/04-multiple-streams/README.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
If you're running this in a web browser, you need to click the window before you'll hear anything!
|
||||
|
||||
This example code loads two .wav files, puts them an audio streams and binds
|
||||
them for playback, repeating both sounds on loop. This shows several streams
|
||||
mixing into a single playback device.
|
||||
135
examples/audio/04-multiple-streams/multiple-streams.c
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* This example code loads two .wav files, puts them an audio streams and
|
||||
* binds them for playback, repeating both sounds on loop. This shows several
|
||||
* streams mixing into a single playback device.
|
||||
*
|
||||
* This code is public domain. Feel free to use it for any purpose!
|
||||
*/
|
||||
|
||||
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
/* We will use this renderer to draw into this window every frame. */
|
||||
static SDL_Window *window = NULL;
|
||||
static SDL_Renderer *renderer = NULL;
|
||||
static SDL_AudioDeviceID audio_device = 0;
|
||||
|
||||
/* things that are playing sound (the audiostream itself, plus the original data, so we can refill to loop. */
|
||||
typedef struct Sound {
|
||||
Uint8 *wav_data;
|
||||
Uint32 wav_data_len;
|
||||
SDL_AudioStream *stream;
|
||||
} Sound;
|
||||
|
||||
static Sound sounds[2];
|
||||
|
||||
static bool init_sound(const char *fname, Sound *sound)
|
||||
{
|
||||
bool retval = false;
|
||||
SDL_AudioSpec spec;
|
||||
char *wav_path = NULL;
|
||||
|
||||
/* Load the .wav files from wherever the app is being run from. */
|
||||
SDL_asprintf(&wav_path, "%s%s", SDL_GetBasePath(), fname); /* allocate a string of the full file path */
|
||||
if (!SDL_LoadWAV(wav_path, &spec, &sound->wav_data, &sound->wav_data_len)) {
|
||||
SDL_Log("Couldn't load .wav file: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Create an audio stream. Set the source format to the wav's format (what
|
||||
we'll input), leave the dest format NULL here (it'll change to what the
|
||||
device wants once we bind it). */
|
||||
sound->stream = SDL_CreateAudioStream(&spec, NULL);
|
||||
if (!sound->stream) {
|
||||
SDL_Log("Couldn't create audio stream: %s", SDL_GetError());
|
||||
} else if (!SDL_BindAudioStream(audio_device, sound->stream)) { /* once bound, it'll start playing when there is data available! */
|
||||
SDL_Log("Failed to bind '%s' stream to device: %s", fname, SDL_GetError());
|
||||
} else {
|
||||
retval = true; /* success! */
|
||||
}
|
||||
|
||||
SDL_free(wav_path); /* done with this string. */
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/* This function runs once at startup. */
|
||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
|
||||
SDL_SetAppMetadata("Example Audio Multiple Streams", "1.0", "com.example.audio-multiple-streams");
|
||||
|
||||
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
|
||||
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!SDL_CreateWindowAndRenderer("examples/audio/multiple-streams", 640, 480, 0, &window, &renderer)) {
|
||||
SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
/* open the default audio device in whatever format it prefers; our audio streams will adjust to it. */
|
||||
audio_device = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, NULL);
|
||||
if (audio_device == 0) {
|
||||
SDL_Log("Couldn't open audio device: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!init_sound("sample.wav", &sounds[0])) {
|
||||
return SDL_APP_FAILURE;
|
||||
} else if (!init_sound("sword.wav", &sounds[1])) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
|
||||
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
{
|
||||
if (event->type == SDL_EVENT_QUIT) {
|
||||
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
|
||||
}
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once per frame, and is the heart of the program. */
|
||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(sounds); i++) {
|
||||
/* If less than a full copy of the audio is queued for playback, put another copy in there.
|
||||
This is overkill, but easy when lots of RAM is cheap. One could be more careful and
|
||||
queue less at a time, as long as the stream doesn't run dry. */
|
||||
if (SDL_GetAudioStreamAvailable(sounds[i].stream) < ((int) sounds[i].wav_data_len)) {
|
||||
SDL_PutAudioStreamData(sounds[i].stream, sounds[i].wav_data, (int) sounds[i].wav_data_len);
|
||||
}
|
||||
}
|
||||
|
||||
/* just blank the screen. */
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once at shutdown. */
|
||||
void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
{
|
||||
int i;
|
||||
|
||||
SDL_CloseAudioDevice(audio_device);
|
||||
|
||||
for (i = 0; i < SDL_arraysize(sounds); i++) {
|
||||
if (sounds[i].stream) {
|
||||
SDL_DestroyAudioStream(sounds[i].stream);
|
||||
}
|
||||
SDL_free(sounds[i].wav_data);
|
||||
}
|
||||
|
||||
/* SDL will clean up the window/renderer for us. */
|
||||
}
|
||||
BIN
examples/audio/onmouseover.webp
Normal file
|
After Width: | Height: | Size: 172 KiB |
BIN
examples/audio/thumbnail.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
examples/camera/01-read-and-draw/onmouseover.webp
Normal file
|
After Width: | Height: | Size: 339 KiB |
BIN
examples/camera/01-read-and-draw/thumbnail.png
Normal file
|
After Width: | Height: | Size: 234 KiB |
13
examples/categories.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
# Blank lines and lines that start with '#' in this file are ignored.
|
||||
|
||||
# Categories, by directory name, go in here, in the order they should be
|
||||
# listed on the main page. If this file is missing, it'll assume any
|
||||
# subdirectory is a category and sort them alphabetically.
|
||||
|
||||
renderer
|
||||
input
|
||||
audio
|
||||
camera
|
||||
asyncio
|
||||
pen
|
||||
demo
|
||||
BIN
examples/demo/01-snake/onmouseover.webp
Normal file
|
After Width: | Height: | Size: 30 KiB |
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Logic implementation of the Snake game. It is designed to efficiently
|
||||
* represent in memory the state of the game.
|
||||
* represent the state of the game in memory.
|
||||
*
|
||||
* This code is public domain. Feel free to use it for any purpose!
|
||||
*/
|
||||
@@ -285,7 +285,7 @@ static const struct
|
||||
const char *value;
|
||||
} extended_metadata[] =
|
||||
{
|
||||
{ SDL_PROP_APP_METADATA_URL_STRING, "https://examples.libsdl.org/SDL3/game/01-snake/" },
|
||||
{ SDL_PROP_APP_METADATA_URL_STRING, "https://examples.libsdl.org/SDL3/demo/01-snake/" },
|
||||
{ SDL_PROP_APP_METADATA_CREATOR_STRING, "SDL team" },
|
||||
{ SDL_PROP_APP_METADATA_COPYRIGHT_STRING, "Placed in the public domain" },
|
||||
{ SDL_PROP_APP_METADATA_TYPE_STRING, "game" }
|
||||
@@ -316,7 +316,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
|
||||
*appstate = as;
|
||||
|
||||
if (!SDL_CreateWindowAndRenderer("examples/game/snake", SDL_WINDOW_WIDTH, SDL_WINDOW_HEIGHT, 0, &as->window, &as->renderer)) {
|
||||
if (!SDL_CreateWindowAndRenderer("examples/demo/snake", SDL_WINDOW_WIDTH, SDL_WINDOW_HEIGHT, 0, &as->window, &as->renderer)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
BIN
examples/demo/01-snake/thumbnail.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
examples/demo/02-woodeneye-008/onmouseover.webp
Normal file
|
After Width: | Height: | Size: 457 KiB |
BIN
examples/demo/02-woodeneye-008/thumbnail.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
@@ -36,7 +36,7 @@ static const struct {
|
||||
const char *key;
|
||||
const char *value;
|
||||
} extended_metadata[] = {
|
||||
{ SDL_PROP_APP_METADATA_URL_STRING, "https://examples.libsdl.org/SDL3/game/02-woodeneye-008/" },
|
||||
{ SDL_PROP_APP_METADATA_URL_STRING, "https://examples.libsdl.org/SDL3/demo/02-woodeneye-008/" },
|
||||
{ SDL_PROP_APP_METADATA_CREATOR_STRING, "SDL team" },
|
||||
{ SDL_PROP_APP_METADATA_COPYRIGHT_STRING, "Placed in the public domain" },
|
||||
{ SDL_PROP_APP_METADATA_TYPE_STRING, "game" }
|
||||
@@ -347,7 +347,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
if (!SDL_CreateWindowAndRenderer("examples/game/woodeneye-008", 640, 480, 0, &as->window, &as->renderer)) {
|
||||
if (!SDL_CreateWindowAndRenderer("examples/demo/woodeneye-008", 640, 480, 0, &as->window, &as->renderer)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!SDL_CreateWindowAndRenderer("examples/game/03-infinite-monkeys", 640, 480, 0, &window, &renderer)) {
|
||||
if (!SDL_CreateWindowAndRenderer("examples/demo/infinite-monkeys", 640, 480, 0, &window, &renderer)) {
|
||||
SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
BIN
examples/demo/03-infinite-monkeys/onmouseover.webp
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
examples/demo/03-infinite-monkeys/thumbnail.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
4
examples/demo/04-bytepusher/README.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
An implementation of the BytePusher VM
|
||||
|
||||
For example programs and more information about BytePusher, see
|
||||
https://esolangs.org/wiki/BytePusher
|
||||
416
examples/demo/04-bytepusher/bytepusher.c
Normal file
@@ -0,0 +1,416 @@
|
||||
/*
|
||||
* An implementation of the BytePusher VM.
|
||||
*
|
||||
* For example programs and more information about BytePusher, see
|
||||
* https://esolangs.org/wiki/BytePusher
|
||||
*
|
||||
* This code is public domain. Feel free to use it for any purpose!
|
||||
*/
|
||||
|
||||
#define SDL_MAIN_USE_CALLBACKS
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define SCREEN_W 256
|
||||
#define SCREEN_H 256
|
||||
#define RAM_SIZE 0x1000000
|
||||
#define FRAMES_PER_SECOND 60
|
||||
#define SAMPLES_PER_FRAME 256
|
||||
#define NS_PER_SECOND (Uint64)SDL_NS_PER_SECOND
|
||||
#define MAX_AUDIO_LATENCY_FRAMES 5
|
||||
|
||||
#define IO_KEYBOARD 0
|
||||
#define IO_PC 2
|
||||
#define IO_SCREEN_PAGE 5
|
||||
#define IO_AUDIO_BANK 6
|
||||
|
||||
typedef struct {
|
||||
Uint8 ram[RAM_SIZE + 8];
|
||||
Uint8 screenbuf[SCREEN_W * SCREEN_H];
|
||||
Uint64 last_tick;
|
||||
Uint64 tick_acc;
|
||||
SDL_Window* window;
|
||||
SDL_Renderer* renderer;
|
||||
SDL_Surface* screen;
|
||||
SDL_Texture* screentex;
|
||||
SDL_Texture* rendertarget; /* we need this render target for text to look good */
|
||||
SDL_AudioStream* audiostream;
|
||||
char status[SCREEN_W / 8];
|
||||
int status_ticks;
|
||||
Uint16 keystate;
|
||||
bool display_help;
|
||||
bool positional_input;
|
||||
} BytePusher;
|
||||
|
||||
static const struct {
|
||||
const char *key;
|
||||
const char *value;
|
||||
} extended_metadata[] = {
|
||||
{ SDL_PROP_APP_METADATA_URL_STRING, "https://examples.libsdl.org/SDL3/demo/04-bytepusher/" },
|
||||
{ SDL_PROP_APP_METADATA_CREATOR_STRING, "SDL team" },
|
||||
{ SDL_PROP_APP_METADATA_COPYRIGHT_STRING, "Placed in the public domain" },
|
||||
{ SDL_PROP_APP_METADATA_TYPE_STRING, "game" }
|
||||
};
|
||||
|
||||
static inline Uint16 read_u16(const BytePusher* vm, Uint32 addr) {
|
||||
const Uint8* ptr = &vm->ram[addr];
|
||||
return ((Uint16)ptr[0] << 8) | ((Uint16)ptr[1]);
|
||||
}
|
||||
|
||||
static inline Uint32 read_u24(const BytePusher* vm, Uint32 addr) {
|
||||
const Uint8* ptr = &vm->ram[addr];
|
||||
return ((Uint32)ptr[0] << 16) | ((Uint32)ptr[1] << 8) | ((Uint32)ptr[2]);
|
||||
}
|
||||
|
||||
static void set_status(BytePusher* vm, const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
SDL_vsnprintf(vm->status, sizeof(vm->status), fmt, args);
|
||||
va_end(args);
|
||||
vm->status[sizeof(vm->status) - 1] = 0;
|
||||
vm->status_ticks = FRAMES_PER_SECOND * 3;
|
||||
}
|
||||
|
||||
static bool load(BytePusher* vm, SDL_IOStream* stream, bool closeio) {
|
||||
size_t bytes_read = 0;
|
||||
bool ok = true;
|
||||
|
||||
SDL_memset(vm->ram, 0, RAM_SIZE);
|
||||
|
||||
if (!stream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (bytes_read < RAM_SIZE) {
|
||||
size_t read = SDL_ReadIO(stream, &vm->ram[bytes_read], RAM_SIZE - bytes_read);
|
||||
bytes_read += read;
|
||||
if (read == 0) {
|
||||
ok = SDL_GetIOStatus(stream) == SDL_IO_STATUS_EOF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (closeio) {
|
||||
SDL_CloseIO(stream);
|
||||
}
|
||||
|
||||
SDL_ClearAudioStream(vm->audiostream);
|
||||
|
||||
vm->display_help = !ok;
|
||||
return ok;
|
||||
}
|
||||
|
||||
static const char* filename(const char* path) {
|
||||
size_t i = SDL_strlen(path) + 1;
|
||||
while (i > 0) {
|
||||
i -= 1;
|
||||
if (path[i] == '/' || path[i] == '\\') {
|
||||
return path + i + 1;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
static bool load_file(BytePusher* vm, const char* path) {
|
||||
if (load(vm, SDL_IOFromFile(path, "rb"), true)) {
|
||||
set_status(vm, "loaded %s", filename(path));
|
||||
return true;
|
||||
} else {
|
||||
set_status(vm, "load failed: %s", filename(path));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void print(BytePusher* vm, int x, int y, const char* str) {
|
||||
SDL_SetRenderDrawColor(vm->renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderDebugText(vm->renderer, (float)(x + 1), (float)(y + 1), str);
|
||||
SDL_SetRenderDrawColor(vm->renderer, 0xff, 0xff, 0xff, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderDebugText(vm->renderer, (float)x, (float)y, str);
|
||||
SDL_SetRenderDrawColor(vm->renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
}
|
||||
|
||||
SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) {
|
||||
BytePusher* vm;
|
||||
SDL_Palette* palette;
|
||||
SDL_Rect usable_bounds;
|
||||
SDL_AudioSpec audiospec = { SDL_AUDIO_S8, 1, SAMPLES_PER_FRAME * FRAMES_PER_SECOND };
|
||||
SDL_DisplayID primary_display;
|
||||
SDL_PropertiesID texprops;
|
||||
int zoom = 2;
|
||||
int i;
|
||||
Uint8 r, g, b;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
if (!SDL_SetAppMetadata("SDL 3 BytePusher", "1.0", "com.example.SDL3BytePusher")) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)SDL_arraysize(extended_metadata); i++) {
|
||||
if (!SDL_SetAppMetadataProperty(extended_metadata[i].key, extended_metadata[i].value)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!(vm = SDL_calloc(1, sizeof(*vm)))) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
*(BytePusher**)appstate = vm;
|
||||
|
||||
vm->display_help = true;
|
||||
|
||||
primary_display = SDL_GetPrimaryDisplay();
|
||||
if (SDL_GetDisplayUsableBounds(primary_display, &usable_bounds)) {
|
||||
int zoom_w = (usable_bounds.w - usable_bounds.x) * 2 / 3 / SCREEN_W;
|
||||
int zoom_h = (usable_bounds.h - usable_bounds.y) * 2 / 3 / SCREEN_H;
|
||||
zoom = zoom_w < zoom_h ? zoom_w : zoom_h;
|
||||
if (zoom < 1) {
|
||||
zoom = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!SDL_CreateWindowAndRenderer("SDL 3 BytePusher",
|
||||
SCREEN_W * zoom, SCREEN_H * zoom, SDL_WINDOW_RESIZABLE,
|
||||
&vm->window, &vm->renderer
|
||||
)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!SDL_SetRenderLogicalPresentation(
|
||||
vm->renderer, SCREEN_W, SCREEN_H, SDL_LOGICAL_PRESENTATION_INTEGER_SCALE
|
||||
)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!(vm->screen = SDL_CreateSurfaceFrom(
|
||||
SCREEN_W, SCREEN_H, SDL_PIXELFORMAT_INDEX8, vm->screenbuf, SCREEN_W
|
||||
))) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!(palette = SDL_CreateSurfacePalette(vm->screen))) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
i = 0;
|
||||
for (r = 0; r < 6; ++r) {
|
||||
for (g = 0; g < 6; ++g) {
|
||||
for (b = 0; b < 6; ++b, ++i) {
|
||||
SDL_Color color = { r * 0x33, g * 0x33, b * 0x33, SDL_ALPHA_OPAQUE };
|
||||
palette->colors[i] = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (; i < 256; ++i) {
|
||||
SDL_Color color = { 0, 0, 0, SDL_ALPHA_OPAQUE };
|
||||
palette->colors[i] = color;
|
||||
}
|
||||
|
||||
texprops = SDL_CreateProperties();
|
||||
SDL_SetNumberProperty(texprops, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STREAMING);
|
||||
SDL_SetNumberProperty(texprops, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, SCREEN_W);
|
||||
SDL_SetNumberProperty(texprops, SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER, SCREEN_H);
|
||||
vm->screentex = SDL_CreateTextureWithProperties(vm->renderer, texprops);
|
||||
SDL_SetNumberProperty(texprops, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_TARGET);
|
||||
vm->rendertarget = SDL_CreateTextureWithProperties(vm->renderer, texprops);
|
||||
SDL_DestroyProperties(texprops);
|
||||
if (!vm->screentex || !vm->rendertarget) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
SDL_SetTextureScaleMode(vm->screentex, SDL_SCALEMODE_NEAREST);
|
||||
SDL_SetTextureScaleMode(vm->rendertarget, SDL_SCALEMODE_NEAREST);
|
||||
|
||||
if (!(vm->audiostream = SDL_OpenAudioDeviceStream(
|
||||
SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &audiospec, NULL, NULL
|
||||
))) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
SDL_SetAudioStreamGain(vm->audiostream, 0.1f); /* examples are loud! */
|
||||
SDL_ResumeAudioStreamDevice(vm->audiostream);
|
||||
|
||||
set_status(vm, "renderer: %s", SDL_GetRendererName(vm->renderer));
|
||||
|
||||
vm->last_tick = SDL_GetTicksNS();
|
||||
vm->tick_acc = NS_PER_SECOND;
|
||||
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
|
||||
SDL_AppResult SDL_AppIterate(void* appstate) {
|
||||
BytePusher* vm = (BytePusher*)appstate;
|
||||
|
||||
Uint64 tick = SDL_GetTicksNS();
|
||||
Uint64 delta = tick - vm->last_tick;
|
||||
bool updated, skip_audio;
|
||||
|
||||
vm->last_tick = tick;
|
||||
|
||||
vm->tick_acc += delta * FRAMES_PER_SECOND;
|
||||
updated = vm->tick_acc >= NS_PER_SECOND;
|
||||
skip_audio = vm->tick_acc >= MAX_AUDIO_LATENCY_FRAMES * NS_PER_SECOND;
|
||||
|
||||
if (skip_audio) {
|
||||
// don't let audio fall too far behind
|
||||
SDL_ClearAudioStream(vm->audiostream);
|
||||
}
|
||||
|
||||
while (vm->tick_acc >= NS_PER_SECOND) {
|
||||
Uint32 pc;
|
||||
int i;
|
||||
|
||||
vm->tick_acc -= NS_PER_SECOND;
|
||||
|
||||
vm->ram[IO_KEYBOARD] = (Uint8)(vm->keystate >> 8);
|
||||
vm->ram[IO_KEYBOARD + 1] = (Uint8)(vm->keystate);
|
||||
|
||||
pc = read_u24(vm, IO_PC);
|
||||
for (i = 0; i < SCREEN_W * SCREEN_H; ++i) {
|
||||
Uint32 src = read_u24(vm, pc);
|
||||
Uint32 dst = read_u24(vm, pc + 3);
|
||||
vm->ram[dst] = vm->ram[src];
|
||||
pc = read_u24(vm, pc + 6);
|
||||
}
|
||||
|
||||
if (!skip_audio || vm->tick_acc < NS_PER_SECOND) {
|
||||
SDL_PutAudioStreamData(
|
||||
vm->audiostream,
|
||||
&vm->ram[(Uint32)read_u16(vm, IO_AUDIO_BANK) << 8],
|
||||
SAMPLES_PER_FRAME
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
SDL_Surface *tex;
|
||||
|
||||
SDL_SetRenderTarget(vm->renderer, vm->rendertarget);
|
||||
|
||||
if (!SDL_LockTextureToSurface(vm->screentex, NULL, &tex)) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
vm->screen->pixels = &vm->ram[(Uint32)vm->ram[IO_SCREEN_PAGE] << 16];
|
||||
SDL_BlitSurface(vm->screen, NULL, tex, NULL);
|
||||
SDL_UnlockTexture(vm->screentex);
|
||||
|
||||
SDL_RenderTexture(vm->renderer, vm->screentex, NULL, NULL);
|
||||
}
|
||||
|
||||
if (vm->display_help) {
|
||||
print(vm, 4, 4, "Drop a BytePusher file in this");
|
||||
print(vm, 8, 12, "window to load and run it!");
|
||||
print(vm, 4, 28, "Press ENTER to switch between");
|
||||
print(vm, 8, 36, "positional and symbolic input.");
|
||||
}
|
||||
|
||||
if (vm->status_ticks > 0) {
|
||||
vm->status_ticks -= 1;
|
||||
print(vm, 4, SCREEN_H - 12, vm->status);
|
||||
}
|
||||
|
||||
SDL_SetRenderTarget(vm->renderer, NULL);
|
||||
SDL_RenderClear(vm->renderer);
|
||||
SDL_RenderTexture(vm->renderer, vm->rendertarget, NULL, NULL);
|
||||
SDL_RenderPresent(vm->renderer);
|
||||
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
|
||||
static Uint16 keycode_mask(SDL_Keycode key) {
|
||||
int index;
|
||||
if (key >= SDLK_0 && key <= SDLK_9) {
|
||||
index = key - SDLK_0;
|
||||
} else if (key >= SDLK_A && key <= SDLK_F) {
|
||||
index = key - SDLK_A + 10;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return (Uint16)1 << index;
|
||||
}
|
||||
|
||||
static Uint16 scancode_mask(SDL_Scancode scancode) {
|
||||
int index;
|
||||
switch (scancode) {
|
||||
case SDL_SCANCODE_1: index = 0x1; break;
|
||||
case SDL_SCANCODE_2: index = 0x2; break;
|
||||
case SDL_SCANCODE_3: index = 0x3; break;
|
||||
case SDL_SCANCODE_4: index = 0xc; break;
|
||||
case SDL_SCANCODE_Q: index = 0x4; break;
|
||||
case SDL_SCANCODE_W: index = 0x5; break;
|
||||
case SDL_SCANCODE_E: index = 0x6; break;
|
||||
case SDL_SCANCODE_R: index = 0xd; break;
|
||||
case SDL_SCANCODE_A: index = 0x7; break;
|
||||
case SDL_SCANCODE_S: index = 0x8; break;
|
||||
case SDL_SCANCODE_D: index = 0x9; break;
|
||||
case SDL_SCANCODE_F: index = 0xe; break;
|
||||
case SDL_SCANCODE_Z: index = 0xa; break;
|
||||
case SDL_SCANCODE_X: index = 0x0; break;
|
||||
case SDL_SCANCODE_C: index = 0xb; break;
|
||||
case SDL_SCANCODE_V: index = 0xf; break;
|
||||
default: return 0;
|
||||
}
|
||||
return (Uint16)1 << index;
|
||||
}
|
||||
|
||||
SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event) {
|
||||
BytePusher* vm = (BytePusher*)appstate;
|
||||
|
||||
switch (event->type) {
|
||||
case SDL_EVENT_QUIT:
|
||||
return SDL_APP_SUCCESS;
|
||||
|
||||
case SDL_EVENT_DROP_FILE:
|
||||
load_file(vm, event->drop.data);
|
||||
break;
|
||||
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
#ifndef __EMSCRIPTEN__
|
||||
if (event->key.key == SDLK_ESCAPE) {
|
||||
return SDL_APP_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
if (event->key.key == SDLK_RETURN) {
|
||||
vm->positional_input = !vm->positional_input;
|
||||
vm->keystate = 0;
|
||||
if (vm->positional_input) {
|
||||
set_status(vm, "switched to positional input");
|
||||
} else {
|
||||
set_status(vm, "switched to symbolic input");
|
||||
}
|
||||
}
|
||||
if (vm->positional_input) {
|
||||
vm->keystate |= scancode_mask(event->key.scancode);
|
||||
} else {
|
||||
vm->keystate |= keycode_mask(event->key.key);
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_EVENT_KEY_UP:
|
||||
if (vm->positional_input) {
|
||||
vm->keystate &= ~scancode_mask(event->key.scancode);
|
||||
} else {
|
||||
vm->keystate &= ~keycode_mask(event->key.key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
|
||||
void SDL_AppQuit(void* appstate, SDL_AppResult result) {
|
||||
if (result == SDL_APP_FAILURE) {
|
||||
SDL_Log("Error: %s", SDL_GetError());
|
||||
}
|
||||
if (appstate) {
|
||||
BytePusher* vm = (BytePusher*)appstate;
|
||||
SDL_DestroyAudioStream(vm->audiostream);
|
||||
SDL_DestroyTexture(vm->rendertarget);
|
||||
SDL_DestroyTexture(vm->screentex);
|
||||
SDL_DestroySurface(vm->screen);
|
||||
SDL_DestroyRenderer(vm->renderer);
|
||||
SDL_DestroyWindow(vm->window);
|
||||
SDL_free(vm);
|
||||
}
|
||||
}
|
||||
BIN
examples/demo/04-bytepusher/onmouseover.webp
Normal file
|
After Width: | Height: | Size: 420 KiB |
BIN
examples/demo/04-bytepusher/thumbnail.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
1
examples/demo/description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Full game and app demos
|
||||
2
examples/input/01-joystick-polling/README.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
This example code looks for the current joystick state once per frame,
|
||||
and draws a visual representation of it.
|
||||
193
examples/input/01-joystick-polling/joystick-polling.c
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* This example code looks for the current joystick state once per frame,
|
||||
* and draws a visual representation of it.
|
||||
*
|
||||
* This code is public domain. Feel free to use it for any purpose!
|
||||
*/
|
||||
|
||||
/* Joysticks are low-level interfaces: there's something with a bunch of
|
||||
buttons, axes and hats, in no understood order or position. This is
|
||||
a flexible interface, but you'll need to build some sort of configuration
|
||||
UI to let people tell you what button, etc, does what. On top of this
|
||||
interface, SDL offers the "gamepad" API, which works with lots of devices,
|
||||
and knows how to map arbitrary buttons and such to look like an
|
||||
Xbox/PlayStation/etc gamepad. This is easier, and better, for many games,
|
||||
but isn't necessarily a good fit for complex apps and hardware. A flight
|
||||
simulator, a realistic racing game, etc, might want this interface instead
|
||||
of gamepads. */
|
||||
|
||||
/* SDL can handle multiple joysticks, but for simplicity, this program only
|
||||
deals with the first stick it sees. */
|
||||
|
||||
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
/* We will use this renderer to draw into this window every frame. */
|
||||
static SDL_Window *window = NULL;
|
||||
static SDL_Renderer *renderer = NULL;
|
||||
static SDL_Joystick *joystick = NULL;
|
||||
static SDL_Color colors[64];
|
||||
|
||||
/* This function runs once at startup. */
|
||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
SDL_SetAppMetadata("Example Input Joystick Polling", "1.0", "com.example.input-joystick-polling");
|
||||
|
||||
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK)) {
|
||||
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!SDL_CreateWindowAndRenderer("examples/input/joystick-polling", 640, 480, 0, &window, &renderer)) {
|
||||
SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < SDL_arraysize(colors); i++) {
|
||||
colors[i].r = SDL_rand(255);
|
||||
colors[i].g = SDL_rand(255);
|
||||
colors[i].b = SDL_rand(255);
|
||||
colors[i].a = 255;
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
|
||||
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
{
|
||||
if (event->type == SDL_EVENT_QUIT) {
|
||||
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
|
||||
} else if (event->type == SDL_EVENT_JOYSTICK_ADDED) {
|
||||
/* this event is sent for each hotplugged stick, but also each already-connected joystick during SDL_Init(). */
|
||||
if (joystick == NULL) { /* we don't have a stick yet and one was added, open it! */
|
||||
joystick = SDL_OpenJoystick(event->jdevice.which);
|
||||
if (!joystick) {
|
||||
SDL_Log("Failed to open joystick ID %u: %s", (unsigned int) event->jdevice.which, SDL_GetError());
|
||||
}
|
||||
}
|
||||
} else if (event->type == SDL_EVENT_JOYSTICK_REMOVED) {
|
||||
if (joystick && (SDL_GetJoystickID(joystick) == event->jdevice.which)) {
|
||||
SDL_CloseJoystick(joystick); /* our joystick was unplugged. */
|
||||
joystick = NULL;
|
||||
}
|
||||
}
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once per frame, and is the heart of the program. */
|
||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
||||
{
|
||||
int winw = 640, winh = 480;
|
||||
const char *text = "Plug in a joystick, please.";
|
||||
float x, y;
|
||||
int i;
|
||||
|
||||
if (joystick) { /* we have a stick opened? */
|
||||
text = SDL_GetJoystickName(joystick);
|
||||
}
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
SDL_GetWindowSize(window, &winw, &winh);
|
||||
|
||||
/* note that you can get input as events, instead of polling, which is
|
||||
better since it won't miss button presses if the system is lagging,
|
||||
but often times checking the current state per-frame is good enough,
|
||||
and maybe better if you'd rather _drop_ inputs due to lag. */
|
||||
|
||||
if (joystick) { /* we have a stick opened? */
|
||||
const float size = 30.0f;
|
||||
int total;
|
||||
|
||||
/* draw axes as bars going across middle of screen. We don't know if it's an X or Y or whatever axis, so we can't do more than this. */
|
||||
total = SDL_GetNumJoystickAxes(joystick);
|
||||
y = (float) ((winh - (total * size)) / 2);
|
||||
x = ((float) winw) / 2.0f;
|
||||
for (i = 0; i < total; i++) {
|
||||
const SDL_Color *color = &colors[i % SDL_arraysize(colors)];
|
||||
const float val = (((float) SDL_GetJoystickAxis(joystick, i)) / 32767.0f); /* make it -1.0f to 1.0f */
|
||||
const float dx = x + (val * x);
|
||||
const SDL_FRect dst = { dx, y, x - SDL_fabsf(dx), size };
|
||||
SDL_SetRenderDrawColor(renderer, color->r, color->g, color->b, color->a);
|
||||
SDL_RenderFillRect(renderer, &dst);
|
||||
y += size;
|
||||
}
|
||||
|
||||
/* draw buttons as blocks across top of window. We only know the button numbers, but not where they are on the device. */
|
||||
total = SDL_GetNumJoystickButtons(joystick);
|
||||
x = (float) ((winw - (total * size)) / 2);
|
||||
for (i = 0; i < total; i++) {
|
||||
const SDL_Color *color = &colors[i % SDL_arraysize(colors)];
|
||||
const SDL_FRect dst = { x, 0.0f, size, size };
|
||||
if (SDL_GetJoystickButton(joystick, i)) {
|
||||
SDL_SetRenderDrawColor(renderer, color->r, color->g, color->b, color->a);
|
||||
} else {
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
}
|
||||
SDL_RenderFillRect(renderer, &dst);
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, color->a);
|
||||
SDL_RenderRect(renderer, &dst); /* outline it */
|
||||
x += size;
|
||||
}
|
||||
|
||||
/* draw hats across the bottom of the screen. */
|
||||
total = SDL_GetNumJoystickHats(joystick);
|
||||
x = ((float) ((winw - (total * (size * 2.0f))) / 2.0f)) + (size / 2.0f);
|
||||
y = ((float) winh) - size;
|
||||
for (i = 0; i < total; i++) {
|
||||
const SDL_Color *color = &colors[i % SDL_arraysize(colors)];
|
||||
const float thirdsize = size / 3.0f;
|
||||
const SDL_FRect cross[] = { { x, y + thirdsize, size, thirdsize }, { x + thirdsize, y, thirdsize, size } };
|
||||
const Uint8 hat = SDL_GetJoystickHat(joystick, i);
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 90, 90, 90, 255);
|
||||
SDL_RenderFillRects(renderer, cross, SDL_arraysize(cross));
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, color->r, color->g, color->b, color->a);
|
||||
|
||||
if (hat & SDL_HAT_UP) {
|
||||
const SDL_FRect dst = { x + thirdsize, y, thirdsize, thirdsize };
|
||||
SDL_RenderFillRect(renderer, &dst);
|
||||
}
|
||||
|
||||
if (hat & SDL_HAT_RIGHT) {
|
||||
const SDL_FRect dst = { x + (thirdsize * 2), y + thirdsize, thirdsize, thirdsize };
|
||||
SDL_RenderFillRect(renderer, &dst);
|
||||
}
|
||||
|
||||
if (hat & SDL_HAT_DOWN) {
|
||||
const SDL_FRect dst = { x + thirdsize, y + (thirdsize * 2), thirdsize, thirdsize };
|
||||
SDL_RenderFillRect(renderer, &dst);
|
||||
}
|
||||
|
||||
if (hat & SDL_HAT_LEFT) {
|
||||
const SDL_FRect dst = { x, y + thirdsize, thirdsize, thirdsize };
|
||||
SDL_RenderFillRect(renderer, &dst);
|
||||
}
|
||||
|
||||
x += size * 2;
|
||||
}
|
||||
}
|
||||
|
||||
x = (((float) winw) - (SDL_strlen(text) * SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE)) / 2.0f;
|
||||
y = (((float) winh) - SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE) / 2.0f;
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||
SDL_RenderDebugText(renderer, x, y, text);
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once at shutdown. */
|
||||
void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
{
|
||||
if (joystick) {
|
||||
SDL_CloseJoystick(joystick);
|
||||
}
|
||||
|
||||
/* SDL will clean up the window/renderer for us. */
|
||||
}
|
||||