Compare commits
935 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fec96137e8 | ||
![]() |
18a36b3e06 | ||
![]() |
40d01162b9 | ||
![]() |
e8a5d7b85c | ||
![]() |
e06047419c | ||
![]() |
03516b1c68 | ||
![]() |
7ab24b94ee | ||
![]() |
bf3e527dab | ||
![]() |
b31c836456 | ||
![]() |
1aacefd6fa | ||
![]() |
3b4f9faebc | ||
![]() |
159e6b6f24 | ||
![]() |
ad2067340f | ||
![]() |
cf04425bc2 | ||
![]() |
796d96408b | ||
![]() |
54ccb18e87 | ||
![]() |
3d64598e11 | ||
![]() |
7ac2b4a226 | ||
![]() |
2b9ef7d15c | ||
![]() |
975c70d2b7 | ||
![]() |
a6300d828a | ||
![]() |
1a361fdfe2 | ||
![]() |
5a2c49b954 | ||
![]() |
90ec0d52e0 | ||
![]() |
a7f81b06b9 | ||
![]() |
393b0d1a80 | ||
![]() |
9a115106b4 | ||
![]() |
a3b7bd0891 | ||
![]() |
dad0e64aa8 | ||
![]() |
90e36d1883 | ||
![]() |
8873aca268 | ||
![]() |
ce28dfbdeb | ||
![]() |
e4bc2c643e | ||
![]() |
54f01e151c | ||
![]() |
11e9a0d41c | ||
![]() |
4f38830058 | ||
![]() |
520ea94de8 | ||
![]() |
8ca3212701 | ||
![]() |
f9c4cc2040 | ||
![]() |
b436c8d7e5 | ||
![]() |
ee3e40c663 | ||
![]() |
4fd1e04e70 | ||
![]() |
4f7b5ff59f | ||
![]() |
ab1e246367 | ||
![]() |
15716e59dc | ||
![]() |
aa3c7f4614 | ||
![]() |
ae53600d31 | ||
![]() |
57f0015a08 | ||
![]() |
1b873b028f | ||
![]() |
3a332d241c | ||
![]() |
0b18882a94 | ||
![]() |
8f7e2cd179 | ||
![]() |
614e0518a7 | ||
![]() |
cf1ebada0e | ||
![]() |
aae7ab64c7 | ||
![]() |
68ee0bb8dd | ||
![]() |
d3f5bc4043 | ||
![]() |
f4f6e25340 | ||
![]() |
9614d3353b | ||
![]() |
ab14ad5d75 | ||
![]() |
0eeb499288 | ||
![]() |
5492f52adc | ||
![]() |
1611cd54e7 | ||
![]() |
6897b43599 | ||
![]() |
394b31faff | ||
![]() |
73c9f72c52 | ||
![]() |
7fd2bf1a32 | ||
![]() |
215eb967e8 | ||
![]() |
cb2ba3675c | ||
![]() |
ca98a84d68 | ||
![]() |
110eab56a7 | ||
![]() |
d5a31168ce | ||
![]() |
d652b95fbf | ||
![]() |
153470d605 | ||
![]() |
b4d824d6fc | ||
![]() |
8169d0eab2 | ||
![]() |
b2926b2d28 | ||
![]() |
3cade2a1a0 | ||
![]() |
bcae065c88 | ||
![]() |
1347a15539 | ||
![]() |
d26a56d4e1 | ||
![]() |
47dd842e81 | ||
![]() |
f594f14510 | ||
![]() |
2766835ed4 | ||
![]() |
9eaed07b77 | ||
![]() |
beb44f1dac | ||
![]() |
903d85e323 | ||
![]() |
5dedb27ce0 | ||
![]() |
ec95aa2e04 | ||
![]() |
1cfb484100 | ||
![]() |
e843be7ea5 | ||
![]() |
547819766f | ||
![]() |
50d17393a5 | ||
![]() |
ea590c44a9 | ||
![]() |
73989a4981 | ||
![]() |
f1bcabcc37 | ||
![]() |
a9c28d7583 | ||
![]() |
22287a78c5 | ||
![]() |
96a9b4e1f2 | ||
![]() |
21961a786d | ||
![]() |
4647441ad8 | ||
![]() |
4ae0a416f4 | ||
![]() |
6ae21d6581 | ||
![]() |
5c6a756014 | ||
![]() |
f784961b9c | ||
![]() |
e187b693ea | ||
![]() |
04ab76b889 | ||
![]() |
1fea266472 | ||
![]() |
c91190fc6e | ||
![]() |
ff70a04bf5 | ||
![]() |
60d0ab418a | ||
![]() |
8c50da167d | ||
![]() |
589892af07 | ||
![]() |
901c4553d2 | ||
![]() |
43e45cbb81 | ||
![]() |
7914332c40 | ||
![]() |
b9e49cdca6 | ||
![]() |
212f331583 | ||
![]() |
d827a65e59 | ||
![]() |
a151cbd37a | ||
![]() |
89171a2608 | ||
![]() |
c94c666d04 | ||
![]() |
929a46cbab | ||
![]() |
df5a736c00 | ||
![]() |
7fff1ba0b0 | ||
![]() |
0b42da4085 | ||
![]() |
83ff7b2466 | ||
![]() |
81ca2f0bf3 | ||
![]() |
af66e751db | ||
![]() |
000cb5a47d | ||
![]() |
f088548261 | ||
![]() |
0125790801 | ||
![]() |
63da7cdec6 | ||
![]() |
4adba0d3c3 | ||
![]() |
7cdffcec52 | ||
![]() |
f68bb8c707 | ||
![]() |
5149da5719 | ||
![]() |
5b3c5e1a16 | ||
![]() |
542ef8904a | ||
![]() |
393a03a46e | ||
![]() |
4706891cae | ||
![]() |
d8af76f67c | ||
![]() |
78ae3b38a6 | ||
![]() |
e539aad118 | ||
![]() |
19715546b3 | ||
![]() |
342b18da03 | ||
![]() |
c649bec26c | ||
![]() |
e64606a82f | ||
![]() |
edaca16d7c | ||
![]() |
116603e61c | ||
![]() |
76468bb8d8 | ||
![]() |
2a2f2b20b8 | ||
![]() |
aed131a8f0 | ||
![]() |
d224414eb1 | ||
![]() |
c6376acfc4 | ||
![]() |
3028bffd4c | ||
![]() |
f549f67be9 | ||
![]() |
6dd1d2d931 | ||
![]() |
bba6ae5622 | ||
![]() |
ce8000ee7e | ||
![]() |
89755e52bf | ||
![]() |
73234d2a28 | ||
![]() |
39f9045703 | ||
![]() |
b854909803 | ||
![]() |
d3c1a04983 | ||
![]() |
f2e3d6eca7 | ||
![]() |
fabedf7636 | ||
![]() |
62f63f9e48 | ||
![]() |
1dbcce8b56 | ||
![]() |
0ccc1d3686 | ||
![]() |
5ba41e4f7f | ||
![]() |
3cfb9a6e83 | ||
![]() |
30b75702df | ||
![]() |
e2a8066fca | ||
![]() |
b59fab7ee6 | ||
![]() |
713e26332f | ||
![]() |
ba38fe5b97 | ||
![]() |
dbdbbea471 | ||
![]() |
03cc540d5f | ||
![]() |
d7f7c94c4d | ||
![]() |
72b9f3c5de | ||
![]() |
d1a104bba4 | ||
![]() |
c2b56c583a | ||
![]() |
619331f4a7 | ||
![]() |
3419aef677 | ||
![]() |
445ce51e51 | ||
![]() |
884d30b85a | ||
![]() |
c04c3668cb | ||
![]() |
855a5f3701 | ||
![]() |
6d59a21e99 | ||
![]() |
935a306b29 | ||
![]() |
2c9d116a5c | ||
![]() |
f1368c36dd | ||
![]() |
4de64f5750 | ||
![]() |
89698844a1 | ||
![]() |
57dd345dc3 | ||
![]() |
5b5dff3f9e | ||
![]() |
a4079ad565 | ||
![]() |
387c060006 | ||
![]() |
0b6d4b376f | ||
![]() |
d241ee8516 | ||
![]() |
2edf5a9584 | ||
![]() |
50a716c0d9 | ||
![]() |
57bd84510f | ||
![]() |
66a2cdee40 | ||
![]() |
bbf9935828 | ||
![]() |
fc5894e734 | ||
![]() |
2fd6d7e8c0 | ||
![]() |
2c77b31e30 | ||
![]() |
c48de2d1af | ||
![]() |
c0010105c2 | ||
![]() |
f6558fe6e0 | ||
![]() |
36bb57d1be | ||
![]() |
e6306e5e76 | ||
![]() |
2761aa40dd | ||
![]() |
c8fd93d356 | ||
![]() |
2604b9f72b | ||
![]() |
3c51d066f1 | ||
![]() |
656f47b7cc | ||
![]() |
2a88dc9bb7 | ||
![]() |
fadc29d811 | ||
![]() |
4bb71c8fa2 | ||
![]() |
baabe22f7a | ||
![]() |
025db8f227 | ||
![]() |
31edd13a72 | ||
![]() |
82e0644195 | ||
![]() |
3888299bf5 | ||
![]() |
7f68c65406 | ||
![]() |
84a2a88572 | ||
![]() |
fca58c8e2f | ||
![]() |
311a57f9fc | ||
![]() |
773c0d78d8 | ||
![]() |
ca6f58eed1 | ||
![]() |
dbdfad7ace | ||
![]() |
1cb81e3f4c | ||
![]() |
4c4a703841 | ||
![]() |
d91f30958f | ||
![]() |
5113817507 | ||
![]() |
28e8b2add3 | ||
![]() |
bcb47255b9 | ||
![]() |
bc60812d68 | ||
![]() |
df4199e2c1 | ||
![]() |
c4abf68351 | ||
![]() |
865f823835 | ||
![]() |
dbecb95024 | ||
![]() |
072e92615a | ||
![]() |
e5d332dea2 | ||
![]() |
d5cd5ebd80 | ||
![]() |
d71505bdc6 | ||
![]() |
483f10397e | ||
![]() |
d9f434afb9 | ||
![]() |
40cf84e7e5 | ||
![]() |
b8e14a4f99 | ||
![]() |
7e7939e1ad | ||
![]() |
c5e89241c5 | ||
![]() |
0b69bc28c6 | ||
![]() |
e61639f6fc | ||
![]() |
ccd4f8b5ae | ||
![]() |
11fd883ee4 | ||
![]() |
aa67f7c39a | ||
![]() |
f080367a0c | ||
![]() |
07bbfe86b9 | ||
![]() |
8ebe62b4dd | ||
![]() |
4cca234f46 | ||
![]() |
0d04ceafbf | ||
![]() |
8025b052b3 | ||
![]() |
cb085a1b50 | ||
![]() |
cee0fc5d78 | ||
![]() |
38025362ee | ||
![]() |
7a15861d44 | ||
![]() |
26969c2c38 | ||
![]() |
25d846aa9a | ||
![]() |
9017be3259 | ||
![]() |
2d88958d35 | ||
![]() |
2e26cf48e8 | ||
![]() |
7459d906de | ||
![]() |
62d228346b | ||
![]() |
2872b2fff5 | ||
![]() |
33e7f7cc59 | ||
![]() |
0daaaddeef | ||
![]() |
03f5fce672 | ||
![]() |
178a356cb4 | ||
![]() |
f14955512f | ||
![]() |
45da03df23 | ||
![]() |
4fe6f885f7 | ||
![]() |
357f782f4e | ||
![]() |
0ced04f0df | ||
![]() |
587e61def9 | ||
![]() |
5c404c79da | ||
![]() |
8f88c61bdf | ||
![]() |
e9ca38fafa | ||
![]() |
7ab056b6ef | ||
![]() |
2ef0b064e5 | ||
![]() |
ea87491a82 | ||
![]() |
810a0330ab | ||
![]() |
4b1d4b4f6b | ||
![]() |
907e9e1fe2 | ||
![]() |
4311ffc9e1 | ||
![]() |
2093fdcc53 | ||
![]() |
0e5cd442be | ||
![]() |
5530a3ceb8 | ||
![]() |
6e8f3b0f45 | ||
![]() |
12e8cef9cf | ||
![]() |
27781a4767 | ||
![]() |
7e3a50b4ac | ||
![]() |
42ecd72547 | ||
![]() |
8f597b3cc3 | ||
![]() |
ff25402f68 | ||
![]() |
8e57c8ace3 | ||
![]() |
494a581339 | ||
![]() |
4c3d577ddb | ||
![]() |
c328f09efc | ||
![]() |
cb9b8f73c0 | ||
![]() |
eaa0b9102b | ||
![]() |
a12ddacb7b | ||
![]() |
853c66baed | ||
![]() |
cf76d23476 | ||
![]() |
cf24c021a3 | ||
![]() |
b478364914 | ||
![]() |
c1b4881e8a | ||
![]() |
ac1ffbad1d | ||
![]() |
b09725fa84 | ||
![]() |
e59442bfab | ||
![]() |
9996e328cb | ||
![]() |
ad5ffd78d6 | ||
![]() |
0917290e95 | ||
![]() |
ac3420faac | ||
![]() |
ee5a87826d | ||
![]() |
f4b4054de5 | ||
![]() |
aff98d7f2a | ||
![]() |
082920eb80 | ||
![]() |
de968e3623 | ||
![]() |
2a798d64a2 | ||
![]() |
234576da71 | ||
![]() |
fb1037a241 | ||
![]() |
64cca24526 | ||
![]() |
a598754b5b | ||
![]() |
bb4d9297b5 | ||
![]() |
4938966e76 | ||
![]() |
cabaa53302 | ||
![]() |
bfab101ac2 | ||
![]() |
23cc39a265 | ||
![]() |
0c7ba773ec | ||
![]() |
4b76aa09dd | ||
![]() |
d66692149b | ||
![]() |
7f5567eec0 | ||
![]() |
be2328f848 | ||
![]() |
568fe42cb1 | ||
![]() |
482dbfc52e | ||
![]() |
10ae54379a | ||
![]() |
2236197d49 | ||
![]() |
9e0e08cba4 | ||
![]() |
8508ae3d15 | ||
![]() |
99948a86e1 | ||
![]() |
f66b1a3136 | ||
![]() |
ae745e4fa8 | ||
![]() |
e92bc8ca4e | ||
![]() |
aa4111a3b2 | ||
![]() |
7bb8ffc29e | ||
![]() |
e835311d0d | ||
![]() |
4ee5fdf619 | ||
![]() |
35c777ef2c | ||
![]() |
904c505125 | ||
![]() |
d8ed3fb31e | ||
![]() |
2ad7967db8 | ||
![]() |
95d3a6ac52 | ||
![]() |
f049f9dd3a | ||
![]() |
67f8424eb0 | ||
![]() |
7db6fe02fd | ||
![]() |
bf2ad9df5f | ||
![]() |
092b6f956e | ||
![]() |
48c7f65b77 | ||
![]() |
e0b487c641 | ||
![]() |
56072a631d | ||
![]() |
f2fbdd1999 | ||
![]() |
03bf7e81dd | ||
![]() |
14b1aef194 | ||
![]() |
d658e6772d | ||
![]() |
965057dbe2 | ||
![]() |
b38dceb2de | ||
![]() |
764254d93e | ||
![]() |
b55cb32d9b | ||
![]() |
931af3a242 | ||
![]() |
372983c06e | ||
![]() |
8b8b5ef70e | ||
![]() |
feb9c52374 | ||
![]() |
71e43612d6 | ||
![]() |
b24947c0d0 | ||
![]() |
60d9cbd754 | ||
![]() |
4c71f5f76e | ||
![]() |
75ece337ae | ||
![]() |
4f6fbaed41 | ||
![]() |
ddb8be3564 | ||
![]() |
b3ed01dbab | ||
![]() |
e87caa2687 | ||
![]() |
b0f3a2c217 | ||
![]() |
d1a5d381d8 | ||
![]() |
621d6ae856 | ||
![]() |
8127044748 | ||
![]() |
2c0071c851 | ||
![]() |
63a23a6b74 | ||
![]() |
304c820a8e | ||
![]() |
86ac792d9a | ||
![]() |
4b2357dc34 | ||
![]() |
e47a3afbd8 | ||
![]() |
3ce5941106 | ||
![]() |
3edf43f1d6 | ||
![]() |
e06ed6c608 | ||
![]() |
ec8fabceeb | ||
![]() |
14990209ef | ||
![]() |
d1c53910b7 | ||
![]() |
5940790379 | ||
![]() |
19d6f2a961 | ||
![]() |
7faeaa757c | ||
![]() |
d70e5cd26b | ||
![]() |
82b76149da | ||
![]() |
b0b6381745 | ||
![]() |
3e4a8bb640 | ||
![]() |
090e47dca0 | ||
![]() |
1a35f73d84 | ||
![]() |
50663f0890 | ||
![]() |
7c9d55f4d9 | ||
![]() |
0739152057 | ||
![]() |
66108c47d9 | ||
![]() |
75c8df348f | ||
![]() |
273c780b67 | ||
![]() |
2ce0722fb8 | ||
![]() |
72b2d1335a | ||
![]() |
b79df1c329 | ||
![]() |
d791c1cf64 | ||
![]() |
94165a40b9 | ||
![]() |
dd455c626e | ||
![]() |
0ce8a8f360 | ||
![]() |
b187d6ca16 | ||
![]() |
5840cd6e50 | ||
![]() |
df5514088e | ||
![]() |
312fa64b88 | ||
![]() |
222997f951 | ||
![]() |
2a2c9e4da8 | ||
![]() |
6ecb29f33f | ||
![]() |
ddbe8972bc | ||
![]() |
9cbbf149d8 | ||
![]() |
328d65b1b3 | ||
![]() |
c457835938 | ||
![]() |
d68ddda766 | ||
![]() |
24e6bf0565 | ||
![]() |
4492e64cb5 | ||
![]() |
191c340409 | ||
![]() |
ed7548051b | ||
![]() |
eb8d14e5b2 | ||
![]() |
fd191a32ea | ||
![]() |
fe9e82b2e6 | ||
![]() |
b20d416131 | ||
![]() |
dacd500ef0 | ||
![]() |
a0b4b28427 | ||
![]() |
f9b71e7bcd | ||
![]() |
0f47054ece | ||
![]() |
a6b3c8aa1e | ||
![]() |
2e5fc3d0c2 | ||
![]() |
f596815973 | ||
![]() |
7853155f99 | ||
![]() |
f31e4ebb3d | ||
![]() |
85bd13c41d | ||
![]() |
d59ea21405 | ||
![]() |
93b633b6e6 | ||
![]() |
bc8cecc6aa | ||
![]() |
6c61f83d63 | ||
![]() |
0ef3e4c4d5 | ||
![]() |
b6f87023ad | ||
![]() |
fccdb68df8 | ||
![]() |
277dd2bb57 | ||
![]() |
721e7914b1 | ||
![]() |
e4229e1be7 | ||
![]() |
bb6b43b7cb | ||
![]() |
52345fd883 | ||
![]() |
241d6526b0 | ||
![]() |
7b05444af8 | ||
![]() |
024a803665 | ||
![]() |
5a2f25cc7c | ||
![]() |
6f3a633f2e | ||
![]() |
00c7509454 | ||
![]() |
64710e6030 | ||
![]() |
d78177d246 | ||
![]() |
39d9d1da42 | ||
![]() |
4b0f28b782 | ||
![]() |
65c3edf797 | ||
![]() |
6ed1ce0082 | ||
![]() |
0abba4dc18 | ||
![]() |
55c43fcd26 | ||
![]() |
b40696eab6 | ||
![]() |
4a9391ae83 | ||
![]() |
4fced50fd1 | ||
![]() |
a3a6b3f24a | ||
![]() |
39ead974a4 | ||
![]() |
e9029d3d00 | ||
![]() |
0f7c4f762f | ||
![]() |
49a534b5d4 | ||
![]() |
cccea34c6f | ||
![]() |
8aa105fd5b | ||
![]() |
6c2c176a99 | ||
![]() |
3ebfee5dbc | ||
![]() |
0379b94b7a | ||
![]() |
b92573e711 | ||
![]() |
0ac825b22a | ||
![]() |
2245500245 | ||
![]() |
066bd5be87 | ||
![]() |
29a0f60778 | ||
![]() |
05dc300296 | ||
![]() |
d1aabb3957 | ||
![]() |
5842a6a399 | ||
![]() |
53e3375186 | ||
![]() |
f7e1550eea | ||
![]() |
41a19cd007 | ||
![]() |
5f9972dfd1 | ||
![]() |
1343f5f31f | ||
![]() |
0295ab968c | ||
![]() |
ab23e2f130 | ||
![]() |
61695c5315 | ||
![]() |
4e763b4aa3 | ||
![]() |
870b7fa05f | ||
![]() |
ff838b48fd | ||
![]() |
8e229ada1d | ||
![]() |
e121058eb6 | ||
![]() |
e3ff5f3dc2 | ||
![]() |
9e97a2c4a1 | ||
![]() |
8f65cb1d94 | ||
![]() |
7fb7591e4f | ||
![]() |
e722a8dbef | ||
![]() |
e0f0a5f663 | ||
![]() |
d0f53db65f | ||
![]() |
cd53531050 | ||
![]() |
bf07d17cec | ||
![]() |
5c5db2c016 | ||
![]() |
c6c71fe73c | ||
![]() |
850321cf2b | ||
![]() |
f579a3a708 | ||
![]() |
061e828524 | ||
![]() |
b84fc30284 | ||
![]() |
9be186624c | ||
![]() |
61e691d94f | ||
![]() |
e9fcc8a391 | ||
![]() |
da5d04061e | ||
![]() |
e4972f4cdd | ||
![]() |
1211047e1c | ||
![]() |
63568721f9 | ||
![]() |
3c3f08c416 | ||
![]() |
6f231ea9ac | ||
![]() |
b1fb469e0d | ||
![]() |
d7a0b46006 | ||
![]() |
77b9ca50e0 | ||
![]() |
3879decb9f | ||
![]() |
371aa0fe7f | ||
![]() |
5044ce9de3 | ||
![]() |
68c7cc0cc4 | ||
![]() |
c1b01c0d5d | ||
![]() |
8bd3ecaa66 | ||
![]() |
0afa79067b | ||
![]() |
5426262ae6 | ||
![]() |
8fe6bfabbf | ||
![]() |
6f3b2a7661 | ||
![]() |
c1d9489294 | ||
![]() |
8d9c45a08a | ||
![]() |
d4f60f8303 | ||
![]() |
a6e31cadbd | ||
![]() |
0964353073 | ||
![]() |
309ad3e08b | ||
![]() |
7ed3d870fe | ||
![]() |
2824aacd5d | ||
![]() |
c392f0c16b | ||
![]() |
377dcef9f4 | ||
![]() |
81157e4e72 | ||
![]() |
d37a63fad7 | ||
![]() |
9998a86625 | ||
![]() |
a2c56b5929 | ||
![]() |
043fa4cba7 | ||
![]() |
7743af853a | ||
![]() |
ad56a49da8 | ||
![]() |
e1e0bc4266 | ||
![]() |
875601c4cc | ||
![]() |
96292bc859 | ||
![]() |
f9426912f6 | ||
![]() |
ad332f49ed | ||
![]() |
8c2019f5ad | ||
![]() |
b8f67c6285 | ||
![]() |
f7744404d6 | ||
![]() |
b1c413237c | ||
![]() |
b9f617aaee | ||
![]() |
702f2bccfc | ||
![]() |
b549baa6b7 | ||
![]() |
4a6e8bb90b | ||
![]() |
5e3ef42201 | ||
![]() |
59a808516e | ||
![]() |
484a61c1d4 | ||
![]() |
3fc1bd0670 | ||
![]() |
70ec71a373 | ||
![]() |
8c55b40e9e | ||
![]() |
ae715ba0d8 | ||
![]() |
b3187e1291 | ||
![]() |
a7459043c6 | ||
![]() |
b5191a03b2 | ||
![]() |
a53411013a | ||
![]() |
dca23cb3ff | ||
![]() |
fc86b5c1b4 | ||
![]() |
9dd28feadf | ||
![]() |
bf208decc0 | ||
![]() |
06db2767fe | ||
![]() |
9c676e599e | ||
![]() |
e6bc401c93 | ||
![]() |
ebbcc2ffce | ||
![]() |
461cdda71e | ||
![]() |
c11d30bafe | ||
![]() |
609d92003b | ||
![]() |
8da566d6e7 | ||
![]() |
865a44adda | ||
![]() |
cda89ebb58 | ||
![]() |
6fccfc57a4 | ||
![]() |
91af3a3152 | ||
![]() |
99841b8fde | ||
![]() |
a28dfbae9f | ||
![]() |
023eb3380d | ||
![]() |
d0318aac4a | ||
![]() |
8294e04749 | ||
![]() |
fe28aa7c9b | ||
![]() |
1f806b555d | ||
![]() |
789e504069 | ||
![]() |
76c3881944 | ||
![]() |
5bdd8f134f | ||
![]() |
426e8252d4 | ||
![]() |
d3caee0e72 | ||
![]() |
6259dc4121 | ||
![]() |
d786af83fc | ||
![]() |
5ecc289201 | ||
![]() |
020e903193 | ||
![]() |
db16833d8c | ||
![]() |
f3aac87422 | ||
![]() |
ea598f7d77 | ||
![]() |
c0275df820 | ||
![]() |
b2c2b5ee21 | ||
![]() |
df3f64bfd2 | ||
![]() |
aa318674e8 | ||
![]() |
bbc8d39185 | ||
![]() |
19f88241ec | ||
![]() |
7fc9662480 | ||
![]() |
ed29b4eedf | ||
![]() |
d9a30b8480 | ||
![]() |
ed2ab55034 | ||
![]() |
4eb3d8857f | ||
![]() |
df6caea25d | ||
![]() |
8cb03ef524 | ||
![]() |
6f044c57ac | ||
![]() |
666aa44a84 | ||
![]() |
f169530d8f | ||
![]() |
5c66cc1c9b | ||
![]() |
db6c677755 | ||
![]() |
28ac82aeb0 | ||
![]() |
3580267479 | ||
![]() |
a7ce537d32 | ||
![]() |
38a3523f59 | ||
![]() |
bdfa256cea | ||
![]() |
6e722d416b | ||
![]() |
e543922055 | ||
![]() |
f2c7b0d3bf | ||
![]() |
74ca81338e | ||
![]() |
dc553d1996 | ||
![]() |
f798ee2bc1 | ||
![]() |
ccfac59c60 | ||
![]() |
e1ee4b1466 | ||
![]() |
d433de7efa | ||
![]() |
233cf3970c | ||
![]() |
ff95f05386 | ||
![]() |
47d768c3d6 | ||
![]() |
015a71fc40 | ||
![]() |
be3ae71aec | ||
![]() |
52befa0815 | ||
![]() |
a5daee3812 | ||
![]() |
559ffc6331 | ||
![]() |
f71cc53bc9 | ||
![]() |
07240b96ad | ||
![]() |
aa8af23f10 | ||
![]() |
9c66e2f97e | ||
![]() |
c064eefe26 | ||
![]() |
709ec1663d | ||
![]() |
1612ba63ab | ||
![]() |
90fc7c0376 | ||
![]() |
5abb87a0d2 | ||
![]() |
9c2d337e99 | ||
![]() |
3bcb19e040 | ||
![]() |
cfe7823453 | ||
![]() |
c2c1c93041 | ||
![]() |
418a595b6f | ||
![]() |
45cc806a5c | ||
![]() |
69ccf6d472 | ||
![]() |
a2399bd2bc | ||
![]() |
8e28872fe1 | ||
![]() |
381236051f | ||
![]() |
bcd84cd36d | ||
![]() |
22c17da4d7 | ||
![]() |
ca12ef48e9 | ||
![]() |
65f28460a1 | ||
![]() |
3634adf8d4 | ||
![]() |
bd95408b06 | ||
![]() |
cb62cb675f | ||
![]() |
40794da9e4 | ||
![]() |
0da7830745 | ||
![]() |
c65efecf0a | ||
![]() |
9ecbc465a9 | ||
![]() |
9723489ccc | ||
![]() |
3d812f8d0c | ||
![]() |
4954778f68 | ||
![]() |
ec7250ca54 | ||
![]() |
d2119848ed | ||
![]() |
f3b0d7f2fe | ||
![]() |
c3a7bd8c51 | ||
![]() |
3f01b8a93f | ||
![]() |
a5a098c97f | ||
![]() |
8065504aba | ||
![]() |
cda1324e87 | ||
![]() |
43dbe67431 | ||
![]() |
e9f97e1165 | ||
![]() |
c5d2cc8e66 | ||
![]() |
7584ce6f48 | ||
![]() |
7bbaba38e4 | ||
![]() |
7fa75cb24e | ||
![]() |
ead8003044 | ||
![]() |
296b57e1f5 | ||
![]() |
6e9ec253c8 | ||
![]() |
937e7b3dd9 | ||
![]() |
68bad6986d | ||
![]() |
761669272f | ||
![]() |
d4382f4a52 | ||
![]() |
963de06d08 | ||
![]() |
4f2bfc5476 | ||
![]() |
4815065c47 | ||
![]() |
b54e9db764 | ||
![]() |
f40eed5adf | ||
![]() |
4bc6e0d7de | ||
![]() |
9cf170e6e9 | ||
![]() |
8c9a0221a4 | ||
![]() |
2f3fc41c33 | ||
![]() |
6ef6dbff2d | ||
![]() |
d0008ae8cd | ||
![]() |
dd15531e25 | ||
![]() |
ddba8478c5 | ||
![]() |
ab47c6401e | ||
![]() |
81cced4d83 | ||
![]() |
30797d3201 | ||
![]() |
96452637d9 | ||
![]() |
1e436be51d | ||
![]() |
c895bed5e6 | ||
![]() |
a0895f1a3c | ||
![]() |
c54d9cd552 | ||
![]() |
680cc72d43 | ||
![]() |
6e9bb7e480 | ||
![]() |
44d3cee5d1 | ||
![]() |
d38fe92c3f | ||
![]() |
0f00c41aad | ||
![]() |
524bf57b74 | ||
![]() |
e5ee69a0f5 | ||
![]() |
76b6efc827 | ||
![]() |
ebdc34a20e | ||
![]() |
b4e0f7ab08 | ||
![]() |
b422e407e8 | ||
![]() |
5b8b24c0c5 | ||
![]() |
45ef46c5e8 | ||
![]() |
dfac74ffa7 | ||
![]() |
3c359ff4bc | ||
![]() |
bec27a6ebc | ||
![]() |
61d0c71b3c | ||
![]() |
4b998cfd05 | ||
![]() |
15b36e04b2 | ||
![]() |
5ac07122bd | ||
![]() |
48a463cca8 | ||
![]() |
8ee0eb8f36 | ||
![]() |
f4dea6919a | ||
![]() |
f57727995a | ||
![]() |
e621efe79f | ||
![]() |
464026f15c | ||
![]() |
a134b8bc6d | ||
![]() |
b61c9afd04 | ||
![]() |
0416d5ff7b | ||
![]() |
cabb5518e5 | ||
![]() |
aaf0175d07 | ||
![]() |
7b7424802f | ||
![]() |
8db56cfc3b | ||
![]() |
8089ef0f2d | ||
![]() |
b4e0ed6007 | ||
![]() |
c0da80c2b8 | ||
![]() |
a6aa5a1e4c | ||
![]() |
9d6fcd1710 | ||
![]() |
7a159664bc | ||
![]() |
612c4ad1dc | ||
![]() |
fbf34f7c0d | ||
![]() |
549ca669aa | ||
![]() |
f7ed804131 | ||
![]() |
2e3cfdcc2f | ||
![]() |
2116a98745 | ||
![]() |
62858e11f7 | ||
![]() |
744bbd12a7 | ||
![]() |
ba1e91b4d7 | ||
![]() |
7eb341ccaf | ||
![]() |
f5a832e770 | ||
![]() |
a940f41b4b | ||
![]() |
bb875b1db7 | ||
![]() |
8f2d9838a3 | ||
![]() |
4bb894f171 | ||
![]() |
d91b9171fa | ||
![]() |
fef5be0bc7 | ||
![]() |
c862c4bdf2 | ||
![]() |
79992a8d50 | ||
![]() |
be5f36444d | ||
![]() |
b1607ad9e7 | ||
![]() |
e222209732 | ||
![]() |
0d064b7808 | ||
![]() |
c9db9e6bb7 | ||
![]() |
803ce9f44b | ||
![]() |
611e54e67e | ||
![]() |
5f2bc20191 | ||
![]() |
8844ad6f0b | ||
![]() |
bf0fed8431 | ||
![]() |
011aebe4b3 | ||
![]() |
423fdb320a | ||
![]() |
dcc0791502 | ||
![]() |
f66ae2366f | ||
![]() |
4874c45ebf | ||
![]() |
31dd7b95bc | ||
![]() |
bb014ee61b | ||
![]() |
9e5a9892be | ||
![]() |
58f2bf4181 | ||
![]() |
a7bc5196cc | ||
![]() |
bb7b13ef3c | ||
![]() |
87b9ee9183 | ||
![]() |
588de4d095 | ||
![]() |
22d0baa896 | ||
![]() |
dcb0e62095 | ||
![]() |
5499388a4c | ||
![]() |
278c9fa5bd | ||
![]() |
76daf6e364 | ||
![]() |
05428df667 | ||
![]() |
f5e951145a | ||
![]() |
ef5be632fe | ||
![]() |
87fa23beee | ||
![]() |
51c929ef21 | ||
![]() |
60b1f29783 | ||
![]() |
2db44bc34a | ||
![]() |
86611e6459 | ||
![]() |
55d310fcc3 | ||
![]() |
fffd78e7c8 | ||
![]() |
48918ca5c6 | ||
![]() |
1653fc5bb5 | ||
![]() |
0454acaacf | ||
![]() |
20f4d8c147 | ||
![]() |
7787102573 | ||
![]() |
c0715c1225 | ||
![]() |
fd0e3a4fdd | ||
![]() |
fe95d82890 | ||
![]() |
f09a916587 | ||
![]() |
ed1e1f35df | ||
![]() |
7d25480723 | ||
![]() |
81240fe960 | ||
![]() |
72f3b00b00 | ||
![]() |
3d0b56045a | ||
![]() |
ef6959ed54 | ||
![]() |
e7f48eb16b | ||
![]() |
3cb4ef2599 | ||
![]() |
fa7337e19c | ||
![]() |
93f05d851d | ||
![]() |
c5eaaed873 | ||
![]() |
c4a62ca1e4 | ||
![]() |
895f5ddd98 | ||
![]() |
e637ad9d2a | ||
![]() |
48d4806e53 | ||
![]() |
930941e85e | ||
![]() |
ba8c73a327 | ||
![]() |
d6517f9cd9 | ||
![]() |
3aff6dd63e | ||
![]() |
6a0d5f6335 | ||
![]() |
59c4facd90 | ||
![]() |
7c6adc5d97 | ||
![]() |
65e07036a6 | ||
![]() |
d1b8d4f2c7 | ||
![]() |
71f2e2b1e4 | ||
![]() |
2b2141902b | ||
![]() |
49a5547386 | ||
![]() |
9088135b49 | ||
![]() |
b248a00c90 | ||
![]() |
e60aa8e935 | ||
![]() |
c5fc7c7640 | ||
![]() |
460eba53c7 | ||
![]() |
924b1c7b0c | ||
![]() |
478b70e53e | ||
![]() |
4d3c79f91f | ||
![]() |
73bded3b0c | ||
![]() |
7755cd0019 | ||
![]() |
3a9f089018 | ||
![]() |
e24443bbbc | ||
![]() |
03f55d8f9e | ||
![]() |
be371ebf99 | ||
![]() |
b7bf220598 | ||
![]() |
ed125f27b0 | ||
![]() |
5a6aa52a7c | ||
![]() |
6342cf103a | ||
![]() |
864e3ee9f3 | ||
![]() |
2c38dad214 | ||
![]() |
c8f029dba9 | ||
![]() |
802a1a1529 | ||
![]() |
fc268129ef | ||
![]() |
91135c8799 | ||
![]() |
da7e0ba9d9 | ||
![]() |
c82390e3f1 | ||
![]() |
4853082a4f | ||
![]() |
f6180efd35 | ||
![]() |
7158c80448 | ||
![]() |
15fffa12a6 | ||
![]() |
35cbacc68b | ||
![]() |
44ba3a50ba | ||
![]() |
14e4992d73 | ||
![]() |
21ec8c38ae | ||
![]() |
8ec5b2dc2f | ||
![]() |
3f595fda26 | ||
![]() |
42f5903b91 | ||
![]() |
bb87d2ae82 | ||
![]() |
43c8c8ec34 | ||
![]() |
9cb8934688 | ||
![]() |
f67947325b | ||
![]() |
1bfdc468da | ||
![]() |
f78b666c26 | ||
![]() |
34f9f51835 | ||
![]() |
9e6133bb09 | ||
![]() |
bf6dac5fa3 | ||
![]() |
2021f09db4 | ||
![]() |
6055e44518 | ||
![]() |
db0cc3c036 | ||
![]() |
87a4ee52b9 | ||
![]() |
7bf8d6bc98 | ||
![]() |
a56b8cd2b7 |
23
.github/workflows/android.yml
vendored
@@ -3,7 +3,6 @@ name: Android
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
workflow_dispatch:
|
|
||||||
paths:
|
paths:
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
@@ -16,8 +15,13 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -38,6 +42,15 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
if: github.event_name == 'release' && github.event.action == 'published'
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
|
- name: Setup Android NDK
|
||||||
|
id: setup-ndk
|
||||||
|
uses: nttld/setup-ndk@v1
|
||||||
|
with:
|
||||||
|
ndk-version: r25
|
||||||
|
add-to-path: false
|
||||||
|
env:
|
||||||
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||||
|
|
||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
@@ -52,8 +65,8 @@ jobs:
|
|||||||
- name: Build Library
|
- name: Build Library
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK="C:\PROGRA~2\Android\android-sdk\ndk-bundle" RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
||||||
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK="C:\PROGRA~2\Android\android-sdk\ndk-bundle" RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
cd ..
|
cd ..
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
@@ -62,14 +75,14 @@ jobs:
|
|||||||
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/extras/raygui.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
|
||||||
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
||||||
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||||
cd build
|
cd build
|
||||||
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
7
.github/workflows/cmake.yml
vendored
@@ -23,6 +23,9 @@ env:
|
|||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_windows:
|
build_windows:
|
||||||
name: Windows Build
|
name: Windows Build
|
||||||
@@ -33,7 +36,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
# Some projects don't allow in-source building, so create a separate build directory
|
# Some projects don't allow in-source building, so create a separate build directory
|
||||||
@@ -72,7 +75,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
# Some projects don't allow in-source building, so create a separate build directory
|
# Some projects don't allow in-source building, so create a separate build directory
|
||||||
|
13
.github/workflows/linux.yml
vendored
@@ -15,8 +15,13 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -60,11 +65,11 @@ jobs:
|
|||||||
cd ../../../raylib
|
cd ../../../raylib
|
||||||
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
|
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
|
||||||
|
|
||||||
# TODO: Support 32bit (i386) shared library building
|
# TODO: Support 32bit (i386) static/shared library building
|
||||||
- name: Build Library
|
- name: Build Library
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-m32" -B
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
|
||||||
# make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
# make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
cd ..
|
cd ..
|
||||||
if: matrix.bits == 32
|
if: matrix.bits == 32
|
||||||
@@ -82,14 +87,14 @@ jobs:
|
|||||||
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/extras/raygui.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
|
||||||
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
||||||
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||||
cd build
|
cd build
|
||||||
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
5
.github/workflows/linux_examples.yml
vendored
@@ -14,12 +14,15 @@ on:
|
|||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
- '.github/workflows/linux_examples.yml'
|
- '.github/workflows/linux_examples.yml'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
run: |
|
run: |
|
||||||
|
51
.github/workflows/macos.yml
vendored
@@ -15,8 +15,13 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -44,22 +49,42 @@ jobs:
|
|||||||
|
|
||||||
# Generating static + shared library, note that i386 architecture is deprecated
|
# Generating static + shared library, note that i386 architecture is deprecated
|
||||||
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
|
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
|
||||||
# TODO: Support Universal ARCH libraries (build arm64 + x86_64 and merge)
|
|
||||||
- name: Build Library
|
- name: Build Library
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
clang --version
|
clang --version
|
||||||
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" -B
|
|
||||||
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_LIB_NAME=raylib_x86_64 CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
|
# Extract version numbers from Makefile
|
||||||
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_LIB_NAME=raylib_arm64 CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
|
brew install grep
|
||||||
# lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a libraylib_x86_64.a libraylib_arm64.a
|
RAYLIB_API_VERSION=`ggrep -Po 'RAYLIB_API_VERSION\s*=\s\K(.*)' Makefile`
|
||||||
|
RAYLIB_VERSION=`ggrep -Po 'RAYLIB_VERSION\s*=\s\K(.*)' Makefile`
|
||||||
|
|
||||||
|
# Build raylib x86_64 static
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
|
||||||
|
mv libraylib.a /tmp/libraylib_x86_64.a
|
||||||
make clean
|
make clean
|
||||||
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" -B
|
|
||||||
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_LIB_NAME=raylib_x86_64 CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" -B
|
# Build raylib arm64 static
|
||||||
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_LIB_NAME=raylib_arm64 CFLAGS="-target i686-apple-macos -DGL_SILENCE_DEPRECATION" -B
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
|
||||||
# lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.3.1.0.dylib libraylib_x86_64.3.1.0.dylib libraylib_arm64.3.1.0.dylib
|
mv libraylib.a /tmp/libraylib_arm64.a
|
||||||
# cp -v ./libraylib_arm64.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
|
make clean
|
||||||
# cp -v ./libraylib_arm64.310.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.310.dylib
|
|
||||||
|
# Join x86_64 and arm64 static
|
||||||
|
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a /tmp/libraylib_x86_64.a /tmp/libraylib_arm64.a
|
||||||
|
|
||||||
|
# Build raylib x86_64 dynamic
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target x86_64-apple-macos10.12" -B
|
||||||
|
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# Build raylib arm64 dynamic
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target arm64-apple-macos11" -B
|
||||||
|
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
|
||||||
|
|
||||||
|
# Join x86_64 and arm64 dynamic
|
||||||
|
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
|
||||||
|
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
|
||||||
|
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_API_VERSION}.dylib
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Generate Artifacts
|
- name: Generate Artifacts
|
||||||
@@ -67,14 +92,14 @@ jobs:
|
|||||||
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
cp -v ./src/extras/raygui.h ./build/${{ env.RELEASE_NAME }}/include
|
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
|
||||||
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
||||||
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||||
cd build
|
cd build
|
||||||
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
10
.github/workflows/webassembly.yml
vendored
@@ -27,9 +27,9 @@ jobs:
|
|||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Setup emsdk
|
- name: Setup emsdk
|
||||||
uses: mymindstorm/setup-emsdk@v9
|
uses: mymindstorm/setup-emsdk@v11
|
||||||
with:
|
with:
|
||||||
version: 2.0.0
|
version: 3.1.30
|
||||||
actions-cache-folder: 'emsdk-cache'
|
actions-cache-folder: 'emsdk-cache'
|
||||||
|
|
||||||
- name: Setup Release Version
|
- name: Setup Release Version
|
||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
emcc -v
|
emcc -v
|
||||||
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-master" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Generate Artifacts
|
- name: Generate Artifacts
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
||||||
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
|
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
|
||||||
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
|
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
|
||||||
copy /Y .\src\extras\raygui.h .\build\${{ env.RELEASE_NAME }}\include\raygui.h
|
copy /Y .\CHANGELOG .\build/${{ env.RELEASE_NAME }}\CHANGELOG
|
||||||
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
|
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
|
||||||
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
|
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
|
||||||
cd build
|
cd build
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.zip
|
name: ${{ env.RELEASE_NAME }}.zip
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.zip
|
path: ./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
42
.github/workflows/windows.yml
vendored
@@ -15,8 +15,13 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -28,12 +33,10 @@ jobs:
|
|||||||
- compiler: mingw-w64
|
- compiler: mingw-w64
|
||||||
bits: 32
|
bits: 32
|
||||||
ARCH: "i686"
|
ARCH: "i686"
|
||||||
COMPILER_PATH: "C:\\msys64\\mingw32\\bin"
|
|
||||||
WINDRES_ARCH: pe-i386
|
WINDRES_ARCH: pe-i386
|
||||||
- compiler: mingw-w64
|
- compiler: mingw-w64
|
||||||
bits: 64
|
bits: 64
|
||||||
ARCH: "x86_64"
|
ARCH: "x86_64"
|
||||||
COMPILER_PATH: "C:\\msys64\\mingw64\\bin"
|
|
||||||
WINDRES_ARCH: pe-x86-64
|
WINDRES_ARCH: pe-x86-64
|
||||||
- compiler: msvc16
|
- compiler: msvc16
|
||||||
bits: 32
|
bits: 32
|
||||||
@@ -71,25 +74,42 @@ jobs:
|
|||||||
|
|
||||||
# Setup MSBuild.exe path if required
|
# Setup MSBuild.exe path if required
|
||||||
- name: Setup MSBuild
|
- name: Setup MSBuild
|
||||||
uses: microsoft/setup-msbuild@v1.0.2
|
uses: microsoft/setup-msbuild@v1.1
|
||||||
if: matrix.compiler == 'msvc16'
|
if: matrix.compiler == 'msvc16'
|
||||||
|
|
||||||
- name: Build Library (MinGW-w64)
|
- name: Build Library (MinGW-w64 32bit)
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
x86_64-w64-mingw32-gcc.exe --version
|
||||||
|
windres.exe --version
|
||||||
|
dir C:\msys64\mingw64\bin
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=x86_64-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS=-m32
|
||||||
|
//windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
|
||||||
|
//make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
shell: cmd
|
||||||
|
if: |
|
||||||
|
matrix.compiler == 'mingw-w64' &&
|
||||||
|
matrix.bits == 32
|
||||||
|
|
||||||
|
- name: Build Library (MinGW-w64 64bit)
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
set PATH=%PATH%;${{ matrix.COMPILER_PATH }}
|
|
||||||
${{ matrix.ARCH }}-w64-mingw32-gcc.exe --version
|
${{ matrix.ARCH }}-w64-mingw32-gcc.exe --version
|
||||||
${{ matrix.COMPILER_PATH }}/windres.exe --version
|
windres.exe --version
|
||||||
|
dir C:\msys64\mingw64\bin
|
||||||
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
||||||
${{ matrix.COMPILER_PATH }}/windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
|
windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
|
||||||
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
cd ..
|
cd ..
|
||||||
shell: cmd
|
shell: cmd
|
||||||
if: matrix.compiler == 'mingw-w64'
|
if: |
|
||||||
|
matrix.compiler == 'mingw-w64' &&
|
||||||
|
matrix.bits == 64
|
||||||
|
|
||||||
- name: Build Library (MSVC16)
|
- name: Build Library (MSVC16)
|
||||||
run: |
|
run: |
|
||||||
cd projects/VS2019
|
cd projects/VS2022
|
||||||
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release /property:Platform=${{ matrix.ARCH }}
|
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release /property:Platform=${{ matrix.ARCH }}
|
||||||
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib
|
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib
|
||||||
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release.DLL /property:Platform=${{ matrix.ARCH }}
|
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release.DLL /property:Platform=${{ matrix.ARCH }}
|
||||||
@@ -104,7 +124,7 @@ jobs:
|
|||||||
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
||||||
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
|
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
|
||||||
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
|
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
|
||||||
copy /Y .\src\extras\raygui.h .\build\${{ env.RELEASE_NAME }}\include\raygui.h
|
copy /Y .\CHANGELOG .\build\${{ env.RELEASE_NAME }}\CHANGELOG
|
||||||
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
|
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
|
||||||
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
|
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
|
||||||
cd build
|
cd build
|
||||||
@@ -113,7 +133,7 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.zip
|
name: ${{ env.RELEASE_NAME }}.zip
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.zip
|
path: ./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
5
.github/workflows/windows_examples.yml
vendored
@@ -14,12 +14,15 @@ on:
|
|||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
- '.github/workflows/windows_examples.yml'
|
- '.github/workflows/windows_examples.yml'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add MSBuild to PATH
|
- name: Add MSBuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v1
|
uses: microsoft/setup-msbuild@v1
|
||||||
|
3
.gitignore
vendored
@@ -101,3 +101,6 @@ zig-out/
|
|||||||
build/
|
build/
|
||||||
build-*/
|
build-*/
|
||||||
docgen_tmp/
|
docgen_tmp/
|
||||||
|
|
||||||
|
# Parser stuff
|
||||||
|
parser/raylib_parser
|
||||||
|
124
BINDINGS.md
@@ -1,50 +1,85 @@
|
|||||||
# raylib bindings and wrappers
|
# raylib bindings and wrappers
|
||||||
|
|
||||||
Some people ported raylib to other languages in form of bindings or wrappers to the library. Here it is alist with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
|
Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
|
||||||
|
|
||||||
### Language Bindings
|
### Language Bindings
|
||||||
|
|
||||||
| name | raylib version | language | repo |
|
| name | raylib version | language | license | repo |
|
||||||
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
|
|:------------------:|:---------------:|:---------:|:----------:|-----------------------------------------------------------|
|
||||||
| raylib | **3.7** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib |
|
| raylib | **4.2** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | https://github.com/raysan5/raylib |
|
||||||
| Raylib-cs | 3.7 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs |
|
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo |
|
||||||
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/) | https://github.com/Rabios/raylib-boo |
|
| Raylib-cs | **4.2** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | https://github.com/ChrisDill/Raylib-cs |
|
||||||
| dray | 3.5 | [D](https://dlang.org/) | https://github.com/xdrie/dray |
|
| Raylib-CsLo | **4.2** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/NotNotTech/Raylib-CsLo |
|
||||||
| raylib-go | 4.0-dev | [Go](https://golang.org/) | https://github.com/gen2brain/raylib-go |
|
| cl-raylib | **4.0** | [Common Lisp](https://common-lisp.net/) | MIT | https://github.com/longlene/cl-raylib |
|
||||||
| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | https://github.com/deltaphc/raylib-rs |
|
| claylib/wrap | **4.2** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
|
||||||
| raylib-lua | 3.7 | [Lua](http://www.lua.org/) | https://github.com/TSnake41/raylib-lua |
|
| chez-raylib | auto | [Chez Scheme](https://cisco.github.io/ChezScheme/) | GPLv3 | https://github.com/Yunoinsky/chez-raylib |
|
||||||
| raylua | 3.7 | [Lua](http://www.lua.org/) | https://github.com/Rabios/raylua |
|
| raylib-cr | **4.5-dev (7e7939e)** | [Crystal](https://crystal-lang.org/) | Apache-2.0 | https://github.com/sol-vin/raylib-cr |
|
||||||
| nelua-raylib | 3.7 | [nelua](https://nelua.io/) | https://github.com/AKDev21/nelua-raylib |
|
| ray-cyber | **4.2** | [Cyber](https://cyberscript.dev) | MIT | https://github.com/fubark/ray-cyber |
|
||||||
| NimraylibNow! | 3.7 | [Nim](https://nim-lang.org/) | https://github.com/greenfork/nimraylib_now |
|
| raylib-c3 | **4.5-dev** | [C3](https://c3-lang.org/) | MIT | https://github.com/Its-Kenta/Raylib-C3 |
|
||||||
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | https://github.com/Guevara-chan/Raylib-Forever |
|
| dart-raylib | **4.0** | [Dart](https://dart.dev/) | MIT | https://gitlab.com/wolfenrain/dart-raylib |
|
||||||
| Ray4Laz | 3.7 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/GuvaCode/Ray4Laz |
|
| bindbc-raylib3 | **4.0** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 |
|
||||||
| pyraylib | 3.7 | [Python](https://www.python.org/) | https://github.com/Ho011/pyraylib |
|
| dray | **4.2** | [D](https://dlang.org/) | Apache-2.0 | https://github.com/redthing1/dray |
|
||||||
| raylib-python-cffi | 3.7 | [Python](https://www.python.org/) | https://github.com/electronstudio/raylib-python-cffi |
|
| raylib-d | **4.2** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d |
|
||||||
| jaylib | 3.7 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/electronstudio/jaylib/ |
|
| dlang_raylib | **4.0** | [D](https://dlang.org) | MPL-2.0 |https://github.com/rc-05/dlang_raylib |
|
||||||
| node-raylib | 3.5 | [Node.js](https://nodejs.org/en/) | https://github.com/RobLoach/node-raylib |
|
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
|
||||||
| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 |
|
| raylib-factor | **4.0** | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
|
||||||
| raylib-php | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/joseph-montanez/raylib-php |
|
| raylib-freebasic | **4.2** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
|
||||||
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-phpcpp |
|
| raylib-go | **4.2** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
|
||||||
| raylib-factor | 3.5 | [Factor](https://factorcode.org/) | https://github.com/ArnautDaniel/raylib-factor |
|
| raylib-guile | auto | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
|
||||||
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | https://github.com/ArnautDaniel/gforth-raylib |
|
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | MIT | https://github.com/ArnautDaniel/gforth-raylib |
|
||||||
| hxRaylib | 3.7 | [Haxe](https://haxe.org/) | https://github.com/ForeignSasquatch/hxRaylib |
|
| h-raylib | 4.5-dev | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib |
|
||||||
| raylib-wren | 3.7 | [Wren](http://wren.io/) | https://github.com/TSnake41/raylib-wren |
|
| raylib-hx | **4.2** | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
|
||||||
| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | https://github.com/Deathbat2190/raylib_odin_bindings |
|
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
|
||||||
| raylib-odin | 3.7| [Odin](https://odin-lang.org/) | https://github.com/odin-lang/Odin/tree/master/vendor/raylib |
|
| jaylib | **4.2** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
|
||||||
| raylib.v | 3.7 | [V](https://vlang.io/) | https://github.com/irishgreencitrus/raylib.v |
|
| raylib-j | **4.0** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J |
|
||||||
| raylib-ocaml | 3.7 | [OCaml](https://ocaml.org/) | https://github.com/tjammer/raylib-ocaml |
|
| raylib.jl | **4.2** | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl |
|
||||||
| raylib-swift | 3.7 | [Swift](https://swift.org/) | https://github.com/STREGAsGate/Raylib |
|
| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | ? | https://github.com/electronstudio/kaylib |
|
||||||
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
|
| kaylib | **4.5-dev**| [Kotlin/native](https://kotlinlang.org) | Zlib | https://codeberg.org/Kenta/Kaylib |
|
||||||
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | https://github.com/RedCubeDev-ByteSpace/Relib |
|
| raylib-lua | **4.2** | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua |
|
||||||
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | https://github.com/shiryel/rayex |
|
| raylua | **4.0** | [Lua](http://www.lua.org/) | MIT | https://github.com/Rabios/raylua |
|
||||||
| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | https://github.com/electronstudio/kaylib |
|
| nelua-raylib | 4.0 | [nelua](https://nelua.io/) | MIT | https://github.com/AKDev21/nelua-raylib |
|
||||||
| dlang_raylib | 3.7 | [D](https://dlang.org) | https://github.com/rc-05/dlang_raylib |
|
| Raylib-Nelua | **4.5-dev** | [nelua](https://nelua.io/) | MIT | https://github.com/Its-Kenta/Raylib-Nelua |
|
||||||
|
| NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now |
|
||||||
|
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever |
|
||||||
|
| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib |
|
||||||
|
| node-raylib | **4.0** | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib |
|
||||||
|
| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | MIT | https://github.com/Deathbat2190/raylib_odin_bindings |
|
||||||
|
| raylib-odin | **4.0** | [Odin](https://odin-lang.org/) | BSD-3Clause | https://github.com/odin-lang/Odin/tree/master/vendor/raylib |
|
||||||
|
| raylib-ocaml | **4.2** | [OCaml](https://ocaml.org/) | MIT | https://github.com/tjammer/raylib-ocaml |
|
||||||
|
| TurboRaylib | **4.2** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | https://github.com/turborium/TurboRaylib |
|
||||||
|
| Ray4Laz | **4.2** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/GuvaCode/Ray4Laz |
|
||||||
|
| Raylib.4.0.Pascal | **4.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/sysrpl/Raylib.4.0.Pascal |
|
||||||
|
| pyraylib | 3.7 | [Python](https://www.python.org/) | Zlib | https://github.com/Ho011/pyraylib |
|
||||||
|
| raylib-python-cffi | **4.2** | [Python](https://www.python.org/) | EPL-2.0 | https://github.com/electronstudio/raylib-python-cffi |
|
||||||
|
| raylibpyctbg | **4.2** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg |
|
||||||
|
| raylib-py | **4.2** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py |
|
||||||
|
| raylib-python-ctypes | **4.2** | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes |
|
||||||
|
| raylib-php | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php |
|
||||||
|
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp |
|
||||||
|
| raylibr | **4.0** | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr |
|
||||||
|
| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs |
|
||||||
|
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib |
|
||||||
|
| racket-raylib | **4.0** | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib |
|
||||||
|
| raylib-swift | **4.0** | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib |
|
||||||
|
| raylib-scopes | auto | [Scopes](http://scopes.rocks) | MIT | https://github.com/salotz/raylib-scopes |
|
||||||
|
| raylib-smallBasic | 4.1-dev | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib |
|
||||||
|
| raylib-umka | **4.2** | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | https://github.com/robloach/raylib-umka |
|
||||||
|
| raylib.v | **4.2** | [V](https://vlang.io/) | Zlib | https://github.com/irishgreencitrus/raylib.v |
|
||||||
|
| raylib-vapi | **4.2** | [Vala](https://vala.dev/) | Zlib | https://github.com/lxmcf/raylib-vapi |
|
||||||
|
| raylib-wren | **4.0** | [Wren](http://wren.io/) | ISC | https://github.com/TSnake41/raylib-wren |
|
||||||
|
| raylib-zig | **4.2** | [Zig](https://ziglang.org/) | MIT | https://github.com/Not-Nik/raylib-zig |
|
||||||
|
| raylib.zig | **4.2** | [Zig](https://ziglang.org/) | MIT | https://github.com/ryupold/raylib.zig |
|
||||||
|
| hare-raylib | auto | [Hare](https://harelang.org/) | Zlib | https://git.sr.ht/~evantj/hare-raylib |
|
||||||
|
| raylib-sunder | auto | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | https://github.com/ashn-dot-dev/raylib-sunder |
|
||||||
|
| rayed-bqn | auto | [BQN](https://mlochbaum.github.io/BQN/) | MIT | https://github.com/Brian-ED/rayed-bqn |
|
||||||
|
|
||||||
|
|
||||||
### Utility Wrapers
|
### Utility Wrapers
|
||||||
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
|
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
|
||||||
| name | raylib version | language | repo |
|
| name | raylib version | language | license | repo |
|
||||||
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
|
|:------------------:|:-------------: | :--------:|:-------:|:-------------------------------------------------------------|
|
||||||
| raylib-cpp | 3.7 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp |
|
| raylib-cpp | **4.2** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | https://github.com/robloach/raylib-cpp |
|
||||||
|
| claylib | **4.2** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
|
||||||
|
|
||||||
### Older or Unmaintained Language Bindings
|
### Older or Unmaintained Language Bindings
|
||||||
These are older raylib bindings that are more than 2 versions old or have not been maintained.
|
These are older raylib bindings that are more than 2 versions old or have not been maintained.
|
||||||
@@ -76,28 +111,25 @@ These are older raylib bindings that are more than 2 versions old or have not be
|
|||||||
| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby |
|
| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby |
|
||||||
| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi |
|
| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi |
|
||||||
| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby |
|
| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby |
|
||||||
| raylib-py-ctbg | 2.6 | [Python](https://www.python.org/) | https://github.com/overdev/raylib-py-ctbg |
|
|
||||||
| raylib-py | 2.0 | [Python](https://www.python.org/) | https://github.com/overdev/raylib-py |
|
|
||||||
| raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java |
|
| raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java |
|
||||||
| raylib-j | 3.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/CreedVI/Raylib-J |
|
|
||||||
| clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib |
|
| clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib |
|
||||||
| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib |
|
| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib |
|
||||||
| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape |
|
| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape |
|
||||||
|
| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 |
|
||||||
| raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript |
|
| raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript |
|
||||||
| raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel |
|
| raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel |
|
||||||
| racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d |
|
| racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d |
|
||||||
| raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi |
|
| raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi |
|
||||||
| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe |
|
| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe |
|
||||||
| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib |
|
| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib |
|
||||||
| cl-raylib | 3.0 | [Common Lisp](https://common-lisp.net/) | https://github.com/longlene/cl-raylib |
|
|
||||||
| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm |
|
| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm |
|
||||||
| raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi |
|
| raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi |
|
||||||
| raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme |
|
| raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme |
|
||||||
| Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib |
|
| Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib |
|
||||||
| raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin |
|
| raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin |
|
||||||
| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib |
|
| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib |
|
||||||
| raylib-zig | 3.0 | [Zig](https://ziglang.org/) | https://github.com/Not-Nik/raylib-zig |
|
| raylib-vala | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | https://code.guddler.uk/mart/raylibVapi |
|
||||||
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kevinw/raylib-jai |
|
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/raylib-jai |
|
||||||
| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments |
|
| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments |
|
||||||
| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada |
|
| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada |
|
||||||
| jaylib | 3.0 | [Janet](https://janet-lang.org/) | https://github.com/janet-lang/jaylib |
|
| jaylib | 3.0 | [Janet](https://janet-lang.org/) | https://github.com/janet-lang/jaylib |
|
||||||
@@ -108,14 +140,12 @@ These are older raylib bindings that are more than 2 versions old or have not be
|
|||||||
| raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp |
|
| raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp |
|
||||||
| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb |
|
| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb |
|
||||||
| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic |
|
| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic |
|
||||||
| raylib-smallBasic | 3.1-dev | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib |
|
|
||||||
| raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 |
|
| raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 |
|
||||||
| raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef |
|
| raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef |
|
||||||
| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
|
| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
|
||||||
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
|
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Missing some language or wrapper? Feel free to create a new one! :)
|
Missing some language or wrapper? Feel free to create a new one! :)
|
||||||
|
|
||||||
Usually, raylib bindings follow the convention: `raylib-{language}`
|
Usually, raylib bindings follow the convention: `raylib-{language}`
|
||||||
|
397
CHANGELOG
@@ -1,13 +1,406 @@
|
|||||||
changelog
|
changelog
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Current Release: raylib 4.0.0 (05 November 2021)
|
Current Release: raylib 4.5.0 (18 March 2023)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
Release: raylib 4.5 (18 March 2023)
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
KEY CHANGES:
|
||||||
|
- ADDED: Improved ANGLE support on Desktop platforms
|
||||||
|
- ADDED: rcamera module, simpler and more extendable
|
||||||
|
- ADDED: Support for M3D models and M3D/GLTF animations
|
||||||
|
- ADDED: Support QOA audio format (import/export)
|
||||||
|
- ADDED: rl_gputex module for compressed textures loading
|
||||||
|
- REDESIGNED: rlgl module for automatic render-batch limits checking
|
||||||
|
- REDESIGNED: rshapes module to minimize the rlgl dependency
|
||||||
|
|
||||||
|
Detailed changes:
|
||||||
|
[core] ADDED: RAYLIB_VERSION_* values to raylib.h (#2856) by @RobLoach
|
||||||
|
[core] ADDED: Basic gamepad support for Android (#2709) by @deniska
|
||||||
|
[core] ADDED: Support CAPS/NUM lock keys registering if locked
|
||||||
|
[core] ADDED: _GNU_SOURCE define on Linux (#2729)
|
||||||
|
[core] ADDED: SetWindowIcons() to set multiple icon image sizes
|
||||||
|
[core] `WARNING`: RENAMED: Exported raylib version symbol to raylib_version #2671
|
||||||
|
[core] REMOVED: Touch points on touch up events on Android (#2711) by @deniska
|
||||||
|
[core] REVIEWED: Window position setup on InitWindow() (#2732) by @RandomErrorMessage
|
||||||
|
[core] REVIEWED: Touchscreen input related functions on Android (#2702) by @deniska
|
||||||
|
[core] REVIEWED: Viewport scaling on Android after context rebind (#2703) by @deniska
|
||||||
|
[core] REVIEWED: ScanDirectoryFilesRecursively() (#2704)
|
||||||
|
[core] REVIEWED: Gamepad mappings with latest gamecontrollerdb (#2725)
|
||||||
|
[core] REVIEWED: Monitor order check on app initialization
|
||||||
|
[core] REVIEWED: Application monitor when opening (#2728, #2731) by @RandomErrorMessage
|
||||||
|
[core] REVIEWED: Gestures module to use GetTime() if available (#2733) by @RobLoach
|
||||||
|
[core] REVIEWED: Resolve GLFW3 some symbols re-definition of windows.h in glfw3native (#2643) by @daipom
|
||||||
|
[core] REVIEWED: OpenURL(), string buffer too short sometimes
|
||||||
|
[core] REVIEWED: GetRandomValue() range limit warning (#2800) by @Pere001
|
||||||
|
[core] REVIEWED: UnloadDirectoryFiles()
|
||||||
|
[core] REVIEWED: GetKeyPressed(), out of range issue (#2814) by @daipom
|
||||||
|
[core] REVIEWED: GetTime(), renamed variable 'time' to 'nanoSeconds' (#2816) by @jtainer
|
||||||
|
[core] REVIEWED: LoadShaderFromMemory(), issue with shader linkage
|
||||||
|
[core] REVIEWED: Avoid possible gamepad index as -1 (#2839)
|
||||||
|
[core] REVIEWED: SetShaderValue*(), avoid setup uniforms for invalid locations
|
||||||
|
[core] REVIEWED: GetClipboardText() on PLATFORM_WEB, permissions issues
|
||||||
|
[core] REVIEWED: Initial window position for display-sized fullscreen (#2742) by @daipom
|
||||||
|
[core] REVIEWED: Sticky touches input (#2857) by @ImazighenGhost
|
||||||
|
[core] REVIEWED: Enable GetWindowHandle() on macOS (#2915) by @Not-Nik
|
||||||
|
[core] REVIEWED: Window position always inits centered in current monitor
|
||||||
|
[core] REVIEWED: IsWindowFocused() to consider Android App state (#2935)
|
||||||
|
[core] REVIEWED: GetMonitorWidth() and GetMonitorHeight() (#2934)
|
||||||
|
[core] REVIEWED: GetWindowHandle() to return Linux window (#2938)
|
||||||
|
[core] REVIEWED: WindowDropCallback(), additional security check (#2943)
|
||||||
|
[core] REVIEWED: Security checks for emscripten_run_script() (#2954)
|
||||||
|
[utils] REVIEWED: TraceLog() message size limit overflow
|
||||||
|
[rcamera] REDESIGNED: New implementation from scratch (#2563) by @Crydsch
|
||||||
|
[rcamera] REVIEWED: Make orbital camera work as expected (#2926) by @JeffM2501
|
||||||
|
[rcamera] REVIEWED: Multiple reviews on the new implementation
|
||||||
|
[rcamera] ADDED: UpdateCameraPro(), supporting custom user inputs
|
||||||
|
[rlgl] ADDED: OpenGL ES 2.0 support on PLATFORM_DESKTOP (#2840) by @wtnbgo
|
||||||
|
[rlgl] ADDED: Separate blending modes for color and alpha, BLEND_CUSTOM_SEPARATE (#2741)
|
||||||
|
[rlgl] ADDED: rlSetBlendFactorsSeparate and custom blend mode modification checks (#2741) by @pure01fx
|
||||||
|
[rlgl] ADDED: RL_TEXTURE_MIPMAP_BIAS_RATIO support to `rlTextureParameters()` for OpenGL 3.3 #2674
|
||||||
|
[rlgl] ADDED: rlCubemapParameters() (#2862) by @GithubPrankster
|
||||||
|
[rlgl] ADDED: rlSetCullFace() (#2797) by @jtainer
|
||||||
|
[rlgl] REMOVED: Mipmaps software generation for OpenGL 1.1
|
||||||
|
[rlgl] REVIEWED: Check for extensions before enabling them (#2706) by @Not-Nik
|
||||||
|
[rlgl] REVIEWED: SSBO usage to avoid long long data types
|
||||||
|
[rlgl] REVIEWED: Enable DXT compression on __APPLE__ targets (#2694) by @Not-Nik
|
||||||
|
[rlgl] REVIEWED: enums exposed and description comments
|
||||||
|
[rlgl] REVIEWED: rlBindImageTexture(), correct data types (#2808) by @planetis-m
|
||||||
|
[rlgl] REVIEWED: rlMultMatrixf(), use const pointer (#2807) by @planetis-m
|
||||||
|
[rlgl] REVIEWED: Expose OpenGL blending mode factors and functions/equations
|
||||||
|
[rlgl] REVIEWED: rLoadTextureDepth(), issue with depth textures on WebGL (#2824)
|
||||||
|
[rlgl] REVIEWED: rlUnloadFramebuffer() (#2937)
|
||||||
|
[raymath] ADDED: Vector2LineAngle() (#2887)
|
||||||
|
[raymath] REVIEWED: Vector2Angle() (#2829, #2832) by @AlxHnr, @planetis-m
|
||||||
|
[shapes] ADDED: CheckCollisionPointPoly() (#2685) by @acejacek
|
||||||
|
[shapes] REVIEWED: DrawPixel*(), use RL_QUADS/RL_TRIANGLES (#2750) by @hatkidchan
|
||||||
|
[shapes] REVIEWED: DrawLineBezier*(), fix bezier line breaking (#2735, #2767) by @nobytesgiven
|
||||||
|
[textures] ADDED: ColorBrightness()
|
||||||
|
[textures] ADDED: ColorTint()
|
||||||
|
[textures] ADDED: ColorContrast()
|
||||||
|
[textures] ADDED: Support for PNM images (.ppm, .pgm)
|
||||||
|
[textures] ADDED: GenImagePerlinNoise()
|
||||||
|
[textures] ADDED: GenImageText(), generate grayscale image from text byte data
|
||||||
|
[textures] ADDED: ImageDrawCircleLines(), ImageDrawCircleLinesV() (#2713) by @RobLoach
|
||||||
|
[textures] ADDED: ImageBlurGaussian() (#2770) by @nobytesgiven
|
||||||
|
[textures] REVIEWED: Image fileformat support: PIC, PNM
|
||||||
|
[textures] REVIEWED: ImageTextEx() and ImageDrawTextEx() scaling (#2756) by @hatkidchan
|
||||||
|
[textures] `WARNING`: REMOVED: DrawTextureQuad()
|
||||||
|
[textures] `WARNING`: REMOVED: DrawTexturePoly(), function moved to example: `textures_polygon`
|
||||||
|
[textures] `WARNING`: REMOVED: DrawTextureTiled(),function implementation moved to the textures_tiled.c
|
||||||
|
[text] ADDED: GetCodepointPrevious()
|
||||||
|
[text] ADDED: UnloadUTF8(), aligned with LoadUTF8()
|
||||||
|
[text] `WARNING`: RENAMED: TextCodepointsToUTF8() to LoadUTF8()
|
||||||
|
[text] `WARNING`: RENAMED: GetCodepoint() -> GetCodepointNext()
|
||||||
|
[text] REDESIGNED: GetCodepointNext()
|
||||||
|
[text] REVIEWED: MeasureTextEx(), avoid crash on bad data
|
||||||
|
[text] REVIEWED: UnloadFontData(), avoid crash on invalid font data
|
||||||
|
[models] ADDED: Support M3D model file format (meshes and materials) (#2648) by @bztsrc
|
||||||
|
[models] ADDED: Support for M3D animations (#2648) by @bztsrc
|
||||||
|
[models] ADDED: GLTF animation support (#2844) by @charles-l
|
||||||
|
[models] ADDED: DrawCapsule() and DrawCapsuleWires() (#2761) by @IanBand
|
||||||
|
[models] ADDED: LoadMaterials(), MTL files loading, same code as OBJ loader (#2872) by @JeffM2501
|
||||||
|
[models] `WARNING`: REMOVED: UnloadModelKeepMeshes()
|
||||||
|
[models] `WARNING`: REMOVED: DrawCubeTexture(), DrawCubeTextureRec(), functions moved to new example: `models_draw_cube_texture`
|
||||||
|
[models] REVIEWED: DrawMesh(), using SHADER_LOC_COLOR_SPECULAR as a material map (#2908) by @haved
|
||||||
|
[models] REVIEWED: LoadM3D() vertex color support (#2878) by @GithubPrankster, @bztsrc
|
||||||
|
[models] REVIEWED: GenMeshHeightmap() (#2716)
|
||||||
|
[models] REVIEWED: LoadIQM() (#2676)
|
||||||
|
[models] REVIEWED: Simplify .vox signature check (#2752) by @CrezyDud
|
||||||
|
[models] REVIEWED: LoadIQM(), support bone names loading if available (#2882) by @PencilAmazing
|
||||||
|
[models] REVIEWED: GenMeshTangents(), avoid crash on missing texcoords data (#2927)
|
||||||
|
[audio] ADDED: Full support for QOA audio file format
|
||||||
|
[audio] ADDED: Mixed audio processor (#2929) by @hatkidchan
|
||||||
|
[audio] ADDED: IsWaveReady()`, IsSoundReady(), IsMusicReady() (#2892) by @RobLoach
|
||||||
|
[audio] `WARNING`: REMOVED: Multichannel audio API: PlaySoundMulti(), StopSoundMulti()
|
||||||
|
[audio] REVIEWED: Clear PCM buffer state when closing audio device (#2736) by @veins1
|
||||||
|
[audio] REVIEWED: Android backend selected (#2118, #2875) by @planetis-m
|
||||||
|
[audio] REVIEWED: Change default threading model for COM objects in miniaudio
|
||||||
|
[multi] ADDED: IsShaderReady(), IsImageReady(), IsFontReady() (#2892) by @RobLoach
|
||||||
|
[multi] ADDED: IsModelReady(), IsMaterialReady(), IsTextureReady(), IsRenderTextureReady() (#2895) by @RobLoach
|
||||||
|
[multi] REVIEWED: Multiple code/comment typos by @sDos280
|
||||||
|
[multi] REVIEWED: Grammar mistakes and typos (#2914) by @stickM4N
|
||||||
|
[multi] REVIEWED: Use TRACELOG() macro instead of TraceLog() in internal modules (#2881) by @RobLoach
|
||||||
|
[examples] ADDED: textures_textured_curve (#2821) by @JeffM2501
|
||||||
|
[examples] ADDED: models_draw_cube_texture
|
||||||
|
[examples] ADDED: models_loading_m3d (#2648) by @bztsrc
|
||||||
|
[examples] ADDED: shaders_write_depth (#2836) by @BugraAlptekinSari
|
||||||
|
[examples] ADDED: shaders_hybrid_render (#2919) by @BugraAlptekinSari
|
||||||
|
[examples] REMOVED: audio_multichannel_sound
|
||||||
|
[examples] RENAMED: Several shaders for naming consistency (#2707)
|
||||||
|
[examples] RENAMED: lighting_instanced.fs to lighting_instancing.fs (glsl100) (#2805) by @gtrxAC
|
||||||
|
[examples] REVIEWED: core_custom_logging.c (#2692) by @hartmannathan
|
||||||
|
[examples] REVIEWED: core_camera_2d_platformer (#2687) by @skylar779
|
||||||
|
[examples] REVIEWED: core_input_gamepad.c (#2903) by @planetis-m
|
||||||
|
[examples] REVIEWED: core_custom_frame_control
|
||||||
|
[examples] REVIEWED: core_drop_files (#2943)
|
||||||
|
[examples] REVIEWED: text_rectangle_bounds (#2746) by @SzieberthAdam
|
||||||
|
[examples] REVIEWED: textures_image_processing, added gaussian blurring (#2775) by @nobytesgiven
|
||||||
|
[examples] REVIEWED: models_billboard, highlighting rotation and draw order (#2779) by @nobytesgiven
|
||||||
|
[examples] REVIEWED: core_loading_thread, join thread on completion (#2845) by @planetis-m
|
||||||
|
[examples] REVIEWED: models_loading_gltf
|
||||||
|
[examples] REVIEWED: Shader lighting.fs for GLSL120 (#2651)
|
||||||
|
[examples] REVIEWED: text_codepoints_loading.c
|
||||||
|
[parser] REVIEWED: raylib-parser Makefile (#2765) by @Peter0x44
|
||||||
|
[build] ADDED: Packaging for distros with deb-based and rpm-based packages (#2877) by @KOLANICH
|
||||||
|
[build] ADDED: Linkage library -latomic on Linux (only required for ARM32)
|
||||||
|
[build] ADDED: Required frameworks on macOS (#2793) by @SpexGuy
|
||||||
|
[build] ADDED: WASM support for Zig build (#2901) by @Not-Nik
|
||||||
|
[build] ADDED: New raylib examples as VS2022 project (to raylib solution)
|
||||||
|
[build] REVIEWED: config.h format and inconsistencies
|
||||||
|
[build] REVIEWED: Zig build to latest master, avoid deprecated functions (#2910) by @star-tek-mb
|
||||||
|
[build] REVIEWED: CMake project template to easily target raylib version (#2700) by @RobLoach
|
||||||
|
[build] REVIEWED: PATH for PLATFORM_WEB target (#2647) by @futureapricot
|
||||||
|
[build] REVIEWED: build.zig to let user decide how to set build mode and linker fixes by @InKryption
|
||||||
|
[build] REVIEWED: Deprecation error on Android API higher than 23 (#2778) by @anggape
|
||||||
|
[build] REVIEWED: Android x86 Architecture name (#2783) by @IsaacTCB
|
||||||
|
[build] REVIEWED: examples/build.zig for the latest Zig version (#2786) by @RomanAkberov
|
||||||
|
[utils] REVIEWED: ExportDataAsCode() data types (#2787) by @RGDTAB
|
||||||
|
[build] REVIEWED: Makefile emscripten path (#2785) by @Julianiolo
|
||||||
|
[build] REVIEWED: Several compilation warnings (for strict rules)
|
||||||
|
[build] REVIEWED: All github workflows using deprecated actions
|
||||||
|
[build] REVIEWED: CMake when compiling for web (#2820) by @object71
|
||||||
|
[build] REVIEWED: DLL build on Windows (#2951) by @Skaytacium
|
||||||
|
[build] REVIEWED: Avoid MSVC warnings in raylib project (#2871) by @JeffM2501
|
||||||
|
[build] REVIEWED: Paths in .bat files to build examples (#2870) by @masoudd
|
||||||
|
[build] REVIEWED: CMake, use GLVND for old cmake versions (#2826) by @simendsjo
|
||||||
|
[build] REVIEWED: Makefile, multiple tweaks
|
||||||
|
[build] REVIEWED: CI action: linux_examples.yml
|
||||||
|
[build] REVIEWED: CI action: cmake.yml
|
||||||
|
[bindings] ADDED: h-raylib (Haskell) by @Anut-py
|
||||||
|
[bindings] ADDED: raylib-c3 (C3) by @Its-Kenta
|
||||||
|
[bindings] ADDED: raylib-umka (Umka) by @RobLoach
|
||||||
|
[bindings] ADDED: chez-raylib (Chez Scheme) by @Yunoinsky
|
||||||
|
[bindings] ADDED: raylib-python-ctypes (Python) by @sDos280
|
||||||
|
[bindings] ADDED: claylib (Common Lisp) by @shelvick
|
||||||
|
[bindings] ADDED: raylib-vapi (Vala) by @lxmcf
|
||||||
|
[bindings] ADDED: TurboRaylib (Object Pascal) by @turborium
|
||||||
|
[bindings] ADDED: Kaylib (Kotlin/Native) by @Its-Kenta
|
||||||
|
[bindings] ADDED: Raylib-Nelua (Nelua) by @Its-Kenta
|
||||||
|
[bindings] ADDED: Cyber (Cyber) by @fubark
|
||||||
|
[bindings] ADDED: raylib-sunder (Sunder) by @ashn-dot-dev
|
||||||
|
[bindings] ADDED: raylib BQN (#2962) by @Brian-ED
|
||||||
|
[misc] REVIEWED: Update external libraries to latest versions
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
Release: raylib 4.2 (11 August 2022)
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
KEY CHANGES:
|
||||||
|
- REMOVED: extras libraries (raygui, physac, rrem, reasings, raudio.h) moved to independent separate repos
|
||||||
|
- UPDATED: examples: Added creation and update raylib versions and assigned **DIFFICULTY LEVELS**!
|
||||||
|
- rres 1.0: A custom resource-processing and packaging file format, including tooling and raylib integration examples
|
||||||
|
- raygui 3.2: New version of the immediate-mode gui system for tools development with raylib
|
||||||
|
- raylib_parser: Multiple improvements of the raylib parser to automatize bindings generation
|
||||||
|
- ADDED: New file system API: Reviewed to be more aligned with raylib conventions and one advance function added
|
||||||
|
- ADDED: New audio stream processors API (_experimental_): Allowing to add custom audio stream data processors using callbacks
|
||||||
|
|
||||||
|
Detailed changes:
|
||||||
|
[multi] ADDED: Frequently Asked Questions (FAQ.md)
|
||||||
|
[multi] REVIEWED: Multiple trace log messages
|
||||||
|
[multi] REVIEWED: Avoid some float to double promotions
|
||||||
|
[multi] REVIEWED: Some functions input parametes that should be const
|
||||||
|
[multi] REVIEWED: Variables initialization, all variables are initialized on declaration
|
||||||
|
[multi] REVIEWED: Static array buffers are always re-initialized with memset()
|
||||||
|
[multi] `WARNING`: RENAMED: Some function input parameters from "length" to "size"
|
||||||
|
[core] ADDED: GetApplicatonDirectory() (#2256, #2285, #2290) by @JeffM2501
|
||||||
|
[core] ADDED: raylibVersion symbol, it could be required by some bindings (#2190)
|
||||||
|
[core] ADDED: SetWindowOpacity() (#2254) by @tusharsingh09
|
||||||
|
[core] ADDED: GetRenderWidth() and GetRenderHeight() by @ArnaudValensi
|
||||||
|
[core] ADDED: EnableEventWaiting() and DisableEventWaiting()
|
||||||
|
[core] ADDED: GetFileLength()
|
||||||
|
[core] ADDED: Modules info at initialization
|
||||||
|
[core] ADDED: Support clipboard copy/paste on web
|
||||||
|
[core] ADDED: Support OpenURL() on Android platform (#2396) by @futureapricot
|
||||||
|
[core] ADDED: Support MOUSE_PASSTHROUGH (#2516)
|
||||||
|
[core] ADDED: GetMouseWheelMoveV() (#2517) by @schveiguy
|
||||||
|
[core] `WARNING`: REMOVED: LoadStorageValue() / SaveStorageValue(), moved to example
|
||||||
|
[core] `WARNING`: RENAMED: GetDirectoryFiles() to LoadDirectoryFiles()
|
||||||
|
[core] `WARNING`: RENAMED: `ClearDroppedFiles()` to `UnloadDroppedFiles()`
|
||||||
|
[core] `WARNING`: RENAMED: GetDroppedFiles() to LoadDroppedFiles()
|
||||||
|
[core] `WARNING`: RENAMED: `ClearDirectoryFiles()` to `UnloadDirectoryFiles()`
|
||||||
|
[core] `WARNING`: REDESIGNED: WaitTime() argument from milliseconds to seconds (#2506) by @flashback-fx
|
||||||
|
[core] REVIEWED: GetMonitorWidth()/GetMonitorHeight() by @gulrak
|
||||||
|
[core] REVIEWED: GetDirectoryFiles(), maximum files allocation (#2126) by @ampers0x26
|
||||||
|
[core] REVIEWED: Expose MAX_KEYBOARD_KEYS and MAX_MOUSE_BUTTONS (#2127)
|
||||||
|
[core] REVIEWED: ExportMesh() (#2138)
|
||||||
|
[core] REVIEWED: Fullscreen switch on PLATFORM_WEB
|
||||||
|
[core] REVIEWED: GetMouseWheelMove(), fixed bug
|
||||||
|
[core] REVIEWED: GetApplicationDirectory() on macOS (#2304)
|
||||||
|
[core] REVIEWED: ToggleFullscreen()
|
||||||
|
[core] REVIEWED: Initialize/reset CORE.inputs global state (#2360)
|
||||||
|
[core] REVIEWED: MouseScrollCallback() (#2371)
|
||||||
|
[core] REVIEWED: SwapScreenBuffers() for PLATFORM_DRM
|
||||||
|
[core] REVIEWED: WaitTime(), fix regression causing video stuttering (#2503) by @flashback-fx
|
||||||
|
[core] REVIEWED: Mouse device support on PLATFORM_DRM (#2381)
|
||||||
|
[core] REVIEWED: Support OpenBSD timming functions
|
||||||
|
[core] REVIEWED: Improved boolean definitions (#2485) by @noodlecollie
|
||||||
|
[core] REVIEWED: TakeScreenshot(), use GetWindowScaleDPI() to calculate size in screenshot/recording (#2446) by @gulrak
|
||||||
|
[core] REVIEWED: Remove fps requirement for drm connector selection (#2468) by @Crydsch
|
||||||
|
[core] REVIEWED: IsFileExtension() (#2530)
|
||||||
|
[camera] REVIEWED: Some camera improvements (#2563)
|
||||||
|
[rlgl] ADDED: Premultiplied alpha blend mode (#2342) by @megagrump
|
||||||
|
[rlgl] REVIEWED: VR rendering not taking render target size into account (#2424) by @FireFlyForLife
|
||||||
|
[rlgl] REVIEWED: Set rlgl internal framebuffer (#2420)
|
||||||
|
[rlgl] REVIEWED: rlGetCompressedFormatName()
|
||||||
|
[rlgl] REVIEWED: Display OpenGL 4.3 capabilities with a compile flag (#2124) by @GithubPrankster
|
||||||
|
[rlgl] REVIEWED: rlUpdateTexture()
|
||||||
|
[rlgl] REVIEWED: Minimize buffer overflow probability
|
||||||
|
[rlgl] REVIEWED: Fix scissor mode on macOS (#2170) by @ArnaudValensi
|
||||||
|
[rlgl] REVIEWED: Clear SSBO buffers on loading (#2185)
|
||||||
|
[rlgl] REVIEWED: rlLoadShaderCode(), improved shader loading code
|
||||||
|
[rlgl] REVIEWED: Comment notes about custom blend modes (#2260) by @glorantq
|
||||||
|
[rlgl] REVIEWED: rlGenTextureMipmaps()
|
||||||
|
[rlgl] REVIEWED: rlTextureParameters()
|
||||||
|
[raymath] ADDED: Wrap() (#2522) by @Tekkitslime
|
||||||
|
[raymath] ADDED: Vector2Transform()
|
||||||
|
[raymath] ADDED: Vector2DistanceSqr() (#2376) by @AnilBK
|
||||||
|
[raymath] ADDED: Vector3DistanceSqr() (#2376) by @AnilBK
|
||||||
|
[raymath] ADDED: Vector2ClampValue(), Vector3ClampValue() (#2428) by @saccharineboi
|
||||||
|
[raymath] ADDED: Vector3RotateByAxisAngle() (#2590) by @Crydsch
|
||||||
|
[raymath] `WARNING`: REDESIGNED: Vector2Angle() returns radians instead of degrees (#2193) by @schveiguy
|
||||||
|
[raymath] `WARNING`: REMOVED: MatrixNormalize() (#2412)
|
||||||
|
[raymath] REVIEWED: Fix inverse length in Vector2Normalize() (#2189) by @HarriP
|
||||||
|
[raymath] REVIEWED: Vector2Angle() not working as expected (#2196) by @jdeokkim
|
||||||
|
[raymath] REVIEWED: Vector2Angle() and Vector3Angle() (#2203) by @trikko
|
||||||
|
[raymath] REVIEWED: QuaternionInvert(), code simplified (#2324) by @megagrump
|
||||||
|
[raymath] REVIEWED: QuaternionScale() (#2419) by @tana
|
||||||
|
[raymath] REVIEWED: Vector2Rotate(), optimized (#2340) by @jdeokkim
|
||||||
|
[raymath] REVIEWED: QuaternionFromMatrix(), QuaternionEquals() (#2591) by @kirigirihitomi
|
||||||
|
[raymath] REVIEWED: MatrixRotate*() (#2595, #2599) by @GoodNike
|
||||||
|
[shapes] REVIEWED: CheckCollision*() consistency
|
||||||
|
[shapes] REVIEWED: DrawRectanglePro(), support TRIANGLES drawing
|
||||||
|
[textures] ADDED: Support for QOI image format
|
||||||
|
[textures] REVIEWED: ImageColorTint(), GetImageColor(), ImageDrawRectangleRec(), optimized functions (#2429) by @AnilBK
|
||||||
|
[textures] REVIEWED: LoadTextureFromImage(), allow texture loading with no data transfer
|
||||||
|
[textures] REVIEWED: ImageDraw(), comment to note that f32bit is not supported (#2222)
|
||||||
|
[textures] REVIEWED: DrawTextureNPatch(), avoid batch overflow (#2401) by @JeffM2501
|
||||||
|
[textures] REVIEWED: DrawTextureTiled() (#2173)
|
||||||
|
[textures] REVIEWED: GenImageCellular() (#2178)
|
||||||
|
[textures] REVIEWED: LoadTextureCubemap() (#2223, #2224)
|
||||||
|
[textures] REVIEWED: Export format for float 32bit
|
||||||
|
[textures] REVIEWED: ExportImage(), support export ".jpeg" files
|
||||||
|
[textures] REVIEWED: ColorAlphaBlend() (#2524) by @royqh1979
|
||||||
|
[textures] REVIEWED: ImageResize() (#2572)
|
||||||
|
[textures] REVIEWED: ImageFromImage() (#2594) by @wiertek
|
||||||
|
[text] ADDED: ExportFontAsCode()
|
||||||
|
[text] ADDED: DrawTextCodepoints() (#2308) by @siddharthroy12
|
||||||
|
[text] REVIEWED: TextIsEqual(), protect from NULLs (#2121) by @lukekras
|
||||||
|
[text] REVIEWED: LoadFontEx(), comment to specify how to get the default character set (#2221) by @JeffM2501
|
||||||
|
[text] REVIEWED: GenImageFontAtlas(), increase atlas size guesstimate by @megagrump
|
||||||
|
[text] REVIEWED: GetCodepoint() (#2201)
|
||||||
|
[text] REVIEWED: GenImageFontAtlas() (#2556)
|
||||||
|
[text] REVIEWED: ExportFontAsCode() to use given font padding (#2525) by @TheTophatDemon
|
||||||
|
[models] ADDED: Reference code to load bones id and weight data for animations
|
||||||
|
[models] `WARNING`: REMOVED: GetRayCollisionModel() (#2405)
|
||||||
|
[models] REMOVED: GenMeshBinormals()
|
||||||
|
[models] REVIEWED: External library: vox_loader.h, 64bit issue (#2186)
|
||||||
|
[models] REVIEWED: Material color loading when no texture material is available (#2298) by @royqh1979
|
||||||
|
[models] REVIEWED: Fix Undefined Symbol _ftelli64 in cgltf (#2319) by @audinue
|
||||||
|
[models] REVIEWED: LoadGLTF(), fix memory leak (#2441, #2442) by @leomonta
|
||||||
|
[models] REVIEWED: DrawTriangle3D() batch limits check (#2489)
|
||||||
|
[models] REVIEWED: DrawBillboardPro() (#2494)
|
||||||
|
[models] REVIEWED: DrawMesh*() issue (#2211)
|
||||||
|
[models] REVIEWED: ExportMesh() (#2220)
|
||||||
|
[models] REVIEWED: GenMeshCylinder() (#2225)
|
||||||
|
[audio] `WARNING`: ADDED: rAudioProcessor pointer to AudioStream struct (used by Sound and Music structs)
|
||||||
|
[audio] ADDED: SetSoundPan(), SetMusicPan(), SetAudioStreamPan(), panning support (#2205) by ptarabbia
|
||||||
|
[audio] ADDED: Audio stream input callback (#2212) by ptarabbia
|
||||||
|
[audio] ADDED: Audio stream processors support (#2212) by ptarabbia
|
||||||
|
[audio] REVIEWED: GetMusicTimePlayed(), incorrect value after the stream restarted for XM audio (#2092 #2215) by @ptarabbia
|
||||||
|
[audio] REVIEWED: Turn on interpolation for XM playback (#2216) by @ptarabbia
|
||||||
|
[audio] REVIEWED: Fix crash with delay example (#2472) by @ptarabbia
|
||||||
|
[audio] REVIEWED: PlaySoundMulti() (#2231)
|
||||||
|
[audio] REVIEWED: ExportWaveAsCode()
|
||||||
|
[audio] REVIEWED: UpdateMusicStream(), reduce dynamic allocations (#2532) by @dbechrd
|
||||||
|
[audio] REVIEWED: UpdateMusicStream() to support proper stream looping (#2579) by @veins1
|
||||||
|
[utils] ADDED: ExportDataAsCode()
|
||||||
|
[utils] REVIEWED: Force flush stdout after trace messages (#2465) by @nagy
|
||||||
|
[easings] ADDED: Function descriptions (#2471) by @RobLoach
|
||||||
|
[camera] REVIEWED: Fix free camera panning in the wrong direction (#2347) by @DavidLyhedDanielsson
|
||||||
|
[examples] ADDED: core_window_should_close
|
||||||
|
[examples] ADDED: core_2d_camera_mouse_zoom (#2583) by @JeffM2501
|
||||||
|
[examples] ADDED: shapes_top_down_lights (#2199) by @JeffM2501
|
||||||
|
[examples] ADDED: textures_fog_of_war
|
||||||
|
[examples] ADDED: textures_gif_player
|
||||||
|
[examples] ADDED: text_codepoints_loading
|
||||||
|
[examples] ADDED: audio_stream_effects
|
||||||
|
[examples] REMOVED: core_quat_conversion, not working properly
|
||||||
|
[examples] REMOVED: raudio_standalone, moved to raudio repo
|
||||||
|
[examples] RENAMED: textures_rectangle -> textures_sprite_anim
|
||||||
|
[examples] REVIEWED: core_input_gamepad, improve joystick visualisation (#2390) by @kristianlm
|
||||||
|
[examples] REVIEWED: textures_draw_tiled
|
||||||
|
[examples] REVIEWED: shaders_mesh_instancing, free allocated matrices (#2425) by @AnilBK
|
||||||
|
[examples] REVIEWED: shaders_raymarching
|
||||||
|
[examples] REVIEWED: audio_raw_stream (#2205) by ptarabbia
|
||||||
|
[examples] REVIEWED: audio_music_stream
|
||||||
|
[examples] REVIEWED: shaders_mesh_instancing, simplified
|
||||||
|
[examples] REVIEWED: shaders_basic_lighting, rlights.h simplified
|
||||||
|
[examples] REVIEWED: All examples descriptions, included creation/update raylib versions
|
||||||
|
[parser] ADDED: Defines to parser (#2269) by @iskolbin
|
||||||
|
[parser] ADDED: Aliases to parser (#2444) by @lazaray
|
||||||
|
[parser] ADDED: Parse struct descriptions (#2214) by @eutro
|
||||||
|
[parser] ADDED: Parse enum descriptions and value descriptions (#2208) by @eutro
|
||||||
|
[parser] ADDED: Lua output format for parser by @iskolbin
|
||||||
|
[parser] ADDED: Makefile for raylib_parser by @iskolbin
|
||||||
|
[parser] ADDED: Support for truncating parser input (#2464) by @lazaray
|
||||||
|
[parser] ADDED: Support for calculated defines to parser (#2463) by @lazaray
|
||||||
|
[parser] REVIEWED: Update parser files (#2125) by @catmanl
|
||||||
|
[parser] REVIEWED: Fix memory leak in parser (#2136) by @ronnieholm
|
||||||
|
[parser] REVIEWED: EscapeBackslashes()
|
||||||
|
[parser] REVIEWED: Parser improvements (#2461 #2462) by @lazaray
|
||||||
|
[bindings] ADDED: License details for BINDINGS
|
||||||
|
[bindings] ADDED: dart-raylib (#2149) by @wolfenrain
|
||||||
|
[bindings] ADDED: raylib-cslo (#2169) by @jasonswearingen
|
||||||
|
[bindings] ADDED: raylib-d (#2194) by @schveiguy
|
||||||
|
[bindings] ADDED: raylib-guile (#2202) by @petelliott
|
||||||
|
[bindings] ADDED: raylib-scopes (#2238) by @salotz
|
||||||
|
[bindings] ADDED: naylib (Nim) (#2386) by @planetis-m
|
||||||
|
[bindings] ADDED: raylib.jl (Julia) (#2403) by @irishgreencitrus
|
||||||
|
[bindings] ADDED: raylib.zig (#2449) by @ryupold
|
||||||
|
[bindings] ADDED: racket-raylib (#2454) by @eutro
|
||||||
|
[bindings] ADDED: raylibr (#2611) by @ramiromagno
|
||||||
|
[bindings] ADDED: Raylib.4.0.Pascal (#2617) by @sysrpl
|
||||||
|
[bindings] REVIEWED: Multiple bindings updated to raylib 4.0
|
||||||
|
[build] ADDED: VS2022 project
|
||||||
|
[build] ADDED: Support macOS by zig build system (#2175)
|
||||||
|
[build] ADDED: Support custom modules selection on compilation
|
||||||
|
[build] ADDED: Minimal web shell for WebAssembly compilation
|
||||||
|
[build] ADDED: BSD support for zig builds (#2332) by @zigster64
|
||||||
|
[build] ADDED: Repology badge (#2367) by @jubalh
|
||||||
|
[build] ADDED: Support DLL compilation with TCC compiler (#2569) by @audinue
|
||||||
|
[build] ADDED: Missing examples to VS2022 examples solution
|
||||||
|
[build] REMOVED: VS2019 project (unmaintained)
|
||||||
|
[build] REMOVED: SUPPORT_MOUSE_CURSOR_POINT config option
|
||||||
|
[build] REVIEWED: Fixed RPi make install (#2217) by @wereii
|
||||||
|
[build] REVIEWED: Fix build results path on Linux and RPi (#2218) by @wereii
|
||||||
|
[build] REVIEWED: Makefiles debug flag
|
||||||
|
[build] REVIEWED: Fixed cross-compilation from x86-64 to RPi (#2233) by @pitpit
|
||||||
|
[build] REVIEWED: All Makefiles, simplified
|
||||||
|
[build] REVIEWED: All Makefiles, improve organization
|
||||||
|
[build] REVIEWED: All Makefiles, support CUSTOM_CFLAGS
|
||||||
|
[build] REVIEWED: Fixed compiling for Android using CMake (#2270) by @hero2002
|
||||||
|
[build] REVIEWED: Make zig build functionality available to zig programs (#2271) by @Not-Nik
|
||||||
|
[build] REVIEWED: Update CMake project template with docs and web (#2274) by @RobLoach
|
||||||
|
[build] REVIEWED: Update VSCode project to work with latest makefile and web (#2296) by @phil-shenk
|
||||||
|
[build] REVIEWED: Support audio examples compilation with external glfw (#2329) by @locriacyber
|
||||||
|
[build] REVIEWED: Fix "make clean" target failing when shell is not cmd (#2338) by @Peter0x44
|
||||||
|
[build] REVIEWED: Makefile linkage -latomic, required by miniaudio on ARM 32bit #2452
|
||||||
|
[build] REVIEWED: Update raylib-config.cmake (#2374) by @marcogmaia
|
||||||
|
[build] REVIEWED: Simplify build.zig to not require user to specify raylib path (#2383) by @Hejsil
|
||||||
|
[build] REVIEWED: Fix OpenGL 4.3 graphics option in CMake (#2427) by @GoldenThumbs
|
||||||
|
[extras] `WARNING`: REMOVED: physac from raylib sources/examples, use github.com/raysan5/physac
|
||||||
|
[extras] `WARNING`: REMOVED: raygui from raylib/src/extras, use github.com/raysan5/raygui
|
||||||
|
[extras] `WARNING`: REMOVED: rmem from raylib/src/extras, moved to github.com/raylib-extras/rmem
|
||||||
|
[extras] `WARNING`: REMOVED: easings from raylib/src/extras, moved to github.com/raylib-extras/reasings
|
||||||
|
[extras] `WARNING`: REMOVED: raudio.h from raylib/src, moved to github.com/raysan5/raudio
|
||||||
|
[misc] REVIEWED: Update some external libraries to latest versions
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
Release: raylib 4.0 - 8th Anniversary Edition (05 November 2021)
|
Release: raylib 4.0 - 8th Anniversary Edition (05 November 2021)
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
KEY CHANGES:
|
KEY CHANGES:
|
||||||
- Naming consistency and coherency: Complete review of the library: sintax, naming, comments, decriptions, logs...
|
- Naming consistency and coherency: Complete review of the library: syntax, naming, comments, decriptions, logs...
|
||||||
- Event Automation System: Support for input events recording and automatic re-playing, useful for automated testing and more!
|
- Event Automation System: Support for input events recording and automatic re-playing, useful for automated testing and more!
|
||||||
- Custom game-loop control: Intended for advance users that want to control the events polling and the timming mechanisms
|
- Custom game-loop control: Intended for advance users that want to control the events polling and the timming mechanisms
|
||||||
- rlgl 4.0: Completely decoupling from platform layer and raylib, intended for standalone usage as single-file header-only
|
- rlgl 4.0: Completely decoupling from platform layer and raylib, intended for standalone usage as single-file header-only
|
||||||
|
12
CMakeLists.txt
Executable file → Normal file
@@ -1,6 +1,18 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
project(raylib)
|
project(raylib)
|
||||||
|
|
||||||
|
# Avoid excessive expansion of variables in conditionals. In particular, if
|
||||||
|
# "PLATFORM" is "DRM" than:
|
||||||
|
#
|
||||||
|
# if (${PLATFORM} MATCHES "DRM")
|
||||||
|
#
|
||||||
|
# may expand e.g to:
|
||||||
|
#
|
||||||
|
# if (/usr/lib/aarch64-linux-gnu/libdrm.so MATCHES "DRM")
|
||||||
|
#
|
||||||
|
# See https://cmake.org/cmake/help/latest/policy/CMP0054.html
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
|
||||||
# Directory for easier includes
|
# Directory for easier includes
|
||||||
# Anywhere you see include(...) you can check <root>/cmake for that file
|
# Anywhere you see include(...) you can check <root>/cmake for that file
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
@@ -27,6 +27,13 @@ endif()
|
|||||||
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
|
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
|
||||||
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
||||||
|
|
||||||
|
# raylib modules included
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RSHAPES "Include module: rshapes" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RTEXTURES "Include module: rtextures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RTEXT "Include module: rtext" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RMODELS "Include module: rmodels" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RAUDIO "Include module: raudio" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
# rcore.c
|
# rcore.c
|
||||||
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
|
||||||
@@ -38,7 +45,6 @@ cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of c
|
|||||||
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" OFF CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_DATA_STORAGE "Support for persistent data storage" ON CUSTOMIZE_BUILD ON)
|
|
||||||
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
# rshapes.c
|
# rshapes.c
|
||||||
@@ -51,12 +57,14 @@ cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editin
|
|||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PNM "Support loading PNM as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
@@ -1,63 +0,0 @@
|
|||||||
### WARNING: This file is unmaintained! This list of contributors is uncomplete!
|
|
||||||
|
|
||||||
### Check CHANGELOG for some of the contributors details or just the official contributors list of the repo
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Here is a list of raylib contributors, these people have invested part of their time
|
|
||||||
contributing (in some way or another) to make the raylib project better. Huge thanks to all of them!
|
|
||||||
|
|
||||||
- [Zopokx](https://github.com/Zopokx) for testing the web.
|
|
||||||
- [Elendow](http://www.elendow.com) for testing and helping on web development.
|
|
||||||
- Victor Dual for implementing and testing 3D shapes functions.
|
|
||||||
- Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules.
|
|
||||||
- Kevin Gato for improving texture internal formats support and helping on raygui development.
|
|
||||||
- Daniel Nicolas for improving texture internal formats support and helping on raygui development.
|
|
||||||
- Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
|
||||||
- Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
|
||||||
- Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
|
||||||
- [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler).
|
|
||||||
- [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing PBR materials and lighting systems... among multiple other improvements and multiple tools and games.
|
|
||||||
- Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5.
|
|
||||||
- Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5.
|
|
||||||
- [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions.
|
|
||||||
- [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system.
|
|
||||||
- [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game.
|
|
||||||
- [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system.
|
|
||||||
- [Marcelo Paez](https://github.com/paezao) for helping on OSX High DPI display issue.
|
|
||||||
- [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for an amazing contribution to raylib Lua module.
|
|
||||||
- [Teodor Stoenescu](https://github.com/teodor-stoenescu) for improvements on OBJ object loading.
|
|
||||||
- [RDR8](https://github.com/RDR8) for helping with Linux build improvements.
|
|
||||||
- [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system.
|
|
||||||
- [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building.
|
|
||||||
- [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c)
|
|
||||||
- [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support.
|
|
||||||
- [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain.
|
|
||||||
- [Michael Vetter](https://github.com/jubalh) for improvements on build system and his work on Suse Linux package... and multiple fixes!
|
|
||||||
- [Wilhem Barbier](https://github.com/nounoursheureux) for adding Image generation functions, shaders work and some fixes.
|
|
||||||
- [Benjamin Summerton](https://github.com/define-private-public) for improving OSX building and his amazing work on CMake build sytem.
|
|
||||||
- [MartinFX](https://github.com/Martinfx) for adding compilation support for FreeBSD OS and derivatives.
|
|
||||||
- [Ahmad Fatoum](https://github.com/a3f) for implementing CI support for raylib (Travis and AppVeyor) and great improvements on build system.
|
|
||||||
- [SamNChiet](https://github.com/SamNChiet) for a greatly improved UWP input implementation.
|
|
||||||
- [David Reid](https://github.com/mackron) for a complete review of audio module to support his amazing miniaudio library.
|
|
||||||
- [Kai](https://github.com/questor) for multiple code reviews and improvements.
|
|
||||||
- [Max Danielsson](https://github.com/autious) for adding support for orthographic 3d camera projection
|
|
||||||
- [Lumaio](https://github.com/TheLumaio) for his great work on GBuffers and GetCollisionRayModel().
|
|
||||||
- [Jonas Daeyaert](https://github.com/culacant) for an amazing work on IQM animated models support.
|
|
||||||
- [Seth Archambault](https://github.com/SethArchambault) for the work on Android Gamepad support (SNES model).
|
|
||||||
- [D3nX](https://github.com/D3nX) for adding Code::Blocks project template.
|
|
||||||
- [Jak Barnes](https://github.com/Syphonx) for a great work on `rnet`, new raylib network module
|
|
||||||
- [Vlad Adrian](https://github.com/Demizdor) for an amazing work on Unicode support, new shapes functions and raygui.
|
|
||||||
- [Reece Mackie](https://github.com/Rover656) for a great work on improving UWP support
|
|
||||||
- [flashback-fx](flashback-fx) for improving easings library and example
|
|
||||||
- [Jorge A. Gomes](https://github.com/overdev) for adding nine-patch textures support and example
|
|
||||||
- [Berni8k](https://github.com/Berni8k) for improving Raspberry Pi input system, using evdev
|
|
||||||
- [Wilhem Barbier](https://github.com/wbrbr) for implementing glTF loading support and solving several issues
|
|
||||||
- [Marco Lizza](https://github.com/MarcoLizza) for improving logging system and multiple issues
|
|
||||||
- [Anata](https://github.com/anatagawa) for creating amazing examples and contributing with them
|
|
||||||
- [Narice](https://github.com/narice) made easings.h includable as standalone header
|
|
||||||
- [Eric J.](https://github.com/ProfJski) for shaders_eratosthenes example contribution
|
|
||||||
- [PompPenguin](https://github.com/PompPenguin) for reviewing 3rd person camera
|
|
||||||
- [Mohamed Shazan](https://github.com/msmshazan) for adding support for ANGLE graphics backend
|
|
||||||
|
|
||||||
Please, if I forget someone in this list, excuse me and send me a PR!
|
|
@@ -52,7 +52,7 @@ switch (value)
|
|||||||
```
|
```
|
||||||
- All conditions checks are **always between parenthesis** but not boolean values:
|
- All conditions checks are **always between parenthesis** but not boolean values:
|
||||||
```c
|
```c
|
||||||
if ((value > 1) && (value < 50) && valueActive))
|
if ((value > 1) && (value < 50) && valueActive)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -92,4 +92,3 @@ resources/characters/enemy_slime.png
|
|||||||
resources/common/font_arial.ttf
|
resources/common/font_arial.ttf
|
||||||
resources/common/gui.png
|
resources/common/gui.png
|
||||||
```
|
```
|
||||||
|
|
||||||
|
137
FAQ.md
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
# Frequently Asked Questions
|
||||||
|
|
||||||
|
- [What is raylib?](#what-is-raylib)
|
||||||
|
- [What can I do with raylib?](#what-can-i-do-with-raylib)
|
||||||
|
- [Which kinds of games can I make with raylib?](#which-kinds-of-games-can-i-make-with-raylib)
|
||||||
|
- [Can I create non-game applications with raylib?](#can-i-create-non-game-applications-with-raylib)
|
||||||
|
- [How can I learn to use raylib? Is there some official documentation or tutorials?](#how-can-i-learn-to-use-raylib-is-there-some-official-documentation-or-tutorials)
|
||||||
|
- [How much does it cost?](#how-much-does-it-cost)
|
||||||
|
- [What is the raylib license?](#what-is-the-raylib-license)
|
||||||
|
- [What platforms are supported by raylib?](#what-platforms-are-supported-by-raylib)
|
||||||
|
- [What programming languages can I use with raylib?](#what-programming-languages-can-i-use-with-raylib)
|
||||||
|
- [Why is it coded in C?](#why-is-it-coded-in-c)
|
||||||
|
- [Is raylib a videogames engine?](#is-raylib-a-videogames-engine)
|
||||||
|
- [What does raylib provide that other engines or libraries don't?](#what-does-raylib-provide-that-other-engines-or-libraries-dont)
|
||||||
|
- [How does raylib compare to Unity/Unreal/Godot?](#how-does-raylib-compare-to-unityunrealgodot)
|
||||||
|
- [What development tools are required for raylib?](#what-development-tools-are-required-for-raylib)
|
||||||
|
- [Which are raylib external dependencies?](#which-are-raylib-external-dependencies)
|
||||||
|
- [Can I use raylib with other technologies or libraries?](#can-i-use-raylib-with-other-technologies-or-libraries)
|
||||||
|
- [What file formats are supported by raylib?](#what-file-formats-are-supported-by-raylib)
|
||||||
|
- [Does raylib support the Vulkan API?](#does-raylib-support-the-vulkan-api)
|
||||||
|
- [What could I expect to see in raylib in the future?](#what-could-i-expect-to-see-in-raylib-in-the-future)
|
||||||
|
- [Who are the raylib developers?](#who-are-the-raylib-developers)
|
||||||
|
|
||||||
|
### What is raylib?
|
||||||
|
|
||||||
|
raylib is a C programming library, designed to be simple and easy-to-use. It provides a set of functions intended for graphics/multimedia applications programming.
|
||||||
|
|
||||||
|
### What can I do with raylib?
|
||||||
|
|
||||||
|
raylib can be used to create any kind of graphics/multimedia applications: videogames, tools, mobile apps, web applications... Actually it can be used to create any application that requires something to be shown in a display with graphic hardware acceleration (OpenGL); including [IoT](https://en.wikipedia.org/wiki/Internet_of_things) devices with a graphics display.
|
||||||
|
|
||||||
|
### Which kinds of games can I make with raylib?
|
||||||
|
|
||||||
|
With enough time and effort any kind of game/application can be created but small-mid sized 2d videogames are the best fit. The raylib [examples](https://www.raylib.com/examples.html)/[games](https://www.raylib.com/games.html) and [raylibtech](https://raylibtech.itch.io/) tools are an example of what can be accomplished with raylib.
|
||||||
|
|
||||||
|
### Can I create non-game applications with raylib?
|
||||||
|
|
||||||
|
Yes, raylib can be used to create any kind of application, not just videogames. For example, it can be used to create [desktop/web tools](https://raylibtech.itch.io/) or also applications for an IoT devices like [Raspberry Pi](https://www.raspberrypi.org/).
|
||||||
|
|
||||||
|
### How can I learn to use raylib? Is there some official documentation or tutorials?
|
||||||
|
|
||||||
|
raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look to [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching.
|
||||||
|
|
||||||
|
raylib also provides a big [collection of examples](https://www.raylib.com/examples.html), to showcase the multiple functionality usage (+120 examples). Examples are categorized by the internal module functionality and also define an estimated level of difficulty to guide the users checking them.
|
||||||
|
|
||||||
|
There is also a [FAQ on the raylib Wiki](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions) with common technical questions.
|
||||||
|
|
||||||
|
There are also many tutorials on the internet and YouTube created by the growing raylib community along the years.
|
||||||
|
|
||||||
|
[raylib Discord Community](https://discord.gg/raylib) is also a great place to join and ask questions, the community is very friendly and always ready to help.
|
||||||
|
|
||||||
|
### How much does it cost?
|
||||||
|
|
||||||
|
raylib is [free and open source](https://github.com/raysan5/raylib). Anyone can use raylib library for free to create games/tools/apps but also the source code of raylib is open for anyone to check it, modify it, adapt it as required or just learn how it works internally.
|
||||||
|
|
||||||
|
### What is the raylib license?
|
||||||
|
|
||||||
|
raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details.
|
||||||
|
|
||||||
|
### What platforms are supported by raylib?
|
||||||
|
|
||||||
|
raylib source code can be compiled for the following platforms:
|
||||||
|
|
||||||
|
- Windows (7, 8.1, 10, 11)
|
||||||
|
- Linux - Desktop (multiple distributions, X11 and Wayland based)
|
||||||
|
- Linux - Native (no windowing system, [DRM](https://en.wikipedia.org/wiki/Direct_Rendering_Manager))
|
||||||
|
- macOS (multiple versions, including ARM64)
|
||||||
|
- FreeBSD, OpenBSD, NetBSD, DragonFly
|
||||||
|
- Raspberry Pi (desktop and native)
|
||||||
|
- Android (multiple API versions and architectures)
|
||||||
|
- HTML5 (WebAssembly)
|
||||||
|
- Haiku
|
||||||
|
|
||||||
|
raylib code has also been ported to several [homebrew](https://en.wikipedia.org/wiki/Homebrew_(video_games)) platforms: N3DS, Switch, PS4, PSVita.
|
||||||
|
|
||||||
|
Also note that raylib is a low-level library that can be easily ported to any platform with OpenGL support (or similar API).
|
||||||
|
|
||||||
|
### What programming languages can I use with raylib?
|
||||||
|
|
||||||
|
raylib original version is coded in C language (using some C99 features) but it has bindings to +60 programming languages. Check [BINDINGS.md](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) for details.
|
||||||
|
|
||||||
|
### Why is it coded in C?
|
||||||
|
|
||||||
|
It's a simple language, no high-level code abstractions like [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming), just data types and functions. It's a very enjoyable language to code.
|
||||||
|
|
||||||
|
### Is raylib a videogames engine?
|
||||||
|
|
||||||
|
I personally consider raylib a graphics library with some high-level features rather than an engine. The line that separates a library/framework from an engine could be very confusing; raylib provides all the required functionality to create simple games or small applications but it does not provide 3 elements that I personally consider any "engine" should provide: Screen manager, GameObject/Entity manager and Resource Manager. Still, most users do not need those elements or just code simple approaches on their own.
|
||||||
|
|
||||||
|
### What does raylib provide that other engines or libraries don't?
|
||||||
|
|
||||||
|
I would say "simplicity" and "enjoyment" at a really low-level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
|
||||||
|
|
||||||
|
### How does raylib compare to Unity/Unreal/Godot?
|
||||||
|
|
||||||
|
Those engines are usually big and complex to use, providing lot of functionality. They require some time to learn and test, they usually abstract many parts of the game development process and they usually provide a set of tools to assist users on their creations (like a GUI editor).
|
||||||
|
|
||||||
|
raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low-level to create graphics applications in a more handmade way.
|
||||||
|
|
||||||
|
### What development tools are required for raylib?
|
||||||
|
|
||||||
|
To develop raylib programs you only need a text editor (with recommended code syntax highlighting) and a compiler.
|
||||||
|
|
||||||
|
A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advance configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials.
|
||||||
|
|
||||||
|
### What are raylib's external dependencies?
|
||||||
|
|
||||||
|
raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file-formats.
|
||||||
|
|
||||||
|
A detailed list of raylib dependencies could be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies).
|
||||||
|
|
||||||
|
### Can I use raylib with other technologies or libraries?
|
||||||
|
|
||||||
|
Yes, raylib can be used with other libraries that provide specific functionality. There are multiple examples of raylib integrations with libraries like Spine, Tiled, Dear Imgui and several physics engines.
|
||||||
|
|
||||||
|
### What file formats are supported by raylib?
|
||||||
|
|
||||||
|
raylib can load data from multiple standard file formats:
|
||||||
|
|
||||||
|
- Image/Textures: PNG, BMP, TGA, JPG, GIF, QOI, PSD, DDS, HDR, KTX, ASTC, PKM, PVR
|
||||||
|
- Fonts: FNT (sprite font), TTF, OTF
|
||||||
|
- Models/Meshes: OBJ, IQM, GLTF, VOX
|
||||||
|
- Audio: WAV, OGG, MP3, FLAC, XM, MOD
|
||||||
|
|
||||||
|
### Does raylib support the Vulkan API?
|
||||||
|
|
||||||
|
No, raylib is built on top of OpenGL API, and there are currently no plans to support any other graphics APIs. In any case, raylib uses rlgl as an abstraction layer to support different OpenGL versions. If really required, a Vulkan backend equivalent could be added but creating that abstraction layer would imply a considerable amount of work.
|
||||||
|
|
||||||
|
### What could I expect to see in raylib in the future?
|
||||||
|
|
||||||
|
The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features are regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable.
|
||||||
|
|
||||||
|
### Who are the raylib developers?
|
||||||
|
|
||||||
|
The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there's 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib.
|
||||||
|
|
||||||
|
The full list of raylib contributors can be seen [on GitHub](https://github.com/raysan5/raylib/graphs/contributors).
|
72
HISTORY.md
@@ -339,7 +339,7 @@ Let's start with some numbers:
|
|||||||
|
|
||||||
Highlights for `raylib 4.0`:
|
Highlights for `raylib 4.0`:
|
||||||
|
|
||||||
- **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the sintax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent.
|
- **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent.
|
||||||
|
|
||||||
- **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental.
|
- **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental.
|
||||||
|
|
||||||
@@ -362,3 +362,73 @@ Highlights for `raylib 4.0`:
|
|||||||
Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes!
|
Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes!
|
||||||
|
|
||||||
Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :)
|
Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :)
|
||||||
|
|
||||||
|
notes on raylib 4.2
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
**New raylib release!** Nine months after latest raylib, here it is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing!
|
||||||
|
|
||||||
|
Some numbers to start with:
|
||||||
|
|
||||||
|
- **+200** closed issues (for a TOTAL of **1230**!)
|
||||||
|
- **+540** commits since previous RELEASE (for a TOTAL of **+6000**!)
|
||||||
|
- **+20** functions ADDED to raylib API (for a TOTAL of **502**!)
|
||||||
|
- **+60** functions REVIEWED/REDESIGNED
|
||||||
|
- **+70** new contributors (for a TOTAL of **+360**!)
|
||||||
|
|
||||||
|
Highlights for `raylib 4.2`:
|
||||||
|
|
||||||
|
- **raylib extra libraries cleanup**: raylib has been on diet and all the _extra_ libraries included on previous releases have been removed from raylib. Now raylib only includes the original **7** raylib modules: `rcore`, `rlgl`, `rshapes`, `rtextures`, `rtext`, `rmodels` and `raudio`. But no worries, _extra_ libraries have not been deleted, they have been moved to their own repos for better maintainability and more focus on its functionality. The libraries moved out from raylib repo are: [`raygui`](https://github.com/raysan5/raygui), [`physac`](https://github.com/raysan5/physac), [`rmem`](https://github.com/raylib-extras/rmem), [`reasings`](https://github.com/raylib-extras/reasings) and [`raudio`](https://github.com/raysan5/raudio) (standalone mode). On that same line, a new **amazing GitHub group:** [`raylib-extras`](https://github.com/raylib-extras) has been created by @JeffM2501 to contain raylib extra libraries as well as other raylib add-ons provided by the community. Jeff has done an amazing work on that line, providing multiple libraries and examples for raylib, like [custom first-person and third person camera systems](https://github.com/raylib-extras/extras-c/tree/main/cameras), [Dear ImGui raylib integration](https://github.com/raylib-extras/rlImGui), [multiple specific examples](https://github.com/raylib-extras/examples-c) and even a complete [RPG Game Example](https://github.com/raylib-extras/RPGExample)! Great work Jeff! :D
|
||||||
|
|
||||||
|
- **raylib examples review**: The +120 raylib examples have been reviewed to add clearer information about when the were first created (raylib version used) and when they were updated for the last time. But the greatest improvement for users has been the **addition of an estimated difficulty level** for every example, [web has been updated accordingly](https://www.raylib.com/examples.html) to reflect those difficulty levels. Now examples are classified with **1 to 4 stars** depending on difficulty to help users with their learning process. Personally, I think this "small" addition could be a game-changer to better guide new users on the library adoption! Additionally, this new raylib release includes 7 new examples; the most interesting one: [`text_codepoints_loading`](https://www.raylib.com/examples/text/loader.html?name=text_codepoints_loading) that illustrates how to load and draw custom codepoints from a font file, very useful for Asian languages.
|
||||||
|
|
||||||
|
- [**`rres 1.0`**](https://github.com/raysan5/rres): New `rres` **resources packaging file-format**, including a [`rres-raylib`](https://github.com/raysan5/rres/blob/master/src/rres-raylib.h) library implementation and [`rrespacker`](https://raylibtech.itch.io/rrespacker) tool. `rres` file format has been [under development for +8 years](https://github.com/raysan5/rres#design-history) and it was originally created to be part of raylib. It was highly inspired by _XNA XNB_ resources file format but design has changed a lot along the years. This first release of the format specs is engine-agnostic and has been designed to be portable to any engine, including lots of professional features like data processing, compression and encryption.
|
||||||
|
|
||||||
|
- [**`raygui 3.2`**](https://github.com/raysan5/raygui): The **official raylib immediate-mode gui library** designed for tools development has been updated to a new version aligned with raylib 4.2. Multiple controls have been reviewed for library consistency, now all controls follow a similar function signature. It has been battle-tested with the development of +8 published tools in the last months. The tools can be seen and used for free in the [raylib technologies tools page](https://raylibtech.itch.io/). Worth mentioning that several of those **tools have been open sourced** for anyone to use, compile, contribute or learn how the code works.
|
||||||
|
|
||||||
|
- [**`raylib_parser`**](https://github.com/raysan5/raylib/tree/master/parser): Multiple contributors **using the tool to automatize bindings creation** have contributed with improvements of this **tool to parse `raylib.h`** (and other raylib-style headers) to tokenize its enums, structs and functions. Processed data can be exported to custom file formats (i.e XML, JSON, LUA) for bindings generation or even docs generation if required.
|
||||||
|
|
||||||
|
- **New file system API**: Current API has been redesigned to be more comprehensive and better aligned with raylib naming conventions, two new functions are provided `LoadDirectoryFiles()`/`LoadDirectoryFilesEx()` to load a `FilePathList` for provided path, supporting extension filtering and recursive directory scan. `LoadDroppedFiles()` has been renamed to better reflect its internal functionality. Now, all raylib functions that start with `Load*()` allocate memory internally and a equivalent `Unload*()` function is defined to take care of that memory internally when not required any more!
|
||||||
|
|
||||||
|
- **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advance users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib.
|
||||||
|
|
||||||
|
As always, there are more improvements than the key features listed, make sure to check raylib [CHANGELOG](CHANGELOG) for the detailed list of changes; for this release a `WARNING` flag has been added to all the changes that could affect bindings or productivity code. **raylib keeps improving one more version** and a special focus on maintainability has been put on the library for the future. Specific/advance functionality will be provided through **raylib-extras** repos and raylib main repo devlelopment will be focused on what made raylib popular: being a simple and easy-to-use library to **enjoy videogames programming**.
|
||||||
|
|
||||||
|
**Enjoy gamedev/tools/graphics programming!** :)
|
||||||
|
|
||||||
|
notes on raylib 4.5
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here it is a small summary highlighting this new **rayib 4.5**.
|
||||||
|
|
||||||
|
Some numbers for this release:
|
||||||
|
|
||||||
|
- **+100** closed issues (for a TOTAL of **+1340**!)
|
||||||
|
- **+350** commits since previous RELEASE (for a TOTAL of **+6350**!)
|
||||||
|
- **+25** functions ADDED to raylib API (for a TOTAL of **516**!)
|
||||||
|
- **+40** functions REVIEWED/REDESIGNED
|
||||||
|
- **+40** new contributors (for a TOTAL of **405**!)
|
||||||
|
|
||||||
|
Highlights for `raylib 4.5`:
|
||||||
|
|
||||||
|
- **`NEW` Improved ANGLE support on Desktop platforms**: Support for OpenGL ES 2.0 on Desktop platforms (Windows, Linux, macOS) has been reviewed by @wtnbgo GitHub user. Now raylib can be compiled on desktop for OpenGL ES 2.0 and linked against [`ANGLE`](https://github.com/google/angle). This _small_ addition open the door to building raylib for all **ANGLE supported backends: Direct3D 11, Vulkan and Metal**. Please note that this new feature is still experimental and requires further testing!
|
||||||
|
|
||||||
|
- **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advance users have **full control over camera inputs and movement/rotation speeds**!
|
||||||
|
|
||||||
|
- **`NEW` Support for M3D models and M3D/GLTF animations**: 3d models animations support has been a limited aspect of raylib for long time, some versions ago IQM animations were supported but raylib 4.5 also adds support for the brand new [M3D file format](https://bztsrc.gitlab.io/model3d/), including animations and the long expected support for **GLTF animations**! The new M3D file format is **simple, portable, feature complete, extensible and open source**. It also provides a complete set of tools to export/visualize M3D models from/to Blender! Now raylib supports up to **3 model file-formats with animations**: `IQM`, `GLTF` and `M3D`.
|
||||||
|
|
||||||
|
- **`NEW` Support QOA audio format (import/export)**: Just a couple of months ago the new [QOA file format](https://qoaformat.org/) was published, a very simple, portable and open source quite-ok-audio file format. raylib already supports it, added to `raudio` module and including audio loading from file, loading from memory, streaming from file, streaming from memory and **exporting to QOA** audio format. **Because simplicity really matters to raylib!**
|
||||||
|
|
||||||
|
- **`NEW` Module for compressed textures loading**: [`rl_gputex`](https://github.com/raysan5/raylib/blob/master/src/external/rl_gputex.h), a portable single-file header-only small library to load compressed texture file-formats (DDS, PKM, KTX, PVR, ASTC). Provided functionality is not new to raylib but it was part of the raylib `rtextures` module, now it has been moved into a separate self-contained library, **improving portability**. Note that this module is only intended to **load compressed data from files, ready to be uploaded to GPU**, no compression/decompression functionality is provided. This change is a first step towards a better modularization of raylib library.
|
||||||
|
|
||||||
|
- **Reviewed `rlgl` module for automatic limits checking**: Again, [`rlgl`](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been reviewed to simplify usage. Now users do not need to worry about reaching the internal render-batch limits when they send their triangles to draw 2d/3d, `rlgl` manages it automatically! This change allows a **great simplification for other modules** like `rshapes`, `rtextures` and `rmodels` that do not need to worry about bufffer overflows and can just define as many vertex as desired!
|
||||||
|
|
||||||
|
- **Reviewed `rshapes` module to minimize the rlgl dependency**: Now `rshapes` 2d shapes drawing functions **only depend on 6 low-level functions**: `rlBegin()`, `rlEnd()`, `rlVertex3f()`, `rlTexCoord2f()`, `rlNormal3f()`, `rlSetTexture()`. With only those pseudo-OpenGl 1.1 minimal functionality, everything can be drawn! This improvement converts `rshapes` module in a **self-contained, portable shapes-drawing library that can be used independently of raylib**, as far as entry points for those 6 functions are provided by the user. It even allows to be used for software rendering, with the proper backend!
|
||||||
|
|
||||||
|
- **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselfs.
|
||||||
|
|
||||||
|
As usual, those are only some highlights but there is much more! New image generators, new color transformation functionality, improved blending support for color/alpha, etc... Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! Please, note that all breaking changes have been flagged with a `WARNING` in the CHANGELOG, specially useful for binding creators!
|
||||||
|
|
||||||
|
**raylib keeps improving one more version** with a special focus on maintainability and sustainability. Always working towards making the library more **simple and easy-to-use**.
|
||||||
|
|
||||||
|
Let's keep **enjoying games/tools/graphics programming!** :)
|
||||||
|
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2013-2021 Ramon Santamaria (@raysan5)
|
Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
|
|
||||||
This software is provided "as-is", without any express or implied warranty. In no event
|
This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
will the authors be held liable for any damages arising from the use of this software.
|
will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
41
README.md
@@ -6,21 +6,23 @@ raylib is highly inspired by Borland BGI graphics lib and by XNA framework and i
|
|||||||
|
|
||||||
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
|
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
|
||||||
|
|
||||||
Ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html)
|
Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
[](https://github.com/raysan5/raylib/graphs/contributors)
|
[](https://github.com/raysan5/raylib/releases)
|
||||||
[](https://github.com/raysan5/raylib/releases)
|
[](https://github.com/raysan5/raylib/stargazers)
|
||||||
[](https://github.com/raysan5/raylib/commits/master)
|
[](https://github.com/raysan5/raylib/commits/master)
|
||||||
|
[](https://github.com/sponsors/raysan5)
|
||||||
|
[](https://repology.org/project/raylib/versions)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|
||||||
[](https://discord.gg/raylib)
|
[](https://discord.gg/raylib)
|
||||||
[](https://github.com/raysan5/raylib/stargazers)
|
[](https://www.reddit.com/r/raylib/)
|
||||||
[](https://twitter.com/raysan5)
|
[](https://www.youtube.com/c/raylib)
|
||||||
[](https://www.reddit.com/r/raylib/)
|
[](https://www.twitch.tv/raysan5)
|
||||||
|
|
||||||
[](https://github.com/raysan5/raylib/actions?query=workflow%3AWindows)
|
[](https://github.com/raysan5/raylib/actions?query=workflow%3AWindows)
|
||||||
[](https://github.com/raysan5/raylib/actions?query=workflow%3ALinux)
|
[](https://github.com/raysan5/raylib/actions?query=workflow%3ALinux)
|
||||||
@@ -36,10 +38,10 @@ features
|
|||||||
--------
|
--------
|
||||||
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
||||||
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
|
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
|
||||||
- Written in plain C code (C99) in PascalCase/camelCase notation
|
- Written in plain C code (C99) using PascalCase/camelCase notation
|
||||||
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3 or ES 2.0**)
|
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3 or ES 2.0**)
|
||||||
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
||||||
- Multiple **Fonts** formats supported (TTF, XNA fonts, AngelCode fonts)
|
- Multiple **Fonts** formats supported (TTF, Image fonts, AngelCode fonts)
|
||||||
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
||||||
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
|
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
|
||||||
- Flexible Materials system, supporting classic maps and **PBR maps**
|
- Flexible Materials system, supporting classic maps and **PBR maps**
|
||||||
@@ -49,7 +51,7 @@ features
|
|||||||
- Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
|
- Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
|
||||||
- **VR stereo rendering** support with configurable HMD device parameters
|
- **VR stereo rendering** support with configurable HMD device parameters
|
||||||
- Huge examples collection with [+120 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
|
- Huge examples collection with [+120 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
|
||||||
- Bindings to [+50 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
|
- Bindings to [+60 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
|
||||||
- **Free and open source**.
|
- **Free and open source**.
|
||||||
|
|
||||||
basic example
|
basic example
|
||||||
@@ -90,28 +92,29 @@ raylib is also available via multiple [package managers](https://github.com/rays
|
|||||||
- [Working on Windows](https://github.com/raysan5/raylib/wiki/Working-on-Windows)
|
- [Working on Windows](https://github.com/raysan5/raylib/wiki/Working-on-Windows)
|
||||||
- [Working on macOS](https://github.com/raysan5/raylib/wiki/Working-on-macOS)
|
- [Working on macOS](https://github.com/raysan5/raylib/wiki/Working-on-macOS)
|
||||||
- [Working on GNU Linux](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)
|
- [Working on GNU Linux](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)
|
||||||
|
- [Working on Chrome OS](https://github.com/raysan5/raylib/wiki/Working-on-Chrome-OS)
|
||||||
- [Working on FreeBSD](https://github.com/raysan5/raylib/wiki/Working-on-FreeBSD)
|
- [Working on FreeBSD](https://github.com/raysan5/raylib/wiki/Working-on-FreeBSD)
|
||||||
- [Working on Raspberry Pi](https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi)
|
- [Working on Raspberry Pi](https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi)
|
||||||
- [Working for Android](https://github.com/raysan5/raylib/wiki/Working-for-Android)
|
- [Working for Android](https://github.com/raysan5/raylib/wiki/Working-for-Android)
|
||||||
- [Working for Web (HTML5)](https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5))
|
- [Working for Web (HTML5)](https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5))
|
||||||
- [Working anywhere with CMake](https://github.com/raysan5/raylib/wiki/Working-with-CMake)
|
- [Working anywhere with CMake](https://github.com/raysan5/raylib/wiki/Working-with-CMake)
|
||||||
|
|
||||||
*Note that Wiki is open for edit, if you find some issue while building raylib for your target platform, feel free to edit the Wiki or open and issue related to it.*
|
*Note that the Wiki is open for edit, if you find some issues while building raylib for your target platform, feel free to edit the Wiki or open an issue related to it.*
|
||||||
|
|
||||||
#### Setup raylib with multiple IDEs
|
#### Setup raylib with multiple IDEs
|
||||||
|
|
||||||
raylib has been developed on Windows platform using [Notepad++](https://notepad-plus-plus.org/) and [MinGW GCC](http://mingw-w64.org/doku.php) compiler but it can be used with other IDEs on multiple platforms.
|
raylib has been developed on Windows platform using [Notepad++](https://notepad-plus-plus.org/) and [MinGW GCC](https://www.mingw-w64.org/) compiler but it can be used with other IDEs on multiple platforms.
|
||||||
|
|
||||||
[Projects directory](https://github.com/raysan5/raylib/tree/master/projects) contains several ready-to-use **project templates** to build raylib and code examples with multiple IDEs.
|
[Projects directory](https://github.com/raysan5/raylib/tree/master/projects) contains several ready-to-use **project templates** to build raylib and code examples with multiple IDEs.
|
||||||
|
|
||||||
*Note that there are lots of IDEs supported, some of the provided templates could require some review, please, if you find some issue with some template or you think they could be improved, feel free to send a PR or open a related issue.*
|
*Note that there are lots of IDEs supported, some of the provided templates could require some review, so please, if you find some issue with a template or you think they could be improved, feel free to send a PR or open a related issue.*
|
||||||
|
|
||||||
learning and docs
|
learning and docs
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
raylib is designed to be learned using [the examples](https://github.com/raysan5/raylib/tree/master/examples) as the main reference. There is no standard API documentation but there is a [**cheatsheet**](https://www.raylib.com/cheatsheet/cheatsheet.html) containing all the functions available on the library and a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works.
|
raylib is designed to be learned using [the examples](https://github.com/raysan5/raylib/tree/master/examples) as the main reference. There is no standard API documentation but there is a [**cheatsheet**](https://www.raylib.com/cheatsheet/cheatsheet.html) containing all the functions available on the library a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works.
|
||||||
|
|
||||||
Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here the more relevant links:
|
Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here are the relevant links:
|
||||||
|
|
||||||
- [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html)
|
- [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html)
|
||||||
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
|
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
|
||||||
@@ -125,10 +128,10 @@ contact and networks
|
|||||||
|
|
||||||
raylib is present in several networks and raylib community is growing everyday. If you are using raylib and enjoying it, feel free to join us in any of these networks. The most active network is our [Discord server](https://discord.gg/raylib)! :)
|
raylib is present in several networks and raylib community is growing everyday. If you are using raylib and enjoying it, feel free to join us in any of these networks. The most active network is our [Discord server](https://discord.gg/raylib)! :)
|
||||||
|
|
||||||
- Webpage: [http://www.raylib.com](http://www.raylib.com)
|
- Webpage: [https://www.raylib.com](https://www.raylib.com)
|
||||||
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
|
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
|
||||||
- Twitter: [http://www.twitter.com/raysan5](http://www.twitter.com/raysan5)
|
- Twitter: [https://www.twitter.com/raysan5](https://www.twitter.com/raysan5)
|
||||||
- Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
|
- Twitch: [https://www.twitch.tv/raysan5](https://www.twitch.tv/raysan5)
|
||||||
- Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
- Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
||||||
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
|
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
|
||||||
- YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/c/raylib)
|
- YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/c/raylib)
|
||||||
|
20
ROADMAP.md
@@ -1,19 +1,25 @@
|
|||||||
# raylib roadmap
|
# raylib roadmap
|
||||||
|
|
||||||
Here it is a wish-list with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements of ideas:
|
Here it is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
|
||||||
|
|
||||||
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
|
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
|
||||||
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
|
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
|
||||||
- [raylib wishlist](https://github.com/raysan5/raylib/discussions/1502) is open to everyone to ask for improvements, feel free to check and comment.
|
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
|
||||||
|
- [raylib wishlist 2021](https://github.com/raysan5/raylib/discussions/1502)
|
||||||
|
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
|
||||||
|
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
|
||||||
|
|
||||||
_Current version of raylib is complete and functional but, as always, there is lot of room for improvement._
|
_Current version of raylib is complete and functional but there is always room for improvements._
|
||||||
|
|
||||||
**raylib 4.x**
|
**raylib 4.x**
|
||||||
- [ ] Redesign camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143))
|
- [ ] Split core module into separate platforms?
|
||||||
|
- [ ] Basic 2d software renderer, using `Image` provided API
|
||||||
- [ ] Redesign gestures system, improve touch inputs management
|
- [ ] Redesign gestures system, improve touch inputs management
|
||||||
- [ ] Better documentation and improved examples
|
- [ ] Redesign audio module, implement miniaudio high-level provided features
|
||||||
- [ ] Focus on HTML5 and embedded platforms
|
- [x] Redesign camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143), https://github.com/raysan5/raylib/discussions/2507)
|
||||||
- [ ] Additional support libraries: [raygui](https://github.com/raysan5/raygui), [rres](https://github.com/raysan5/rres)...
|
- [x] Better documentation and improved examples, reviewed webpage with examples complexity level
|
||||||
|
- [x] Focus on HTML5 ([raylib 5k gamejam](https://itch.io/jam/raylib-5k-gamejam)) and embedded platforms (RPI and similar SOCs)
|
||||||
|
- [x] Additional support libraries: [raygui](https://github.com/raysan5/raygui), [rres](https://github.com/raysan5/rres)
|
||||||
|
|
||||||
**raylib 4.0**
|
**raylib 4.0**
|
||||||
- [x] Improved consistency and coherency in raylib API
|
- [x] Improved consistency and coherency in raylib API
|
||||||
|
68
SPONSORS.md
@@ -1,68 +0,0 @@
|
|||||||
## raylib GitHub Sponsors
|
|
||||||
|
|
||||||
### Current raylib GitHub Sponsors (raylib 4.0 release)
|
|
||||||
|
|
||||||
The following people are currently [**sponsoring raylib**](https://github.com/sponsors/raysan5) with a generous donation to allow improving and growing the project!
|
|
||||||
|
|
||||||
- Eric J. ([@ProfJski](https://github.com/ProfJski))
|
|
||||||
- Zach Geis ([@zacgeis](https://github.com/zacgeis))
|
|
||||||
- minirop ([@minirop](https://github.com/minirop))
|
|
||||||
- Daniel Gómez ([@Koocachookies](https://github.com/Koocachookies))
|
|
||||||
- Marc Agüera ([@maguera93](https://github.com/maguera93))
|
|
||||||
- Robin Mattheussen ([@romatthe](https://github.com/romatthe))
|
|
||||||
- Grant Haywood ([@cinterloper](https://github.com/cinterloper))
|
|
||||||
- Terry Nguyen ([@terrehbyte](https://github.com/terrehbyte))
|
|
||||||
- Tommi Sinivuo ([@TommiSinivuo](https://github.com/TommiSinivuo))
|
|
||||||
- Richard Urbanec ([@Poryg1](https://github.com/Poryg1))
|
|
||||||
- pmgl ([@pmgl](https://github.com/pmgl))
|
|
||||||
- cob ([@majorcob](https://github.com/majorcob))
|
|
||||||
- Samuel Batista ([@gamedevsam](https://github.com/gamedevsam))
|
|
||||||
- Merlyn Morgan-Graham ([@kavika13](https://github.com/kavika13))
|
|
||||||
- linus ([@hochbaum](https://github.com/hochbaum))
|
|
||||||
- Níckolas Daniel da Silva ([@nawarian](https://github.com/nawarian) - [thephp.website](https://thephp.website/))
|
|
||||||
- kenzie ([@sme-ek](https://github.com/sme-ek))
|
|
||||||
- Allan Regush ([@AllanRegush](https://github.com/AllanRegush))
|
|
||||||
- Jeffery Myers ([@JeffM2501](https://github.com/ProfJski))
|
|
||||||
- Ryan Roden-Corrent ([@rcorre](https://github.com/ProfJski))
|
|
||||||
- michaelfiber ([@michaelfiber](https://github.com/ProfJski))
|
|
||||||
- Nikhilesh S ([@nikki93](https://github.com/ProfJski))
|
|
||||||
- kevinabraun ([@kevinabraun](https://github.com/ProfJski))
|
|
||||||
- Matthew Owens ([@MatthewOwens](https://github.com/ProfJski))
|
|
||||||
- Tim Eilers ([@eilerstim](https://github.com/ProfJski))
|
|
||||||
|
|
||||||
### Past raylib GitHub Sponsors
|
|
||||||
|
|
||||||
The following people has **sponsored raylib** in the past, allowing the project to reach current amazing state.
|
|
||||||
|
|
||||||
- Jonathan Johnson ([@ecton](https://github.com/ecton))
|
|
||||||
- Rudy Faile ([@rfaile313](https://github.com/rfaile313)) - https://rudyfaile.com/
|
|
||||||
- frithrah ([@frithrah](https://github.com/frithrah))
|
|
||||||
- Jens Pitkänen ([@neonmoe](https://github.com/neonmoe))
|
|
||||||
- Rahul Nair ([@rahulunair](https://github.com/rahulunair))
|
|
||||||
- albatros-hmd ([@albatros-hmd](https://github.com/albatros-hmd))
|
|
||||||
- Benjamin Stigsen ([@BenStigsen](https://github.com/BenStigsen))
|
|
||||||
- Louis Johnson ([@louisgjohnson](https://github.com/louisgjohnson))
|
|
||||||
- Dani Martin ([@danimartin82](https://github.com/danimartin82))
|
|
||||||
- Joakim Wennergren ([@joakimwennergren](https://github.com/joakimwennergren))
|
|
||||||
- Alexandre Chêne ([@kooparse](https://github.com/kooparse))
|
|
||||||
- daddio69 ([@daddio69](https://github.com/daddio69))
|
|
||||||
- James Ghawaly ([@jghawaly](https://github.com/jghawaly))
|
|
||||||
- jack ([@Jack-Ji](https://github.com/Jack-Ji))
|
|
||||||
- Guido Offermans ([@jghawaly](https://github.com/GuidoOffermans))
|
|
||||||
- devdad ([@devdad](https://github.com/devdad))
|
|
||||||
- Pau Fernández ([@pauek](https://github.com/pauek))
|
|
||||||
- Sergio ([@anidealgift](https://github.com/anidealgift))
|
|
||||||
- Snowminx ([@Gamerfiend](https://github.com/Gamerfiend))
|
|
||||||
- NimbusFox ([@NimbusFox](https://github.com/NimbusFox))
|
|
||||||
- Shylie ([@Shylie](https://github.com/Shylie))
|
|
||||||
- Livio Dal Maso ([@Humeur](https://github.com/Humeur))
|
|
||||||
- Diego Vaccher ([@denny0754](https://github.com/denny0754))
|
|
||||||
- Ricardo Alcantara ([@ricardoalcantara](https://github.com/ricardoalcantara))
|
|
||||||
- Toby4213 ([@Toby4213](https://github.com/Toby4213))
|
|
||||||
|
|
||||||
### Notes for Current/Past raylib Sponsor
|
|
||||||
|
|
||||||
- If you are not on the list, feel free to send a PR to be added (if desired).
|
|
||||||
- If you want your personal webpage or project listed, feel free to send a PR to be added.
|
|
||||||
- If you prefer not to be in this list, feel free to send a PR to be remove.
|
|
||||||
|
|
18
build.zig
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
const std = @import("std");
|
||||||
|
const raylib = @import("src/build.zig");
|
||||||
|
|
||||||
|
pub fn build(b: *std.Build) void {
|
||||||
|
// Standard target options allows the person running `zig build` to choose
|
||||||
|
// what target to build for. Here we do not override the defaults, which
|
||||||
|
// means any target is allowed, and the default is native. Other options
|
||||||
|
// for restricting supported target set are available.
|
||||||
|
const target = b.standardTargetOptions(.{});
|
||||||
|
// Standard optimization options allow the person running `zig build` to select
|
||||||
|
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
|
||||||
|
// set a preferred release mode, allowing the user to decide how to optimize.
|
||||||
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
|
const lib = raylib.addRaylib(b, target, optimize);
|
||||||
|
lib.installHeader("src/raylib.h", "raylib.h");
|
||||||
|
lib.install();
|
||||||
|
}
|
@@ -4,60 +4,65 @@ target_compile_definitions("raylib" PUBLIC "${GRAPHICS}")
|
|||||||
|
|
||||||
function(define_if target variable)
|
function(define_if target variable)
|
||||||
if (${${variable}})
|
if (${${variable}})
|
||||||
|
message(STATUS "${variable}=${${variable}}")
|
||||||
target_compile_definitions(${target} PUBLIC "${variable}")
|
target_compile_definitions(${target} PUBLIC "${variable}")
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
if (${CUSTOMIZE_BUILD})
|
if (${CUSTOMIZE_BUILD})
|
||||||
target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS)
|
target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS)
|
||||||
|
define_if("raylib" USE_AUDIO)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RSHAPES)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RTEXTURES)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RTEXT)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RMODELS)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RAUDIO)
|
||||||
define_if("raylib" SUPPORT_CAMERA_SYSTEM)
|
define_if("raylib" SUPPORT_CAMERA_SYSTEM)
|
||||||
define_if("raylib" SUPPORT_GESTURES_SYSTEM)
|
define_if("raylib" SUPPORT_GESTURES_SYSTEM)
|
||||||
define_if("raylib" SUPPORT_MOUSE_GESTURES)
|
define_if("raylib" SUPPORT_MOUSE_GESTURES)
|
||||||
define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI)
|
define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI)
|
||||||
define_if("raylib" SUPPORT_BUSY_WAIT_LOOP)
|
define_if("raylib" SUPPORT_DEFAULT_FONT)
|
||||||
define_if("raylib" SUPPORT_EVENTS_WAITING)
|
|
||||||
define_if("raylib" SUPPORT_SCREEN_CAPTURE)
|
define_if("raylib" SUPPORT_SCREEN_CAPTURE)
|
||||||
define_if("raylib" SUPPORT_GIF_RECORDING)
|
define_if("raylib" SUPPORT_GIF_RECORDING)
|
||||||
define_if("raylib" SUPPORT_HIGH_DPI)
|
define_if("raylib" SUPPORT_BUSY_WAIT_LOOP)
|
||||||
|
define_if("raylib" SUPPORT_EVENTS_WAITING)
|
||||||
|
define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER)
|
||||||
define_if("raylib" SUPPORT_COMPRESSION_API)
|
define_if("raylib" SUPPORT_COMPRESSION_API)
|
||||||
define_if("raylib" SUPPORT_DATA_STORAGE)
|
|
||||||
define_if("raylib" SUPPORT_VR_SIMULATOR)
|
|
||||||
define_if("raylib" SUPPORT_FONT_TEXTURE)
|
|
||||||
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
|
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
|
||||||
|
define_if("raylib" SUPPORT_IMAGE_EXPORT)
|
||||||
|
define_if("raylib" SUPPORT_IMAGE_GENERATION)
|
||||||
|
define_if("raylib" SUPPORT_IMAGE_MANIPULATION)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
|
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
|
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
|
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PNM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
|
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
|
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_BMP)
|
define_if("raylib" SUPPORT_FILEFORMAT_BMP)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_TGA)
|
define_if("raylib" SUPPORT_FILEFORMAT_TGA)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_JPG)
|
define_if("raylib" SUPPORT_FILEFORMAT_JPG)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_GIF)
|
define_if("raylib" SUPPORT_FILEFORMAT_GIF)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_QOI)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
|
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
|
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
|
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
|
||||||
define_if("raylib" ORT_IMAGE_EXPORT)
|
|
||||||
define_if("raylib" SUPPORT_IMAGE_MANIPULATION)
|
|
||||||
define_if("raylib" SUPPORT_IMAGE_GENERATION)
|
|
||||||
define_if("raylib" SUPPORT_DEFAULT_FONT)
|
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
|
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
|
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
|
||||||
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
|
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
|
||||||
|
define_if("raylib" SUPPORT_MESH_GENERATION)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_OBJ)
|
define_if("raylib" SUPPORT_FILEFORMAT_OBJ)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_MTL)
|
define_if("raylib" SUPPORT_FILEFORMAT_MTL)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
|
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
|
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
|
||||||
define_if("raylib" SUPPORT_MESH_GENERATION)
|
define_if("raylib" SUPPORT_FILEFORMAT_VOX)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
|
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
|
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_XM)
|
define_if("raylib" SUPPORT_FILEFORMAT_XM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
|
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
|
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
|
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
|
||||||
define_if("raylib" SUPPORT_STANDARD_FILEIO)
|
define_if("raylib" SUPPORT_STANDARD_FILEIO)
|
||||||
define_if("raylib" SUPPORT_TRACELOG)
|
define_if("raylib" SUPPORT_TRACELOG)
|
||||||
define_if("raylib" SUPPORT_COMPRESSION_API)
|
|
||||||
|
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096")
|
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096")
|
||||||
@@ -72,7 +77,7 @@ if (${CUSTOMIZE_BUILD})
|
|||||||
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
|
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
|
||||||
|
|
||||||
target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"")
|
target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"")
|
||||||
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
|
target_compile_definitions("raylib" PUBLIC "MAX_CHAR_PRESSED_QUEUE=16")
|
||||||
target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64")
|
target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64")
|
||||||
|
|
||||||
if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11")
|
if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11")
|
||||||
|
@@ -28,6 +28,8 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT
|
|||||||
|
|
||||||
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
|
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
|
||||||
include_directories(BEFORE SYSTEM external/glfw/include)
|
include_directories(BEFORE SYSTEM external/glfw/include)
|
||||||
|
elseif("${PLATFORM}" STREQUAL "DRM")
|
||||||
|
MESSAGE(STATUS "No GLFW required on PLATFORM_DRM")
|
||||||
else()
|
else()
|
||||||
MESSAGE(STATUS "Using external GLFW")
|
MESSAGE(STATUS "Using external GLFW")
|
||||||
set(GLFW_PKG_DEPS glfw3)
|
set(GLFW_PKG_DEPS glfw3)
|
||||||
|
@@ -1,3 +1,12 @@
|
|||||||
|
# Set OpenGL_GL_PREFERENCE to new "GLVND" even when legacy library exists and
|
||||||
|
# cmake is <= 3.10
|
||||||
|
#
|
||||||
|
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html for more
|
||||||
|
# information.
|
||||||
|
if(POLICY CMP0072)
|
||||||
|
cmake_policy(SET CMP0072 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (${PLATFORM} MATCHES "Desktop")
|
if (${PLATFORM} MATCHES "Desktop")
|
||||||
set(PLATFORM_CPP "PLATFORM_DESKTOP")
|
set(PLATFORM_CPP "PLATFORM_DESKTOP")
|
||||||
|
|
||||||
@@ -27,7 +36,11 @@ if (${PLATFORM} MATCHES "Desktop")
|
|||||||
find_library(OSS_LIBRARY ossaudio)
|
find_library(OSS_LIBRARY ossaudio)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
set(LIBS_PRIVATE m atomic pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
||||||
|
|
||||||
|
if (USE_AUDIO)
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} dl)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
elseif (${PLATFORM} MATCHES "Web")
|
elseif (${PLATFORM} MATCHES "Web")
|
||||||
@@ -40,10 +53,9 @@ elseif (${PLATFORM} MATCHES "Android")
|
|||||||
set(PLATFORM_CPP "PLATFORM_ANDROID")
|
set(PLATFORM_CPP "PLATFORM_ANDROID")
|
||||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
list(APPEND raylib_sources ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
||||||
add_definitions(-DANDROID -D__ANDROID_API__=21)
|
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||||
include_directories(external/android/native_app_glue)
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate")
|
|
||||||
|
|
||||||
find_library(OPENGL_LIBRARY OpenGL)
|
find_library(OPENGL_LIBRARY OpenGL)
|
||||||
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
|
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
|
||||||
@@ -61,7 +73,7 @@ elseif (${PLATFORM} MATCHES "Raspberry Pi")
|
|||||||
link_directories(/opt/vc/lib)
|
link_directories(/opt/vc/lib)
|
||||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl)
|
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl)
|
||||||
|
|
||||||
elseif (${PLATFORM} MATCHES "DRM")
|
elseif ("${PLATFORM}" MATCHES "DRM")
|
||||||
set(PLATFORM_CPP "PLATFORM_DRM")
|
set(PLATFORM_CPP "PLATFORM_DRM")
|
||||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||||
|
|
||||||
@@ -77,13 +89,15 @@ elseif (${PLATFORM} MATCHES "DRM")
|
|||||||
if (NOT CMAKE_CROSSCOMPILING)
|
if (NOT CMAKE_CROSSCOMPILING)
|
||||||
include_directories(/usr/include/libdrm)
|
include_directories(/usr/include/libdrm)
|
||||||
endif ()
|
endif ()
|
||||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} pthread m dl)
|
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
|
||||||
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (${OPENGL_VERSION})
|
if (NOT ${OPENGL_VERSION})
|
||||||
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
|
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
|
||||||
if (${OPENGL_VERSION} MATCHES "3.3")
|
if (${OPENGL_VERSION} MATCHES "4.3")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_43")
|
||||||
|
elseif (${OPENGL_VERSION} MATCHES "3.3")
|
||||||
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
|
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
|
||||||
elseif (${OPENGL_VERSION} MATCHES "2.1")
|
elseif (${OPENGL_VERSION} MATCHES "2.1")
|
||||||
set(GRAPHICS "GRAPHICS_API_OPENGL_21")
|
set(GRAPHICS "GRAPHICS_API_OPENGL_21")
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
# Packaging
|
# Packaging
|
||||||
SET(CPACK_PACKAGE_NAME "raylib")
|
SET(CPACK_PACKAGE_NAME "raylib")
|
||||||
|
SET(CPACK_PACKAGE_CONTACT "raysan5")
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to enjoy videogames programming")
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to enjoy videogames programming")
|
||||||
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||||
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
|
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
|
||||||
@@ -9,5 +10,9 @@ SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md")
|
|||||||
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
|
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
|
||||||
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
|
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
|
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
|
||||||
SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows
|
SET(CPACK_GENERATOR "ZIP;TGZ;DEB;RPM") # Remove this, if you want the NSIS installer on Windows
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # can be used to generate deps, slow and requires tools.
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libatomic1, libc6, libglfw3, libglu1-mesa | libglu1, libglx0, libopengl0")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-dev")
|
||||||
|
SET(CPACK_RPM_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-devel")
|
||||||
include(CPack)
|
include(CPack)
|
@@ -11,6 +11,7 @@
|
|||||||
# raylib_LDFLAGS - The linker flags needed with raylib
|
# raylib_LDFLAGS - The linker flags needed with raylib
|
||||||
# raylib_DEFINITIONS - Compiler switches required for using raylib
|
# raylib_DEFINITIONS - Compiler switches required for using raylib
|
||||||
|
|
||||||
|
if (NOT TARGET raylib)
|
||||||
set(XPREFIX PC_RAYLIB)
|
set(XPREFIX PC_RAYLIB)
|
||||||
|
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
@@ -62,6 +63,7 @@ string (REPLACE ";" " " raylib_LDFLAGS "${raylib_LDFLAGS}")
|
|||||||
set_target_properties(raylib
|
set_target_properties(raylib
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
IMPORTED_LOCATION "${raylib_LIBRARIES}"
|
IMPORTED_LOCATION "${raylib_LIBRARIES}"
|
||||||
|
IMPORTED_IMPLIB "${raylib_LIBRARIES}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${raylib_INCLUDE_DIRS}"
|
INTERFACE_INCLUDE_DIRECTORIES "${raylib_INCLUDE_DIRS}"
|
||||||
INTERFACE_LINK_LIBRARIES "${raylib_LDFLAGS}"
|
INTERFACE_LINK_LIBRARIES "${raylib_LDFLAGS}"
|
||||||
INTERFACE_COMPILE_OPTIONS "${raylib_DEFINITIONS}"
|
INTERFACE_COMPILE_OPTIONS "${raylib_DEFINITIONS}"
|
||||||
@@ -74,3 +76,4 @@ if (raylib_VERBOSE)
|
|||||||
message(STATUS "raylib_LDFLAGS: ${raylib_LDFLAGS}")
|
message(STATUS "raylib_LDFLAGS: ${raylib_LDFLAGS}")
|
||||||
message(STATUS "raylib_DEFINITIONS: ${raylib_DEFINITIONS}")
|
message(STATUS "raylib_DEFINITIONS: ${raylib_DEFINITIONS}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
@@ -102,10 +102,17 @@ elseif (${PLATFORM} MATCHES "Web")
|
|||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
|
||||||
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
||||||
|
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
|
||||||
|
|
||||||
# Remove the -rdynamic flag because otherwise emscripten
|
# Remove the -rdynamic flag because otherwise emscripten
|
||||||
# does not generate HTML+JS+WASM files, only a non-working
|
# does not generate HTML+JS+WASM files, only a non-working
|
||||||
# and fat HTML
|
# and fat HTML
|
||||||
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
|
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
|
||||||
|
|
||||||
|
elseif ("${PLATFORM}" STREQUAL "DRM")
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
|
||||||
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include_directories(BEFORE SYSTEM others/external/include)
|
include_directories(BEFORE SYSTEM others/external/include)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2021 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -23,46 +23,52 @@
|
|||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
# Define required raylib variables
|
# Define required environment variables
|
||||||
PROJECT_NAME ?= raylib_examples
|
#------------------------------------------------------------------------------------------------
|
||||||
RAYLIB_VERSION ?= 4.0.0
|
# Define target platform: PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
|
||||||
RAYLIB_PATH ?= ..
|
|
||||||
|
|
||||||
# Define default options
|
|
||||||
|
|
||||||
# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
|
|
||||||
PLATFORM ?= PLATFORM_DESKTOP
|
PLATFORM ?= PLATFORM_DESKTOP
|
||||||
|
|
||||||
# Locations of your newly installed library and associated headers. See ../src/Makefile
|
# Define required raylib variables
|
||||||
# On Linux, if you have installed raylib but cannot compile the examples, check that
|
PROJECT_NAME ?= raylib_examples
|
||||||
# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations.
|
RAYLIB_VERSION ?= 4.5.0
|
||||||
# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED.
|
RAYLIB_PATH ?= ..
|
||||||
# To enable compile-time linking to a special version of libraylib.so, change these variables here.
|
|
||||||
# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below.
|
|
||||||
# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime,
|
|
||||||
# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH.
|
|
||||||
# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
|
|
||||||
DESTDIR ?= /usr/local
|
|
||||||
RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
|
|
||||||
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
|
|
||||||
RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
|
|
||||||
|
|
||||||
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
|
# Locations of raylib.h and libraylib.a/libraylib.so
|
||||||
|
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
|
||||||
|
RAYLIB_INCLUDE_PATH ?= /usr/local/include
|
||||||
|
RAYLIB_LIB_PATH ?= /usr/local/lib
|
||||||
|
|
||||||
|
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
|
||||||
RAYLIB_LIBTYPE ?= STATIC
|
RAYLIB_LIBTYPE ?= STATIC
|
||||||
|
|
||||||
# Build mode for project: DEBUG or RELEASE
|
# Build mode for project: DEBUG or RELEASE
|
||||||
BUILD_MODE ?= RELEASE
|
BUILD_MODE ?= RELEASE
|
||||||
|
|
||||||
# Use external GLFW library instead of rglfw module
|
# Use external GLFW library instead of rglfw module
|
||||||
# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3
|
|
||||||
USE_EXTERNAL_GLFW ?= FALSE
|
USE_EXTERNAL_GLFW ?= FALSE
|
||||||
|
|
||||||
# Use Wayland display server protocol on Linux desktop
|
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
||||||
# by default it uses X11 windowing system
|
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
||||||
USE_WAYLAND_DISPLAY ?= FALSE
|
USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# PLATFORM_WEB: Default properties
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
BUILD_WEB_ASYNCIFY ?= TRUE
|
||||||
|
BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
|
||||||
|
BUILD_WEB_HEAP_SIZE ?= 134217728
|
||||||
|
BUILD_WEB_RESOURCES ?= TRUE
|
||||||
|
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
|
||||||
|
|
||||||
|
# Use cross-compiler for PLATFORM_RPI
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
USE_RPI_CROSS_COMPILER ?= FALSE
|
||||||
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
|
RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
|
||||||
|
RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
|
||||||
|
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB))
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
# ifeq ($(UNAME),Msys) -> Windows
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
@@ -102,18 +108,16 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# RAYLIB_PATH adjustment for different platforms.
|
# RAYLIB_PATH adjustment for LINUX platform
|
||||||
# If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
|
# TODO: Do we really need this?
|
||||||
# Required for ldconfig or other tools that do not perform path expansion.
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_PREFIX ?= ..
|
RAYLIB_PREFIX ?= ..
|
||||||
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
|
|
||||||
# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki.
|
# Default path for raylib on Raspberry Pi
|
||||||
# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX.
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
RAYLIB_PATH ?= /home/pi/raylib
|
RAYLIB_PATH ?= /home/pi/raylib
|
||||||
endif
|
endif
|
||||||
@@ -121,36 +125,23 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
RAYLIB_PATH ?= /home/pi/raylib
|
RAYLIB_PATH ?= /home/pi/raylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Define raylib release directory for compiled library
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/emsdk
|
EMSDK_PATH ?= C:/emsdk
|
||||||
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
|
||||||
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
|
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
|
||||||
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
|
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
|
||||||
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
|
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
|
||||||
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define raylib release directory for compiled library.
|
# Define default C compiler: CC
|
||||||
# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version
|
#------------------------------------------------------------------------------------------------
|
||||||
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
|
||||||
|
|
||||||
# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries
|
|
||||||
# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH
|
|
||||||
# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux
|
|
||||||
# without formal installation from ../src/Makefile. It aids portability and is useful if you have
|
|
||||||
# multiple versions of raylib, have raylib installed to a non-standard location, or want to
|
|
||||||
# bundle libraylib.so with your game. Change it to your liking.
|
|
||||||
# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
|
|
||||||
# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH,
|
|
||||||
# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
|
||||||
# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute.
|
|
||||||
# To see which libraries a built example is linking to, ldd core/core_basic_window;
|
|
||||||
# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing.
|
|
||||||
EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH)
|
|
||||||
|
|
||||||
# Define default C compiler: gcc
|
|
||||||
# NOTE: define g++ compiler if using C++
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
@@ -177,8 +168,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
CC = emcc
|
CC = emcc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define default make program
|
# Define default make program: MAKE
|
||||||
MAKE = make
|
#------------------------------------------------------------------------------------------------
|
||||||
|
MAKE ?= make
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
@@ -192,7 +184,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
MAKE = mingw32-make
|
MAKE = mingw32-make
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define compiler flags:
|
# Define compiler flags: CFLAGS
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
# -O1 defines optimization level
|
# -O1 defines optimization level
|
||||||
# -g include debug information on compilation
|
# -g include debug information on compilation
|
||||||
# -s strip unnecessary data from build
|
# -s strip unnecessary data from build
|
||||||
@@ -200,23 +193,32 @@ endif
|
|||||||
# -std=c99 defines C language mode (standard C from 1999 revision)
|
# -std=c99 defines C language mode (standard C from 1999 revision)
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
|
# -Wno-unused-value ignore unused return values of some functions (i.e. fread())
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
||||||
|
|
||||||
ifeq ($(BUILD_MODE),DEBUG)
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g
|
CFLAGS += -g -D_DEBUG
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
CFLAGS += -s ASSERTIONS=1 --profiling
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
CFLAGS += -Os
|
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||||
|
CFLAGS += -O3
|
||||||
else
|
else
|
||||||
CFLAGS += -s -O1
|
CFLAGS += -Os
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
# -Wextra enables some extra warning flags that are not enabled by -Wall
|
||||||
|
# -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration
|
||||||
|
# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
|
||||||
|
# -Werror=implicit-function-declaration catch function calls without prior declaration
|
||||||
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
@@ -225,7 +227,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||||||
endif
|
endif
|
||||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
# Explicitly enable runtime link to libraylib.so
|
# Explicitly enable runtime link to libraylib.so
|
||||||
CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
CFLAGS += -Wl,-rpath,$(RAYLIB_RELEASE_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -236,51 +238,47 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
CFLAGS += -std=gnu99 -DEGL_NO_X11
|
CFLAGS += -std=gnu99 -DEGL_NO_X11
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define include paths for required headers
|
# Define include paths for required headers: INCLUDE_PATHS
|
||||||
# NOTE: Some external/extras libraries could be required (stb, physac, easings...)
|
# NOTE: Some external/extras libraries could be required (stb, easings...)
|
||||||
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external -I$(RAYLIB_PATH)/src/extras
|
#------------------------------------------------------------------------------------------------
|
||||||
|
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
|
||||||
|
|
||||||
# Define additional directories containing required header files
|
# Define additional directories containing required header files
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
# RPI required libraries
|
|
||||||
INCLUDE_PATHS += -I/opt/vc/include
|
|
||||||
INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
|
|
||||||
INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
|
||||||
# DRM required libraries
|
|
||||||
INCLUDE_PATHS += -I/usr/include/libdrm
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
# Consider -L$(RAYLIB_H_INSTALL_PATH)
|
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||||
INCLUDE_PATHS += -I/usr/local/include
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
INCLUDE_PATHS += -I$(RAYLIB_H_INSTALL_PATH)
|
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
|
||||||
|
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux
|
||||||
|
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||||
|
INCLUDE_PATHS += -I/usr/include/libdrm
|
||||||
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs.
|
# Define library paths containing required libs: LDFLAGS
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# resource file contains windows executable icon and properties
|
# NOTE: The resource .rc file contains windows executable icon and properties
|
||||||
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
|
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
|
||||||
# -Wl,--subsystem,windows hides the console window
|
# -Wl,--subsystem,windows hides the console window
|
||||||
ifeq ($(BUILD_MODE), RELEASE)
|
ifeq ($(BUILD_MODE), RELEASE)
|
||||||
LDFLAGS += -Wl,--subsystem,windows
|
LDFLAGS += -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
|
||||||
# Consider -L$(RAYLIB_INSTALL_PATH)
|
|
||||||
LDFLAGS += -L. -Lsrc -L/usr/local/lib
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Reset everything.
|
LDFLAGS += -L$(RAYLIB_LIB_PATH)
|
||||||
# Precedence: immediately local, installed version, raysan5 provided libs
|
endif
|
||||||
LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
|
LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
@@ -298,30 +296,45 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
# --source-map-base # allow debugging in browser with source map
|
# --source-map-base # allow debugging in browser with source map
|
||||||
LDFLAGS += -s USE_GLFW=3 -s ASYNCIFY -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 --preload-file $(dir $<)resources@resources
|
LDFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -s FORCE_FILESYSTEM=1
|
||||||
|
|
||||||
|
# Build using asyncify
|
||||||
|
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||||
|
LDFLAGS += -s ASYNCIFY
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Add resources building if required
|
||||||
|
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
|
||||||
|
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Add debug mode flags if required
|
||||||
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
|
LDFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define a custom shell .html and output extension
|
||||||
|
LDFLAGS += --shell-file $(BUILD_WEB_SHELL)
|
||||||
|
EXT = .html
|
||||||
|
|
||||||
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
|
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
|
||||||
# we can compile same code for ALL platforms with no change required, but, working on bigger
|
# we can compile same code for ALL platforms with no change required, but, working on bigger
|
||||||
# projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
|
# projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
|
||||||
# logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
|
# logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
|
||||||
LDFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
|
||||||
EXT = .html
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
LDFLAGS += -L/opt/vc/lib
|
LDFLAGS += -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define any libraries required on linking
|
# Define libraries required on linking: LDLIBS
|
||||||
# if you want to link libraries (libname.so or libname.a), use the -lname
|
# NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# Libraries for Windows desktop compilation
|
# Libraries for Windows desktop compilation
|
||||||
# NOTE: WinMM library required to set high-res timer resolution
|
# NOTE: WinMM library required to set high-res timer resolution
|
||||||
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
||||||
# Required for physac examples
|
|
||||||
LDLIBS += -static -lpthread
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
@@ -341,6 +354,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
LDLIBS += -lc
|
LDLIBS += -lc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
|
||||||
|
LDLIBS += -latomic
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
# Libraries for OSX 10.9 desktop compiling
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
@@ -363,19 +379,23 @@ endif
|
|||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
# Libraries for Raspberry Pi compiling
|
# Libraries for Raspberry Pi compiling
|
||||||
# NOTE: Required packages: libasound2-dev (ALSA)
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
|
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl -latomic
|
||||||
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
|
LDLIBS += -lvchiq_arm -lvcos
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||||
# Libraries for DRM compiling
|
# Libraries for DRM compiling
|
||||||
# NOTE: Required packages: libasound2-dev (ALSA)
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl
|
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define all object files required
|
# Define source code object files required
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
CORE = \
|
CORE = \
|
||||||
core/core_basic_window \
|
core/core_basic_window \
|
||||||
core/core_basic_screen_manager \
|
core/core_basic_screen_manager \
|
||||||
@@ -387,21 +407,22 @@ CORE = \
|
|||||||
core/core_input_gestures \
|
core/core_input_gestures \
|
||||||
core/core_2d_camera \
|
core/core_2d_camera \
|
||||||
core/core_2d_camera_platformer \
|
core/core_2d_camera_platformer \
|
||||||
|
core/core_2d_camera_mouse_zoom \
|
||||||
core/core_3d_camera_mode \
|
core/core_3d_camera_mode \
|
||||||
core/core_3d_camera_free \
|
core/core_3d_camera_free \
|
||||||
core/core_3d_camera_first_person \
|
core/core_3d_camera_first_person \
|
||||||
core/core_3d_picking \
|
core/core_3d_picking \
|
||||||
core/core_world_screen \
|
core/core_world_screen \
|
||||||
core/core_custom_logging \
|
core/core_custom_logging \
|
||||||
core/core_window_letterbox \
|
|
||||||
core/core_drop_files \
|
core/core_drop_files \
|
||||||
core/core_random_values \
|
core/core_random_values \
|
||||||
core/core_scissor_test \
|
core/core_scissor_test \
|
||||||
core/core_storage_values \
|
core/core_storage_values \
|
||||||
core/core_vr_simulator \
|
core/core_vr_simulator \
|
||||||
core/core_loading_thread \
|
core/core_loading_thread \
|
||||||
core/core_quat_conversion \
|
|
||||||
core/core_window_flags \
|
core/core_window_flags \
|
||||||
|
core/core_window_letterbox \
|
||||||
|
core/core_window_should_close \
|
||||||
core/core_split_screen \
|
core/core_split_screen \
|
||||||
core/core_smooth_pixelperfect \
|
core/core_smooth_pixelperfect \
|
||||||
core/core_custom_frame_control
|
core/core_custom_frame_control
|
||||||
@@ -421,12 +442,12 @@ SHAPES = \
|
|||||||
shapes/shapes_easings_rectangle_array \
|
shapes/shapes_easings_rectangle_array \
|
||||||
shapes/shapes_draw_ring \
|
shapes/shapes_draw_ring \
|
||||||
shapes/shapes_draw_circle_sector \
|
shapes/shapes_draw_circle_sector \
|
||||||
shapes/shapes_draw_rectangle_rounded
|
shapes/shapes_draw_rectangle_rounded \
|
||||||
|
shapes/shapes_top_down_lights
|
||||||
|
|
||||||
TEXTURES = \
|
TEXTURES = \
|
||||||
textures/textures_logo_raylib \
|
textures/textures_logo_raylib \
|
||||||
textures/textures_mouse_painting \
|
textures/textures_mouse_painting \
|
||||||
textures/textures_rectangle \
|
|
||||||
textures/textures_srcrec_dstrec \
|
textures/textures_srcrec_dstrec \
|
||||||
textures/textures_image_drawing \
|
textures/textures_image_drawing \
|
||||||
textures/textures_image_generation \
|
textures/textures_image_generation \
|
||||||
@@ -438,12 +459,16 @@ TEXTURES = \
|
|||||||
textures/textures_particles_blending \
|
textures/textures_particles_blending \
|
||||||
textures/textures_npatch_drawing \
|
textures/textures_npatch_drawing \
|
||||||
textures/textures_background_scrolling \
|
textures/textures_background_scrolling \
|
||||||
|
textures/textures_sprite_anim \
|
||||||
textures/textures_sprite_button \
|
textures/textures_sprite_button \
|
||||||
textures/textures_sprite_explosion \
|
textures/textures_sprite_explosion \
|
||||||
|
textures/textures_textured_curve \
|
||||||
textures/textures_bunnymark \
|
textures/textures_bunnymark \
|
||||||
textures/textures_blend_modes \
|
textures/textures_blend_modes \
|
||||||
textures/textures_draw_tiled \
|
textures/textures_draw_tiled \
|
||||||
textures/textures_polygon
|
textures/textures_polygon \
|
||||||
|
textures/textures_gif_player \
|
||||||
|
textures/textures_fog_of_war
|
||||||
|
|
||||||
TEXT = \
|
TEXT = \
|
||||||
text/text_raylib_fonts \
|
text/text_raylib_fonts \
|
||||||
@@ -456,13 +481,15 @@ TEXT = \
|
|||||||
text/text_writing_anim \
|
text/text_writing_anim \
|
||||||
text/text_rectangle_bounds \
|
text/text_rectangle_bounds \
|
||||||
text/text_unicode \
|
text/text_unicode \
|
||||||
text/text_draw_3d
|
text/text_draw_3d \
|
||||||
|
text/text_codepoints_loading
|
||||||
|
|
||||||
MODELS = \
|
MODELS = \
|
||||||
models/models_animation \
|
models/models_animation \
|
||||||
models/models_billboard \
|
models/models_billboard \
|
||||||
models/models_box_collisions \
|
models/models_box_collisions \
|
||||||
models/models_cubicmap \
|
models/models_cubicmap \
|
||||||
|
models/models_draw_cube_texture \
|
||||||
models/models_first_person_maze \
|
models/models_first_person_maze \
|
||||||
models/models_geometric_shapes \
|
models/models_geometric_shapes \
|
||||||
models/models_mesh_generation \
|
models/models_mesh_generation \
|
||||||
@@ -470,6 +497,7 @@ MODELS = \
|
|||||||
models/models_loading \
|
models/models_loading \
|
||||||
models/models_loading_vox \
|
models/models_loading_vox \
|
||||||
models/models_loading_gltf \
|
models/models_loading_gltf \
|
||||||
|
models/models_loading_m3d \
|
||||||
models/models_orthographic_projection \
|
models/models_orthographic_projection \
|
||||||
models/models_rlgl_solar_system \
|
models/models_rlgl_solar_system \
|
||||||
models/models_skybox \
|
models/models_skybox \
|
||||||
@@ -495,27 +523,24 @@ SHADERS = \
|
|||||||
shaders/shaders_spotlight \
|
shaders/shaders_spotlight \
|
||||||
shaders/shaders_hot_reloading \
|
shaders/shaders_hot_reloading \
|
||||||
shaders/shaders_mesh_instancing \
|
shaders/shaders_mesh_instancing \
|
||||||
shaders/shaders_multi_sample2d
|
shaders/shaders_multi_sample2d \
|
||||||
|
shaders/shaders_write_depth \
|
||||||
|
shaders/shaders_hybrid_render
|
||||||
|
|
||||||
AUDIO = \
|
AUDIO = \
|
||||||
audio/audio_module_playing \
|
audio/audio_module_playing \
|
||||||
audio/audio_music_stream \
|
audio/audio_music_stream \
|
||||||
audio/audio_raw_stream \
|
audio/audio_raw_stream \
|
||||||
audio/audio_sound_loading \
|
audio/audio_sound_loading \
|
||||||
audio/audio_multichannel_sound
|
audio/audio_stream_effects \
|
||||||
|
audio/audio_mixed_processor
|
||||||
PHYSICS = \
|
|
||||||
physics/physics_demo \
|
|
||||||
physics/physics_friction \
|
|
||||||
physics/physics_movement \
|
|
||||||
physics/physics_restitution \
|
|
||||||
physics/physics_shatter
|
|
||||||
|
|
||||||
|
|
||||||
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||||
|
|
||||||
|
# Define processes to execute
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
# Default target entry
|
# Default target entry
|
||||||
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO) $(PHYSICS)
|
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
|
||||||
|
|
||||||
core: $(CORE)
|
core: $(CORE)
|
||||||
shapes: $(SHAPES)
|
shapes: $(SHAPES)
|
||||||
@@ -524,7 +549,6 @@ text: $(TEXT)
|
|||||||
models: $(MODELS)
|
models: $(MODELS)
|
||||||
shaders: $(SHADERS)
|
shaders: $(SHADERS)
|
||||||
audio: $(AUDIO)
|
audio: $(AUDIO)
|
||||||
physics: $(PHYSICS)
|
|
||||||
|
|
||||||
# Generic compilation pattern
|
# Generic compilation pattern
|
||||||
# NOTE: Examples must be ready for Android compilation!
|
# NOTE: Examples must be ready for Android compilation!
|
||||||
@@ -559,7 +583,10 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
rm -fv *.o
|
rm -fv *.o
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
del *.o *.html *.js
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
|
del *.wasm *.html *.js *.data
|
||||||
|
else
|
||||||
|
rm -f */*.wasm */*.html */*.js */*.data
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
@echo Cleaning done
|
@echo Cleaning done
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# raylib makefile for Android project (APK building)
|
# raylib makefile for Android project (APK building)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017-2021 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2017-2023 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -48,7 +48,7 @@ ifeq ($(ANDROID_ARCH),ARM64)
|
|||||||
ANDROID_ARCH_NAME = arm64-v8a
|
ANDROID_ARCH_NAME = arm64-v8a
|
||||||
endif
|
endif
|
||||||
ifeq ($(ANDROID_ARCH),x86)
|
ifeq ($(ANDROID_ARCH),x86)
|
||||||
ANDROID_ARCH_NAME = i686
|
ANDROID_ARCH_NAME = x86
|
||||||
endif
|
endif
|
||||||
ifeq ($(ANDROID_ARCH),x86_64)
|
ifeq ($(ANDROID_ARCH),x86_64)
|
||||||
ANDROID_ARCH_NAME = x86_64
|
ANDROID_ARCH_NAME = x86_64
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2021 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -23,46 +23,45 @@
|
|||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
|
# Define required environment variables
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
|
# Define target platform: PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
|
||||||
|
PLATFORM ?= PLATFORM_WEB
|
||||||
|
|
||||||
# Define required raylib variables
|
# Define required raylib variables
|
||||||
PROJECT_NAME ?= raylib_examples
|
PROJECT_NAME ?= raylib_examples
|
||||||
RAYLIB_VERSION ?= 4.0.0
|
RAYLIB_VERSION ?= 4.5.0
|
||||||
RAYLIB_PATH ?= ..
|
RAYLIB_PATH ?= ..
|
||||||
|
|
||||||
# Define default options
|
# Locations of raylib.h and libraylib.a/libraylib.so
|
||||||
|
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
|
||||||
|
RAYLIB_INCLUDE_PATH ?= /usr/local/include
|
||||||
|
RAYLIB_LIB_PATH ?= /usr/local/lib
|
||||||
|
|
||||||
# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
|
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
|
||||||
PLATFORM ?= PLATFORM_DESKTOP
|
|
||||||
|
|
||||||
# Locations of your newly installed library and associated headers. See ../src/Makefile
|
|
||||||
# On Linux, if you have installed raylib but cannot compile the examples, check that
|
|
||||||
# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations.
|
|
||||||
# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED.
|
|
||||||
# To enable compile-time linking to a special version of libraylib.so, change these variables here.
|
|
||||||
# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below.
|
|
||||||
# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime,
|
|
||||||
# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH.
|
|
||||||
# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
|
|
||||||
DESTDIR ?= /usr/local
|
|
||||||
RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
|
|
||||||
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
|
|
||||||
RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
|
|
||||||
|
|
||||||
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
|
|
||||||
RAYLIB_LIBTYPE ?= STATIC
|
RAYLIB_LIBTYPE ?= STATIC
|
||||||
|
|
||||||
# Build mode for project: DEBUG or RELEASE
|
# Build mode for project: DEBUG or RELEASE
|
||||||
BUILD_MODE ?= RELEASE
|
BUILD_MODE ?= RELEASE
|
||||||
|
|
||||||
# Use external GLFW library instead of rglfw module
|
# Use external GLFW library instead of rglfw module
|
||||||
# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3
|
|
||||||
USE_EXTERNAL_GLFW ?= FALSE
|
USE_EXTERNAL_GLFW ?= FALSE
|
||||||
|
|
||||||
# Use Wayland display server protocol on Linux desktop
|
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
||||||
# by default it uses X11 windowing system
|
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
||||||
USE_WAYLAND_DISPLAY ?= FALSE
|
USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# Use cross-compiler for PLATFORM_RPI
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
USE_RPI_CROSS_COMPILER ?= FALSE
|
||||||
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
|
RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
|
||||||
|
RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
|
||||||
|
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB))
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
# ifeq ($(UNAME),Msys) -> Windows
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
@@ -102,18 +101,16 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# RAYLIB_PATH adjustment for different platforms.
|
# RAYLIB_PATH adjustment for LINUX platform
|
||||||
# If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
|
# TODO: Do we really need this?
|
||||||
# Required for ldconfig or other tools that do not perform path expansion.
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_PREFIX ?= ..
|
RAYLIB_PREFIX ?= ..
|
||||||
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
|
|
||||||
# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki.
|
# Default path for raylib on Raspberry Pi
|
||||||
# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX.
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
RAYLIB_PATH ?= /home/pi/raylib
|
RAYLIB_PATH ?= /home/pi/raylib
|
||||||
endif
|
endif
|
||||||
@@ -121,36 +118,23 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
RAYLIB_PATH ?= /home/pi/raylib
|
RAYLIB_PATH ?= /home/pi/raylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Define raylib release directory for compiled library
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/emsdk
|
EMSDK_PATH ?= C:/emsdk
|
||||||
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
|
||||||
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
|
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
|
||||||
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
|
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
|
||||||
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
|
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
|
||||||
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define raylib release directory for compiled library.
|
# Define default C compiler: CC
|
||||||
# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version
|
#------------------------------------------------------------------------------------------------
|
||||||
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
|
||||||
|
|
||||||
# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries
|
|
||||||
# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH
|
|
||||||
# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux
|
|
||||||
# without formal installation from ../src/Makefile. It aids portability and is useful if you have
|
|
||||||
# multiple versions of raylib, have raylib installed to a non-standard location, or want to
|
|
||||||
# bundle libraylib.so with your game. Change it to your liking.
|
|
||||||
# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
|
|
||||||
# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH,
|
|
||||||
# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
|
||||||
# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute.
|
|
||||||
# To see which libraries a built example is linking to, ldd core/core_basic_window;
|
|
||||||
# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing.
|
|
||||||
EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH)
|
|
||||||
|
|
||||||
# Define default C compiler: gcc
|
|
||||||
# NOTE: define g++ compiler if using C++
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
@@ -177,8 +161,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
CC = emcc
|
CC = emcc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define default make program
|
# Define default make program: MAKE
|
||||||
MAKE = make
|
#------------------------------------------------------------------------------------------------
|
||||||
|
MAKE ?= make
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
@@ -192,7 +177,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
MAKE = mingw32-make
|
MAKE = mingw32-make
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define compiler flags:
|
# Define compiler flags: CFLAGS
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
# -O1 defines optimization level
|
# -O1 defines optimization level
|
||||||
# -g include debug information on compilation
|
# -g include debug information on compilation
|
||||||
# -s strip unnecessary data from build
|
# -s strip unnecessary data from build
|
||||||
@@ -200,23 +186,32 @@ endif
|
|||||||
# -std=c99 defines C language mode (standard C from 1999 revision)
|
# -std=c99 defines C language mode (standard C from 1999 revision)
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
|
# -Wno-unused-value ignore unused return values of some functions (i.e. fread())
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
||||||
|
|
||||||
ifeq ($(BUILD_MODE),DEBUG)
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g
|
CFLAGS += -g -D_DEBUG
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
CFLAGS += -s ASSERTIONS=1 --profiling
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
CFLAGS += -Os
|
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||||
|
CFLAGS += -O3
|
||||||
else
|
else
|
||||||
CFLAGS += -s -O1
|
CFLAGS += -Os
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
CFLAGS += -s -O2
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
# -Wextra enables some extra warning flags that are not enabled by -Wall
|
||||||
|
# -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration
|
||||||
|
# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
|
||||||
|
# -Werror=implicit-function-declaration catch function calls without prior declaration
|
||||||
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
@@ -225,7 +220,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||||||
endif
|
endif
|
||||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
# Explicitly enable runtime link to libraylib.so
|
# Explicitly enable runtime link to libraylib.so
|
||||||
CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
CFLAGS += -Wl,-rpath,$(RAYLIB_RELEASE_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -236,51 +231,47 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
|||||||
CFLAGS += -std=gnu99 -DEGL_NO_X11
|
CFLAGS += -std=gnu99 -DEGL_NO_X11
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define include paths for required headers
|
# Define include paths for required headers: INCLUDE_PATHS
|
||||||
# NOTE: Some external/extras libraries could be required (stb, physac, easings...)
|
# NOTE: Some external/extras libraries could be required (stb, easings...)
|
||||||
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external -I$(RAYLIB_PATH)/src/extras
|
#------------------------------------------------------------------------------------------------
|
||||||
|
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
|
||||||
|
|
||||||
# Define additional directories containing required header files
|
# Define additional directories containing required header files
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
# RPI required libraries
|
|
||||||
INCLUDE_PATHS += -I/opt/vc/include
|
|
||||||
INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
|
|
||||||
INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
|
||||||
# DRM required libraries
|
|
||||||
INCLUDE_PATHS += -I/usr/include/libdrm
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
# Consider -L$(RAYLIB_H_INSTALL_PATH)
|
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||||
INCLUDE_PATHS += -I/usr/local/include
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
INCLUDE_PATHS += -I$(RAYLIB_H_INSTALL_PATH)
|
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
|
||||||
|
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux
|
||||||
|
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||||
|
INCLUDE_PATHS += -I/usr/include/libdrm
|
||||||
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs.
|
# Define library paths containing required libs: LDFLAGS
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# resource file contains windows executable icon and properties
|
# NOTE: The resource .rc file contains windows executable icon and properties
|
||||||
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
|
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
|
||||||
# -Wl,--subsystem,windows hides the console window
|
# -Wl,--subsystem,windows hides the console window
|
||||||
ifeq ($(BUILD_MODE), RELEASE)
|
ifeq ($(BUILD_MODE), RELEASE)
|
||||||
LDFLAGS += -Wl,--subsystem,windows
|
LDFLAGS += -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
|
||||||
# Consider -L$(RAYLIB_INSTALL_PATH)
|
|
||||||
LDFLAGS += -L. -Lsrc -L/usr/local/lib
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Reset everything.
|
LDFLAGS += -L$(RAYLIB_LIB_PATH)
|
||||||
# Precedence: immediately local, installed version, raysan5 provided libs
|
endif
|
||||||
LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
|
LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
@@ -294,11 +285,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
# -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
# -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||||
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||||
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||||
|
# -s EXPORTED_RUNTIME_METHODS=ccall # require exporting some LEGACY_RUNTIME functions, ccall() is required by miniaudio
|
||||||
# --profiling # include information for code profiling
|
# --profiling # include information for code profiling
|
||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
# --source-map-base # allow debugging in browser with source map
|
# --source-map-base # allow debugging in browser with source map
|
||||||
LDFLAGS += -s USE_GLFW=3 -s ASYNCIFY
|
LDFLAGS += -s USE_GLFW=3 -s ASYNCIFY -s EXPORTED_RUNTIME_METHODS=ccall
|
||||||
|
|
||||||
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
|
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
|
||||||
# we can compile same code for ALL platforms with no change required, but, working on bigger
|
# we can compile same code for ALL platforms with no change required, but, working on bigger
|
||||||
@@ -313,18 +305,17 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
EXT = .html
|
EXT = .html
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
LDFLAGS += -L/opt/vc/lib
|
LDFLAGS += -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define any libraries required on linking
|
# Define libraries required on linking: LDLIBS
|
||||||
# if you want to link libraries (libname.so or libname.a), use the -lname
|
# NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# Libraries for Windows desktop compilation
|
# Libraries for Windows desktop compilation
|
||||||
# NOTE: WinMM library required to set high-res timer resolution
|
# NOTE: WinMM library required to set high-res timer resolution
|
||||||
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
||||||
# Required for physac examples
|
|
||||||
LDLIBS += -static -lpthread
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
@@ -344,6 +335,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
LDLIBS += -lc
|
LDLIBS += -lc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
|
||||||
|
LDLIBS += -latomic
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
# Libraries for OSX 10.9 desktop compiling
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
@@ -366,19 +360,23 @@ endif
|
|||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
# Libraries for Raspberry Pi compiling
|
# Libraries for Raspberry Pi compiling
|
||||||
# NOTE: Required packages: libasound2-dev (ALSA)
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
|
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl -latomic
|
||||||
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
|
LDLIBS += -lvchiq_arm -lvcos
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||||
# Libraries for DRM compiling
|
# Libraries for DRM compiling
|
||||||
# NOTE: Required packages: libasound2-dev (ALSA)
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl
|
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define all object files required
|
# Define source code object files required
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
CORE = \
|
CORE = \
|
||||||
core/core_basic_window \
|
core/core_basic_window \
|
||||||
core/core_basic_screen_manager \
|
core/core_basic_screen_manager \
|
||||||
@@ -390,24 +388,25 @@ CORE = \
|
|||||||
core/core_input_gestures \
|
core/core_input_gestures \
|
||||||
core/core_2d_camera \
|
core/core_2d_camera \
|
||||||
core/core_2d_camera_platformer \
|
core/core_2d_camera_platformer \
|
||||||
|
core/core_2d_camera_mouse_zoom \
|
||||||
core/core_3d_camera_mode \
|
core/core_3d_camera_mode \
|
||||||
core/core_3d_camera_free \
|
core/core_3d_camera_free \
|
||||||
core/core_3d_camera_first_person \
|
core/core_3d_camera_first_person \
|
||||||
core/core_3d_picking \
|
core/core_3d_picking \
|
||||||
core/core_world_screen \
|
core/core_world_screen \
|
||||||
core/core_custom_logging \
|
core/core_custom_logging \
|
||||||
core/core_window_letterbox \
|
|
||||||
core/core_drop_files \
|
core/core_drop_files \
|
||||||
core/core_random_values \
|
core/core_random_values \
|
||||||
core/core_scissor_test \
|
core/core_scissor_test \
|
||||||
core/core_storage_values \
|
core/core_storage_values \
|
||||||
core/core_vr_simulator \
|
core/core_vr_simulator \
|
||||||
core/core_loading_thread \
|
|
||||||
core/core_quat_conversion \
|
|
||||||
core/core_window_flags \
|
core/core_window_flags \
|
||||||
|
core/core_window_letterbox \
|
||||||
|
core/core_window_should_close \
|
||||||
core/core_split_screen \
|
core/core_split_screen \
|
||||||
core/core_smooth_pixelperfect \
|
core/core_smooth_pixelperfect \
|
||||||
core/core_custom_frame_control
|
core/core_custom_frame_control \
|
||||||
|
core/core_loading_thread
|
||||||
|
|
||||||
SHAPES = \
|
SHAPES = \
|
||||||
shapes/shapes_basic_shapes \
|
shapes/shapes_basic_shapes \
|
||||||
@@ -424,12 +423,12 @@ SHAPES = \
|
|||||||
shapes/shapes_easings_rectangle_array \
|
shapes/shapes_easings_rectangle_array \
|
||||||
shapes/shapes_draw_ring \
|
shapes/shapes_draw_ring \
|
||||||
shapes/shapes_draw_circle_sector \
|
shapes/shapes_draw_circle_sector \
|
||||||
shapes/shapes_draw_rectangle_rounded
|
shapes/shapes_draw_rectangle_rounded \
|
||||||
|
shapes/shapes_top_down_lights
|
||||||
|
|
||||||
TEXTURES = \
|
TEXTURES = \
|
||||||
textures/textures_logo_raylib \
|
textures/textures_logo_raylib \
|
||||||
textures/textures_mouse_painting \
|
textures/textures_mouse_painting \
|
||||||
textures/textures_rectangle \
|
|
||||||
textures/textures_srcrec_dstrec \
|
textures/textures_srcrec_dstrec \
|
||||||
textures/textures_image_drawing \
|
textures/textures_image_drawing \
|
||||||
textures/textures_image_generation \
|
textures/textures_image_generation \
|
||||||
@@ -441,12 +440,16 @@ TEXTURES = \
|
|||||||
textures/textures_particles_blending \
|
textures/textures_particles_blending \
|
||||||
textures/textures_npatch_drawing \
|
textures/textures_npatch_drawing \
|
||||||
textures/textures_background_scrolling \
|
textures/textures_background_scrolling \
|
||||||
|
textures/textures_sprite_anim \
|
||||||
textures/textures_sprite_button \
|
textures/textures_sprite_button \
|
||||||
textures/textures_sprite_explosion \
|
textures/textures_sprite_explosion \
|
||||||
|
textures/textures_textured_curve \
|
||||||
textures/textures_bunnymark \
|
textures/textures_bunnymark \
|
||||||
textures/textures_blend_modes \
|
textures/textures_blend_modes \
|
||||||
textures/textures_draw_tiled \
|
textures/textures_draw_tiled \
|
||||||
textures/textures_polygon
|
textures/textures_polygon \
|
||||||
|
textures/textures_gif_player \
|
||||||
|
textures/textures_fog_of_war
|
||||||
|
|
||||||
TEXT = \
|
TEXT = \
|
||||||
text/text_raylib_fonts \
|
text/text_raylib_fonts \
|
||||||
@@ -459,13 +462,15 @@ TEXT = \
|
|||||||
text/text_writing_anim \
|
text/text_writing_anim \
|
||||||
text/text_rectangle_bounds \
|
text/text_rectangle_bounds \
|
||||||
text/text_unicode \
|
text/text_unicode \
|
||||||
text/text_draw_3d
|
text/text_draw_3d \
|
||||||
|
text/text_codepoints_loading
|
||||||
|
|
||||||
MODELS = \
|
MODELS = \
|
||||||
models/models_animation \
|
models/models_animation \
|
||||||
models/models_billboard \
|
models/models_billboard \
|
||||||
models/models_box_collisions \
|
models/models_box_collisions \
|
||||||
models/models_cubicmap \
|
models/models_cubicmap \
|
||||||
|
models/models_draw_cube_texture \
|
||||||
models/models_first_person_maze \
|
models/models_first_person_maze \
|
||||||
models/models_geometric_shapes \
|
models/models_geometric_shapes \
|
||||||
models/models_mesh_generation \
|
models/models_mesh_generation \
|
||||||
@@ -473,6 +478,7 @@ MODELS = \
|
|||||||
models/models_loading \
|
models/models_loading \
|
||||||
models/models_loading_vox \
|
models/models_loading_vox \
|
||||||
models/models_loading_gltf \
|
models/models_loading_gltf \
|
||||||
|
models/models_loading_m3d \
|
||||||
models/models_orthographic_projection \
|
models/models_orthographic_projection \
|
||||||
models/models_rlgl_solar_system \
|
models/models_rlgl_solar_system \
|
||||||
models/models_skybox \
|
models/models_skybox \
|
||||||
@@ -498,26 +504,24 @@ SHADERS = \
|
|||||||
shaders/shaders_spotlight \
|
shaders/shaders_spotlight \
|
||||||
shaders/shaders_hot_reloading \
|
shaders/shaders_hot_reloading \
|
||||||
shaders/shaders_mesh_instancing \
|
shaders/shaders_mesh_instancing \
|
||||||
shaders/shaders_multi_sample2d
|
shaders/shaders_multi_sample2d \
|
||||||
|
shaders/shaders_write_depth \
|
||||||
|
shaders/shaders_hybrid_render
|
||||||
|
|
||||||
AUDIO = \
|
AUDIO = \
|
||||||
audio/audio_module_playing \
|
audio/audio_module_playing \
|
||||||
audio/audio_music_stream \
|
audio/audio_music_stream \
|
||||||
audio/audio_raw_stream \
|
audio/audio_raw_stream \
|
||||||
audio/audio_sound_loading \
|
audio/audio_sound_loading \
|
||||||
audio/audio_multichannel_sound
|
audio/audio_stream_effects \
|
||||||
|
audio/audio_mixed_processor
|
||||||
PHYSICS = \
|
|
||||||
physics/physics_demo \
|
|
||||||
physics/physics_friction \
|
|
||||||
physics/physics_movement \
|
|
||||||
physics/physics_restitution \
|
|
||||||
physics/physics_shatter
|
|
||||||
|
|
||||||
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||||
|
|
||||||
|
# Define processes to execute
|
||||||
|
#------------------------------------------------------------------------------------------------
|
||||||
# Default target entry
|
# Default target entry
|
||||||
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO) $(PHYSICS)
|
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
|
||||||
|
|
||||||
core: $(CORE)
|
core: $(CORE)
|
||||||
shapes: $(SHAPES)
|
shapes: $(SHAPES)
|
||||||
@@ -526,7 +530,6 @@ text: $(TEXT)
|
|||||||
models: $(MODELS)
|
models: $(MODELS)
|
||||||
shaders: $(SHADERS)
|
shaders: $(SHADERS)
|
||||||
audio: $(AUDIO)
|
audio: $(AUDIO)
|
||||||
physics: $(PHYSICS)
|
|
||||||
|
|
||||||
# Compile CORE examples
|
# Compile CORE examples
|
||||||
core/core_basic_window: core/core_basic_window.c
|
core/core_basic_window: core/core_basic_window.c
|
||||||
@@ -561,6 +564,9 @@ core/core_2d_camera: core/core_2d_camera.c
|
|||||||
core/core_2d_camera_platformer: core/core_2d_camera_platformer.c
|
core/core_2d_camera_platformer: core/core_2d_camera_platformer.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
|
core/core_2d_camera_mouse_zoom: core/core_2d_camera_mouse_zoom.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
core/core_3d_camera_mode: core/core_3d_camera_mode.c
|
core/core_3d_camera_mode: core/core_3d_camera_mode.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
@@ -598,14 +604,6 @@ core/core_vr_simulator: core/core_vr_simulator.c
|
|||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file core/resources/distortion100.fs@resources/distortion100.fs
|
--preload-file core/resources/distortion100.fs@resources/distortion100.fs
|
||||||
|
|
||||||
# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1)
|
|
||||||
# WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021)
|
|
||||||
core/core_loading_thread: core/core_loading_thread.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s USE_PTHREADS=1
|
|
||||||
|
|
||||||
core/core_quat_conversion: core/core_quat_conversion.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
|
||||||
|
|
||||||
core/core_window_flags: core/core_window_flags.c
|
core/core_window_flags: core/core_window_flags.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
@@ -618,6 +616,17 @@ core/core_smooth_pixelperfect: core/core_smooth_pixelperfect.c
|
|||||||
core/core_custom_frame_control: core/core_custom_frame_control.c
|
core/core_custom_frame_control: core/core_custom_frame_control.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
|
core/core_window_should_close: core/core_window_should_close.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
|
# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1)
|
||||||
|
# WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021)
|
||||||
|
# WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any)
|
||||||
|
# in its source were transformed to non-atomic operations and non-thread-local data
|
||||||
|
core/core_loading_thread: core/core_loading_thread.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s USE_PTHREADS=1
|
||||||
|
|
||||||
|
|
||||||
# Compile SHAPES examples
|
# Compile SHAPES examples
|
||||||
shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c
|
shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
@@ -664,6 +673,9 @@ shapes/shapes_draw_circle_sector: shapes/shapes_draw_circle_sector.c
|
|||||||
shapes/shapes_draw_rectangle_rounded: shapes/shapes_draw_rectangle_rounded.c
|
shapes/shapes_draw_rectangle_rounded: shapes/shapes_draw_rectangle_rounded.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
|
shapes/shapes_top_down_lights: shapes/shapes_top_down_lights.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
# Compile TEXTURES examples
|
# Compile TEXTURES examples
|
||||||
textures/textures_logo_raylib: textures/textures_logo_raylib.c
|
textures/textures_logo_raylib: textures/textures_logo_raylib.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
@@ -672,7 +684,7 @@ textures/textures_logo_raylib: textures/textures_logo_raylib.c
|
|||||||
textures/textures_mouse_painting: textures/textures_mouse_painting.c
|
textures/textures_mouse_painting: textures/textures_mouse_painting.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
textures/textures_rectangle: textures/textures_rectangle.c
|
textures/textures_sprite_anim: textures/textures_sprite_anim.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file textures/resources/scarfy.png@resources/scarfy.png
|
--preload-file textures/resources/scarfy.png@resources/scarfy.png
|
||||||
|
|
||||||
@@ -734,23 +746,34 @@ textures/textures_sprite_explosion: textures/textures_sprite_explosion.c
|
|||||||
--preload-file textures/resources/explosion.png@resources/explosion.png \
|
--preload-file textures/resources/explosion.png@resources/explosion.png \
|
||||||
--preload-file textures/resources/boom.wav@resources/boom.wav
|
--preload-file textures/resources/boom.wav@resources/boom.wav
|
||||||
|
|
||||||
|
textures/textures_textured_curve: textures/textures_textured_curve.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
|
--preload-file textures/resources/road.png@resources/road.png
|
||||||
|
|
||||||
textures/textures_bunnymark: textures/textures_bunnymark.c
|
textures/textures_bunnymark: textures/textures_bunnymark.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file textures/resources/wabbit_alpha.png@resources/wabbit_alpha.png
|
--preload-file textures/resources/wabbit_alpha.png@resources/wabbit_alpha.png
|
||||||
|
|
||||||
textures/textures_blend_modes: textures/textures_blend_modes.c
|
textures/textures_blend_modes: textures/textures_blend_modes.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s ASYNCIFY \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file textures/resources/cyberpunk_street_background.png@resources/cyberpunk_street_background.png \
|
--preload-file textures/resources/cyberpunk_street_background.png@resources/cyberpunk_street_background.png \
|
||||||
--preload-file textures/resources/cyberpunk_street_foreground.png@resources/cyberpunk_street_foreground.png
|
--preload-file textures/resources/cyberpunk_street_foreground.png@resources/cyberpunk_street_foreground.png
|
||||||
|
|
||||||
textures/textures_draw_tiled: textures/textures_draw_tiled.c
|
textures/textures_draw_tiled: textures/textures_draw_tiled.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s ASYNCIFY \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file textures/resources/patterns.png@resources/patterns.png
|
--preload-file textures/resources/patterns.png@resources/patterns.png
|
||||||
|
|
||||||
textures/textures_polygon: textures/textures_polygon.c
|
textures/textures_polygon: textures/textures_polygon.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file textures/resources/cat.png@resources/cat.png
|
--preload-file textures/resources/cat.png@resources/cat.png
|
||||||
|
|
||||||
|
textures/textures_gif_player: textures/textures_gif_player.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
|
--preload-file textures/resources/scarfy_run.gif@resources/scarfy_run.gif
|
||||||
|
|
||||||
|
textures/textures_fog_of_war: textures/textures_fog_of_war.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
# Compile TEXT examples
|
# Compile TEXT examples
|
||||||
text/text_raylib_fonts: text/text_raylib_fonts.c
|
text/text_raylib_fonts: text/text_raylib_fonts.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
@@ -809,6 +832,10 @@ text/text_draw_3d: text/text_draw_3d.c
|
|||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file text/resources/shaders/glsl100/alpha_discard.fs@resources/shaders/glsl100/alpha_discard.fs
|
--preload-file text/resources/shaders/glsl100/alpha_discard.fs@resources/shaders/glsl100/alpha_discard.fs
|
||||||
|
|
||||||
|
text/text_codepoints_loading: text/text_codepoints_loading.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
|
--preload-file text/resources/DotGothic16-Regular.ttf@resources/DotGothic16-Regular.ttf
|
||||||
|
|
||||||
# Compile MODELS examples
|
# Compile MODELS examples
|
||||||
models/models_animation: models/models_animation.c
|
models/models_animation: models/models_animation.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
||||||
@@ -828,6 +855,10 @@ models/models_cubicmap: models/models_cubicmap.c
|
|||||||
--preload-file models/resources/cubicmap.png@resources/cubicmap.png \
|
--preload-file models/resources/cubicmap.png@resources/cubicmap.png \
|
||||||
--preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
|
--preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
|
||||||
|
|
||||||
|
models/models_draw_cube_texture: models/models_draw_cube_texture.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
|
--preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
|
||||||
|
|
||||||
models/models_first_person_maze: models/models_first_person_maze.c
|
models/models_first_person_maze: models/models_first_person_maze.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file models/resources/cubicmap.png@resources/cubicmap.png \
|
--preload-file models/resources/cubicmap.png@resources/cubicmap.png \
|
||||||
@@ -857,14 +888,11 @@ models/models_loading_vox: models/models_loading_vox.c
|
|||||||
|
|
||||||
models/models_loading_gltf: models/models_loading_gltf.c
|
models/models_loading_gltf: models/models_loading_gltf.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
||||||
--preload-file models/resources/models/gltf/raylib_32x32.glb@resources/models/gltf/raylib_32x32.glb \
|
--preload-file models/resources/models/gltf/robot.glb@resources/models/gltf/robot.glb
|
||||||
--preload-file models/resources/models/gltf/girl.glb@resources/models/gltf/girl.glb \
|
|
||||||
--preload-file models/resources/models/gltf/rigged_figure.glb@resources/models/gltf/rigged_figure.glb \
|
models/models_loading_m3d: models/models_loading_m3d.c
|
||||||
--preload-file models/resources/models/gltf/GearboxAssy.glb@resources/models/gltf/GearboxAssy.glb \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
||||||
--preload-file models/resources/models/gltf/BoxAnimated.glb@resources/models/gltf/BoxAnimated.glb \
|
--preload-file models/resources/models/m3d/cesium_man.m3d@resources/models/m3d/cesium_man.m3d
|
||||||
--preload-file models/resources/models/gltf/AnimatedTriangle.gltf@resources/models/gltf/AnimatedTriangle.gltf \
|
|
||||||
--preload-file models/resources/models/gltf/AnimatedMorphCube.glb@resources/models/gltf/AnimatedMorphCube.glb \
|
|
||||||
--preload-file models/resources/models/gltf/vertex_colored_object.glb@resources/models/gltf/vertex_colored_object.glb
|
|
||||||
|
|
||||||
models/models_orthographic_projection: models/models_orthographic_projection.c
|
models/models_orthographic_projection: models/models_orthographic_projection.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
@@ -882,7 +910,7 @@ models/models_skybox: models/models_skybox.c
|
|||||||
|
|
||||||
models/models_yaw_pitch_roll: models/models_yaw_pitch_roll.c
|
models/models_yaw_pitch_roll: models/models_yaw_pitch_roll.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
||||||
--preload-file models/resources/models/obj/plane.gltf@resources/modelsobj/plane.gltf \
|
--preload-file models/resources/models/obj/plane.obj@resources/models/obj/plane.obj \
|
||||||
--preload-file models/resources/models/obj/plane_diffuse.png@resources/models/obj/plane_diffuse.png
|
--preload-file models/resources/models/obj/plane_diffuse.png@resources/models/obj/plane_diffuse.png
|
||||||
|
|
||||||
models/models_heightmap: models/models_heightmap.c
|
models/models_heightmap: models/models_heightmap.c
|
||||||
@@ -946,13 +974,13 @@ shaders/shaders_basic_lighting: shaders/shaders_basic_lighting.c
|
|||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file shaders/resources/texel_checker.png@resources/texel_checker.png \
|
--preload-file shaders/resources/texel_checker.png@resources/texel_checker.png \
|
||||||
--preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs \
|
--preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs \
|
||||||
--preload-file shaders/resources/shaders/glsl100/base_lighting.vs@resources/shaders/glsl100/base_lighting.vs
|
--preload-file shaders/resources/shaders/glsl100/lighting.vs@resources/shaders/glsl100/lighting.vs
|
||||||
|
|
||||||
shaders/shaders_fog: shaders/shaders_fog.c
|
shaders/shaders_fog: shaders/shaders_fog.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file shaders/resources/texel_checker.png@resources/texel_checker.png \
|
--preload-file shaders/resources/texel_checker.png@resources/texel_checker.png \
|
||||||
--preload-file shaders/resources/shaders/glsl100/fog.fs@resources/shaders/glsl100/fog.fs \
|
--preload-file shaders/resources/shaders/glsl100/fog.fs@resources/shaders/glsl100/fog.fs \
|
||||||
--preload-file shaders/resources/shaders/glsl100/base_lighting.vs@resources/shaders/glsl100/base_lighting.vs
|
--preload-file shaders/resources/shaders/glsl100/lighting.vs@resources/shaders/glsl100/lighting.vs
|
||||||
|
|
||||||
shaders/shaders_simple_mask: shaders/shaders_simple_mask.c
|
shaders/shaders_simple_mask: shaders/shaders_simple_mask.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
@@ -971,10 +999,9 @@ shaders/shaders_hot_reloading: shaders/shaders_hot_reloading.c
|
|||||||
|
|
||||||
shaders/shaders_mesh_instancing: shaders/shaders_mesh_instancing.c
|
shaders/shaders_mesh_instancing: shaders/shaders_mesh_instancing.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file shaders/resources/shaders/glsl100/base_lighting_instanced.vs@resources/shaders/glsl100/base_lighting_instanced.vs \
|
--preload-file shaders/resources/shaders/glsl100/lighting_instancing.vs@resources/shaders/glsl100/lighting_instancing.vs \
|
||||||
--preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs
|
--preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs
|
||||||
|
|
||||||
|
|
||||||
shaders/shaders_multi_sample2d: shaders/shaders_multi_sample2d.c
|
shaders/shaders_multi_sample2d: shaders/shaders_multi_sample2d.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
--preload-file shaders/resources/shaders/glsl100/color_mix.fs@resources/shaders/glsl100/color_mix.fs
|
--preload-file shaders/resources/shaders/glsl100/color_mix.fs@resources/shaders/glsl100/color_mix.fs
|
||||||
@@ -984,6 +1011,15 @@ shaders/shaders_texture_outline: shaders/shaders_texture_outline.c
|
|||||||
--preload-file shaders/resources/shaders/glsl100/outline.fs@resources/shaders/glsl100/outline.fs \
|
--preload-file shaders/resources/shaders/glsl100/outline.fs@resources/shaders/glsl100/outline.fs \
|
||||||
--preload-file shaders/resources/fudesumi.png@resources/fudesumi.png
|
--preload-file shaders/resources/fudesumi.png@resources/fudesumi.png
|
||||||
|
|
||||||
|
shaders/shaders_write_depth: shaders/shaders_write_depth.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
|
--preload-file shaders/resources/shaders/glsl100/write_depth.fs@resources/shaders/glsl100/write_depth.fs
|
||||||
|
|
||||||
|
shaders/shaders_hybrid_render: shaders/shaders_hybrid_render.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
|
--preload-file shaders/resources/shaders/glsl100/hybrid_raymarch.fs@resources/shaders/glsl100/hybrid_raymarch.fs \
|
||||||
|
--preload-file shaders/resources/shaders/glsl100/hybrid_raster.fs@resources/shaders/glsl100/hybrid_raster.fs
|
||||||
|
|
||||||
# Compile AUDIO examples
|
# Compile AUDIO examples
|
||||||
audio/audio_module_playing: audio/audio_module_playing.c
|
audio/audio_module_playing: audio/audio_module_playing.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||||
@@ -1001,27 +1037,14 @@ audio/audio_sound_loading: audio/audio_sound_loading.c
|
|||||||
--preload-file audio/resources/sound.wav@resources/sound.wav \
|
--preload-file audio/resources/sound.wav@resources/sound.wav \
|
||||||
--preload-file audio/resources/target.ogg@resources/target.ogg
|
--preload-file audio/resources/target.ogg@resources/target.ogg
|
||||||
|
|
||||||
audio/audio_multichannel_sound: audio/audio_multichannel_sound.c
|
audio/audio_stream_effects: audio/audio_stream_effects.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
||||||
--preload-file audio/resources/sound.wav@resources/sound.wav \
|
--preload-file audio/resources/country.mp3@resources/country.mp3
|
||||||
--preload-file audio/resources/target.ogg@resources/target.ogg
|
|
||||||
|
|
||||||
# Compile PHYSICS examples
|
|
||||||
physics/physics_demo: physics/physics_demo.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -DPHYSAC_AVOID_TIMMING_SYSTEM
|
|
||||||
|
|
||||||
physics/physics_friction: physics/physics_friction.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -DPHYSAC_AVOID_TIMMING_SYSTEM
|
|
||||||
|
|
||||||
physics/physics_movement: physics/physics_movement.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -DPHYSAC_AVOID_TIMMING_SYSTEM
|
|
||||||
|
|
||||||
physics/physics_restitution: physics/physics_restitution.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -DPHYSAC_AVOID_TIMMING_SYSTEM
|
|
||||||
|
|
||||||
physics/physics_shatter: physics/physics_shatter.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -DPHYSAC_AVOID_TIMMING_SYSTEM
|
|
||||||
|
|
||||||
|
audio/audio_mixed_processor: audio/audio_mixed_processor.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
|
||||||
|
--preload-file audio/resources/country.mp3@resources/country.mp3 \
|
||||||
|
--preload-file audio/resources/coin.wav@resources/coin.wav
|
||||||
|
|
||||||
# Clean everything
|
# Clean everything
|
||||||
clean:
|
clean:
|
||||||
|
@@ -22,182 +22,182 @@ You may find it easier to use than other toolchains, especially when it comes to
|
|||||||
|
|
||||||
Examples using raylib core platform functionality like window creation, inputs, drawing modes and system functionality.
|
Examples using raylib core platform functionality like window creation, inputs, drawing modes and system functionality.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 01 | [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="200"> | ray | |
|
| 01 | [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 02 | [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="200"> | ray | |
|
| 02 | [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 03 | [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="200"> | ray | |
|
| 03 | [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="80"> | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 04 | [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="200"> | ray | |
|
| 04 | [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="80"> | ⭐️☆☆☆ | 1.1 | 1.3 | [Ray](https://github.com/raysan5) |
|
||||||
| 05 | [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="200"> | ray | |
|
| 05 | [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="80"> | ⭐️☆☆☆ | 1.1 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 06 | [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="200"> | [Berni](https://github.com/Berni8k) | |
|
| 06 | [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="80"> | ⭐️☆☆☆ | 2.1 | 2.5 | [Berni](https://github.com/Berni8k) |
|
||||||
| 07 | [core_input_gestures](core/core_input_gestures.c) | <img src="core/core_input_gestures.png" alt="core_input_gestures" width="200"> | ray | |
|
| 07 | [core_input_gestures](core/core_input_gestures.c) | <img src="core/core_input_gestures.png" alt="core_input_gestures" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 08 | [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="200"> | ray | |
|
| 08 | [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="80"> | ⭐️⭐️☆☆ | 1.5 | 3.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 09 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="200"> | [avyy](https://github.com/avyy) | ⭐️ |
|
| 09 | [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | <img src="core/core_2d_camera_mouse_zoom.png" alt="core_2d_camera_mouse_zoom" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
| 10 | [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="200"> | ray | |
|
| 10 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [avyy](https://github.com/avyy) |
|
||||||
| 11 | [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="200"> | ray | |
|
| 11 | [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 12 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="200"> | ray | |
|
| 12 | [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
||||||
| 13 | [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="200"> | ray | |
|
| 13 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
||||||
| 14 | [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="200"> | ray | |
|
| 14 | [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 15 | [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="200"> | [Pablo Marcos](https://github.com/pamarcos) | |
|
| 15 | [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.4 | [Ray](https://github.com/raysan5) |
|
||||||
| 16 | [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="200"> | [Anata](https://github.com/anatagawa) | |
|
| 16 | [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) |
|
||||||
| 17 | [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="200"> | ray | |
|
| 17 | [core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="80"> | ⭐️⭐️⭐️☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 18 | [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="200"> | ray | |
|
| 18 | [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Anata](https://github.com/anatagawa) |
|
||||||
| 19 | [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="200"> | [Chris Dill](https://github.com/MysteriousSpace) | |
|
| 19 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 20 | [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="200"> | ray | |
|
| 20 | [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 21 | [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="200"> | ray | ⭐️ |
|
| 21 | [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="80"> | ⭐️☆☆☆ | 1.1 | 1.1 | [Ray](https://github.com/raysan5) |
|
||||||
| 22 | [core_loading_thread](core/core_loading_thread.c) | <img src="core/core_loading_thread.png" alt="core_loading_thread" width="200"> | ray | |
|
| 22 | [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 23 | [core/core_quat_conversion](core/core_quat_conversion.c) | <img src="core/core_quat_conversion.png" alt="core_quat_conversion" width="200"> | [Chris Camacho](https://github.com/codifies) | |
|
| 23 | [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 24 | [core/core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="200"> | ray | |
|
| 24 | [core_loading_thread](core/core_loading_thread.c) | <img src="core/core_loading_thread.png" alt="core_loading_thread" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [Ray](https://github.com/raysan5) |
|
||||||
|
| 25 | [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="80"> | ⭐️☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
|
||||||
|
| 26 | [core_basic_screen_manager](core/core_basic_screen_manager.c) | <img src="core/core_basic_screen_manager.png" alt="core_basic_screen_manager" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
|
| 27 | [core_custom_frame_control](core/core_custom_frame_control.c) | <img src="core/core_custom_frame_control.png" alt="core_custom_frame_control" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
|
| 28 | [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | <img src="core/core_smooth_pixelperfect.png" alt="core_smooth_pixelperfect" width="80"> | ⭐️⭐️⭐️☆ | 3.7 | **4.0** | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) |
|
||||||
|
| 29 | [core_split_screen](core/core_split_screen.c) | <img src="core/core_split_screen.png" alt="core_split_screen" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.0** | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
|
| 30 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
|
|
||||||
### category: shapes
|
### category: shapes
|
||||||
|
|
||||||
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/shapes.c) module.
|
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/shapes.c) module.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 25 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="200"> | ray | |
|
| 31 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 26 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="200"> | ray | |
|
| 32 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="80"> | ⭐️☆☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 27 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="200"> | ray | |
|
| 33 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="80"> | ⭐️⭐️☆☆ | 1.0 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 28 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="200"> | ray | |
|
| 34 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 29 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="200"> | ray | |
|
| 35 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 30 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 36 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 31 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="200"> | ray | |
|
| 37 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="80"> | ⭐️☆☆☆ | 1.7 | 1.7 | [Ray](https://github.com/raysan5) |
|
||||||
| 32 | [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="200"> | ray | |
|
| 38 | [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 33 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="200"> | ray | |
|
| 39 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 34 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="200"> | ray | |
|
| 40 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 35 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="200"> | ray | |
|
| 41 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 36 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="200"> | ray | |
|
| 42 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 37 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 43 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 38 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 44 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 39 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 45 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
|
| 46 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | <img src="shapes/shapes_top_down_lights.png" alt="shapes_top_down_lights" width="80"> | ⭐️⭐️⭐️⭐️ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
|
|
||||||
### category: textures
|
### category: textures
|
||||||
|
|
||||||
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/textures.c) module.
|
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/textures.c) module.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|:------------------------------------------------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 40 | [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="200"> | ray | |
|
| 47 | [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 41 | [textures_rectangle](textures/textures_rectangle.c) | <img src="textures/textures_rectangle.png" alt="textures_rectangle" width="200"> | ray | |
|
| 48 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
||||||
| 42 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="200"> | ray | |
|
| 49 | [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
|
||||||
| 43 | [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="200"> | ray | |
|
| 50 | [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | 1.8 | [Ray](https://github.com/raysan5) |
|
||||||
| 44 | [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="200"> | ray | |
|
| 51 | [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
||||||
| 45 | [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="200"> | ray | |
|
| 52 | [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="80"> | ⭐️⭐️⭐️☆ | 1.4 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 46 | [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="200"> | ray | |
|
| 53 | [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 47 | [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="200"> | ray | |
|
| 54 | [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="80"> | ⭐️☆☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 48 | [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="200"> | ray | |
|
| 55 | [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 49 | [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="200"> | ray | |
|
| 56 | [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="80"> | ⭐️☆☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 50 | [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="200"> | ray | |
|
| 57 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="80"> | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) |
|
||||||
| 51 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="200"> | [Jorge A. Gomes](https://github.com/overdev) | |
|
| 58 | [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="80"> | ⭐️☆☆☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 52 | [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="200"> | ray | |
|
| 59 | [textures_sprite_anim](textures/textures_sprite_anim.c) | <img src="textures/textures_sprite_anim.png" alt="textures_sprite_anim" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
||||||
| 53 | [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="200"> | ray | |
|
| 60 | [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 54 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="200"> | ray | |
|
| 61 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 55 | [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="200"> | ray | |
|
| 62 | [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | 2.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 56 | [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="200"> | [Chris Dill](https://github.com/MysteriousSpace) | |
|
| 63 | [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
|
||||||
| 57 | [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="200"> | [Karlo Licudine](https://github.com/accidentalrebel) | |
|
| 64 | [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="80"> | ⭐️☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) |
|
||||||
| 58 | [textures_draw_tiled](textures/textures_draw_tiled.c) | <img src="textures/textures_draw_tiled.png" alt="textures_draw_tiled" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 65 | [textures_draw_tiled](textures/textures_draw_tiled.c) | <img src="textures/textures_draw_tiled.png" alt="textures_draw_tiled" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| -- | [textures_poly](textures/textures_poly.c) | <img src="textures/textures_poly.png" alt="textures_poly" width="200"> | [Chris Camacho](https://github.com/codifies) | ⭐️ |
|
| 66 | [textures_polygon](textures/textures_polygon.c) | <img src="textures/textures_polygon.png" alt="textures_polygon" width="80"> | ⭐️☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||||
|
| 67 | [textures_fog_of_war](textures/textures_fog_of_war.c) | <img src="textures/textures_fog_of_war.png" alt="textures_fog_of_war" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
|
| 68 | [textures_gif_player](textures/textures_gif_player.c) | <img src="textures/textures_gif_player.png" alt="textures_gif_player" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
|
|
||||||
### category: text
|
### category: text
|
||||||
|
|
||||||
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/text.c) module.
|
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/text.c) module.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 59 | [text_raylib_fonts](text/text_raylib_fonts.c) | <img src="text/text_raylib_fonts.png" alt="text_raylib_fonts" width="200"> | ray | |
|
| 69 | [text_raylib_fonts](text/text_raylib_fonts.c) | <img src="text/text_raylib_fonts.png" alt="text_raylib_fonts" width="80"> | ⭐️☆☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||||
| 60 | [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="200"> | ray | |
|
| 70 | [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 61 | [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="200"> | ray | |
|
| 71 | [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 62 | [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="200"> | ray | |
|
| 72 | [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="80"> | ⭐️☆☆☆ | 1.4 | 3.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 63 | [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="200"> | ray | |
|
| 73 | [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 64 | [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="200"> | ray | |
|
| 74 | [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="80"> | ⭐️☆☆☆ | 1.1 | 3.0 | [Ray](https://github.com/raysan5) |
|
||||||
| 65 | [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="200"> | ray | |
|
| 75 | [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 66 | [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="200"> | ray | |
|
| 76 | [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
|
||||||
| 67 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 77 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 68 | [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="200"> | [Vlad Adrian](https://github.com/demizdor) | |
|
| 78 | [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| -- | [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="200"> | [Vlad Adrian](https://github.com/demizdor) | ⭐️ |
|
| 79 | [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="80"> | ⭐️⭐️⭐️⭐️ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
|
| 80 | [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
|
|
||||||
### category: models
|
### category: models
|
||||||
|
|
||||||
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/models.c) module.
|
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/models.c) module.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 69 | [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="200"> | [culacant](https://github.com/culacant) | |
|
| 81 | [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [culacant](https://github.com/culacant) |
|
||||||
| 70 | [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="200"> | ray | |
|
| 82 | [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 71 | [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="200"> | ray | |
|
| 83 | [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="80"> | ⭐️☆☆☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 72 | [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="200"> | ray | |
|
| 84 | [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="80"> | ⭐️⭐️☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 73 | [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="200"> | ray | |
|
| 85 | [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 74 | [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="200"> | ray | |
|
| 86 | [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 75 | [...]() | | ray | |
|
| 87 | [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 76 | [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="200"> | ray | |
|
| 88 | [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="80"> | ⭐️⭐️⭐️☆ | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) |
|
||||||
| 77 | [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="200"> | [Joel Davis](https://github.com/joeld42) | |
|
| 89 | [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="80"> | ⭐️☆☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 78 | [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="200"> | ray | |
|
| 90 | [models_loading_gltf](models/models_loading_gltf.c) | <img src="models/models_loading_gltf.png" alt="models_loading_gltf" width="80"> | ⭐️☆☆☆ | 3.7 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 79 | [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="200"> | [Max Danielsson](https://github.com/autious) | |
|
| 91 | [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) |
|
||||||
| 80 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="200"> | ray | |
|
| 92 | [models_loading_m3d](models/models_loading_m3d.c) | <img src="models/models_loading_m3d.png" alt="models_loading_m3d" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) |
|
||||||
| 81 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="200"> | ray | |
|
| 93 | [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
|
||||||
| 82 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="200"> | [Berni](https://github.com/Berni8k) | ⭐️ |
|
| 94 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 83 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="200"> | ray | |
|
| 95 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) |
|
||||||
| 84 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="200"> | [codecat](https://github.com/codecat) | |
|
| 96 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) |
|
||||||
| -- | [models_gltf_model](models/models_gltf_model.c) | <img src="models/models_gltf_model.png" alt="models_gltf_model" width="200"> | [object71](https://github.com/object71) | ⭐️ |
|
| 97 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
|
| 98 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
|
|
||||||
### category: shaders
|
### category: shaders
|
||||||
|
|
||||||
Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.c) module.
|
Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.c) module.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 85 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="200"> | [Chris Camacho](https://github.com/codifies) | |
|
| 99 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) |
|
||||||
| 86 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="200"> | ray | |
|
| 100 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||||
| 87 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="200"> | ray | |
|
| 101 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||||
| 88 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="200"> | ray | |
|
| 102 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 89 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="200"> | ray | |
|
| 103 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 90 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="200"> | [Marco Lizza](https://github.com/MarcoLizza) | |
|
| 104 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
|
||||||
| 91 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="200"> | Shader by Iñigo Quilez | |
|
| 105 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 92 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="200"> | Michał Ciesielski | |
|
| 106 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) |
|
||||||
| 93 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="200"> | [Anata](https://github.com/anatagawa) | |
|
| 107 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) |
|
||||||
| 94 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="200"> | [eggmund](https://github.com/eggmund) | |
|
| 108 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
|
||||||
| 95 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="200"> | [ProfJski](https://github.com/ProfJski) | |
|
| 109 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) |
|
||||||
| 96 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="200"> | [Chris Camacho](https://github.com/codifies) | |
|
| 110 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) |
|
||||||
| 97 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="200"> | [Chris Camacho](https://github.com/codifies) | |
|
| 111 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||||
| 98 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="200"> | [Chris Camacho](https://github.com/codifies) | |
|
| 112 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||||
| 99 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="200"> | ray | |
|
| 113 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 100 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="200"> | [seanpringle](https://github.com/seanpringle), [moliad](https://github.com/moliad) | ⭐️ |
|
| 114 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) |
|
||||||
| 101 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="200"> | ray | |
|
| 115 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
|
| 116 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||||
|
|
||||||
### category: audio
|
### category: audio
|
||||||
|
|
||||||
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib, check [raudio_standalone](others/raudio_standalone.c) example.
|
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib, check [raudio_standalone](others/raudio_standalone.c) example.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 102 | [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="200"> | ray | |
|
| 117 | [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="80"> | ⭐️☆☆☆ | 1.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 103 | [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="200"> | ray | |
|
| 118 | [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="80"> | ⭐️☆☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 104 | [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="200"> | ray | |
|
| 119 | [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||||
| 105 | [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="200"> | ray | |
|
| 120 | [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||||
| 106 | [audio_multichannel_sound](audio/audio_multichannel_sound.c) | <img src="audio/audio_multichannel_sound.png" alt="audio_multichannel_sound" width="200"> | [Chris Camacho](https://github.com/codifies) | ⭐️ |
|
|
||||||
|
|
||||||
### category: physics
|
|
||||||
|
|
||||||
Examples showing physics functionality with raylib. This functionality is provided by [physac](https://github.com/victorfisac/Physac) library, included with raylib [sources](../src/physac.h). Note this library is not linked with raylib by default, it should be manually included in user code.
|
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
|
||||||
|----|----------|--------|:----------:|:---:|
|
|
||||||
| 107 | [physics_demo](physics/physics_demo.c) | <img src="physics/physics_demo.png" alt="physics_demo" width="200"> | [Victor Fisac](https://github.com/victorfisac) | |
|
|
||||||
| 108 | [physics_friction](physics/physics_friction.c) | <img src="physics/physics_friction.png" alt="physics_friction" width="200"> | [Victor Fisac](https://github.com/victorfisac) | |
|
|
||||||
| 109 | [physics_movement](physics/physics_movement.c) | <img src="physics/physics_movement.png" alt="physics_movement" width="200"> | [Victor Fisac](https://github.com/victorfisac) | |
|
|
||||||
| 110 | [physics_restitution](physics/physics_restitution.c) | <img src="physics/physics_restitution.png" alt="physics_restitution" width="200"> | [Victor Fisac](https://github.com/victorfisac) | |
|
|
||||||
| 111 | [physics_shatter](physics/physics_shatter.c) | <img src="physics/physics_shatter.png" alt="physics_shatter" width="200"> | [Victor Fisac](https://github.com/victorfisac) | |
|
|
||||||
|
|
||||||
### category: others
|
### category: others
|
||||||
|
|
||||||
Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
|
Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
|
||||||
|
|
||||||
| ## | example | image | developer | new |
|
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:----------:|:---:|
|
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||||
| 119 | [raudio_standalone](others/raudio_standalone.c) | | ray | |
|
| 122 | [rlgl_standalone](others/rlgl_standalone.c) | <img src="others/rlgl_standalone.png" alt="rlgl_standalone" width="80"> | ⭐️⭐️⭐️⭐️ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||||
| 120 | [rlgl_standalone](others/rlgl_standalone.c) | | ray | |
|
| 123 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | <img src="others/rlgl_compute_shader.png" alt="rlgl_compute_shader" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) |
|
||||||
| 121 | [easings_testbed](others/easings_testbed.c) | | [Juan Miguel López](https://github.com/flashback-fx) | |
|
| 124 | [easings_testbed](others/easings_testbed.c) | <img src="others/easings_testbed.png" alt="easings_testbed" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) |
|
||||||
| 122 | [embedded_files_loading](others/embedded_files_loading.c) | | [Kristian Holmgren](https://github.com/defutura) | |
|
| 125 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | <img src="others/raylib_opengl_interop.png" alt="raylib_opengl_interop" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) |
|
||||||
|
| 126 | [embedded_files_loading](others/embedded_files_loading.c) | <img src="others/embedded_files_loading.png" alt="embedded_files_loading" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) |
|
||||||
|
|
||||||
As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with!
|
As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with!
|
||||||
|
|
||||||
|
123
examples/audio/audio_mixed_processor.c
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [audio] example - Mixed audio processing
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
|
*
|
||||||
|
* Example contributed by hkc (@hatkidchan) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2023 hkc (@hatkidchan)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
#include "raylib.h"
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
static float exponent = 1.0f; // Audio exponentiation value
|
||||||
|
static float averageVolume[400] = { 0.0f }; // Average volume history
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Audio processing function
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
void ProcessAudio(void *buffer, unsigned int frames)
|
||||||
|
{
|
||||||
|
float *samples = (float *)buffer; // Samples internally stored as <float>s
|
||||||
|
float average = 0.0f; // Temporary average volume
|
||||||
|
|
||||||
|
for (unsigned int frame = 0; frame < frames; frame++)
|
||||||
|
{
|
||||||
|
float *left = &samples[frame * 2 + 0], *right = &samples[frame * 2 + 1];
|
||||||
|
|
||||||
|
*left = powf(fabsf(*left), exponent) * ( (*left < 0.0f)? -1.0f : 1.0f );
|
||||||
|
*right = powf(fabsf(*right), exponent) * ( (*right < 0.0f)? -1.0f : 1.0f );
|
||||||
|
|
||||||
|
average += fabsf(*left) / frames; // accumulating average volume
|
||||||
|
average += fabsf(*right) / frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Moving history to the left
|
||||||
|
for (int i = 0; i < 399; i++) averageVolume[i] = averageVolume[i + 1];
|
||||||
|
|
||||||
|
averageVolume[399] = average; // Adding last average value
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [audio] example - processing mixed output");
|
||||||
|
|
||||||
|
InitAudioDevice(); // Initialize audio device
|
||||||
|
|
||||||
|
AttachAudioMixedProcessor(ProcessAudio);
|
||||||
|
|
||||||
|
Music music = LoadMusicStream("resources/country.mp3");
|
||||||
|
Sound sound = LoadSound("resources/coin.wav");
|
||||||
|
|
||||||
|
PlayMusicStream(music);
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||||
|
|
||||||
|
// Modify processing variables
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
if (IsKeyPressed(KEY_LEFT)) exponent -= 0.05f;
|
||||||
|
if (IsKeyPressed(KEY_RIGHT)) exponent += 0.05f;
|
||||||
|
|
||||||
|
if (exponent <= 0.5f) exponent = 0.5f;
|
||||||
|
if (exponent >= 3.0f) exponent = 3.0f;
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_SPACE)) PlaySound(sound);
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
DrawText(TextFormat("EXPONENT = %.2f", exponent), 215, 180, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
|
||||||
|
for (int i = 0; i < 400; i++)
|
||||||
|
{
|
||||||
|
DrawLine(201 + i, 232 - averageVolume[i] * 32, 201 + i, 232, MAROON);
|
||||||
|
}
|
||||||
|
DrawRectangleLines(199, 199, 402, 34, GRAY);
|
||||||
|
|
||||||
|
DrawText("PRESS SPACE TO PLAY OTHER SOUND", 200, 250, 20, LIGHTGRAY);
|
||||||
|
DrawText("USE LEFT AND RIGHT ARROWS TO ALTER DISTORTION", 140, 280, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadMusicStream(music); // Unload music stream buffers from RAM
|
||||||
|
|
||||||
|
DetachAudioMixedProcessor(ProcessAudio); // Disconnect audio processor
|
||||||
|
|
||||||
|
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
examples/audio/audio_mixed_processor.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
@@ -2,10 +2,12 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Module playing (streaming)
|
* raylib [audio] example - Module playing (streaming)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.5 (www.raylib.com)
|
* Example originally created with raylib 1.5, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -21,6 +23,9 @@ typedef struct {
|
|||||||
Color color;
|
Color color;
|
||||||
} CircleWave;
|
} CircleWave;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -37,7 +42,7 @@ int main(void)
|
|||||||
Color colors[14] = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
|
Color colors[14] = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
|
||||||
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE };
|
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE };
|
||||||
|
|
||||||
// Creates ome circles for visual effect
|
// Creates some circles for visual effect
|
||||||
CircleWave circles[MAX_CIRCLES] = { 0 };
|
CircleWave circles[MAX_CIRCLES] = { 0 };
|
||||||
|
|
||||||
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
|
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
/*******************************************************************************************
|
|
||||||
*
|
|
||||||
* raylib [audio] example - Multichannel sound playing
|
|
||||||
*
|
|
||||||
* This example has been created using raylib 2.6 (www.raylib.com)
|
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
|
||||||
* Example contributed by Chris Camacho (@chriscamacho) and reviewed by Ramon Santamaria (@raysan5)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2019 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5)
|
|
||||||
*
|
|
||||||
********************************************************************************************/
|
|
||||||
|
|
||||||
#include "raylib.h"
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
// Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
const int screenWidth = 800;
|
|
||||||
const int screenHeight = 450;
|
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [audio] example - Multichannel sound playing");
|
|
||||||
|
|
||||||
InitAudioDevice(); // Initialize audio device
|
|
||||||
|
|
||||||
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
|
|
||||||
Sound fxOgg = LoadSound("resources/target.ogg"); // Load OGG audio file
|
|
||||||
|
|
||||||
SetSoundVolume(fxWav, 0.2f);
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Main game loop
|
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
|
||||||
{
|
|
||||||
// Update
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
if (IsKeyPressed(KEY_ENTER)) PlaySoundMulti(fxWav); // Play a new wav sound instance
|
|
||||||
if (IsKeyPressed(KEY_SPACE)) PlaySoundMulti(fxOgg); // Play a new ogg sound instance
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
BeginDrawing();
|
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
|
||||||
|
|
||||||
DrawText("MULTICHANNEL SOUND PLAYING", 20, 20, 20, GRAY);
|
|
||||||
DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, LIGHTGRAY);
|
|
||||||
DrawText("Press ENTER to play new wav instance!", 200, 180, 20, LIGHTGRAY);
|
|
||||||
|
|
||||||
DrawText(TextFormat("CONCURRENT SOUNDS PLAYING: %02i", GetSoundsPlaying()), 220, 280, 20, RED);
|
|
||||||
|
|
||||||
EndDrawing();
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
|
|
||||||
// De-Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
StopSoundMulti(); // We must stop the buffer pool before unloading
|
|
||||||
|
|
||||||
UnloadSound(fxWav); // Unload sound data
|
|
||||||
UnloadSound(fxOgg); // Unload sound data
|
|
||||||
|
|
||||||
CloseAudioDevice(); // Close audio device
|
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 16 KiB |
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Music playing (streaming)
|
* raylib [audio] example - Music playing (streaming)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -26,10 +31,10 @@ int main(void)
|
|||||||
|
|
||||||
PlayMusicStream(music);
|
PlayMusicStream(music);
|
||||||
|
|
||||||
float timePlayed = 0.0f;
|
float timePlayed = 0.0f; // Time played normalized [0.0f..1.0f]
|
||||||
bool pause = false;
|
bool pause = false; // Music playing paused
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(30); // Set our game to run at 30 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
@@ -55,10 +60,10 @@ int main(void)
|
|||||||
else ResumeMusicStream(music);
|
else ResumeMusicStream(music);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get timePlayed scaled to bar dimensions (400 pixels)
|
// Get normalized time played for current music stream
|
||||||
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*400;
|
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
|
||||||
|
|
||||||
if (timePlayed > 400) StopMusicStream(music);
|
if (timePlayed > 1.0f) timePlayed = 1.0f; // Make sure time played is no longer than music
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@@ -70,7 +75,7 @@ int main(void)
|
|||||||
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
|
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
|
||||||
|
|
||||||
DrawRectangle(200, 200, 400, 12, LIGHTGRAY);
|
DrawRectangle(200, 200, 400, 12, LIGHTGRAY);
|
||||||
DrawRectangle(200, 200, (int)timePlayed, 12, MAROON);
|
DrawRectangle(200, 200, (int)(timePlayed*400.0f), 12, MAROON);
|
||||||
DrawRectangleLines(200, 200, 400, 12, GRAY);
|
DrawRectangleLines(200, 200, 400, 12, GRAY);
|
||||||
|
|
||||||
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, LIGHTGRAY);
|
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, LIGHTGRAY);
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Raw audio streaming
|
* raylib [audio] example - Raw audio streaming
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.6 (www.raylib.com)
|
* Example originally created with raylib 1.6, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example created by Ramon Santamaria (@raysan5) and reviewed by James Hofmann (@triplefox)
|
* Example created by Ramon Santamaria (@raysan5) and reviewed by James Hofmann (@triplefox)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2019 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -20,6 +22,38 @@
|
|||||||
#define MAX_SAMPLES 512
|
#define MAX_SAMPLES 512
|
||||||
#define MAX_SAMPLES_PER_UPDATE 4096
|
#define MAX_SAMPLES_PER_UPDATE 4096
|
||||||
|
|
||||||
|
// Cycles per second (hz)
|
||||||
|
float frequency = 440.0f;
|
||||||
|
|
||||||
|
// Audio frequency, for smoothing
|
||||||
|
float audioFrequency = 440.0f;
|
||||||
|
|
||||||
|
// Previous value, used to test if sine needs to be rewritten, and to smoothly modulate frequency
|
||||||
|
float oldFrequency = 1.0f;
|
||||||
|
|
||||||
|
// Index for audio rendering
|
||||||
|
float sineIdx = 0.0f;
|
||||||
|
|
||||||
|
// Audio input processing callback
|
||||||
|
void AudioInputCallback(void *buffer, unsigned int frames)
|
||||||
|
{
|
||||||
|
audioFrequency = frequency + (audioFrequency - frequency)*0.95f;
|
||||||
|
audioFrequency += 1.0f;
|
||||||
|
audioFrequency -= 1.0f;
|
||||||
|
float incr = audioFrequency/44100.0f;
|
||||||
|
short *d = (short *)buffer;
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < frames; i++)
|
||||||
|
{
|
||||||
|
d[i] = (short)(32000.0f*sinf(2*PI*sineIdx));
|
||||||
|
sineIdx += incr;
|
||||||
|
if (sineIdx > 1.0f) sineIdx -= 1.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -33,9 +67,11 @@ int main(void)
|
|||||||
|
|
||||||
SetAudioStreamBufferSizeDefault(MAX_SAMPLES_PER_UPDATE);
|
SetAudioStreamBufferSizeDefault(MAX_SAMPLES_PER_UPDATE);
|
||||||
|
|
||||||
// Init raw audio stream (sample rate: 22050, sample size: 16bit-short, channels: 1-mono)
|
// Init raw audio stream (sample rate: 44100, sample size: 16bit-short, channels: 1-mono)
|
||||||
AudioStream stream = LoadAudioStream(44100, 16, 1);
|
AudioStream stream = LoadAudioStream(44100, 16, 1);
|
||||||
|
|
||||||
|
SetAudioStreamCallback(stream, AudioInputCallback);
|
||||||
|
|
||||||
// Buffer for the single cycle waveform we are synthesizing
|
// Buffer for the single cycle waveform we are synthesizing
|
||||||
short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES);
|
short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES);
|
||||||
|
|
||||||
@@ -47,6 +83,7 @@ int main(void)
|
|||||||
// Position read in to determine next frequency
|
// Position read in to determine next frequency
|
||||||
Vector2 mousePosition = { -100.0f, -100.0f };
|
Vector2 mousePosition = { -100.0f, -100.0f };
|
||||||
|
|
||||||
|
/*
|
||||||
// Cycles per second (hz)
|
// Cycles per second (hz)
|
||||||
float frequency = 440.0f;
|
float frequency = 440.0f;
|
||||||
|
|
||||||
@@ -55,6 +92,7 @@ int main(void)
|
|||||||
|
|
||||||
// Cursor to read and copy the samples of the sine wave buffer
|
// Cursor to read and copy the samples of the sine wave buffer
|
||||||
int readCursor = 0;
|
int readCursor = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
// Computed size in samples of the sine wave
|
// Computed size in samples of the sine wave
|
||||||
int waveLength = 1;
|
int waveLength = 1;
|
||||||
@@ -77,29 +115,38 @@ int main(void)
|
|||||||
{
|
{
|
||||||
float fp = (float)(mousePosition.y);
|
float fp = (float)(mousePosition.y);
|
||||||
frequency = 40.0f + (float)(fp);
|
frequency = 40.0f + (float)(fp);
|
||||||
|
|
||||||
|
float pan = (float)(mousePosition.x) / (float)screenWidth;
|
||||||
|
SetAudioStreamPan(stream, pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite the sine wave.
|
// Rewrite the sine wave
|
||||||
// Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc.
|
// Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc.
|
||||||
if (frequency != oldFrequency)
|
if (frequency != oldFrequency)
|
||||||
{
|
{
|
||||||
// Compute wavelength. Limit size in both directions.
|
// Compute wavelength. Limit size in both directions.
|
||||||
int oldWavelength = waveLength;
|
//int oldWavelength = waveLength;
|
||||||
waveLength = (int)(22050/frequency);
|
waveLength = (int)(22050/frequency);
|
||||||
if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2;
|
if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2;
|
||||||
if (waveLength < 1) waveLength = 1;
|
if (waveLength < 1) waveLength = 1;
|
||||||
|
|
||||||
// Write sine wave.
|
// Write sine wave
|
||||||
for (int i = 0; i < waveLength*2; i++)
|
for (int i = 0; i < waveLength*2; i++)
|
||||||
{
|
{
|
||||||
data[i] = (short)(sinf(((2*PI*(float)i/waveLength)))*32000);
|
data[i] = (short)(sinf(((2*PI*(float)i/waveLength)))*32000);
|
||||||
}
|
}
|
||||||
|
// Make sure the rest of the line is flat
|
||||||
|
for (int j = waveLength*2; j < MAX_SAMPLES; j++)
|
||||||
|
{
|
||||||
|
data[j] = (short)0;
|
||||||
|
}
|
||||||
|
|
||||||
// Scale read cursor's position to minimize transition artifacts
|
// Scale read cursor's position to minimize transition artifacts
|
||||||
readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));
|
//readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));
|
||||||
oldFrequency = frequency;
|
oldFrequency = frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// Refill audio stream if required
|
// Refill audio stream if required
|
||||||
if (IsAudioStreamProcessed(stream))
|
if (IsAudioStreamProcessed(stream))
|
||||||
{
|
{
|
||||||
@@ -128,6 +175,7 @@ int main(void)
|
|||||||
// Copy finished frame to audio stream
|
// Copy finished frame to audio stream
|
||||||
UpdateAudioStream(stream, writeBuf, MAX_SAMPLES_PER_UPDATE);
|
UpdateAudioStream(stream, writeBuf, MAX_SAMPLES_PER_UPDATE);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@@ -137,7 +185,7 @@ int main(void)
|
|||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
DrawText(TextFormat("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED);
|
DrawText(TextFormat("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED);
|
||||||
DrawText("click mouse button to change frequency", 10, 10, 20, DARKGRAY);
|
DrawText("click mouse button to change frequency or pan", 10, 10, 20, DARKGRAY);
|
||||||
|
|
||||||
// Draw the current buffer state proportionate to the screen
|
// Draw the current buffer state proportionate to the screen
|
||||||
for (int i = 0; i < screenWidth; i++)
|
for (int i = 0; i < screenWidth; i++)
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Sound loading and playing
|
* raylib [audio] example - Sound loading and playing
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* Example originally created with raylib 1.1, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
179
examples/audio/audio_stream_effects.c
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [audio] example - Music stream processing effects
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022-2023 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include <stdlib.h> // Required for: NULL
|
||||||
|
|
||||||
|
// Required delay effect variables
|
||||||
|
static float *delayBuffer = NULL;
|
||||||
|
static unsigned int delayBufferSize = 0;
|
||||||
|
static unsigned int delayReadIndex = 2;
|
||||||
|
static unsigned int delayWriteIndex = 0;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Module Functions Declaration
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
static void AudioProcessEffectLPF(void *buffer, unsigned int frames); // Audio effect: lowpass filter
|
||||||
|
static void AudioProcessEffectDelay(void *buffer, unsigned int frames); // Audio effect: delay
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [audio] example - stream effects");
|
||||||
|
|
||||||
|
InitAudioDevice(); // Initialize audio device
|
||||||
|
|
||||||
|
Music music = LoadMusicStream("resources/country.mp3");
|
||||||
|
|
||||||
|
// Allocate buffer for the delay effect
|
||||||
|
delayBufferSize = 48000*2; // 1 second delay (device sampleRate*channels)
|
||||||
|
delayBuffer = (float *)RL_CALLOC(delayBufferSize, sizeof(float));
|
||||||
|
|
||||||
|
PlayMusicStream(music);
|
||||||
|
|
||||||
|
float timePlayed = 0.0f; // Time played normalized [0.0f..1.0f]
|
||||||
|
bool pause = false; // Music playing paused
|
||||||
|
|
||||||
|
bool enableEffectLPF = false; // Enable effect low-pass-filter
|
||||||
|
bool enableEffectDelay = false; // Enable effect delay (1 second)
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||||
|
|
||||||
|
// Restart music playing (stop and play)
|
||||||
|
if (IsKeyPressed(KEY_SPACE))
|
||||||
|
{
|
||||||
|
StopMusicStream(music);
|
||||||
|
PlayMusicStream(music);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pause/Resume music playing
|
||||||
|
if (IsKeyPressed(KEY_P))
|
||||||
|
{
|
||||||
|
pause = !pause;
|
||||||
|
|
||||||
|
if (pause) PauseMusicStream(music);
|
||||||
|
else ResumeMusicStream(music);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add/Remove effect: lowpass filter
|
||||||
|
if (IsKeyPressed(KEY_F))
|
||||||
|
{
|
||||||
|
enableEffectLPF = !enableEffectLPF;
|
||||||
|
if (enableEffectLPF) AttachAudioStreamProcessor(music.stream, AudioProcessEffectLPF);
|
||||||
|
else DetachAudioStreamProcessor(music.stream, AudioProcessEffectLPF);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add/Remove effect: delay
|
||||||
|
if (IsKeyPressed(KEY_D))
|
||||||
|
{
|
||||||
|
enableEffectDelay = !enableEffectDelay;
|
||||||
|
if (enableEffectDelay) AttachAudioStreamProcessor(music.stream, AudioProcessEffectDelay);
|
||||||
|
else DetachAudioStreamProcessor(music.stream, AudioProcessEffectDelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get normalized time played for current music stream
|
||||||
|
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
|
||||||
|
|
||||||
|
if (timePlayed > 1.0f) timePlayed = 1.0f; // Make sure time played is no longer than music
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
DrawText("MUSIC SHOULD BE PLAYING!", 245, 150, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
DrawRectangle(200, 180, 400, 12, LIGHTGRAY);
|
||||||
|
DrawRectangle(200, 180, (int)(timePlayed*400.0f), 12, MAROON);
|
||||||
|
DrawRectangleLines(200, 180, 400, 12, GRAY);
|
||||||
|
|
||||||
|
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 230, 20, LIGHTGRAY);
|
||||||
|
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 260, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
DrawText(TextFormat("PRESS F TO TOGGLE LPF EFFECT: %s", enableEffectLPF? "ON" : "OFF"), 200, 320, 20, GRAY);
|
||||||
|
DrawText(TextFormat("PRESS D TO TOGGLE DELAY EFFECT: %s", enableEffectDelay? "ON" : "OFF"), 180, 350, 20, GRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadMusicStream(music); // Unload music stream buffers from RAM
|
||||||
|
|
||||||
|
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||||
|
|
||||||
|
RL_FREE(delayBuffer); // Free delay buffer
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Module Functions Definition
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Audio effect: lowpass filter
|
||||||
|
static void AudioProcessEffectLPF(void *buffer, unsigned int frames)
|
||||||
|
{
|
||||||
|
static float low[2] = { 0.0f, 0.0f };
|
||||||
|
static const float cutoff = 70.0f / 44100.0f; // 70 Hz lowpass filter
|
||||||
|
const float k = cutoff / (cutoff + 0.1591549431f); // RC filter formula
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < frames*2; i += 2)
|
||||||
|
{
|
||||||
|
float l = ((float *)buffer)[i], r = ((float *)buffer)[i + 1];
|
||||||
|
low[0] += k * (l - low[0]);
|
||||||
|
low[1] += k * (r - low[1]);
|
||||||
|
((float *)buffer)[i] = low[0];
|
||||||
|
((float *)buffer)[i + 1] = low[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Audio effect: delay
|
||||||
|
static void AudioProcessEffectDelay(void *buffer, unsigned int frames)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < frames*2; i += 2)
|
||||||
|
{
|
||||||
|
float leftDelay = delayBuffer[delayReadIndex++]; // ERROR: Reading buffer -> WHY??? Maybe thread related???
|
||||||
|
float rightDelay = delayBuffer[delayReadIndex++];
|
||||||
|
|
||||||
|
if (delayReadIndex == delayBufferSize) delayReadIndex = 0;
|
||||||
|
|
||||||
|
((float *)buffer)[i] = 0.5f*((float *)buffer)[i] + 0.5f*leftDelay;
|
||||||
|
((float *)buffer)[i + 1] = 0.5f*((float *)buffer)[i + 1] + 0.5f*rightDelay;
|
||||||
|
|
||||||
|
delayBuffer[delayWriteIndex++] = ((float *)buffer)[i];
|
||||||
|
delayBuffer[delayWriteIndex++] = ((float *)buffer)[i + 1];
|
||||||
|
if (delayWriteIndex == delayBufferSize) delayWriteIndex = 0;
|
||||||
|
}
|
||||||
|
}
|
BIN
examples/audio/audio_stream_effects.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
examples/audio/resources/target.qoa
Normal file
@@ -1,16 +1,13 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
fn add_module(comptime module: []const u8, b: *std.build.Builder, target: std.zig.CrossTarget) !*std.build.Step {
|
fn add_module(comptime module: []const u8, b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.OptimizeMode) !*std.Build.Step {
|
||||||
// Standard release options allow the person running `zig build` to select
|
if (target.getOsTag() == .emscripten) {
|
||||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
@panic("Emscripten building via Zig unsupported");
|
||||||
const mode = b.standardReleaseOptions();
|
}
|
||||||
|
|
||||||
const all = b.step(module, "All " ++ module ++ " examples");
|
const all = b.step(module, "All " ++ module ++ " examples");
|
||||||
const dir = try std.fs.cwd().openDir(
|
const dir = try std.fs.cwd().openIterableDir(module, .{});
|
||||||
module,
|
|
||||||
.{ .iterate = true },
|
|
||||||
);
|
|
||||||
var iter = dir.iterate();
|
var iter = dir.iterate();
|
||||||
while (try iter.next()) |entry| {
|
while (try iter.next()) |entry| {
|
||||||
if (entry.kind != .File) continue;
|
if (entry.kind != .File) continue;
|
||||||
@@ -21,26 +18,33 @@ fn add_module(comptime module: []const u8, b: *std.build.Builder, target: std.zi
|
|||||||
// zig's mingw headers do not include pthread.h
|
// zig's mingw headers do not include pthread.h
|
||||||
if (std.mem.eql(u8, "core_loading_thread", name) and target.getOsTag() == .windows) continue;
|
if (std.mem.eql(u8, "core_loading_thread", name) and target.getOsTag() == .windows) continue;
|
||||||
|
|
||||||
const exe = b.addExecutable(name, path);
|
const exe = b.addExecutable(.{
|
||||||
exe.setTarget(target);
|
.name = name,
|
||||||
exe.setBuildMode(mode);
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
});
|
||||||
|
exe.addCSourceFile(path, &[_][]const u8{});
|
||||||
exe.linkLibC();
|
exe.linkLibC();
|
||||||
exe.addObjectFile(switch (target.getOsTag()) {
|
exe.addObjectFile(switch (target.getOsTag()) {
|
||||||
.windows => "../src/raylib.lib",
|
.windows => "../src/raylib.lib",
|
||||||
.linux => "../src/libraylib.a",
|
.linux => "../src/libraylib.a",
|
||||||
|
.macos => "../src/libraylib.a",
|
||||||
|
.emscripten => "../src/libraylib.a",
|
||||||
else => @panic("Unsupported OS"),
|
else => @panic("Unsupported OS"),
|
||||||
});
|
});
|
||||||
|
|
||||||
exe.addIncludeDir("../src");
|
exe.addIncludePath("../src");
|
||||||
exe.addIncludeDir("../src/external");
|
exe.addIncludePath("../src/external");
|
||||||
exe.addIncludeDir("../src/external/glfw/include");
|
exe.addIncludePath("../src/external/glfw/include");
|
||||||
|
|
||||||
switch (exe.target.toTarget().os.tag) {
|
switch (target.getOsTag()) {
|
||||||
.windows => {
|
.windows => {
|
||||||
exe.linkSystemLibrary("winmm");
|
exe.linkSystemLibrary("winmm");
|
||||||
exe.linkSystemLibrary("gdi32");
|
exe.linkSystemLibrary("gdi32");
|
||||||
exe.linkSystemLibrary("opengl32");
|
exe.linkSystemLibrary("opengl32");
|
||||||
exe.addIncludeDir("external/glfw/deps/mingw");
|
exe.addIncludePath("external/glfw/deps/mingw");
|
||||||
|
|
||||||
|
exe.defineCMacro("PLATFORM_DESKTOP", null);
|
||||||
},
|
},
|
||||||
.linux => {
|
.linux => {
|
||||||
exe.linkSystemLibrary("GL");
|
exe.linkSystemLibrary("GL");
|
||||||
@@ -48,6 +52,18 @@ fn add_module(comptime module: []const u8, b: *std.build.Builder, target: std.zi
|
|||||||
exe.linkSystemLibrary("dl");
|
exe.linkSystemLibrary("dl");
|
||||||
exe.linkSystemLibrary("m");
|
exe.linkSystemLibrary("m");
|
||||||
exe.linkSystemLibrary("X11");
|
exe.linkSystemLibrary("X11");
|
||||||
|
|
||||||
|
exe.defineCMacro("PLATFORM_DESKTOP", null);
|
||||||
|
},
|
||||||
|
.macos => {
|
||||||
|
exe.linkFramework("Foundation");
|
||||||
|
exe.linkFramework("Cocoa");
|
||||||
|
exe.linkFramework("OpenGL");
|
||||||
|
exe.linkFramework("CoreAudio");
|
||||||
|
exe.linkFramework("CoreVideo");
|
||||||
|
exe.linkFramework("IOKit");
|
||||||
|
|
||||||
|
exe.defineCMacro("PLATFORM_DESKTOP", null);
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
@panic("Unsupported OS");
|
@panic("Unsupported OS");
|
||||||
@@ -65,22 +81,25 @@ fn add_module(comptime module: []const u8, b: *std.build.Builder, target: std.zi
|
|||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) !void {
|
pub fn build(b: *std.Build) !void {
|
||||||
// Standard target options allows the person running `zig build` to choose
|
// Standard target options allows the person running `zig build` to choose
|
||||||
// what target to build for. Here we do not override the defaults, which
|
// what target to build for. Here we do not override the defaults, which
|
||||||
// means any target is allowed, and the default is native. Other options
|
// means any target is allowed, and the default is native. Other options
|
||||||
// for restricting supported target set are available.
|
// for restricting supported target set are available.
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
|
// Standard optimization options allow the person running `zig build` to select
|
||||||
|
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
|
||||||
|
// set a preferred release mode, allowing the user to decide how to optimize.
|
||||||
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
const all = b.getInstallStep();
|
const all = b.getInstallStep();
|
||||||
|
|
||||||
all.dependOn(try add_module("audio", b, target));
|
all.dependOn(try add_module("audio", b, target, optimize));
|
||||||
all.dependOn(try add_module("core", b, target));
|
all.dependOn(try add_module("core", b, target, optimize));
|
||||||
all.dependOn(try add_module("models", b, target));
|
all.dependOn(try add_module("models", b, target, optimize));
|
||||||
all.dependOn(try add_module("others", b, target));
|
all.dependOn(try add_module("others", b, target, optimize));
|
||||||
all.dependOn(try add_module("physics", b, target));
|
all.dependOn(try add_module("shaders", b, target, optimize));
|
||||||
all.dependOn(try add_module("shaders", b, target));
|
all.dependOn(try add_module("shapes", b, target, optimize));
|
||||||
all.dependOn(try add_module("shapes", b, target));
|
all.dependOn(try add_module("text", b, target, optimize));
|
||||||
all.dependOn(try add_module("text", b, target));
|
all.dependOn(try add_module("textures", b, target, optimize));
|
||||||
all.dependOn(try add_module("textures", b, target));
|
|
||||||
}
|
}
|
||||||
|
@@ -2,10 +2,12 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 2d camera
|
* raylib [core] example - 2d camera
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.5 (www.raylib.com)
|
* Example originally created with raylib 1.5, last time updated with raylib 3.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -13,6 +15,9 @@
|
|||||||
|
|
||||||
#define MAX_BUILDINGS 100
|
#define MAX_BUILDINGS 100
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -54,7 +59,6 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Player movement
|
// Player movement
|
||||||
if (IsKeyDown(KEY_RIGHT)) player.x += 2;
|
if (IsKeyDown(KEY_RIGHT)) player.x += 2;
|
||||||
else if (IsKeyDown(KEY_LEFT)) player.x -= 2;
|
else if (IsKeyDown(KEY_LEFT)) player.x -= 2;
|
||||||
|
105
examples/core/core_2d_camera_mouse_zoom.c
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - 2d camera mouse zoom
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022-2023 Jeffery Myers (@JeffM2501)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include "rlgl.h"
|
||||||
|
#include "raymath.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera mouse zoom");
|
||||||
|
|
||||||
|
Camera2D camera = { 0 };
|
||||||
|
camera.zoom = 1.0f;
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Translate based on mouse right click
|
||||||
|
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
||||||
|
{
|
||||||
|
Vector2 delta = GetMouseDelta();
|
||||||
|
delta = Vector2Scale(delta, -1.0f/camera.zoom);
|
||||||
|
|
||||||
|
camera.target = Vector2Add(camera.target, delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zoom based on mouse wheel
|
||||||
|
float wheel = GetMouseWheelMove();
|
||||||
|
if (wheel != 0)
|
||||||
|
{
|
||||||
|
// Get the world point that is under the mouse
|
||||||
|
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
|
||||||
|
|
||||||
|
// Set the offset to where the mouse is
|
||||||
|
camera.offset = GetMousePosition();
|
||||||
|
|
||||||
|
// Set the target to match, so that the camera maps the world space point
|
||||||
|
// under the cursor to the screen space point under the cursor at any zoom
|
||||||
|
camera.target = mouseWorldPos;
|
||||||
|
|
||||||
|
// Zoom increment
|
||||||
|
const float zoomIncrement = 0.125f;
|
||||||
|
|
||||||
|
camera.zoom += (wheel*zoomIncrement);
|
||||||
|
if (camera.zoom < zoomIncrement) camera.zoom = zoomIncrement;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
ClearBackground(BLACK);
|
||||||
|
|
||||||
|
BeginMode2D(camera);
|
||||||
|
|
||||||
|
// Draw the 3d grid, rotated 90 degrees and centered around 0,0
|
||||||
|
// just so we have something in the XY plane
|
||||||
|
rlPushMatrix();
|
||||||
|
rlTranslatef(0, 25*50, 0);
|
||||||
|
rlRotatef(90, 1, 0, 0);
|
||||||
|
DrawGrid(100, 50);
|
||||||
|
rlPopMatrix();
|
||||||
|
|
||||||
|
// Draw a reference circle
|
||||||
|
DrawCircle(100, 100, 50, YELLOW);
|
||||||
|
|
||||||
|
EndMode2D();
|
||||||
|
|
||||||
|
DrawText("Mouse right button drag to move, mouse wheel to zoom", 10, 10, 20, WHITE);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
examples/core/core_2d_camera_mouse_zoom.png
Normal file
After Width: | Height: | Size: 16 KiB |
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 2d camera platformer
|
* raylib [core] example - 2d camera platformer
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by arvyy (@arvyy) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by arvyy (@arvyy) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 arvyy (@arvyy)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019-2023 arvyy (@arvyy)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -30,16 +32,19 @@ typedef struct EnvItem {
|
|||||||
Color color;
|
Color color;
|
||||||
} EnvItem;
|
} EnvItem;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Module functions declaration
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float delta);
|
void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float delta);
|
||||||
|
|
||||||
void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
||||||
void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
||||||
void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
||||||
void UpdateCameraEvenOutOnLanding(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
void UpdateCameraEvenOutOnLanding(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
||||||
void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -172,7 +177,7 @@ void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float d
|
|||||||
ei->rect.x <= p->x &&
|
ei->rect.x <= p->x &&
|
||||||
ei->rect.x + ei->rect.width >= p->x &&
|
ei->rect.x + ei->rect.width >= p->x &&
|
||||||
ei->rect.y >= p->y &&
|
ei->rect.y >= p->y &&
|
||||||
ei->rect.y < p->y + player->speed*delta)
|
ei->rect.y <= p->y + player->speed*delta)
|
||||||
{
|
{
|
||||||
hitObstacle = 1;
|
hitObstacle = 1;
|
||||||
player->speed = 0.0f;
|
player->speed = 0.0f;
|
||||||
|
@@ -2,17 +2,23 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 3d camera first person
|
* raylib [core] example - 3d camera first person
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
#include "rcamera.h"
|
||||||
|
|
||||||
#define MAX_COLUMNS 20
|
#define MAX_COLUMNS 20
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -24,11 +30,13 @@ int main(void)
|
|||||||
|
|
||||||
// Define the camera to look into our 3d world (position, target, up vector)
|
// Define the camera to look into our 3d world (position, target, up vector)
|
||||||
Camera camera = { 0 };
|
Camera camera = { 0 };
|
||||||
camera.position = (Vector3){ 4.0f, 2.0f, 4.0f };
|
camera.position = (Vector3){ 0.0f, 2.0f, 4.0f }; // Camera position
|
||||||
camera.target = (Vector3){ 0.0f, 1.8f, 0.0f };
|
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 60.0f;
|
camera.fovy = 60.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE;
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
|
int cameraMode = CAMERA_FIRST_PERSON;
|
||||||
|
|
||||||
// Generates some random columns
|
// Generates some random columns
|
||||||
float heights[MAX_COLUMNS] = { 0 };
|
float heights[MAX_COLUMNS] = { 0 };
|
||||||
@@ -42,7 +50,7 @@ int main(void)
|
|||||||
colors[i] = (Color){ GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255 };
|
colors[i] = (Color){ GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255 };
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -52,7 +60,83 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
// Switch camera mode
|
||||||
|
if (IsKeyPressed(KEY_ONE))
|
||||||
|
{
|
||||||
|
cameraMode = CAMERA_FREE;
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_TWO))
|
||||||
|
{
|
||||||
|
cameraMode = CAMERA_FIRST_PERSON;
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_THREE))
|
||||||
|
{
|
||||||
|
cameraMode = CAMERA_THIRD_PERSON;
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_FOUR))
|
||||||
|
{
|
||||||
|
cameraMode = CAMERA_ORBITAL;
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
|
||||||
|
}
|
||||||
|
|
||||||
|
// Switch camera projection
|
||||||
|
if (IsKeyPressed(KEY_P))
|
||||||
|
{
|
||||||
|
if (camera.projection == CAMERA_PERSPECTIVE)
|
||||||
|
{
|
||||||
|
// Create isometric view
|
||||||
|
cameraMode = CAMERA_THIRD_PERSON;
|
||||||
|
// Note: The target distance is related to the render distance in the orthographic projection
|
||||||
|
camera.position = (Vector3){ 0.0f, 2.0f, -100.0f };
|
||||||
|
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
||||||
|
camera.projection = CAMERA_ORTHOGRAPHIC;
|
||||||
|
camera.fovy = 20.0f; // near plane width in CAMERA_ORTHOGRAPHIC
|
||||||
|
CameraYaw(&camera, -135 * DEG2RAD, true);
|
||||||
|
CameraPitch(&camera, -45 * DEG2RAD, true, true, false);
|
||||||
|
}
|
||||||
|
else if (camera.projection == CAMERA_ORTHOGRAPHIC)
|
||||||
|
{
|
||||||
|
// Reset to default view
|
||||||
|
cameraMode = CAMERA_THIRD_PERSON;
|
||||||
|
camera.position = (Vector3){ 0.0f, 2.0f, 10.0f };
|
||||||
|
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE;
|
||||||
|
camera.fovy = 60.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update camera computes movement internally depending on the camera mode
|
||||||
|
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
|
||||||
|
// For advance camera controls, it's reecommended to compute camera movement manually
|
||||||
|
UpdateCamera(&camera, cameraMode); // Update camera
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Camera PRO usage example (EXPERIMENTAL)
|
||||||
|
// This new camera function allows custom movement/rotation values to be directly provided
|
||||||
|
// as input parameters, with this approach, rcamera module is internally independent of raylib inputs
|
||||||
|
UpdateCameraPro(&camera,
|
||||||
|
(Vector3){
|
||||||
|
(IsKeyDown(KEY_W) || IsKeyDown(KEY_UP))*0.1f - // Move forward-backward
|
||||||
|
(IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN))*0.1f,
|
||||||
|
(IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT))*0.1f - // Move right-left
|
||||||
|
(IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT))*0.1f,
|
||||||
|
0.0f // Move up-down
|
||||||
|
},
|
||||||
|
(Vector3){
|
||||||
|
GetMouseDelta().x*0.05f, // Rotation: yaw
|
||||||
|
GetMouseDelta().y*0.05f, // Rotation: pitch
|
||||||
|
0.0f // Rotation: roll
|
||||||
|
},
|
||||||
|
GetMouseWheelMove()*2.0f); // Move to target (zoom)
|
||||||
|
*/
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@@ -75,14 +159,39 @@ int main(void)
|
|||||||
DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, MAROON);
|
DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, MAROON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw player cube
|
||||||
|
if (cameraMode == CAMERA_THIRD_PERSON)
|
||||||
|
{
|
||||||
|
DrawCube(camera.target, 0.5f, 0.5f, 0.5f, PURPLE);
|
||||||
|
DrawCubeWires(camera.target, 0.5f, 0.5f, 0.5f, DARKPURPLE);
|
||||||
|
}
|
||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5f));
|
// Draw info boxes
|
||||||
DrawRectangleLines( 10, 10, 220, 70, BLUE);
|
DrawRectangle(5, 5, 330, 100, Fade(SKYBLUE, 0.5f));
|
||||||
|
DrawRectangleLines(5, 5, 330, 100, BLUE);
|
||||||
|
|
||||||
DrawText("First person camera default controls:", 20, 20, 10, BLACK);
|
DrawText("Camera controls:", 15, 15, 10, BLACK);
|
||||||
DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY);
|
DrawText("- Move keys: W, A, S, D, Space, Left-Ctrl", 15, 30, 10, BLACK);
|
||||||
DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY);
|
DrawText("- Look around: arrow keys or mouse", 15, 45, 10, BLACK);
|
||||||
|
DrawText("- Camera mode keys: 1, 2, 3, 4", 15, 60, 10, BLACK);
|
||||||
|
DrawText("- Zoom keys: num-plus, num-minus or mouse scroll", 15, 75, 10, BLACK);
|
||||||
|
DrawText("- Camera projection key: P", 15, 90, 10, BLACK);
|
||||||
|
|
||||||
|
DrawRectangle(600, 5, 195, 100, Fade(SKYBLUE, 0.5f));
|
||||||
|
DrawRectangleLines(600, 5, 195, 100, BLUE);
|
||||||
|
|
||||||
|
DrawText("Camera status:", 610, 15, 10, BLACK);
|
||||||
|
DrawText(TextFormat("- Mode: %s", (cameraMode == CAMERA_FREE) ? "FREE" :
|
||||||
|
(cameraMode == CAMERA_FIRST_PERSON) ? "FIRST_PERSON" :
|
||||||
|
(cameraMode == CAMERA_THIRD_PERSON) ? "THIRD_PERSON" :
|
||||||
|
(cameraMode == CAMERA_ORBITAL) ? "ORBITAL" : "CUSTOM"), 610, 30, 10, BLACK);
|
||||||
|
DrawText(TextFormat("- Projection: %s", (camera.projection == CAMERA_PERSPECTIVE) ? "PERSPECTIVE" :
|
||||||
|
(camera.projection == CAMERA_ORTHOGRAPHIC) ? "ORTHOGRAPHIC" : "CUSTOM"), 610, 45, 10, BLACK);
|
||||||
|
DrawText(TextFormat("- Position: (%06.3f, %06.3f, %06.3f)", camera.position.x, camera.position.y, camera.position.z), 610, 60, 10, BLACK);
|
||||||
|
DrawText(TextFormat("- Target: (%06.3f, %06.3f, %06.3f)", camera.target.x, camera.target.y, camera.target.z), 610, 75, 10, BLACK);
|
||||||
|
DrawText(TextFormat("- Up: (%06.3f, %06.3f, %06.3f)", camera.up.x, camera.up.y, camera.up.z), 610, 90, 10, BLACK);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Initialize 3d camera free
|
* raylib [core] example - Initialize 3d camera free
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -26,11 +31,11 @@ int main(void)
|
|||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -40,7 +45,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_FREE);
|
||||||
|
|
||||||
if (IsKeyDown('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
if (IsKeyDown('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Initialize 3d camera mode
|
* raylib [core] example - Initialize 3d camera mode
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Picking in 3d mode
|
* raylib [core] example - Picking in 3d mode
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -26,16 +31,13 @@ int main(void)
|
|||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Vector3 cubePosition = { 0.0f, 1.0f, 0.0f };
|
Vector3 cubePosition = { 0.0f, 1.0f, 0.0f };
|
||||||
Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };
|
Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };
|
||||||
|
|
||||||
Ray ray = { 0 }; // Picking line ray
|
Ray ray = { 0 }; // Picking line ray
|
||||||
|
RayCollision collision = { 0 }; // Ray collision hit info
|
||||||
RayCollision collision = { 0 };
|
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -45,7 +47,14 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
if (IsCursorHidden()) UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
|
// Toggle camera controls
|
||||||
|
if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT))
|
||||||
|
{
|
||||||
|
if (IsCursorHidden()) EnableCursor();
|
||||||
|
else DisableCursor();
|
||||||
|
}
|
||||||
|
|
||||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
||||||
{
|
{
|
||||||
@@ -88,10 +97,12 @@ int main(void)
|
|||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY);
|
DrawText("Try clicking on the box with your mouse!", 240, 10, 20, DARKGRAY);
|
||||||
|
|
||||||
if (collision.hit) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, (int)(screenHeight * 0.1f), 30, GREEN);
|
if (collision.hit) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, (int)(screenHeight * 0.1f), 30, GREEN);
|
||||||
|
|
||||||
|
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, GRAY);
|
||||||
|
|
||||||
DrawFPS(10, 10);
|
DrawFPS(10, 10);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] examples - basic screen manager
|
* raylib [core] examples - basic screen manager
|
||||||
*
|
*
|
||||||
* This example illustrates a very simple screen manager based on a states machines
|
* NOTE: This example illustrates a very simple screen manager based on a states machines
|
||||||
*
|
*
|
||||||
* This test has been created using raylib 1.1 (www.raylib.com)
|
* Example originally created with raylib 4.0, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -18,9 +20,9 @@
|
|||||||
//------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------
|
||||||
typedef enum GameScreen { LOGO = 0, TITLE, GAMEPLAY, ENDING } GameScreen;
|
typedef enum GameScreen { LOGO = 0, TITLE, GAMEPLAY, ENDING } GameScreen;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Main entry point
|
// Program main entry point
|
||||||
//------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -12,15 +12,20 @@
|
|||||||
*
|
*
|
||||||
* Enjoy using raylib. :)
|
* Enjoy using raylib. :)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,14 +2,16 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Basic window (adapted for HTML5 platform)
|
* raylib [core] example - Basic window (adapted for HTML5 platform)
|
||||||
*
|
*
|
||||||
* This example is prepared to compile for PLATFORM_WEB, PLATFORM_DESKTOP and PLATFORM_RPI
|
* NOTE: This example is prepared to compile for PLATFORM_WEB, PLATFORM_DESKTOP and PLATFORM_RPI
|
||||||
* As you will notice, code structure is slightly diferent to the other examples...
|
* As you will notice, code structure is slightly diferent to the other examples...
|
||||||
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
|
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -24,18 +26,18 @@
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Global Variables Definition
|
// Global Variables Definition
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Functions Declaration
|
// Module functions declaration
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
void UpdateDrawFrame(void); // Update and Draw one frame
|
void UpdateDrawFrame(void); // Update and Draw one frame
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Main Enry Point
|
// Program main entry point
|
||||||
//----------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
int main()
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - custom frame control
|
* raylib [core] example - custom frame control
|
||||||
*
|
*
|
||||||
* WARNING: This is an example for advance users willing to have full control over
|
* NOTE: WARNING: This is an example for advance users willing to have full control over
|
||||||
* the frame processes. By default, EndDrawing() calls the following processes:
|
* the frame processes. By default, EndDrawing() calls the following processes:
|
||||||
* 1. Draw remaining batch data: rlDrawRenderBatchActive()
|
* 1. Draw remaining batch data: rlDrawRenderBatchActive()
|
||||||
* 2. SwapScreenBuffer()
|
* 2. SwapScreenBuffer()
|
||||||
@@ -17,15 +17,20 @@
|
|||||||
* - SetTargetFPS()
|
* - SetTargetFPS()
|
||||||
* - GetFPS()
|
* - GetFPS()
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.8 (www.raylib.com)
|
* Example originally created with raylib 4.0, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -81,8 +86,8 @@ int main(void)
|
|||||||
|
|
||||||
DrawCircle((int)position, GetScreenHeight()/2 - 25, 50, RED);
|
DrawCircle((int)position, GetScreenHeight()/2 - 25, 50, RED);
|
||||||
|
|
||||||
DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), position - 40, GetScreenHeight()/2 - 100, 20, MAROON);
|
DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), (int)position - 40, GetScreenHeight()/2 - 100, 20, MAROON);
|
||||||
DrawText(TextFormat("PosX: %03.0f", position), position - 50, GetScreenHeight()/2 + 40, 20, BLACK);
|
DrawText(TextFormat("PosX: %03.0f", position), (int)position - 50, GetScreenHeight()/2 + 40, 20, BLACK);
|
||||||
|
|
||||||
DrawText("Circle is moving at a constant 200 pixels/sec,\nindependently of the frame rate.", 10, 10, 20, DARKGRAY);
|
DrawText("Circle is moving at a constant 200 pixels/sec,\nindependently of the frame rate.", 10, 10, 20, DARKGRAY);
|
||||||
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
|
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
|
||||||
@@ -105,12 +110,12 @@ int main(void)
|
|||||||
waitTime = (1.0f/(float)targetFPS) - updateDrawTime;
|
waitTime = (1.0f/(float)targetFPS) - updateDrawTime;
|
||||||
if (waitTime > 0.0)
|
if (waitTime > 0.0)
|
||||||
{
|
{
|
||||||
WaitTime((float)waitTime*1000.0f);
|
WaitTime((float)waitTime);
|
||||||
currentTime = GetTime();
|
currentTime = GetTime();
|
||||||
deltaTime = (float)(currentTime - previousTime);
|
deltaTime = (float)(currentTime - previousTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else deltaTime = updateDrawTime; // Framerate could be variable
|
else deltaTime = (float)updateDrawTime; // Framerate could be variable
|
||||||
|
|
||||||
previousTime = currentTime;
|
previousTime = currentTime;
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Custom logging
|
* raylib [core] example - Custom logging
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.1 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 2.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Pablo Marcos Oltra (@pamarcos) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Pablo Marcos Oltra (@pamarcos) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2018-2023 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -16,8 +18,8 @@
|
|||||||
#include <stdio.h> // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen()
|
#include <stdio.h> // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen()
|
||||||
#include <time.h> // Required for: time_t, tm, time(), localtime(), strftime()
|
#include <time.h> // Required for: time_t, tm, time(), localtime(), strftime()
|
||||||
|
|
||||||
// Custom logging funtion
|
// Custom logging function
|
||||||
void LogCustom(int msgType, const char *text, va_list args)
|
void CustomLog(int msgType, const char *text, va_list args)
|
||||||
{
|
{
|
||||||
char timeStr[64] = { 0 };
|
char timeStr[64] = { 0 };
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
@@ -39,16 +41,18 @@ void LogCustom(int msgType, const char *text, va_list args)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
// First thing we do is setting our custom logger to ensure everything raylib logs
|
// Set custom logger
|
||||||
// will use our own logger instead of its internal one
|
SetTraceLogCallback(CustomLog);
|
||||||
SetTraceLogCallback(LogCustom);
|
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - custom logging");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - custom logging");
|
||||||
|
|
||||||
|
@@ -2,17 +2,27 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Windows drop files
|
* raylib [core] example - Windows drop files
|
||||||
*
|
*
|
||||||
* This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
|
* NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include <stdlib.h> // Required for: calloc(), free()
|
||||||
|
|
||||||
|
#define MAX_FILEPATH_RECORDED 4096
|
||||||
|
#define MAX_FILEPATH_SIZE 2048
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -22,8 +32,14 @@ int main(void)
|
|||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - drop files");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - drop files");
|
||||||
|
|
||||||
int count = 0;
|
int filePathCounter = 0;
|
||||||
char **droppedFiles = { 0 };
|
char *filePaths[MAX_FILEPATH_RECORDED] = { 0 }; // We will register a maximum of filepaths
|
||||||
|
|
||||||
|
// Allocate space for the required file paths
|
||||||
|
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
|
||||||
|
{
|
||||||
|
filePaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_SIZE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -35,7 +51,18 @@ int main(void)
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
if (IsFileDropped())
|
if (IsFileDropped())
|
||||||
{
|
{
|
||||||
droppedFiles = GetDroppedFiles(&count);
|
FilePathList droppedFiles = LoadDroppedFiles();
|
||||||
|
|
||||||
|
for (int i = 0, offset = filePathCounter; i < droppedFiles.count; i++)
|
||||||
|
{
|
||||||
|
if (filePathCounter < (MAX_FILEPATH_RECORDED - 1))
|
||||||
|
{
|
||||||
|
TextCopy(filePaths[offset + i], droppedFiles.paths[i]);
|
||||||
|
filePathCounter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -45,20 +72,20 @@ int main(void)
|
|||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
if (count == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY);
|
if (filePathCounter == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawText("Dropped files:", 100, 40, 20, DARKGRAY);
|
DrawText("Dropped files:", 100, 40, 20, DARKGRAY);
|
||||||
|
|
||||||
for (int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < filePathCounter; i++)
|
||||||
{
|
{
|
||||||
if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
|
if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
|
||||||
else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f));
|
else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f));
|
||||||
|
|
||||||
DrawText(droppedFiles[i], 120, 100 + 40*i, 10, GRAY);
|
DrawText(filePaths[i], 120, 100 + 40*i, 10, GRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawText("Drop new files...", 100, 110 + 40*count, 20, DARKGRAY);
|
DrawText("Drop new files...", 100, 110 + 40*filePathCounter, 20, DARKGRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
@@ -67,7 +94,10 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
ClearDroppedFiles(); // Clear internal buffers
|
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
|
||||||
|
{
|
||||||
|
RL_FREE(filePaths[i]); // Free allocated memory for all filepaths
|
||||||
|
}
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@@ -8,10 +8,12 @@
|
|||||||
* - PLAYSTATION(R)3 Controller
|
* - PLAYSTATION(R)3 Controller
|
||||||
* Check raylib.h for buttons configuration
|
* Check raylib.h for buttons configuration
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 1.1, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -27,6 +29,9 @@
|
|||||||
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
|
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -92,20 +97,20 @@ int main(void)
|
|||||||
// Draw axis: left joystick
|
// Draw axis: left joystick
|
||||||
DrawCircle(259, 152, 39, BLACK);
|
DrawCircle(259, 152, 39, BLACK);
|
||||||
DrawCircle(259, 152, 34, LIGHTGRAY);
|
DrawCircle(259, 152, 34, LIGHTGRAY);
|
||||||
DrawCircle(259 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X)*20),
|
DrawCircle(259 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X)*20),
|
||||||
152 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK);
|
152 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK);
|
||||||
|
|
||||||
// Draw axis: right joystick
|
// Draw axis: right joystick
|
||||||
DrawCircle(461, 237, 38, BLACK);
|
DrawCircle(461, 237, 38, BLACK);
|
||||||
DrawCircle(461, 237, 33, LIGHTGRAY);
|
DrawCircle(461, 237, 33, LIGHTGRAY);
|
||||||
DrawCircle(461 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20),
|
DrawCircle(461 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20),
|
||||||
237 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
|
237 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
|
||||||
|
|
||||||
// Draw axis: left-right triggers
|
// Draw axis: left-right triggers
|
||||||
DrawRectangle(170, 30, 15, 70, GRAY);
|
DrawRectangle(170, 30, 15, 70, GRAY);
|
||||||
DrawRectangle(604, 30, 15, 70, GRAY);
|
DrawRectangle(604, 30, 15, 70, GRAY);
|
||||||
DrawRectangle(170, 30, 15, (((1 + (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER))/2)*70), RED);
|
DrawRectangle(170, 30, 15, (int)(((1 + GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER))/2)*70), RED);
|
||||||
DrawRectangle(604, 30, 15, (((1 + (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER))/2)*70), RED);
|
DrawRectangle(604, 30, 15, (int)(((1 + GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER))/2)*70), RED);
|
||||||
|
|
||||||
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
|
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
|
||||||
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
|
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
|
||||||
@@ -140,20 +145,20 @@ int main(void)
|
|||||||
// Draw axis: left joystick
|
// Draw axis: left joystick
|
||||||
DrawCircle(319, 255, 35, BLACK);
|
DrawCircle(319, 255, 35, BLACK);
|
||||||
DrawCircle(319, 255, 31, LIGHTGRAY);
|
DrawCircle(319, 255, 31, LIGHTGRAY);
|
||||||
DrawCircle(319 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) * 20),
|
DrawCircle(319 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) * 20),
|
||||||
255 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) * 20), 25, BLACK);
|
255 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) * 20), 25, BLACK);
|
||||||
|
|
||||||
// Draw axis: right joystick
|
// Draw axis: right joystick
|
||||||
DrawCircle(475, 255, 35, BLACK);
|
DrawCircle(475, 255, 35, BLACK);
|
||||||
DrawCircle(475, 255, 31, LIGHTGRAY);
|
DrawCircle(475, 255, 31, LIGHTGRAY);
|
||||||
DrawCircle(475 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20),
|
DrawCircle(475 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X) * 20),
|
||||||
255 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
|
255 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y) * 20), 25, BLACK);
|
||||||
|
|
||||||
// Draw axis: left-right triggers
|
// Draw axis: left-right triggers
|
||||||
DrawRectangle(169, 48, 15, 70, GRAY);
|
DrawRectangle(169, 48, 15, 70, GRAY);
|
||||||
DrawRectangle(611, 48, 15, 70, GRAY);
|
DrawRectangle(611, 48, 15, 70, GRAY);
|
||||||
DrawRectangle(169, 48, 15, (((1 - (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)) / 2) * 70), RED);
|
DrawRectangle(169, 48, 15, (int)(((1 - GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)) / 2) * 70), RED);
|
||||||
DrawRectangle(611, 48, 15, (((1 - (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)) / 2) * 70), RED);
|
DrawRectangle(611, 48, 15, (int)(((1 - GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)) / 2) * 70), RED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -169,7 +174,7 @@ int main(void)
|
|||||||
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(0, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(0, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGamepadButtonPressed() != -1) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
if (GetGamepadButtonPressed() != GAMEPAD_BUTTON_UNKNOWN) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
||||||
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
|
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -2,18 +2,22 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Input Gestures Detection
|
* raylib [core] example - Input Gestures Detection
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.4 (www.raylib.com)
|
* Example originally created with raylib 1.4, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define MAX_GESTURE_STRINGS 20
|
#define MAX_GESTURE_STRINGS 20
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -53,16 +57,16 @@ int main(void)
|
|||||||
// Store gesture string
|
// Store gesture string
|
||||||
switch (currentGesture)
|
switch (currentGesture)
|
||||||
{
|
{
|
||||||
case GESTURE_TAP: strcpy(gestureStrings[gesturesCount], "GESTURE TAP"); break;
|
case GESTURE_TAP: TextCopy(gestureStrings[gesturesCount], "GESTURE TAP"); break;
|
||||||
case GESTURE_DOUBLETAP: strcpy(gestureStrings[gesturesCount], "GESTURE DOUBLETAP"); break;
|
case GESTURE_DOUBLETAP: TextCopy(gestureStrings[gesturesCount], "GESTURE DOUBLETAP"); break;
|
||||||
case GESTURE_HOLD: strcpy(gestureStrings[gesturesCount], "GESTURE HOLD"); break;
|
case GESTURE_HOLD: TextCopy(gestureStrings[gesturesCount], "GESTURE HOLD"); break;
|
||||||
case GESTURE_DRAG: strcpy(gestureStrings[gesturesCount], "GESTURE DRAG"); break;
|
case GESTURE_DRAG: TextCopy(gestureStrings[gesturesCount], "GESTURE DRAG"); break;
|
||||||
case GESTURE_SWIPE_RIGHT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE RIGHT"); break;
|
case GESTURE_SWIPE_RIGHT: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE RIGHT"); break;
|
||||||
case GESTURE_SWIPE_LEFT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
|
case GESTURE_SWIPE_LEFT: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
|
||||||
case GESTURE_SWIPE_UP: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
|
case GESTURE_SWIPE_UP: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
|
||||||
case GESTURE_SWIPE_DOWN: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
|
case GESTURE_SWIPE_DOWN: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
|
||||||
case GESTURE_PINCH_IN: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH IN"); break;
|
case GESTURE_PINCH_IN: TextCopy(gestureStrings[gesturesCount], "GESTURE PINCH IN"); break;
|
||||||
case GESTURE_PINCH_OUT: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH OUT"); break;
|
case GESTURE_PINCH_OUT: TextCopy(gestureStrings[gesturesCount], "GESTURE PINCH OUT"); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +75,7 @@ int main(void)
|
|||||||
// Reset gestures strings
|
// Reset gestures strings
|
||||||
if (gesturesCount >= MAX_GESTURE_STRINGS)
|
if (gesturesCount >= MAX_GESTURE_STRINGS)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_GESTURE_STRINGS; i++) strcpy(gestureStrings[i], "\0");
|
for (int i = 0; i < MAX_GESTURE_STRINGS; i++) TextCopy(gestureStrings[i], "\0");
|
||||||
|
|
||||||
gesturesCount = 0;
|
gesturesCount = 0;
|
||||||
}
|
}
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Keyboard input
|
* raylib [core] example - Keyboard input
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Mouse input
|
* raylib [core] example - Mouse input
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* Example originally created with raylib 1.0, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] examples - Mouse wheel input
|
* raylib [core] examples - Mouse wheel input
|
||||||
*
|
*
|
||||||
* This test has been created using raylib 1.1 (www.raylib.com)
|
* Example originally created with raylib 1.1, last time updated with raylib 1.3
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Input multitouch
|
* raylib [core] example - Input multitouch
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.1 (www.raylib.com)
|
* Example originally created with raylib 2.1, last time updated with raylib 2.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Berni (@Berni8k) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Berni (@Berni8k) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019-2023 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -15,6 +17,9 @@
|
|||||||
|
|
||||||
#define MAX_TOUCH_POINTS 10
|
#define MAX_TOUCH_POINTS 10
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -34,8 +39,12 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Get multiple touchpoints
|
// Get the touch point count ( how many fingers are touching the screen )
|
||||||
for (int i = 0; i < MAX_TOUCH_POINTS; ++i) touchPositions[i] = GetTouchPosition(i);
|
int tCount = GetTouchPointCount();
|
||||||
|
// Clamp touch points available ( set the maximum touch points allowed )
|
||||||
|
if(tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
|
||||||
|
// Get touch points positions
|
||||||
|
for (int i = 0; i < tCount; ++i) touchPositions[i] = GetTouchPosition(i);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@@ -44,7 +53,7 @@ int main(void)
|
|||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
for (int i = 0; i < MAX_TOUCH_POINTS; ++i)
|
for (int i = 0; i < tCount; ++i)
|
||||||
{
|
{
|
||||||
// Make sure point is not (0, 0) as this means there is no touch for it
|
// Make sure point is not (0, 0) as this means there is no touch for it
|
||||||
if ((touchPositions[i].x > 0) && (touchPositions[i].y > 0))
|
if ((touchPositions[i].x > 0) && (touchPositions[i].y > 0))
|
||||||
|
@@ -1,14 +1,15 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib example - loading thread
|
* raylib [core] example - loading thread
|
||||||
*
|
*
|
||||||
* NOTE: This example requires linking with pthreads library,
|
* NOTE: This example requires linking with pthreads library on MinGW,
|
||||||
* on MinGW, it can be accomplished passing -static parameter to compiler
|
* it can be accomplished passing -static parameter to compiler
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -22,11 +23,14 @@
|
|||||||
|
|
||||||
// Using C11 atomics for synchronization
|
// Using C11 atomics for synchronization
|
||||||
// NOTE: A plain bool (or any plain data type for that matter) can't be used for inter-thread synchronization
|
// NOTE: A plain bool (or any plain data type for that matter) can't be used for inter-thread synchronization
|
||||||
static atomic_bool dataLoaded = ATOMIC_VAR_INIT(false); // Data Loaded completion indicator
|
static atomic_bool dataLoaded = false; // Data Loaded completion indicator
|
||||||
static void *LoadDataThread(void *arg); // Loading data thread function declaration
|
static void *LoadDataThread(void *arg); // Loading data thread function declaration
|
||||||
|
|
||||||
static int dataProgress = 0; // Data progress accumulator
|
static atomic_int dataProgress = 0; // Data progress accumulator
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -65,9 +69,13 @@ int main(void)
|
|||||||
case STATE_LOADING:
|
case STATE_LOADING:
|
||||||
{
|
{
|
||||||
framesCounter++;
|
framesCounter++;
|
||||||
if (atomic_load(&dataLoaded))
|
if (atomic_load_explicit(&dataLoaded, memory_order_relaxed))
|
||||||
{
|
{
|
||||||
framesCounter = 0;
|
framesCounter = 0;
|
||||||
|
int error = pthread_join(threadId, NULL);
|
||||||
|
if (error != 0) TraceLog(LOG_ERROR, "Error joining loading thread");
|
||||||
|
else TraceLog(LOG_INFO, "Loading thread terminated successfully");
|
||||||
|
|
||||||
state = STATE_FINISHED;
|
state = STATE_FINISHED;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
@@ -76,8 +84,8 @@ int main(void)
|
|||||||
if (IsKeyPressed(KEY_ENTER))
|
if (IsKeyPressed(KEY_ENTER))
|
||||||
{
|
{
|
||||||
// Reset everything to launch again
|
// Reset everything to launch again
|
||||||
atomic_store(&dataLoaded, false);
|
atomic_store_explicit(&dataLoaded, false, memory_order_relaxed);
|
||||||
dataProgress = 0;
|
atomic_store_explicit(&dataProgress, 0, memory_order_relaxed);
|
||||||
state = STATE_WAITING;
|
state = STATE_WAITING;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
@@ -96,7 +104,7 @@ int main(void)
|
|||||||
case STATE_WAITING: DrawText("PRESS ENTER to START LOADING DATA", 150, 170, 20, DARKGRAY); break;
|
case STATE_WAITING: DrawText("PRESS ENTER to START LOADING DATA", 150, 170, 20, DARKGRAY); break;
|
||||||
case STATE_LOADING:
|
case STATE_LOADING:
|
||||||
{
|
{
|
||||||
DrawRectangle(150, 200, dataProgress, 60, SKYBLUE);
|
DrawRectangle(150, 200, atomic_load_explicit(&dataProgress, memory_order_relaxed), 60, SKYBLUE);
|
||||||
if ((framesCounter/15)%2) DrawText("LOADING DATA...", 240, 210, 40, DARKBLUE);
|
if ((framesCounter/15)%2) DrawText("LOADING DATA...", 240, 210, 40, DARKBLUE);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
@@ -137,11 +145,11 @@ static void *LoadDataThread(void *arg)
|
|||||||
|
|
||||||
// We accumulate time over a global variable to be used in
|
// We accumulate time over a global variable to be used in
|
||||||
// main thread as a progress bar
|
// main thread as a progress bar
|
||||||
dataProgress = timeCounter/10;
|
atomic_store_explicit(&dataProgress, timeCounter/10, memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When data has finished loading, we set global variable
|
// When data has finished loading, we set global variable
|
||||||
atomic_store(&dataLoaded, true);
|
atomic_store_explicit(&dataLoaded, true, memory_order_relaxed);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -1,132 +0,0 @@
|
|||||||
/*******************************************************************************************
|
|
||||||
*
|
|
||||||
* raylib [core] example - quat conversions
|
|
||||||
*
|
|
||||||
* Generally you should really stick to eulers OR quats...
|
|
||||||
* This tests that various conversions are equivalent.
|
|
||||||
*
|
|
||||||
* This example has been created using raylib 3.5 (www.raylib.com)
|
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
|
||||||
* Example contributed by Chris Camacho (@chriscamacho) and reviewed by Ramon Santamaria (@raysan5)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2020-2021 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5)
|
|
||||||
*
|
|
||||||
********************************************************************************************/
|
|
||||||
|
|
||||||
#include "raylib.h"
|
|
||||||
|
|
||||||
#include "raymath.h"
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
// Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
const int screenWidth = 800;
|
|
||||||
const int screenHeight = 450;
|
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - quat conversions");
|
|
||||||
|
|
||||||
Camera3D camera = { 0 };
|
|
||||||
camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; // Camera position
|
|
||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
|
||||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
|
|
||||||
|
|
||||||
// Load a cylinder model for testing
|
|
||||||
Model model = LoadModelFromMesh(GenMeshCylinder(0.2f, 1.0f, 32));
|
|
||||||
|
|
||||||
// Generic quaternion for operations
|
|
||||||
Quaternion q1 = { 0 };
|
|
||||||
|
|
||||||
// Transform matrices required to draw 4 cylinders
|
|
||||||
Matrix m1 = { 0 };
|
|
||||||
Matrix m2 = { 0 };
|
|
||||||
Matrix m3 = { 0 };
|
|
||||||
Matrix m4 = { 0 };
|
|
||||||
|
|
||||||
// Generic vectors for rotations
|
|
||||||
Vector3 v1 = { 0 };
|
|
||||||
Vector3 v2 = { 0 };
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Main game loop
|
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
|
||||||
{
|
|
||||||
// Update
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
if (v2.x < 0) v2.x += PI*2;
|
|
||||||
if (v2.y < 0) v2.y += PI*2;
|
|
||||||
if (v2.z < 0) v2.z += PI*2;
|
|
||||||
|
|
||||||
if (!IsKeyDown(KEY_SPACE))
|
|
||||||
{
|
|
||||||
v1.x += 0.01f;
|
|
||||||
v1.y += 0.03f;
|
|
||||||
v1.z += 0.05f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v1.x > PI*2) v1.x -= PI*2;
|
|
||||||
if (v1.y > PI*2) v1.y -= PI*2;
|
|
||||||
if (v1.z > PI*2) v1.z -= PI*2;
|
|
||||||
|
|
||||||
q1 = QuaternionFromEuler(v1.x, v1.y, v1.z);
|
|
||||||
m1 = MatrixRotateZYX(v1);
|
|
||||||
m2 = QuaternionToMatrix(q1);
|
|
||||||
|
|
||||||
q1 = QuaternionFromMatrix(m1);
|
|
||||||
m3 = QuaternionToMatrix(q1);
|
|
||||||
|
|
||||||
v2 = QuaternionToEuler(q1); // Angles returned in radians
|
|
||||||
|
|
||||||
m4 = MatrixRotateZYX(v2);
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
BeginDrawing();
|
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
|
||||||
|
|
||||||
BeginMode3D(camera);
|
|
||||||
|
|
||||||
model.transform = m1;
|
|
||||||
DrawModel(model, (Vector3){ -1, 0, 0 }, 1.0f, RED);
|
|
||||||
|
|
||||||
model.transform = m2;
|
|
||||||
DrawModel(model, (Vector3){ 1, 0, 0 }, 1.0f, RED);
|
|
||||||
|
|
||||||
model.transform = m3;
|
|
||||||
DrawModel(model, (Vector3){ 0, 0, 0 }, 1.0f, RED);
|
|
||||||
|
|
||||||
model.transform = m4;
|
|
||||||
DrawModel(model, (Vector3){ 0, 0, -1 }, 1.0f, RED);
|
|
||||||
|
|
||||||
DrawGrid(10, 1.0f);
|
|
||||||
|
|
||||||
EndMode3D();
|
|
||||||
|
|
||||||
DrawText(TextFormat("%2.3f", v1.x), 20, 20, 20, (v1.x == v2.x)? GREEN: BLACK);
|
|
||||||
DrawText(TextFormat("%2.3f", v1.y), 20, 40, 20, (v1.y == v2.y)? GREEN: BLACK);
|
|
||||||
DrawText(TextFormat("%2.3f", v1.z), 20, 60, 20, (v1.z == v2.z)? GREEN: BLACK);
|
|
||||||
|
|
||||||
DrawText(TextFormat("%2.3f", v2.x), 200, 20, 20, (v1.x == v2.x)? GREEN: BLACK);
|
|
||||||
DrawText(TextFormat("%2.3f", v2.y), 200, 40, 20, (v1.y == v2.y)? GREEN: BLACK);
|
|
||||||
DrawText(TextFormat("%2.3f", v2.z), 200, 60, 20, (v1.z == v2.z)? GREEN: BLACK);
|
|
||||||
|
|
||||||
EndDrawing();
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
|
|
||||||
// De-Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
UnloadModel(model); // Unload model data (mesh and materials)
|
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 16 KiB |
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Generate random values
|
* raylib [core] example - Generate random values
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.1 (www.raylib.com)
|
* Example originally created with raylib 1.1, last time updated with raylib 1.1
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,17 +2,22 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Scissor test
|
* raylib [core] example - Scissor test
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Chris Dill (@MysteriousSpace) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Chris Dill (@MysteriousSpace) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 Chris Dill (@MysteriousSpace)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019-2023 Chris Dill (@MysteriousSpace)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,13 +2,15 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - smooth pixel-perfect camera
|
* raylib [core] example - smooth pixel-perfect camera
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.7 (www.raylib.com)
|
* Example originally created with raylib 3.7, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Giancamillo Alessandroni (@NotManyIdeasDev) and
|
* Example contributed by Giancamillo Alessandroni (@NotManyIdeasDev) and
|
||||||
* reviewed by Ramon Santamaria (@raysan5)
|
* reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021-2023 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -16,6 +18,9 @@
|
|||||||
|
|
||||||
#include <math.h> // Required for: sinf(), cosf()
|
#include <math.h> // Required for: sinf(), cosf()
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,18 +2,19 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - split screen
|
* raylib [core] example - split screen
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.7 (www.raylib.com)
|
* Example originally created with raylib 3.7, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Jeffery Myers (@JeffM2501)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021-2023 Jeffery Myers (@JeffM2501)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
Texture2D textureGrid = { 0 };
|
|
||||||
Camera cameraPlayer1 = { 0 };
|
Camera cameraPlayer1 = { 0 };
|
||||||
Camera cameraPlayer2 = { 0 };
|
Camera cameraPlayer2 = { 0 };
|
||||||
|
|
||||||
@@ -30,8 +31,8 @@ void DrawScene(void)
|
|||||||
{
|
{
|
||||||
for (float z = -count*spacing; z <= count*spacing; z += spacing)
|
for (float z = -count*spacing; z <= count*spacing; z += spacing)
|
||||||
{
|
{
|
||||||
DrawCubeTexture(textureGrid, (Vector3) { x, 1.5f, z }, 1, 1, 1, GREEN);
|
DrawCube((Vector3) { x, 1.5f, z }, 1, 1, 1, LIME);
|
||||||
DrawCubeTexture(textureGrid, (Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN);
|
DrawCube((Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +41,9 @@ void DrawScene(void)
|
|||||||
DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE);
|
DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -49,13 +53,6 @@ int main(void)
|
|||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - split screen");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - split screen");
|
||||||
|
|
||||||
// Generate a simple texture to use for trees
|
|
||||||
Image img = GenImageChecked(256, 256, 32, 32, DARKGRAY, WHITE);
|
|
||||||
textureGrid = LoadTextureFromImage(img);
|
|
||||||
UnloadImage(img);
|
|
||||||
SetTextureFilter(textureGrid, TEXTURE_FILTER_ANISOTROPIC_16X);
|
|
||||||
SetTextureWrap(textureGrid, TEXTURE_WRAP_CLAMP);
|
|
||||||
|
|
||||||
// Setup player 1 camera and screen
|
// Setup player 1 camera and screen
|
||||||
cameraPlayer1.fovy = 45.0f;
|
cameraPlayer1.fovy = 45.0f;
|
||||||
cameraPlayer1.up.y = 1.0f;
|
cameraPlayer1.up.y = 1.0f;
|
||||||
@@ -146,7 +143,6 @@ int main(void)
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadRenderTexture(screenPlayer1); // Unload render texture
|
UnloadRenderTexture(screenPlayer1); // Unload render texture
|
||||||
UnloadRenderTexture(screenPlayer2); // Unload render texture
|
UnloadRenderTexture(screenPlayer2); // Unload render texture
|
||||||
UnloadTexture(textureGrid); // Unload texture
|
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@@ -2,21 +2,34 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Storage save/load values
|
* raylib [core] example - Storage save/load values
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.4 (www.raylib.com)
|
* Example originally created with raylib 1.4, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include <stdlib.h> // Required for: calloc(), free()
|
||||||
|
|
||||||
|
#define STORAGE_DATA_FILE "storage.data" // Storage file
|
||||||
|
|
||||||
// NOTE: Storage positions must start with 0, directly related to file memory layout
|
// NOTE: Storage positions must start with 0, directly related to file memory layout
|
||||||
typedef enum {
|
typedef enum {
|
||||||
STORAGE_POSITION_SCORE = 0,
|
STORAGE_POSITION_SCORE = 0,
|
||||||
STORAGE_POSITION_HISCORE = 1
|
STORAGE_POSITION_HISCORE = 1
|
||||||
} StorageData;
|
} StorageData;
|
||||||
|
|
||||||
|
// Persistent storage functions
|
||||||
|
static bool SaveStorageValue(unsigned int position, int value);
|
||||||
|
static int LoadStorageValue(unsigned int position);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -85,3 +98,96 @@ int main(void)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save integer value to storage file (to defined position)
|
||||||
|
// NOTE: Storage positions is directly related to file memory layout (4 bytes each integer)
|
||||||
|
bool SaveStorageValue(unsigned int position, int value)
|
||||||
|
{
|
||||||
|
bool success = false;
|
||||||
|
unsigned int dataSize = 0;
|
||||||
|
unsigned int newDataSize = 0;
|
||||||
|
unsigned char *fileData = LoadFileData(STORAGE_DATA_FILE, &dataSize);
|
||||||
|
unsigned char *newFileData = NULL;
|
||||||
|
|
||||||
|
if (fileData != NULL)
|
||||||
|
{
|
||||||
|
if (dataSize <= (position*sizeof(int)))
|
||||||
|
{
|
||||||
|
// Increase data size up to position and store value
|
||||||
|
newDataSize = (position + 1)*sizeof(int);
|
||||||
|
newFileData = (unsigned char *)RL_REALLOC(fileData, newDataSize);
|
||||||
|
|
||||||
|
if (newFileData != NULL)
|
||||||
|
{
|
||||||
|
// RL_REALLOC succeded
|
||||||
|
int *dataPtr = (int *)newFileData;
|
||||||
|
dataPtr[position] = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// RL_REALLOC failed
|
||||||
|
TraceLog(LOG_WARNING, "FILEIO: [%s] Failed to realloc data (%u), position in bytes (%u) bigger than actual file size", STORAGE_DATA_FILE, dataSize, position*sizeof(int));
|
||||||
|
|
||||||
|
// We store the old size of the file
|
||||||
|
newFileData = fileData;
|
||||||
|
newDataSize = dataSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Store the old size of the file
|
||||||
|
newFileData = fileData;
|
||||||
|
newDataSize = dataSize;
|
||||||
|
|
||||||
|
// Replace value on selected position
|
||||||
|
int *dataPtr = (int *)newFileData;
|
||||||
|
dataPtr[position] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
success = SaveFileData(STORAGE_DATA_FILE, newFileData, newDataSize);
|
||||||
|
RL_FREE(newFileData);
|
||||||
|
|
||||||
|
TraceLog(LOG_INFO, "FILEIO: [%s] Saved storage value: %i", STORAGE_DATA_FILE, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TraceLog(LOG_INFO, "FILEIO: [%s] File created successfully", STORAGE_DATA_FILE);
|
||||||
|
|
||||||
|
dataSize = (position + 1)*sizeof(int);
|
||||||
|
fileData = (unsigned char *)RL_MALLOC(dataSize);
|
||||||
|
int *dataPtr = (int *)fileData;
|
||||||
|
dataPtr[position] = value;
|
||||||
|
|
||||||
|
success = SaveFileData(STORAGE_DATA_FILE, fileData, dataSize);
|
||||||
|
UnloadFileData(fileData);
|
||||||
|
|
||||||
|
TraceLog(LOG_INFO, "FILEIO: [%s] Saved storage value: %i", STORAGE_DATA_FILE, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load integer value from storage file (from defined position)
|
||||||
|
// NOTE: If requested position could not be found, value 0 is returned
|
||||||
|
int LoadStorageValue(unsigned int position)
|
||||||
|
{
|
||||||
|
int value = 0;
|
||||||
|
unsigned int dataSize = 0;
|
||||||
|
unsigned char *fileData = LoadFileData(STORAGE_DATA_FILE, &dataSize);
|
||||||
|
|
||||||
|
if (fileData != NULL)
|
||||||
|
{
|
||||||
|
if (dataSize < (position*4)) TraceLog(LOG_WARNING, "FILEIO: [%s] Failed to find storage position: %i", STORAGE_DATA_FILE, position);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int *dataPtr = (int *)fileData;
|
||||||
|
value = dataPtr[position];
|
||||||
|
}
|
||||||
|
|
||||||
|
UnloadFileData(fileData);
|
||||||
|
|
||||||
|
TraceLog(LOG_INFO, "FILEIO: [%s] Loaded storage value: %i", STORAGE_DATA_FILE, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
@@ -2,10 +2,12 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
|
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.7 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2017-2021 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -17,6 +19,9 @@
|
|||||||
#define GLSL_VERSION 100
|
#define GLSL_VERSION 100
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -78,7 +83,11 @@ int main(void)
|
|||||||
|
|
||||||
// Initialize framebuffer for stereo rendering
|
// Initialize framebuffer for stereo rendering
|
||||||
// NOTE: Screen size should match HMD aspect ratio
|
// NOTE: Screen size should match HMD aspect ratio
|
||||||
RenderTexture2D target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight());
|
RenderTexture2D target = LoadRenderTexture(device.hResolution, device.vResolution);
|
||||||
|
|
||||||
|
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
|
||||||
|
Rectangle sourceRec = { 0.0f, 0.0f, (float)target.texture.width, -(float)target.texture.height };
|
||||||
|
Rectangle destRec = { 0.0f, 0.0f, (float)GetScreenWidth(), (float)GetScreenHeight() };
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { 0 };
|
Camera camera = { 0 };
|
||||||
@@ -86,11 +95,11 @@ int main(void)
|
|||||||
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
|
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector
|
||||||
camera.fovy = 60.0f; // Camera field-of-view Y
|
camera.fovy = 60.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set first person camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(90); // Set our game to run at 90 frames-per-second
|
SetTargetFPS(90); // Set our game to run at 90 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -100,7 +109,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera (simulator mode)
|
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@@ -121,8 +130,7 @@ int main(void)
|
|||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
BeginShaderMode(distortion);
|
BeginShaderMode(distortion);
|
||||||
DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width,
|
DrawTexturePro(target.texture, sourceRec, destRec, (Vector2){ 0.0f, 0.0f }, 0.0f, WHITE);
|
||||||
(float)-target.texture.height }, (Vector2){ 0.0f, 0.0f }, WHITE);
|
|
||||||
EndShaderMode();
|
EndShaderMode();
|
||||||
DrawFPS(10, 10);
|
DrawFPS(10, 10);
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - window flags
|
* raylib [core] example - window flags
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.5 (www.raylib.com)
|
* Example originally created with raylib 3.5, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,32 +2,27 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - window scale letterbox (and virtual mouse)
|
* raylib [core] example - window scale letterbox (and virtual mouse)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Anata (@anatagawa) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Anata (@anatagawa) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 Anata (@anatagawa) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019-2023 Anata (@anatagawa) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
#define max(a, b) ((a)>(b)? (a) : (b))
|
#include "raymath.h" // Required for: Vector2Clamp()
|
||||||
#define min(a, b) ((a)<(b)? (a) : (b))
|
|
||||||
|
|
||||||
// Clamp Vector2 value with min and max and return a new vector2
|
#define MAX(a, b) ((a)>(b)? (a) : (b))
|
||||||
// NOTE: Required for virtual mouse, to clamp inside virtual game size
|
#define MIN(a, b) ((a)<(b)? (a) : (b))
|
||||||
Vector2 ClampValue(Vector2 value, Vector2 min, Vector2 max)
|
|
||||||
{
|
|
||||||
Vector2 result = value;
|
|
||||||
result.x = (result.x > max.x)? max.x : result.x;
|
|
||||||
result.x = (result.x < min.x)? min.x : result.x;
|
|
||||||
result.y = (result.y > max.y)? max.y : result.y;
|
|
||||||
result.y = (result.y < min.y)? min.y : result.y;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
const int windowWidth = 800;
|
const int windowWidth = 800;
|
||||||
@@ -57,7 +52,7 @@ int main(void)
|
|||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Compute required framebuffer scaling
|
// Compute required framebuffer scaling
|
||||||
float scale = min((float)GetScreenWidth()/gameScreenWidth, (float)GetScreenHeight()/gameScreenHeight);
|
float scale = MIN((float)GetScreenWidth()/gameScreenWidth, (float)GetScreenHeight()/gameScreenHeight);
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_SPACE))
|
if (IsKeyPressed(KEY_SPACE))
|
||||||
{
|
{
|
||||||
@@ -70,7 +65,7 @@ int main(void)
|
|||||||
Vector2 virtualMouse = { 0 };
|
Vector2 virtualMouse = { 0 };
|
||||||
virtualMouse.x = (mouse.x - (GetScreenWidth() - (gameScreenWidth*scale))*0.5f)/scale;
|
virtualMouse.x = (mouse.x - (GetScreenWidth() - (gameScreenWidth*scale))*0.5f)/scale;
|
||||||
virtualMouse.y = (mouse.y - (GetScreenHeight() - (gameScreenHeight*scale))*0.5f)/scale;
|
virtualMouse.y = (mouse.y - (GetScreenHeight() - (gameScreenHeight*scale))*0.5f)/scale;
|
||||||
virtualMouse = ClampValue(virtualMouse, (Vector2){ 0, 0 }, (Vector2){ (float)gameScreenWidth, (float)gameScreenHeight });
|
virtualMouse = Vector2Clamp(virtualMouse, (Vector2){ 0, 0 }, (Vector2){ (float)gameScreenWidth, (float)gameScreenHeight });
|
||||||
|
|
||||||
// Apply the same transformation as the virtual mouse to the real mouse (i.e. to work with raygui)
|
// Apply the same transformation as the virtual mouse to the real mouse (i.e. to work with raygui)
|
||||||
//SetMouseOffset(-(GetScreenWidth() - (gameScreenWidth*scale))*0.5f, -(GetScreenHeight() - (gameScreenHeight*scale))*0.5f);
|
//SetMouseOffset(-(GetScreenWidth() - (gameScreenWidth*scale))*0.5f, -(GetScreenHeight() - (gameScreenHeight*scale))*0.5f);
|
||||||
|
77
examples/core/core_window_should_close.c
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - Window should close
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - window should close");
|
||||||
|
|
||||||
|
SetExitKey(KEY_NULL); // Disable KEY_ESCAPE to close window, X-button still works
|
||||||
|
|
||||||
|
bool exitWindowRequested = false; // Flag to request window to exit
|
||||||
|
bool exitWindow = false; // Flag to set window to exit
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!exitWindow)
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Detect if X-button or KEY_ESCAPE have been pressed to close window
|
||||||
|
if (WindowShouldClose() || IsKeyPressed(KEY_ESCAPE)) exitWindowRequested = true;
|
||||||
|
|
||||||
|
if (exitWindowRequested)
|
||||||
|
{
|
||||||
|
// A request for close window has been issued, we can save data before closing
|
||||||
|
// or just show a message asking for confirmation
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_Y)) exitWindow = true;
|
||||||
|
else if (IsKeyPressed(KEY_N)) exitWindowRequested = false;
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
if (exitWindowRequested)
|
||||||
|
{
|
||||||
|
DrawRectangle(0, 100, screenWidth, 200, BLACK);
|
||||||
|
DrawText("Are you sure you want to exit program? [Y/N]", 40, 180, 30, WHITE);
|
||||||
|
}
|
||||||
|
else DrawText("Try to close the window to get confirmation message!", 120, 200, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
examples/core/core_window_should_close.png
Normal file
After Width: | Height: | Size: 15 KiB |
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - World to screen
|
* raylib [core] example - World to screen
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 1.4
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -18,20 +23,20 @@ int main(void)
|
|||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera free");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - core world screen");
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { 0 };
|
Camera camera = { 0 };
|
||||||
camera.position = (Vector3){ 10.0f, 10.0f, 10.0f };
|
camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; // Camera position
|
||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f;
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE;
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||||
Vector2 cubeScreenPosition = { 0.0f, 0.0f };
|
Vector2 cubeScreenPosition = { 0.0f, 0.0f };
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -41,7 +46,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_THIRD_PERSON);
|
||||||
|
|
||||||
// Calculate cube screen space position (with a little offset to be in top)
|
// Calculate cube screen space position (with a little offset to be in top)
|
||||||
cubeScreenPosition = GetWorldToScreen((Vector3){cubePosition.x, cubePosition.y + 2.5f, cubePosition.z}, camera);
|
cubeScreenPosition = GetWorldToScreen((Vector3){cubePosition.x, cubePosition.y + 2.5f, cubePosition.z}, camera);
|
||||||
@@ -63,7 +68,9 @@ int main(void)
|
|||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
DrawText("Enemy: 100 / 100", (int)cubeScreenPosition.x - MeasureText("Enemy: 100/100", 20)/2, (int)cubeScreenPosition.y, 20, BLACK);
|
DrawText("Enemy: 100 / 100", (int)cubeScreenPosition.x - MeasureText("Enemy: 100/100", 20)/2, (int)cubeScreenPosition.y, 20, BLACK);
|
||||||
DrawText("Text is always on top of the cube", (screenWidth - MeasureText("Text is always on top of the cube", 20))/2, 25, 20, GRAY);
|
|
||||||
|
DrawText(TextFormat("Cube position in screen space coordinates: [%i, %i]", (int)cubeScreenPosition.x, (int)cubeScreenPosition.y), 10, 10, 20, LIME);
|
||||||
|
DrawText("Text 2d should be always on top of the cube", 10, 40, 20, GRAY);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@@ -41,17 +41,22 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Basic window
|
* raylib [core] example - Basic window
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.8 (www.raylib.com)
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by <user_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by <user_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 <user_name> (@<user_github>)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2023 <user_name> (@<user_github>)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,26 +2,28 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Load 3d model with animations and play them
|
* raylib [models] example - Load 3d model with animations and play them
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Culacant (@culacant) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Culacant (@culacant) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 Culacant (@culacant) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019-2023 Culacant (@culacant) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************
|
********************************************************************************************
|
||||||
*
|
*
|
||||||
* To export a model from blender, make sure it is not posed, the vertices need to be in the
|
* NOTE: To export a model from blender, make sure it is not posed, the vertices need to be
|
||||||
* same position as they would be in edit mode.
|
* in the same position as they would be in edit mode and the scale of your models is
|
||||||
* and that the scale of your models is set to 0. Scaling can be done from the export menu.
|
* set to 0. Scaling can be done from the export menu.
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -50,8 +52,7 @@ int main(void)
|
|||||||
ModelAnimation *anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", &animsCount);
|
ModelAnimation *anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", &animsCount);
|
||||||
int animFrameCounter = 0;
|
int animFrameCounter = 0;
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set free camera mode
|
DisableCursor(); // Catch cursor
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera);
|
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
// Play animation when spacebar is held down
|
// Play animation when spacebar is held down
|
||||||
if (IsKeyDown(KEY_SPACE))
|
if (IsKeyDown(KEY_SPACE))
|
||||||
@@ -100,11 +101,7 @@ int main(void)
|
|||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadTexture(texture); // Unload texture
|
UnloadTexture(texture); // Unload texture
|
||||||
|
UnloadModelAnimations(anims, animsCount); // Unload model animations data
|
||||||
// Unload model animations data
|
|
||||||
for (unsigned int i = 0; i < animsCount; i++) UnloadModelAnimation(anims[i]);
|
|
||||||
RL_FREE(anims);
|
|
||||||
|
|
||||||
UnloadModel(model); // Unload model
|
UnloadModel(model); // Unload model
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
@@ -2,15 +2,21 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Drawing billboards
|
* raylib [models] example - Drawing billboards
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
#include "raymath.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -22,16 +28,32 @@ int main(void)
|
|||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { 0 };
|
Camera camera = { 0 };
|
||||||
camera.position = (Vector3){ 5.0f, 4.0f, 5.0f };
|
camera.position = (Vector3){ 5.0f, 4.0f, 5.0f }; // Camera position
|
||||||
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
|
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f;
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE;
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Texture2D bill = LoadTexture("resources/billboard.png"); // Our texture billboard
|
Texture2D bill = LoadTexture("resources/billboard.png"); // Our billboard texture
|
||||||
Vector3 billPosition = { 0.0f, 2.0f, 0.0f }; // Position where draw billboard
|
Vector3 billPositionStatic = { 0.0f, 2.0f, 0.0f }; // Position of static billboard
|
||||||
|
Vector3 billPositionRotating = { 1.0f, 2.0f, 1.0f }; // Position of rotating billboard
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
// Entire billboard texture, source is used to take a segment from a larger texture.
|
||||||
|
Rectangle source = { 0.0f, 0.0f, (float)bill.width, (float)bill.height };
|
||||||
|
|
||||||
|
// NOTE: Billboard locked on axis-Y
|
||||||
|
Vector3 billUp = { 0.0f, 1.0f, 0.0f };
|
||||||
|
|
||||||
|
// Rotate around origin
|
||||||
|
// Here we choose to rotate around the image center
|
||||||
|
// NOTE: (-1, 1) is the range where origin.x, origin.y is inside the texture
|
||||||
|
Vector2 rotateOrigin = { 0.0f };
|
||||||
|
|
||||||
|
// Distance is needed for the correct billboard draw order
|
||||||
|
// Larger distance (further away from the camera) should be drawn prior to smaller distance.
|
||||||
|
float distanceStatic;
|
||||||
|
float distanceRotating;
|
||||||
|
float rotation = 0.0f;
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -41,7 +63,11 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||||
|
|
||||||
|
rotation += 0.4f;
|
||||||
|
distanceStatic = Vector3Distance(camera.position, billPositionStatic);
|
||||||
|
distanceRotating = Vector3Distance(camera.position, billPositionRotating);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@@ -54,7 +80,17 @@ int main(void)
|
|||||||
|
|
||||||
DrawGrid(10, 1.0f); // Draw a grid
|
DrawGrid(10, 1.0f); // Draw a grid
|
||||||
|
|
||||||
DrawBillboard(camera, bill, billPosition, 2.0f, WHITE);
|
// Draw order matters!
|
||||||
|
if (distanceStatic > distanceRotating)
|
||||||
|
{
|
||||||
|
DrawBillboard(camera, bill, billPositionStatic, 2.0f, WHITE);
|
||||||
|
DrawBillboardPro(camera, bill, source, billPositionRotating, billUp, (Vector2) {1.0f, 1.0f}, rotateOrigin, rotation, WHITE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DrawBillboardPro(camera, bill, source, billPositionRotating, billUp, (Vector2) {1.0f, 1.0f}, rotateOrigin, rotation, WHITE);
|
||||||
|
DrawBillboard(camera, bill, billPositionStatic, 2.0f, WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Detect basic 3d collisions (box vs sphere vs box)
|
* raylib [models] example - Detect basic 3d collisions (box vs sphere vs box)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* Example originally created with raylib 1.3, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Cubicmap loading and drawing
|
* raylib [models] example - Cubicmap loading and drawing
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.8 (www.raylib.com)
|
* Example originally created with raylib 1.8, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -21,7 +26,12 @@ int main(void)
|
|||||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - cubesmap loading and drawing");
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - cubesmap loading and drawing");
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { { 16.0f, 14.0f, 16.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 };
|
Camera camera = { 0 };
|
||||||
|
camera.position = (Vector3){ 16.0f, 14.0f, 16.0f }; // Camera position
|
||||||
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
|
Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
|
||||||
Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM)
|
Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM)
|
||||||
@@ -37,8 +47,6 @@ int main(void)
|
|||||||
|
|
||||||
UnloadImage(image); // Unload cubesmap image from RAM, already uploaded to VRAM
|
UnloadImage(image); // Unload cubesmap image from RAM, already uploaded to VRAM
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -47,7 +55,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
245
examples/models/models_draw_cube_texture.c
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [models] example - Draw textured cube
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022-2023 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include "rlgl.h" // Required to define vertex data (immediate-mode style)
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Custom Functions Declaration
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured
|
||||||
|
void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - draw cube texture");
|
||||||
|
|
||||||
|
// Define the camera to look into our 3d world
|
||||||
|
Camera camera = { 0 };
|
||||||
|
camera.position = (Vector3){ 0.0f, 10.0f, 10.0f };
|
||||||
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
||||||
|
camera.fovy = 45.0f;
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE;
|
||||||
|
|
||||||
|
// Load texture to be applied to the cubes sides
|
||||||
|
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// TODO: Update your variables here
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
BeginMode3D(camera);
|
||||||
|
|
||||||
|
// Draw cube with an applied texture
|
||||||
|
DrawCubeTexture(texture, (Vector3){ -2.0f, 2.0f, 0.0f }, 2.0f, 4.0f, 2.0f, WHITE);
|
||||||
|
|
||||||
|
// Draw cube with an applied texture, but only a defined rectangle piece of the texture
|
||||||
|
DrawCubeTextureRec(texture, (Rectangle){ 0, texture.height/2, texture.width/2, texture.height/2 },
|
||||||
|
(Vector3){ 2.0f, 1.0f, 0.0f }, 2.0f, 2.0f, 2.0f, WHITE);
|
||||||
|
|
||||||
|
DrawGrid(10, 1.0f); // Draw a grid
|
||||||
|
|
||||||
|
EndMode3D();
|
||||||
|
|
||||||
|
DrawFPS(10, 10);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadTexture(texture); // Unload texture
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Custom Functions Definition
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Draw cube textured
|
||||||
|
// NOTE: Cube position is the center position
|
||||||
|
void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color)
|
||||||
|
{
|
||||||
|
float x = position.x;
|
||||||
|
float y = position.y;
|
||||||
|
float z = position.z;
|
||||||
|
|
||||||
|
// Set desired texture to be enabled while drawing following vertex data
|
||||||
|
rlSetTexture(texture.id);
|
||||||
|
|
||||||
|
// Vertex data transformation can be defined with the commented lines,
|
||||||
|
// but in this example we calculate the transformed vertex data directly when calling rlVertex3f()
|
||||||
|
//rlPushMatrix();
|
||||||
|
// NOTE: Transformation is applied in inverse order (scale -> rotate -> translate)
|
||||||
|
//rlTranslatef(2.0f, 0.0f, 0.0f);
|
||||||
|
//rlRotatef(45, 0, 1, 0);
|
||||||
|
//rlScalef(2.0f, 2.0f, 2.0f);
|
||||||
|
|
||||||
|
rlBegin(RL_QUADS);
|
||||||
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
// Front Face
|
||||||
|
rlNormal3f(0.0f, 0.0f, 1.0f); // Normal Pointing Towards Viewer
|
||||||
|
rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - width/2, y - height/2, z + length/2); // Bottom Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + width/2, y - height/2, z + length/2); // Bottom Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + width/2, y + height/2, z + length/2); // Top Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - width/2, y + height/2, z + length/2); // Top Left Of The Texture and Quad
|
||||||
|
// Back Face
|
||||||
|
rlNormal3f(0.0f, 0.0f, - 1.0f); // Normal Pointing Away From Viewer
|
||||||
|
rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - width/2, y - height/2, z - length/2); // Bottom Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - width/2, y + height/2, z - length/2); // Top Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + width/2, y + height/2, z - length/2); // Top Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + width/2, y - height/2, z - length/2); // Bottom Left Of The Texture and Quad
|
||||||
|
// Top Face
|
||||||
|
rlNormal3f(0.0f, 1.0f, 0.0f); // Normal Pointing Up
|
||||||
|
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - width/2, y + height/2, z - length/2); // Top Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - width/2, y + height/2, z + length/2); // Bottom Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + width/2, y + height/2, z + length/2); // Bottom Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + width/2, y + height/2, z - length/2); // Top Right Of The Texture and Quad
|
||||||
|
// Bottom Face
|
||||||
|
rlNormal3f(0.0f, - 1.0f, 0.0f); // Normal Pointing Down
|
||||||
|
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - width/2, y - height/2, z - length/2); // Top Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + width/2, y - height/2, z - length/2); // Top Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + width/2, y - height/2, z + length/2); // Bottom Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - width/2, y - height/2, z + length/2); // Bottom Right Of The Texture and Quad
|
||||||
|
// Right face
|
||||||
|
rlNormal3f(1.0f, 0.0f, 0.0f); // Normal Pointing Right
|
||||||
|
rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + width/2, y - height/2, z - length/2); // Bottom Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + width/2, y + height/2, z - length/2); // Top Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + width/2, y + height/2, z + length/2); // Top Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + width/2, y - height/2, z + length/2); // Bottom Left Of The Texture and Quad
|
||||||
|
// Left Face
|
||||||
|
rlNormal3f( - 1.0f, 0.0f, 0.0f); // Normal Pointing Left
|
||||||
|
rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - width/2, y - height/2, z - length/2); // Bottom Left Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - width/2, y - height/2, z + length/2); // Bottom Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - width/2, y + height/2, z + length/2); // Top Right Of The Texture and Quad
|
||||||
|
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - width/2, y + height/2, z - length/2); // Top Left Of The Texture and Quad
|
||||||
|
rlEnd();
|
||||||
|
//rlPopMatrix();
|
||||||
|
|
||||||
|
rlSetTexture(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw cube with texture piece applied to all faces
|
||||||
|
void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color)
|
||||||
|
{
|
||||||
|
float x = position.x;
|
||||||
|
float y = position.y;
|
||||||
|
float z = position.z;
|
||||||
|
float texWidth = (float)texture.width;
|
||||||
|
float texHeight = (float)texture.height;
|
||||||
|
|
||||||
|
// Set desired texture to be enabled while drawing following vertex data
|
||||||
|
rlSetTexture(texture.id);
|
||||||
|
|
||||||
|
// We calculate the normalized texture coordinates for the desired texture-source-rectangle
|
||||||
|
// It means converting from (tex.width, tex.height) coordinates to [0.0f, 1.0f] equivalent
|
||||||
|
rlBegin(RL_QUADS);
|
||||||
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
|
||||||
|
// Front face
|
||||||
|
rlNormal3f(0.0f, 0.0f, 1.0f);
|
||||||
|
rlTexCoord2f(source.x/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y - height/2, z + length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y - height/2, z + length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y + height/2, z + length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y + height/2, z + length/2);
|
||||||
|
|
||||||
|
// Back face
|
||||||
|
rlNormal3f(0.0f, 0.0f, - 1.0f);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y - height/2, z - length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y + height/2, z - length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y + height/2, z - length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y - height/2, z - length/2);
|
||||||
|
|
||||||
|
// Top face
|
||||||
|
rlNormal3f(0.0f, 1.0f, 0.0f);
|
||||||
|
rlTexCoord2f(source.x/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y + height/2, z - length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y + height/2, z + length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y + height/2, z + length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y + height/2, z - length/2);
|
||||||
|
|
||||||
|
// Bottom face
|
||||||
|
rlNormal3f(0.0f, - 1.0f, 0.0f);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y - height/2, z - length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y - height/2, z - length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y - height/2, z + length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y - height/2, z + length/2);
|
||||||
|
|
||||||
|
// Right face
|
||||||
|
rlNormal3f(1.0f, 0.0f, 0.0f);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y - height/2, z - length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y + height/2, z - length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y + height/2, z + length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x + width/2, y - height/2, z + length/2);
|
||||||
|
|
||||||
|
// Left face
|
||||||
|
rlNormal3f( - 1.0f, 0.0f, 0.0f);
|
||||||
|
rlTexCoord2f(source.x/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y - height/2, z - length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, (source.y + source.height)/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y - height/2, z + length/2);
|
||||||
|
rlTexCoord2f((source.x + source.width)/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y + height/2, z + length/2);
|
||||||
|
rlTexCoord2f(source.x/texWidth, source.y/texHeight);
|
||||||
|
rlVertex3f(x - width/2, y + height/2, z - length/2);
|
||||||
|
|
||||||
|
rlEnd();
|
||||||
|
|
||||||
|
rlSetTexture(0);
|
||||||
|
}
|
BIN
examples/models/models_draw_cube_texture.png
Normal file
After Width: | Height: | Size: 62 KiB |
@@ -2,10 +2,12 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - first person maze
|
* raylib [models] example - first person maze
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -13,6 +15,9 @@
|
|||||||
|
|
||||||
#include <stdlib.h> // Required for: free()
|
#include <stdlib.h> // Required for: free()
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -23,7 +28,13 @@ int main(void)
|
|||||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - first person maze");
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - first person maze");
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { { 0.2f, 0.4f, 0.2f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 };
|
Camera camera = { 0 };
|
||||||
|
camera.position = (Vector3){ 0.2f, 0.4f, 0.2f }; // Camera position
|
||||||
|
camera.target = (Vector3){ 0.185f, 0.4f, 0.0f }; // Camera looking at point
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
Image imMap = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
|
Image imMap = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
|
||||||
Texture2D cubicmap = LoadTextureFromImage(imMap); // Convert image to texture to display (VRAM)
|
Texture2D cubicmap = LoadTextureFromImage(imMap); // Convert image to texture to display (VRAM)
|
||||||
@@ -40,7 +51,7 @@ int main(void)
|
|||||||
|
|
||||||
Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position
|
Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -52,7 +63,7 @@ int main(void)
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
Vector3 oldCamPos = camera.position; // Store old camera position
|
Vector3 oldCamPos = camera.position; // Store old camera position
|
||||||
|
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
// Check player collision (we simplify to 2D collision detection)
|
// Check player collision (we simplify to 2D collision detection)
|
||||||
Vector2 playerPos = { camera.position.x, camera.position.z };
|
Vector2 playerPos = { camera.position.x, camera.position.z };
|
||||||
|
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Draw some basic geometric shapes (cube, sphere, cylinder...)
|
* raylib [models] example - Draw some basic geometric shapes (cube, sphere, cylinder...)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* Example originally created with raylib 1.0, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -61,6 +66,9 @@ int main(void)
|
|||||||
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD);
|
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD);
|
||||||
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK);
|
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK);
|
||||||
|
|
||||||
|
DrawCapsule ((Vector3){-3.0f, 1.5f, -4.0f}, (Vector3){-4.0f, -1.0f, -4.0f}, 1.2f, 8, 8, VIOLET);
|
||||||
|
DrawCapsuleWires((Vector3){-3.0f, 1.5f, -4.0f}, (Vector3){-4.0f, -1.0f, -4.0f}, 1.2f, 8, 8, PURPLE);
|
||||||
|
|
||||||
DrawGrid(10, 1.0f); // Draw a grid
|
DrawGrid(10, 1.0f); // Draw a grid
|
||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 22 KiB |
@@ -2,15 +2,20 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Heightmap loading and drawing
|
* raylib [models] example - Heightmap loading and drawing
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.8 (www.raylib.com)
|
* Example originally created with raylib 1.8, last time updated with raylib 3.5
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -21,7 +26,12 @@ int main(void)
|
|||||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - heightmap loading and drawing");
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - heightmap loading and drawing");
|
||||||
|
|
||||||
// Define our custom camera to look into our 3d world
|
// Define our custom camera to look into our 3d world
|
||||||
Camera camera = { { 18.0f, 18.0f, 18.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 };
|
Camera camera = { 0 };
|
||||||
|
camera.position = (Vector3){ 18.0f, 21.0f, 18.0f }; // Camera position
|
||||||
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
|
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
|
||||||
Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
|
Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
|
||||||
@@ -34,8 +44,6 @@ int main(void)
|
|||||||
|
|
||||||
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
|
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -44,7 +52,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Models loading
|
* raylib [models] example - Models loading
|
||||||
*
|
*
|
||||||
* raylib supports multiple models file formats:
|
* NOTE: raylib supports multiple models file formats:
|
||||||
*
|
*
|
||||||
* - OBJ > Text file format. Must include vertex position-texcoords-normals information,
|
* - OBJ > Text file format. Must include vertex position-texcoords-normals information,
|
||||||
* if files references some .mtl materials file, it will be loaded (or try to).
|
* if files references some .mtl materials file, it will be loaded (or try to).
|
||||||
@@ -12,16 +12,23 @@
|
|||||||
* raylib can load .iqm animations.
|
* raylib can load .iqm animations.
|
||||||
* - VOX > Binary file format. MagikaVoxel mesh format:
|
* - VOX > Binary file format. MagikaVoxel mesh format:
|
||||||
* https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt
|
* https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt
|
||||||
|
* - M3D > Binary file format. Model 3D format:
|
||||||
|
* https://bztsrc.gitlab.io/model3d
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 4.0 (www.raylib.com)
|
* Example originally created with raylib 2.0, last time updated with raylib 4.2
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2021 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -50,10 +57,10 @@ int main(void)
|
|||||||
// NOTE: bounds are calculated from the original size of the model,
|
// NOTE: bounds are calculated from the original size of the model,
|
||||||
// if model is scaled on drawing, bounds must be also scaled
|
// if model is scaled on drawing, bounds must be also scaled
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
|
||||||
|
|
||||||
bool selected = false; // Selected object flag
|
bool selected = false; // Selected object flag
|
||||||
|
|
||||||
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -62,40 +69,40 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera);
|
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
// Load new models/textures on drag&drop
|
// Load new models/textures on drag&drop
|
||||||
if (IsFileDropped())
|
if (IsFileDropped())
|
||||||
{
|
{
|
||||||
int count = 0;
|
FilePathList droppedFiles = LoadDroppedFiles();
|
||||||
char **droppedFiles = GetDroppedFiles(&count);
|
|
||||||
|
|
||||||
if (count == 1) // Only support one file dropped
|
if (droppedFiles.count == 1) // Only support one file dropped
|
||||||
{
|
{
|
||||||
if (IsFileExtension(droppedFiles[0], ".obj") ||
|
if (IsFileExtension(droppedFiles.paths[0], ".obj") ||
|
||||||
IsFileExtension(droppedFiles[0], ".gltf") ||
|
IsFileExtension(droppedFiles.paths[0], ".gltf") ||
|
||||||
IsFileExtension(droppedFiles[0], ".glb") ||
|
IsFileExtension(droppedFiles.paths[0], ".glb") ||
|
||||||
IsFileExtension(droppedFiles[0], ".vox") ||
|
IsFileExtension(droppedFiles.paths[0], ".vox") ||
|
||||||
IsFileExtension(droppedFiles[0], ".iqm")) // Model file formats supported
|
IsFileExtension(droppedFiles.paths[0], ".iqm") ||
|
||||||
|
IsFileExtension(droppedFiles.paths[0], ".m3d")) // Model file formats supported
|
||||||
{
|
{
|
||||||
UnloadModel(model); // Unload previous model
|
UnloadModel(model); // Unload previous model
|
||||||
model = LoadModel(droppedFiles[0]); // Load new model
|
model = LoadModel(droppedFiles.paths[0]); // Load new model
|
||||||
model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set current map diffuse texture
|
model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set current map diffuse texture
|
||||||
|
|
||||||
bounds = GetMeshBoundingBox(model.meshes[0]);
|
bounds = GetMeshBoundingBox(model.meshes[0]);
|
||||||
|
|
||||||
// TODO: Move camera position from target enough distance to visualize model properly
|
// TODO: Move camera position from target enough distance to visualize model properly
|
||||||
}
|
}
|
||||||
else if (IsFileExtension(droppedFiles[0], ".png")) // Texture file formats supported
|
else if (IsFileExtension(droppedFiles.paths[0], ".png")) // Texture file formats supported
|
||||||
{
|
{
|
||||||
// Unload current model texture and load new one
|
// Unload current model texture and load new one
|
||||||
UnloadTexture(texture);
|
UnloadTexture(texture);
|
||||||
texture = LoadTexture(droppedFiles[0]);
|
texture = LoadTexture(droppedFiles.paths[0]);
|
||||||
model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;
|
model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearDroppedFiles(); // Clear internal buffers
|
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select model on mouse click
|
// Select model on mouse click
|
||||||
|
@@ -1,25 +1,28 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [models] example - Load models gltf
|
* raylib [models] example - loading gltf with animations
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.5 (www.raylib.com)
|
* LIMITATIONS:
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
* - Only supports 1 armature per file, and skips loading it if there are multiple armatures
|
||||||
|
* - Only supports linear interpolation (default method in Blender when checked
|
||||||
|
* "Always Sample Animations" when exporting a GLTF file)
|
||||||
|
* - Only supports translation/rotation/scale animation channel.path,
|
||||||
|
* weights not considered (i.e. morph targets)
|
||||||
*
|
*
|
||||||
* NOTE: To export a model from Blender, make sure it is not posed, the vertices need to be
|
* Example originally created with raylib 3.7, last time updated with raylib 4.2
|
||||||
* in the same position as they would be in edit mode.
|
|
||||||
* Also make sure the scale parameter of your models is set to 0.0,
|
|
||||||
* scaling can be applied from the export menu.
|
|
||||||
*
|
*
|
||||||
* Example contributed by Hristo Stamenov (@object71) and reviewed by Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Hristo Stamenov (@object71) and Ramon Santamaria (@raysan5)
|
* Copyright (c) 2020-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
#define MAX_GLTF_MODELS 8
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -27,32 +30,28 @@ int main(void)
|
|||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - model");
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - loading gltf");
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { 0 };
|
Camera camera = { 0 };
|
||||||
camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; // Camera position
|
camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position
|
||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
// Load some models
|
// Load gltf model
|
||||||
Model model[MAX_GLTF_MODELS] = { 0 };
|
Model model = LoadModel("resources/models/gltf/robot.glb");
|
||||||
model[0] = LoadModel("resources/models/gltf/raylib_32x32.glb");
|
|
||||||
model[1] = LoadModel("resources/models/gltf/rigged_figure.glb");
|
|
||||||
model[2] = LoadModel("resources/models/gltf/GearboxAssy.glb");
|
|
||||||
model[3] = LoadModel("resources/models/gltf/BoxAnimated.glb");
|
|
||||||
model[4] = LoadModel("resources/models/gltf/AnimatedTriangle.gltf");
|
|
||||||
model[5] = LoadModel("resources/models/gltf/AnimatedMorphCube.glb");
|
|
||||||
model[6] = LoadModel("resources/models/gltf/vertex_colored_object.glb");
|
|
||||||
model[7] = LoadModel("resources/models/gltf/girl.glb");
|
|
||||||
|
|
||||||
int currentModel = 0;
|
// Load gltf model animations
|
||||||
|
unsigned int animsCount = 0;
|
||||||
|
unsigned int animIndex = 0;
|
||||||
|
unsigned int animCurrentFrame = 0;
|
||||||
|
ModelAnimation *modelAnimations = LoadModelAnimations("resources/models/gltf/robot.glb", &animsCount);
|
||||||
|
|
||||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set free camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -62,41 +61,39 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update our camera with inputs
|
UpdateCamera(&camera, CAMERA_THIRD_PERSON);
|
||||||
|
// Select current animation
|
||||||
|
if (IsKeyPressed(KEY_UP)) animIndex = (animIndex + 1)%animsCount;
|
||||||
|
else if (IsKeyPressed(KEY_DOWN)) animIndex = (animIndex + animsCount - 1)%animsCount;
|
||||||
|
|
||||||
if (IsKeyReleased(KEY_RIGHT))
|
// Update model animation
|
||||||
{
|
ModelAnimation anim = modelAnimations[animIndex];
|
||||||
currentModel++;
|
animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
|
||||||
if (currentModel == MAX_GLTF_MODELS) currentModel = 0;
|
UpdateModelAnimation(model, anim, animCurrentFrame);
|
||||||
}
|
|
||||||
|
|
||||||
if (IsKeyReleased(KEY_LEFT))
|
|
||||||
{
|
|
||||||
currentModel--;
|
|
||||||
if (currentModel < 0) currentModel = MAX_GLTF_MODELS - 1;
|
|
||||||
}
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
|
|
||||||
ClearBackground(SKYBLUE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
BeginMode3D(camera);
|
BeginMode3D(camera);
|
||||||
|
|
||||||
DrawModel(model[currentModel], position, 1.0f, WHITE);
|
DrawModel(model, position, 1.0f, WHITE); // Draw animated model
|
||||||
DrawGrid(10, 1.0f); // Draw a grid
|
DrawGrid(10, 1.0f);
|
||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
|
DrawText("Use the UP/DOWN arrow keys to switch animation", 10, 10, 20, GRAY);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
for (int i = 0; i < MAX_GLTF_MODELS; i++) UnloadModel(model[i]); // Unload models
|
UnloadModel(model); // Unload model and meshes/material
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 25 KiB |
173
examples/models/models_loading_m3d.c
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [models] example - Load models M3D
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
||||||
|
*
|
||||||
|
* Example contributed by bzt (@bztsrc) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
* NOTES:
|
||||||
|
* - Model3D (M3D) fileformat specs: https://gitlab.com/bztsrc/model3d
|
||||||
|
* - Bender M3D exported: https://gitlab.com/bztsrc/model3d/-/tree/master/blender
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022-2023 bzt (@bztsrc)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - M3D model loading");
|
||||||
|
|
||||||
|
// Define the camera to look into our 3d world
|
||||||
|
Camera camera = { 0 };
|
||||||
|
camera.position = (Vector3){ 1.5f, 1.5f, 1.5f }; // Camera position
|
||||||
|
camera.target = (Vector3){ 0.0f, 0.4f, 0.0f }; // Camera looking at point
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
|
char modelFileName[128] = "resources/models/m3d/cesium_man.m3d";
|
||||||
|
bool drawMesh = 1;
|
||||||
|
bool drawSkeleton = 1;
|
||||||
|
bool animPlaying = false; // Store anim state, what to draw
|
||||||
|
|
||||||
|
// Load model
|
||||||
|
Model model = LoadModel(modelFileName); // Load the bind-pose model mesh and basic data
|
||||||
|
|
||||||
|
// Load animations
|
||||||
|
unsigned int animsCount = 0;
|
||||||
|
int animFrameCounter = 0, animId = 0;
|
||||||
|
ModelAnimation *anims = LoadModelAnimations(modelFileName, &animsCount); // Load skeletal animation data
|
||||||
|
|
||||||
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
|
if (animsCount)
|
||||||
|
{
|
||||||
|
// Play animation when spacebar is held down (or step one frame with N)
|
||||||
|
if (IsKeyDown(KEY_SPACE) || IsKeyPressed(KEY_N))
|
||||||
|
{
|
||||||
|
animFrameCounter++;
|
||||||
|
|
||||||
|
if (animFrameCounter >= anims[animId].frameCount) animFrameCounter = 0;
|
||||||
|
|
||||||
|
UpdateModelAnimation(model, anims[animId], animFrameCounter);
|
||||||
|
animPlaying = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select animation by pressing A
|
||||||
|
if (IsKeyPressed(KEY_A))
|
||||||
|
{
|
||||||
|
animFrameCounter = 0;
|
||||||
|
animId++;
|
||||||
|
|
||||||
|
if (animId >= animsCount) animId = 0;
|
||||||
|
UpdateModelAnimation(model, anims[animId], 0);
|
||||||
|
animPlaying = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Toggle skeleton drawing
|
||||||
|
if (IsKeyPressed(KEY_S)) drawSkeleton ^= 1;
|
||||||
|
|
||||||
|
// Toggle mesh drawing
|
||||||
|
if (IsKeyPressed(KEY_M)) drawMesh ^= 1;
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
BeginMode3D(camera);
|
||||||
|
|
||||||
|
// Draw 3d model with texture
|
||||||
|
if (drawMesh) DrawModel(model, position, 1.0f, WHITE);
|
||||||
|
|
||||||
|
// Draw the animated skeleton
|
||||||
|
if (drawSkeleton)
|
||||||
|
{
|
||||||
|
// Loop to (boneCount - 1) because the last one is a special "no bone" bone,
|
||||||
|
// needed to workaround buggy models
|
||||||
|
// without a -1, we would always draw a cube at the origin
|
||||||
|
for (int i = 0; i < model.boneCount - 1; i++)
|
||||||
|
{
|
||||||
|
// By default the model is loaded in bind-pose by LoadModel().
|
||||||
|
// But if UpdateModelAnimation() has been called at least once
|
||||||
|
// then the model is already in animation pose, so we need the animated skeleton
|
||||||
|
if (!animPlaying || !animsCount)
|
||||||
|
{
|
||||||
|
// Display the bind-pose skeleton
|
||||||
|
DrawCube(model.bindPose[i].translation, 0.04f, 0.04f, 0.04f, RED);
|
||||||
|
|
||||||
|
if (model.bones[i].parent >= 0)
|
||||||
|
{
|
||||||
|
DrawLine3D(model.bindPose[i].translation,
|
||||||
|
model.bindPose[model.bones[i].parent].translation, RED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Display the frame-pose skeleton
|
||||||
|
DrawCube(anims[animId].framePoses[animFrameCounter][i].translation, 0.05f, 0.05f, 0.05f, RED);
|
||||||
|
|
||||||
|
if (anims[animId].bones[i].parent >= 0)
|
||||||
|
{
|
||||||
|
DrawLine3D(anims[animId].framePoses[animFrameCounter][i].translation,
|
||||||
|
anims[animId].framePoses[animFrameCounter][anims[animId].bones[i].parent].translation, RED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawGrid(10, 1.0f); // Draw a grid
|
||||||
|
|
||||||
|
EndMode3D();
|
||||||
|
|
||||||
|
DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, GetScreenHeight() - 60, 10, MAROON);
|
||||||
|
DrawText("PRESS A to CYCLE THROUGH ANIMATIONS", 10, GetScreenHeight() - 40, 10, DARKGRAY);
|
||||||
|
DrawText("PRESS M to toggle MESH, S to toggle SKELETON DRAWING", 10, GetScreenHeight() - 20, 10, DARKGRAY);
|
||||||
|
DrawText("(c) CesiumMan model by KhronosGroup", GetScreenWidth() - 210, GetScreenHeight() - 20, 10, GRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Unload model animations data
|
||||||
|
UnloadModelAnimations(anims, animsCount);
|
||||||
|
|
||||||
|
UnloadModel(model); // Unload model
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
examples/models/models_loading_m3d.png
Normal file
After Width: | Height: | Size: 23 KiB |
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Load models vox (MagicaVoxel)
|
* raylib [models] example - Load models vox (MagicaVoxel)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 4.0 (www.raylib.com)
|
* Example originally created with raylib 4.0, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Johann Nadalutti (@procfxgen) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Johann Nadalutti (@procfxgen) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Johann Nadalutti (@procfxgen) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021-2023 Johann Nadalutti (@procfxgen) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -17,6 +19,9 @@
|
|||||||
|
|
||||||
#define MAX_VOX_FILES 3
|
#define MAX_VOX_FILES 3
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -38,7 +43,7 @@ int main(void)
|
|||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
// Load MagicaVoxel files
|
// Load MagicaVoxel files
|
||||||
Model models[MAX_VOX_FILES] = { 0 };
|
Model models[MAX_VOX_FILES] = { 0 };
|
||||||
@@ -64,8 +69,6 @@ int main(void)
|
|||||||
|
|
||||||
int currentModel = 0;
|
int currentModel = 0;
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set a orbital camera mode
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -74,7 +77,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update our camera to orbit
|
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||||
|
|
||||||
// Cycle between models on mouse click
|
// Cycle between models on mouse click
|
||||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1)%MAX_VOX_FILES;
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1)%MAX_VOX_FILES;
|
||||||
|
@@ -2,10 +2,12 @@
|
|||||||
*
|
*
|
||||||
* raylib example - procedural mesh generation
|
* raylib example - procedural mesh generation
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.8 (www.raylib.com)
|
* Example originally created with raylib 1.8, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2017 Ramon Santamaria (Ray San)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -13,57 +15,11 @@
|
|||||||
|
|
||||||
#define NUM_MODELS 9 // Parametric 3d shapes to generate
|
#define NUM_MODELS 9 // Parametric 3d shapes to generate
|
||||||
|
|
||||||
void AllocateMeshData(Mesh* mesh, int triangleCount)
|
static Mesh GenMeshCustom(void); // Generate a simple triangle mesh from code
|
||||||
{
|
|
||||||
mesh->vertexCount = triangleCount * 3;
|
|
||||||
mesh->triangleCount = triangleCount;
|
|
||||||
|
|
||||||
mesh->vertices = (float*)MemAlloc(mesh->vertexCount * 3 * sizeof(float));
|
|
||||||
mesh->texcoords = (float*)MemAlloc(mesh->vertexCount * 2 * sizeof(float));
|
|
||||||
mesh->normals = (float*)MemAlloc(mesh->vertexCount * 3 * sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
// generate a simple triangle mesh from code
|
|
||||||
Mesh MakeMesh()
|
|
||||||
{
|
|
||||||
Mesh mesh = { 0 };
|
|
||||||
AllocateMeshData(&mesh, 1);
|
|
||||||
|
|
||||||
// vertex at the origin
|
|
||||||
mesh.vertices[0] = 0;
|
|
||||||
mesh.vertices[1] = 0;
|
|
||||||
mesh.vertices[2] = 0;
|
|
||||||
mesh.normals[0] = 0;
|
|
||||||
mesh.normals[1] = 1;
|
|
||||||
mesh.normals[2] = 0;
|
|
||||||
mesh.texcoords[0] = 0;
|
|
||||||
mesh.texcoords[1] = 0;
|
|
||||||
|
|
||||||
// vertex at 1,0,2
|
|
||||||
mesh.vertices[3] = 1;
|
|
||||||
mesh.vertices[4] = 0;
|
|
||||||
mesh.vertices[5] = 2;
|
|
||||||
mesh.normals[3] = 0;
|
|
||||||
mesh.normals[4] = 1;
|
|
||||||
mesh.normals[5] = 0;
|
|
||||||
mesh.texcoords[2] = 0.5f;
|
|
||||||
mesh.texcoords[3] = 1.0f;
|
|
||||||
|
|
||||||
// vertex at 2,0,0
|
|
||||||
mesh.vertices[6] = 2;
|
|
||||||
mesh.vertices[7] = 0;
|
|
||||||
mesh.vertices[8] = 0;
|
|
||||||
mesh.normals[6] = 0;
|
|
||||||
mesh.normals[7] = 1;
|
|
||||||
mesh.normals[8] = 0;
|
|
||||||
mesh.texcoords[4] = 1;
|
|
||||||
mesh.texcoords[5] =0;
|
|
||||||
|
|
||||||
UploadMesh(&mesh, false);
|
|
||||||
|
|
||||||
return mesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -88,7 +44,18 @@ int main(void)
|
|||||||
models[5] = LoadModelFromMesh(GenMeshTorus(0.25f, 4.0f, 16, 32));
|
models[5] = LoadModelFromMesh(GenMeshTorus(0.25f, 4.0f, 16, 32));
|
||||||
models[6] = LoadModelFromMesh(GenMeshKnot(1.0f, 2.0f, 16, 128));
|
models[6] = LoadModelFromMesh(GenMeshKnot(1.0f, 2.0f, 16, 128));
|
||||||
models[7] = LoadModelFromMesh(GenMeshPoly(5, 2.0f));
|
models[7] = LoadModelFromMesh(GenMeshPoly(5, 2.0f));
|
||||||
models[8] = LoadModelFromMesh(MakeMesh());
|
models[8] = LoadModelFromMesh(GenMeshCustom());
|
||||||
|
|
||||||
|
// Generated meshes could be exported as .obj files
|
||||||
|
//ExportMesh(models[0].meshes[0], "plane.obj");
|
||||||
|
//ExportMesh(models[1].meshes[0], "cube.obj");
|
||||||
|
//ExportMesh(models[2].meshes[0], "sphere.obj");
|
||||||
|
//ExportMesh(models[3].meshes[0], "hemisphere.obj");
|
||||||
|
//ExportMesh(models[4].meshes[0], "cylinder.obj");
|
||||||
|
//ExportMesh(models[5].meshes[0], "torus.obj");
|
||||||
|
//ExportMesh(models[6].meshes[0], "knot.obj");
|
||||||
|
//ExportMesh(models[7].meshes[0], "poly.obj");
|
||||||
|
//ExportMesh(models[8].meshes[0], "custom.obj");
|
||||||
|
|
||||||
// Set checked texture as default diffuse component for all models material
|
// Set checked texture as default diffuse component for all models material
|
||||||
for (int i = 0; i < NUM_MODELS; i++) models[i].materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;
|
for (int i = 0; i < NUM_MODELS; i++) models[i].materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;
|
||||||
@@ -101,8 +68,6 @@ int main(void)
|
|||||||
|
|
||||||
int currentModel = 0;
|
int currentModel = 0;
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set a orbital camera mode
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -111,7 +76,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update internal camera and our camera
|
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||||
|
|
||||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
||||||
{
|
{
|
||||||
@@ -157,7 +122,7 @@ int main(void)
|
|||||||
case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break;
|
case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break;
|
||||||
case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break;
|
case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break;
|
||||||
case 7: DrawText("POLY", 680, 10, 20, DARKBLUE); break;
|
case 7: DrawText("POLY", 680, 10, 20, DARKBLUE); break;
|
||||||
case 8: DrawText("Parametric(custom)", 580, 10, 20, DARKBLUE); break;
|
case 8: DrawText("Custom (triangle)", 580, 10, 20, DARKBLUE); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,3 +142,49 @@ int main(void)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate a simple triangle mesh from code
|
||||||
|
static Mesh GenMeshCustom(void)
|
||||||
|
{
|
||||||
|
Mesh mesh = { 0 };
|
||||||
|
mesh.triangleCount = 1;
|
||||||
|
mesh.vertexCount = mesh.triangleCount*3;
|
||||||
|
mesh.vertices = (float *)MemAlloc(mesh.vertexCount*3*sizeof(float)); // 3 vertices, 3 coordinates each (x, y, z)
|
||||||
|
mesh.texcoords = (float *)MemAlloc(mesh.vertexCount*2*sizeof(float)); // 3 vertices, 2 coordinates each (x, y)
|
||||||
|
mesh.normals = (float *)MemAlloc(mesh.vertexCount*3*sizeof(float)); // 3 vertices, 3 coordinates each (x, y, z)
|
||||||
|
|
||||||
|
// Vertex at (0, 0, 0)
|
||||||
|
mesh.vertices[0] = 0;
|
||||||
|
mesh.vertices[1] = 0;
|
||||||
|
mesh.vertices[2] = 0;
|
||||||
|
mesh.normals[0] = 0;
|
||||||
|
mesh.normals[1] = 1;
|
||||||
|
mesh.normals[2] = 0;
|
||||||
|
mesh.texcoords[0] = 0;
|
||||||
|
mesh.texcoords[1] = 0;
|
||||||
|
|
||||||
|
// Vertex at (1, 0, 2)
|
||||||
|
mesh.vertices[3] = 1;
|
||||||
|
mesh.vertices[4] = 0;
|
||||||
|
mesh.vertices[5] = 2;
|
||||||
|
mesh.normals[3] = 0;
|
||||||
|
mesh.normals[4] = 1;
|
||||||
|
mesh.normals[5] = 0;
|
||||||
|
mesh.texcoords[2] = 0.5f;
|
||||||
|
mesh.texcoords[3] = 1.0f;
|
||||||
|
|
||||||
|
// Vertex at (2, 0, 0)
|
||||||
|
mesh.vertices[6] = 2;
|
||||||
|
mesh.vertices[7] = 0;
|
||||||
|
mesh.vertices[8] = 0;
|
||||||
|
mesh.normals[6] = 0;
|
||||||
|
mesh.normals[7] = 1;
|
||||||
|
mesh.normals[8] = 0;
|
||||||
|
mesh.texcoords[4] = 1;
|
||||||
|
mesh.texcoords[5] =0;
|
||||||
|
|
||||||
|
// Upload mesh data from CPU (RAM) to GPU (VRAM) memory
|
||||||
|
UploadMesh(&mesh, false);
|
||||||
|
|
||||||
|
return mesh;
|
||||||
|
}
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Mesh picking in 3d mode, ground plane, triangle, mesh
|
* raylib [models] example - Mesh picking in 3d mode, ground plane, triangle, mesh
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.7 (www.raylib.com)
|
* Example originally created with raylib 1.7, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Joel Davis (@joeld42) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Joel Davis (@joeld42) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2017 Joel Davis (@joeld42) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017-2023 Joel Davis (@joeld42) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -16,6 +18,9 @@
|
|||||||
|
|
||||||
#define FLT_MAX 340282346638528859811704183484516925440.0f // Maximum value of a float, from bit pattern 01111111011111111111111111111111
|
#define FLT_MAX 340282346638528859811704183484516925440.0f // Maximum value of a float, from bit pattern 01111111011111111111111111111111
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -31,7 +36,7 @@ int main(void)
|
|||||||
camera.target = (Vector3){ 0.0f, 8.0f, 0.0f }; // Camera looking at point
|
camera.target = (Vector3){ 0.0f, 8.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target)
|
camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Ray ray = { 0 }; // Picking ray
|
Ray ray = { 0 }; // Picking ray
|
||||||
|
|
||||||
@@ -59,8 +64,6 @@ int main(void)
|
|||||||
Vector3 sp = (Vector3){ -30.0f, 5.0f, 5.0f };
|
Vector3 sp = (Vector3){ -30.0f, 5.0f, 5.0f };
|
||||||
float sr = 4.0f;
|
float sr = 4.0f;
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// Main game loop
|
// Main game loop
|
||||||
@@ -68,7 +71,14 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
if (IsCursorHidden()) UpdateCamera(&camera, CAMERA_FIRST_PERSON); // Update camera
|
||||||
|
|
||||||
|
// Toggle camera controls
|
||||||
|
if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT))
|
||||||
|
{
|
||||||
|
if (IsCursorHidden()) EnableCursor();
|
||||||
|
else DisableCursor();
|
||||||
|
}
|
||||||
|
|
||||||
// Display information about closest hit
|
// Display information about closest hit
|
||||||
RayCollision collision = { 0 };
|
RayCollision collision = { 0 };
|
||||||
@@ -121,9 +131,22 @@ int main(void)
|
|||||||
cursorColor = ORANGE;
|
cursorColor = ORANGE;
|
||||||
hitObjectName = "Box";
|
hitObjectName = "Box";
|
||||||
|
|
||||||
// Check ray collision against model
|
// Check ray collision against model meshes
|
||||||
// NOTE: It considers model.transform matrix!
|
RayCollision meshHitInfo = { 0 };
|
||||||
RayCollision meshHitInfo = GetRayCollisionModel(ray, tower);
|
for (int m = 0; m < tower.meshCount; m++)
|
||||||
|
{
|
||||||
|
// NOTE: We consider the model.transform for the collision check but
|
||||||
|
// it can be checked against any transform Matrix, used when checking against same
|
||||||
|
// model drawn multiple times with multiple transforms
|
||||||
|
meshHitInfo = GetRayCollisionMesh(ray, tower.meshes[m], tower.transform);
|
||||||
|
if (meshHitInfo.hit)
|
||||||
|
{
|
||||||
|
// Save the closest hit mesh
|
||||||
|
if ((!collision.hit) || (collision.distance > meshHitInfo.distance)) collision = meshHitInfo;
|
||||||
|
|
||||||
|
break; // Stop once one mesh collision is detected, the colliding mesh is m
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (meshHitInfo.hit)
|
if (meshHitInfo.hit)
|
||||||
{
|
{
|
||||||
@@ -201,7 +224,7 @@ int main(void)
|
|||||||
DrawText(TextFormat("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
|
DrawText(TextFormat("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY);
|
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, GRAY);
|
||||||
|
|
||||||
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
|
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
|
||||||
|
|
||||||
|
@@ -2,14 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Show the difference between perspective and orthographic projection
|
* raylib [models] example - Show the difference between perspective and orthographic projection
|
||||||
*
|
*
|
||||||
* This program is heavily based on the geometric objects example
|
* Example originally created with raylib 2.0, last time updated with raylib 3.7
|
||||||
*
|
|
||||||
* This example has been created using raylib 2.0 (www.raylib.com)
|
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Example contributed by Max Danielsson (@autious) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Max Danielsson (@autious) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018 Max Danielsson (@autious) and Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2018-2023 Max Danielsson (@autious) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -18,6 +18,9 @@
|
|||||||
#define FOVY_PERSPECTIVE 45.0f
|
#define FOVY_PERSPECTIVE 45.0f
|
||||||
#define WIDTH_ORTHOGRAPHIC 10.0f
|
#define WIDTH_ORTHOGRAPHIC 10.0f
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - rlgl module usage with push/pop matrix transformations
|
* raylib [models] example - rlgl module usage with push/pop matrix transformations
|
||||||
*
|
*
|
||||||
* This example uses [rlgl] module funtionality (pseudo-OpenGL 1.1 style coding)
|
* NOTE: This example uses [rlgl] module functionality (pseudo-OpenGL 1.1 style coding)
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 2.5 (www.raylib.com)
|
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2018-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -41,13 +43,11 @@ int main(void)
|
|||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { 0 };
|
Camera camera = { 0 };
|
||||||
camera.position = (Vector3){ 16.0f, 16.0f, 16.0f };
|
camera.position = (Vector3){ 16.0f, 16.0f, 16.0f }; // Camera position
|
||||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
|
||||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
camera.fovy = 45.0f;
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
camera.projection = CAMERA_PERSPECTIVE;
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FREE);
|
|
||||||
|
|
||||||
float rotationSpeed = 0.2f; // General system rotation speed
|
float rotationSpeed = 0.2f; // General system rotation speed
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera);
|
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||||
|
|
||||||
earthRotation += (5.0f*rotationSpeed);
|
earthRotation += (5.0f*rotationSpeed);
|
||||||
earthOrbitRotation += (365/360.0f*(5.0f*rotationSpeed)*rotationSpeed);
|
earthOrbitRotation += (365/360.0f*(5.0f*rotationSpeed)*rotationSpeed);
|
||||||
|
@@ -2,10 +2,12 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Skybox loading and drawing
|
* raylib [models] example - Skybox loading and drawing
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 3.5 (www.raylib.com)
|
* Example originally created with raylib 1.8, last time updated with raylib 4.0
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2017-2020 Ramon Santamaria (@raysan5)
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017-2023 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@@ -23,6 +25,9 @@
|
|||||||
// Generate cubemap (6 faces) from equirectangular (panorama) texture
|
// Generate cubemap (6 faces) from equirectangular (panorama) texture
|
||||||
static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format);
|
static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -33,7 +38,12 @@ int main(void)
|
|||||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - skybox loading and drawing");
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - skybox loading and drawing");
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera = { { 1.0f, 1.0f, 1.0f }, { 4.0f, 1.0f, 4.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 };
|
Camera camera = { 0 };
|
||||||
|
camera.position = (Vector3){ 1.0f, 1.0f, 1.0f }; // Camera position
|
||||||
|
camera.target = (Vector3){ 4.0f, 1.0f, 4.0f }; // Camera looking at point
|
||||||
|
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||||
|
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
// Load skybox model
|
// Load skybox model
|
||||||
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
|
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
|
||||||
@@ -82,7 +92,7 @@ int main(void)
|
|||||||
UnloadImage(img);
|
UnloadImage(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -92,23 +102,22 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera); // Update camera
|
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
// Load new cubemap texture on drag&drop
|
// Load new cubemap texture on drag&drop
|
||||||
if (IsFileDropped())
|
if (IsFileDropped())
|
||||||
{
|
{
|
||||||
int count = 0;
|
FilePathList droppedFiles = LoadDroppedFiles();
|
||||||
char **droppedFiles = GetDroppedFiles(&count);
|
|
||||||
|
|
||||||
if (count == 1) // Only support one file dropped
|
if (droppedFiles.count == 1) // Only support one file dropped
|
||||||
{
|
{
|
||||||
if (IsFileExtension(droppedFiles[0], ".png;.jpg;.hdr;.bmp;.tga"))
|
if (IsFileExtension(droppedFiles.paths[0], ".png;.jpg;.hdr;.bmp;.tga"))
|
||||||
{
|
{
|
||||||
// Unload current cubemap texture and load new one
|
// Unload current cubemap texture and load new one
|
||||||
UnloadTexture(skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture);
|
UnloadTexture(skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture);
|
||||||
if (useHDR)
|
if (useHDR)
|
||||||
{
|
{
|
||||||
Texture2D panorama = LoadTexture(droppedFiles[0]);
|
Texture2D panorama = LoadTexture(droppedFiles.paths[0]);
|
||||||
|
|
||||||
// Generate cubemap from panorama texture
|
// Generate cubemap from panorama texture
|
||||||
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8);
|
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8);
|
||||||
@@ -116,16 +125,16 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Image img = LoadImage(droppedFiles[0]);
|
Image img = LoadImage(droppedFiles.paths[0]);
|
||||||
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT);
|
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT);
|
||||||
UnloadImage(img);
|
UnloadImage(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextCopy(skyboxFileName, droppedFiles[0]);
|
TextCopy(skyboxFileName, droppedFiles.paths[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearDroppedFiles(); // Clear internal buffers
|
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|