Compare commits
975 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
910b4b5d53 | ||
![]() |
95b39e5345 | ||
![]() |
9f8a2e4612 | ||
![]() |
413d059fd8 | ||
![]() |
afb841b7dd | ||
![]() |
c068de183b | ||
![]() |
949ed3f9f8 | ||
![]() |
9b24120cd9 | ||
![]() |
d033c87d27 | ||
![]() |
f1acd4a065 | ||
![]() |
e01a1ba10c | ||
![]() |
1a37f09b02 | ||
![]() |
4a4fffe439 | ||
![]() |
a083d4726f | ||
![]() |
aec6c0350a | ||
![]() |
9f50c6e611 | ||
![]() |
b4a68d2c87 | ||
![]() |
636a2acc95 | ||
![]() |
ad174def77 | ||
![]() |
2800b2a19a | ||
![]() |
b6b01f5420 | ||
![]() |
1e2d3d93fe | ||
![]() |
bc981a0628 | ||
![]() |
34ce1048d0 | ||
![]() |
33aef15555 | ||
![]() |
9819614276 | ||
![]() |
0780cd4e6a | ||
![]() |
a5bfd7db22 | ||
![]() |
e563ebe240 | ||
![]() |
f8a4498a24 | ||
![]() |
65e6a6db53 | ||
![]() |
c9d6b7e356 | ||
![]() |
aba25e9ba3 | ||
![]() |
b3b828c8bb | ||
![]() |
dd7b64a536 | ||
![]() |
4ca229ed7f | ||
![]() |
a8f142e736 | ||
![]() |
6a48e7376b | ||
![]() |
4a31ce4bd2 | ||
![]() |
87a3970222 | ||
![]() |
5f09c71f98 | ||
![]() |
2a2bee8964 | ||
![]() |
31b598cbc6 | ||
![]() |
fb0f2fd181 | ||
![]() |
01e65664dd | ||
![]() |
32e5e20734 | ||
![]() |
026f9829e5 | ||
![]() |
a63ad0fec4 | ||
![]() |
edb9e4159d | ||
![]() |
1ed3d3285f | ||
![]() |
42ad00b7c2 | ||
![]() |
fd5c36fc32 | ||
![]() |
3d6c1f3f4f | ||
![]() |
518bdfc134 | ||
![]() |
35fe34ba0f | ||
![]() |
27bccdbd50 | ||
![]() |
3ec2365103 | ||
![]() |
76062247f8 | ||
![]() |
93e2fd8ea1 | ||
![]() |
16842233c9 | ||
![]() |
0880be638e | ||
![]() |
7f6b16add4 | ||
![]() |
bac50fbba5 | ||
![]() |
321027a242 | ||
![]() |
0ca874c710 | ||
![]() |
4c27412eff | ||
![]() |
f05d6dfc3c | ||
![]() |
8ccb558996 | ||
![]() |
fd1fe3ac14 | ||
![]() |
35c6aff21f | ||
![]() |
50c887cb0a | ||
![]() |
822c2ddad5 | ||
![]() |
83aba22e49 | ||
![]() |
a522914183 | ||
![]() |
3861bc80f2 | ||
![]() |
39732d04ec | ||
![]() |
0ebd8b0f6e | ||
![]() |
3bdf367711 | ||
![]() |
70a7c65668 | ||
![]() |
18b31f6792 | ||
![]() |
9c66d961d0 | ||
![]() |
2d5c8e61b1 | ||
![]() |
73774aadd6 | ||
![]() |
a64e909e55 | ||
![]() |
c4500901eb | ||
![]() |
33069cddc5 | ||
![]() |
e197665e1d | ||
![]() |
db0cfa935f | ||
![]() |
d593bd0081 | ||
![]() |
2d6213af60 | ||
![]() |
86f2d4b9f9 | ||
![]() |
66320582a3 | ||
![]() |
c785d84d30 | ||
![]() |
be40d97954 | ||
![]() |
71fe3c0b08 | ||
![]() |
9a515ae9db | ||
![]() |
b4f4b179c2 | ||
![]() |
0b869948c6 | ||
![]() |
332f3b4f9d | ||
![]() |
3c99093aed | ||
![]() |
f2656871e9 | ||
![]() |
7bcae59477 | ||
![]() |
3a1e6ab0b6 | ||
![]() |
9b072dc346 | ||
![]() |
cfec2b40a4 | ||
![]() |
247da006ae | ||
![]() |
b0f8ea27e3 | ||
![]() |
5620e73914 | ||
![]() |
ec22577e5a | ||
![]() |
e38a7fcede | ||
![]() |
e7f0d0eef1 | ||
![]() |
ecfe31bf1d | ||
![]() |
8d3750e36d | ||
![]() |
1df7a8b4a6 | ||
![]() |
517a7e3466 | ||
![]() |
0ed82150f0 | ||
![]() |
61ce160023 | ||
![]() |
bc1bfe54d6 | ||
![]() |
35172430c6 | ||
![]() |
a5c8ce2a34 | ||
![]() |
99c226b344 | ||
![]() |
be4d530ebe | ||
![]() |
4b8a0268ed | ||
![]() |
881f134f4d | ||
![]() |
3e082f1d62 | ||
![]() |
b4d28cc7a1 | ||
![]() |
c67cffea38 | ||
![]() |
8849a4c752 | ||
![]() |
f5894278b7 | ||
![]() |
7e65c300b6 | ||
![]() |
9956344215 | ||
![]() |
843731e048 | ||
![]() |
4315b82ea7 | ||
![]() |
82c54449bf | ||
![]() |
774b120335 | ||
![]() |
1bba1242f4 | ||
![]() |
677c5cc9a8 | ||
![]() |
f7bebf9861 | ||
![]() |
8374460c39 | ||
![]() |
20d205cae5 | ||
![]() |
5fd83708cf | ||
![]() |
17b3f5e02e | ||
![]() |
d2d4b17633 | ||
![]() |
ca338b3318 | ||
![]() |
29067e19d9 | ||
![]() |
74255b6eb2 | ||
![]() |
795c6b465c | ||
![]() |
eb7212fe42 | ||
![]() |
82577ededc | ||
![]() |
4b7ea25603 | ||
![]() |
0c2a58cf96 | ||
![]() |
54f070a0f4 | ||
![]() |
c47b04a2c6 | ||
![]() |
fdf8501e81 | ||
![]() |
99affa0caf | ||
![]() |
407746193d | ||
![]() |
1f56e8e5d0 | ||
![]() |
dd4dd0e87d | ||
![]() |
5a230659ef | ||
![]() |
c3b8a41f95 | ||
![]() |
50bc77ed96 | ||
![]() |
256bc6e1dc | ||
![]() |
e6ed85e993 | ||
![]() |
0a33fbf8bb | ||
![]() |
9724443c5b | ||
![]() |
0d06c946f2 | ||
![]() |
954a24545f | ||
![]() |
44de97ea16 | ||
![]() |
f65bd8e4a0 | ||
![]() |
4889f240fe | ||
![]() |
080a79f0b0 | ||
![]() |
2f65975c5e | ||
![]() |
b5dd18a70c | ||
![]() |
5338bbf70d | ||
![]() |
90b36bd274 | ||
![]() |
b7a8a40e71 | ||
![]() |
160408f269 | ||
![]() |
72b90bff0f | ||
![]() |
efc4b2941b | ||
![]() |
0c16af01e5 | ||
![]() |
5387b45431 | ||
![]() |
b2f0c7ca8b | ||
![]() |
3f0c296422 | ||
![]() |
ff44cb02e7 | ||
![]() |
9eaff6902f | ||
![]() |
f1bb245999 | ||
![]() |
e23c120c8b | ||
![]() |
9875198a56 | ||
![]() |
6ba5217c28 | ||
![]() |
314e1e0fd5 | ||
![]() |
c87006f85a | ||
![]() |
004117a05c | ||
![]() |
2ac7b684b5 | ||
![]() |
974a6d4031 | ||
![]() |
ae0b776eaf | ||
![]() |
59652c75b4 | ||
![]() |
7b42492941 | ||
![]() |
8278eebfac | ||
![]() |
3f3ee5e37f | ||
![]() |
fee5e8cfac | ||
![]() |
46c2f2058f | ||
![]() |
8f5ff64420 | ||
![]() |
ca8c565617 | ||
![]() |
5d1f661661 | ||
![]() |
3813722f17 | ||
![]() |
63c65f8cc5 | ||
![]() |
2c0604aa29 | ||
![]() |
023a08aeb9 | ||
![]() |
7154b42f48 | ||
![]() |
7c888edba1 | ||
![]() |
4ec65c0d25 | ||
![]() |
81897e7771 | ||
![]() |
b898a161f7 | ||
![]() |
6d1519c132 | ||
![]() |
cb29b1d2ac | ||
![]() |
6e683d57e8 | ||
![]() |
c964559bc9 | ||
![]() |
cb463a37ef | ||
![]() |
f88a943418 | ||
![]() |
9261c3b8dc | ||
![]() |
b734802743 | ||
![]() |
59038bae96 | ||
![]() |
c05701253e | ||
![]() |
aaf9c648d3 | ||
![]() |
d1c9afd1d8 | ||
![]() |
47e3fbfc12 | ||
![]() |
b347c35ef4 | ||
![]() |
bb7b9adb37 | ||
![]() |
b16f118452 | ||
![]() |
203d1a154e | ||
![]() |
9cfaa81a7e | ||
![]() |
9cda98b4e9 | ||
![]() |
de103ecc5e | ||
![]() |
2ac956208d | ||
![]() |
c46989a1d9 | ||
![]() |
bbdbc098dc | ||
![]() |
d8c19be047 | ||
![]() |
e54c8ecdf8 | ||
![]() |
34e791376d | ||
![]() |
05cff44d0a | ||
![]() |
1c364cc507 | ||
![]() |
177af272f0 | ||
![]() |
4cb3e4a240 | ||
![]() |
05f039f85f | ||
![]() |
afcd748fdf | ||
![]() |
b4988777ef | ||
![]() |
f8d94aeba5 | ||
![]() |
42d5e3bd24 | ||
![]() |
836c1636a2 | ||
![]() |
9492901133 | ||
![]() |
1f6eb1fc61 | ||
![]() |
f2f05a734d | ||
![]() |
ac6b4d3830 | ||
![]() |
734776b923 | ||
![]() |
7bf6a712cc | ||
![]() |
c4bd214cf0 | ||
![]() |
1a879ba08e | ||
![]() |
a08117155d | ||
![]() |
495108a2e9 | ||
![]() |
30bb24aa6e | ||
![]() |
c85dfd4bc6 | ||
![]() |
b681e8c277 | ||
![]() |
37a64df7b9 | ||
![]() |
7b5f61ddf7 | ||
![]() |
a1527f5620 | ||
![]() |
3c3a9318ff | ||
![]() |
d8edcafe5a | ||
![]() |
ff7108389b | ||
![]() |
8a549c3fbe | ||
![]() |
825eab37e2 | ||
![]() |
762d2580cd | ||
![]() |
f164ec80d6 | ||
![]() |
7586031410 | ||
![]() |
7cd24d2706 | ||
![]() |
3b120bd7d9 | ||
![]() |
fc7d4cef18 | ||
![]() |
46f95a730a | ||
![]() |
6d6659205c | ||
![]() |
53457e4664 | ||
![]() |
e5a2def57f | ||
![]() |
61f6b0f707 | ||
![]() |
4a158d972d | ||
![]() |
4ea8494f3e | ||
![]() |
07a2c00e84 | ||
![]() |
1ca445a9b9 | ||
![]() |
fbda9c4180 | ||
![]() |
9b334dcd25 | ||
![]() |
21181f8167 | ||
![]() |
d4f5c4e133 | ||
![]() |
658c280669 | ||
![]() |
0369bb4c8c | ||
![]() |
d5d391faaf | ||
![]() |
81388363fa | ||
![]() |
037da8879a | ||
![]() |
674ee2cf75 | ||
![]() |
202f45415c | ||
![]() |
bf3a213e44 | ||
![]() |
e7464d5fc3 | ||
![]() |
3c91dc099d | ||
![]() |
5da815234c | ||
![]() |
a27be5f2a9 | ||
![]() |
14cdd7fbff | ||
![]() |
852f3d4fd0 | ||
![]() |
6d6c542a1d | ||
![]() |
d8bf84f118 | ||
![]() |
5de597579f | ||
![]() |
4419ee9802 | ||
![]() |
aaea2eb9a6 | ||
![]() |
1aa775eca8 | ||
![]() |
b2d4cd66a7 | ||
![]() |
c394708c43 | ||
![]() |
5df10d824c | ||
![]() |
060d501cd1 | ||
![]() |
4a9b77dd70 | ||
![]() |
814507906f | ||
![]() |
673ea62b27 | ||
![]() |
06b8727d70 | ||
![]() |
d5c0f9d386 | ||
![]() |
377dcb025f | ||
![]() |
ab9f5d5780 | ||
![]() |
f5d792e551 | ||
![]() |
d91ad4e2aa | ||
![]() |
177c58d23a | ||
![]() |
b9310f7d3a | ||
![]() |
46ce30a2eb | ||
![]() |
44e21d84cd | ||
![]() |
17f09cb034 | ||
![]() |
a81dfabf86 | ||
![]() |
784aa1b6b5 | ||
![]() |
fda91436b5 | ||
![]() |
05f68c22d5 | ||
![]() |
0925f4ec4d | ||
![]() |
b8481369f7 | ||
![]() |
f1bcfc1352 | ||
![]() |
d1c9c34b2f | ||
![]() |
e8630c78d0 | ||
![]() |
d0fca7e02b | ||
![]() |
aa9353feb4 | ||
![]() |
0716125ee9 | ||
![]() |
918fc002d0 | ||
![]() |
bdbb1eb901 | ||
![]() |
481ce3d39d | ||
![]() |
85c400c006 | ||
![]() |
f0626324ab | ||
![]() |
6fa5dec16d | ||
![]() |
0603e59cae | ||
![]() |
6b072e696d | ||
![]() |
f7b706263a | ||
![]() |
c7f0350182 | ||
![]() |
b0d5a7a372 | ||
![]() |
bee283b12b | ||
![]() |
e23e73d9b2 | ||
![]() |
6f3186eacc | ||
![]() |
f18c8cea16 | ||
![]() |
41e49c5a6e | ||
![]() |
5d46c27cd5 | ||
![]() |
6d1b712a96 | ||
![]() |
9d3ad52160 | ||
![]() |
4123233f78 | ||
![]() |
a3d71dd58d | ||
![]() |
2b50440a77 | ||
![]() |
9fb6eda5f1 | ||
![]() |
38df2cad25 | ||
![]() |
4245237892 | ||
![]() |
773b0b6bc0 | ||
![]() |
66d22acfb3 | ||
![]() |
aa945055fa | ||
![]() |
ca96122a7b | ||
![]() |
ed4fdfdaf8 | ||
![]() |
3be81b01d7 | ||
![]() |
f2d61d4d43 | ||
![]() |
f16f39e8aa | ||
![]() |
80f6b2f963 | ||
![]() |
64f67f6e9f | ||
![]() |
6d3b11ef91 | ||
![]() |
3393fda384 | ||
![]() |
673dcf9436 | ||
![]() |
cc917fbac6 | ||
![]() |
16101ce3d8 | ||
![]() |
836d3341a5 | ||
![]() |
988d39029f | ||
![]() |
43fd9ffe08 | ||
![]() |
02842a3e2f | ||
![]() |
4ff98f34bb | ||
![]() |
5c80f65082 | ||
![]() |
137057f499 | ||
![]() |
6d34adbd60 | ||
![]() |
1142d4edae | ||
![]() |
b8ce680511 | ||
![]() |
0ce7f0c409 | ||
![]() |
d5e0f4e84e | ||
![]() |
8f60996b64 | ||
![]() |
a9315fc422 | ||
![]() |
1c05017548 | ||
![]() |
9e285d8dc3 | ||
![]() |
98d7a10c08 | ||
![]() |
4a3ed6d73c | ||
![]() |
b3bc4b21d1 | ||
![]() |
76a67a149e | ||
![]() |
97e3277d58 | ||
![]() |
648676f46b | ||
![]() |
5fecf5c088 | ||
![]() |
c384b375df | ||
![]() |
b1651baea5 | ||
![]() |
4c791100cc | ||
![]() |
5af1b4a7c9 | ||
![]() |
3396743aba | ||
![]() |
efa286a550 | ||
![]() |
b4a3f294bf | ||
![]() |
2a158c4795 | ||
![]() |
db6538859c | ||
![]() |
b082807b0b | ||
![]() |
637d3195ec | ||
![]() |
2ae9ce29eb | ||
![]() |
978c49472a | ||
![]() |
753b549aa5 | ||
![]() |
87fc7254e7 | ||
![]() |
65d4eb5e82 | ||
![]() |
4a65b19f0f | ||
![]() |
1ffe713d93 | ||
![]() |
478d3cbb79 | ||
![]() |
c5bf9623d1 | ||
![]() |
79c8eb543e | ||
![]() |
9923fe51a7 | ||
![]() |
7f0880a735 | ||
![]() |
173f199313 | ||
![]() |
94142ecce5 | ||
![]() |
0c58c1198f | ||
![]() |
1e55c30824 | ||
![]() |
8b35de3276 | ||
![]() |
10280c4b91 | ||
![]() |
36f20376e6 | ||
![]() |
9d66bc4a05 | ||
![]() |
a9ab516dae | ||
![]() |
d27709b1f2 | ||
![]() |
384602e5b5 | ||
![]() |
d0cf19e035 | ||
![]() |
be97583f00 | ||
![]() |
7dbb17792a | ||
![]() |
4770e2010d | ||
![]() |
5d88eb1d95 | ||
![]() |
f1c3f2870b | ||
![]() |
2a9b8d7a39 | ||
![]() |
1d71e1b754 | ||
![]() |
959a228815 | ||
![]() |
342b89c5b9 | ||
![]() |
852813bdf1 | ||
![]() |
1ffc4c7825 | ||
![]() |
bd26b66c27 | ||
![]() |
3377a4485b | ||
![]() |
c98b7eecd8 | ||
![]() |
6e20037f7d | ||
![]() |
29f14186c1 | ||
![]() |
289e04a62a | ||
![]() |
a1b6b217e4 | ||
![]() |
eb9072a2f1 | ||
![]() |
cc2b3228d1 | ||
![]() |
caecb1c1eb | ||
![]() |
7e36727328 | ||
![]() |
ed387d00aa | ||
![]() |
7fbd821727 | ||
![]() |
f69f930b51 | ||
![]() |
cae209816c | ||
![]() |
2c079d7c6e | ||
![]() |
46248b0922 | ||
![]() |
47b6e62744 | ||
![]() |
6f27941e28 | ||
![]() |
1950085893 | ||
![]() |
306945fe14 | ||
![]() |
16ac468bdb | ||
![]() |
58c762baa3 | ||
![]() |
865b216ebe | ||
![]() |
82a0fae678 | ||
![]() |
7f9513fbf4 | ||
![]() |
cfe47cc854 | ||
![]() |
4960e6b6d7 | ||
![]() |
3b80e2c1e0 | ||
![]() |
d5f5f0a930 | ||
![]() |
ae70540a96 | ||
![]() |
00c7e54d3c | ||
![]() |
5f1b4e9474 | ||
![]() |
5da66e7ec8 | ||
![]() |
3d519c7a39 | ||
![]() |
80789e6140 | ||
![]() |
055d501345 | ||
![]() |
70ec517fda | ||
![]() |
5c30e079f4 | ||
![]() |
735968e685 | ||
![]() |
d3d9aaceb1 | ||
![]() |
8c0bd30fcb | ||
![]() |
50ccc39d6b | ||
![]() |
68d647c1af | ||
![]() |
58d2f70b7e | ||
![]() |
36cf1f7dfd | ||
![]() |
2dc5f580a6 | ||
![]() |
02c456432d | ||
![]() |
a61b832c4a | ||
![]() |
13ebc745fe | ||
![]() |
8f7cb6fb19 | ||
![]() |
a008d49230 | ||
![]() |
a422e39492 | ||
![]() |
07a375e2d6 | ||
![]() |
6d68c78989 | ||
![]() |
9e8232d750 | ||
![]() |
c604b53f78 | ||
![]() |
020601092e | ||
![]() |
a94b553aff | ||
![]() |
4facc03a64 | ||
![]() |
53056f3e7e | ||
![]() |
fbf0362943 | ||
![]() |
7fa1f2ffde | ||
![]() |
ab5d1df7cb | ||
![]() |
7921d85dc8 | ||
![]() |
32a671b9da | ||
![]() |
ab0d19f356 | ||
![]() |
c482f37dfd | ||
![]() |
c12737ae38 | ||
![]() |
3140496a12 | ||
![]() |
61558ab83f | ||
![]() |
76c9e9883d | ||
![]() |
5139948ef9 | ||
![]() |
3e1321ac24 | ||
![]() |
13e18c23ed | ||
![]() |
af46222b12 | ||
![]() |
eaec086177 | ||
![]() |
bec58075ff | ||
![]() |
0e6b249260 | ||
![]() |
5ff9811ea8 | ||
![]() |
6c2dc5574f | ||
![]() |
ce1c4055f7 | ||
![]() |
de865a9b55 | ||
![]() |
697e1d4941 | ||
![]() |
7a09043cba | ||
![]() |
f5f3b4e095 | ||
![]() |
40fbe9da81 | ||
![]() |
ebfb1978b8 | ||
![]() |
8328353204 | ||
![]() |
13c56887f1 | ||
![]() |
2272a4722f | ||
![]() |
94a5fc5c2c | ||
![]() |
a36cc7075a | ||
![]() |
f1f51bd9b6 | ||
![]() |
1eafa7020d | ||
![]() |
55b9a2479a | ||
![]() |
52cb0d709a | ||
![]() |
d38fb9bda2 | ||
![]() |
6efaa78058 | ||
![]() |
e62c30c8b1 | ||
![]() |
0ba349bdf2 | ||
![]() |
35bda8980f | ||
![]() |
cac378bd95 | ||
![]() |
be551d7707 | ||
![]() |
bfb5ffedda | ||
![]() |
a05150392a | ||
![]() |
6f335d2c9e | ||
![]() |
f685acd69e | ||
![]() |
dbec22f2df | ||
![]() |
4ef3acfa41 | ||
![]() |
0fbd48a889 | ||
![]() |
b7b51569e2 | ||
![]() |
55491fdb36 | ||
![]() |
a2794379a0 | ||
![]() |
fc19e24eba | ||
![]() |
da71c3d801 | ||
![]() |
e815e205da | ||
![]() |
eb58a0596d | ||
![]() |
7959ccd84d | ||
![]() |
338bb3fd9c | ||
![]() |
11172118d1 | ||
![]() |
9d6d68f00a | ||
![]() |
31b64d4689 | ||
![]() |
3876f19d6a | ||
![]() |
22672bc738 | ||
![]() |
56ec22f5c9 | ||
![]() |
84d1b19f61 | ||
![]() |
24c267d324 | ||
![]() |
d587cc0e36 | ||
![]() |
1733125873 | ||
![]() |
884e13ac2f | ||
![]() |
bcc2b17701 | ||
![]() |
3922bc27cd | ||
![]() |
7cefbd8a94 | ||
![]() |
e2a3a52ad6 | ||
![]() |
8fd4507847 | ||
![]() |
9fea631bfb | ||
![]() |
09cc27ca7a | ||
![]() |
bc80174357 | ||
![]() |
1aecd5be07 | ||
![]() |
2ff2096b36 | ||
![]() |
3fb1c446ea | ||
![]() |
8bdd03eeac | ||
![]() |
2f9abe6e13 | ||
![]() |
ee72654b55 | ||
![]() |
164ead03c9 | ||
![]() |
f88c95ce2d | ||
![]() |
308fcbb96c | ||
![]() |
be61d2f8c1 | ||
![]() |
6fbf6a1c23 | ||
![]() |
5a4eb34c39 | ||
![]() |
c4922c9e88 | ||
![]() |
e977915577 | ||
![]() |
572936ec65 | ||
![]() |
a8bed54586 | ||
![]() |
4b444e7cc3 | ||
![]() |
9127b5a57d | ||
![]() |
8652e644dd | ||
![]() |
4ff85c2ac2 | ||
![]() |
6981e2bffa | ||
![]() |
8fb84d9e63 | ||
![]() |
71ab202295 | ||
![]() |
369b8532c0 | ||
![]() |
f9f33926f7 | ||
![]() |
9ee96bea95 | ||
![]() |
5f7ac64c44 | ||
![]() |
b358402cb3 | ||
![]() |
a522b6e23b | ||
![]() |
03d9583b94 | ||
![]() |
e913de58c7 | ||
![]() |
afe033412b | ||
![]() |
c28a5fbd62 | ||
![]() |
6062201e8f | ||
![]() |
b01f5ff6a7 | ||
![]() |
24c9b1f717 | ||
![]() |
9fdf4420d5 | ||
![]() |
4df7a0f2f8 | ||
![]() |
3468af213f | ||
![]() |
d5d1305bc0 | ||
![]() |
1b0996fb0b | ||
![]() |
1879a8129e | ||
![]() |
4e84ded7ef | ||
![]() |
1a8fbe5cf0 | ||
![]() |
5a1cbb2842 | ||
![]() |
54537e8f0b | ||
![]() |
c9c1263e6f | ||
![]() |
d1a5374ac4 | ||
![]() |
c914010606 | ||
![]() |
56bd9da07c | ||
![]() |
d60dc7c2eb | ||
![]() |
97fc266ad4 | ||
![]() |
3ce0228206 | ||
![]() |
0d0f306fc2 | ||
![]() |
c25b4cdc69 | ||
![]() |
3a5fc0c320 | ||
![]() |
3d6be7fd80 | ||
![]() |
47afda2549 | ||
![]() |
6a2bbae521 | ||
![]() |
5625c11e99 | ||
![]() |
16609d6702 | ||
![]() |
8d2de09f3d | ||
![]() |
4dae3385c3 | ||
![]() |
66ec0b5d82 | ||
![]() |
7999bbafa8 | ||
![]() |
4c43a40788 | ||
![]() |
c10c49e44f | ||
![]() |
1a60f376a4 | ||
![]() |
27ba7de1e4 | ||
![]() |
68a02e567d | ||
![]() |
c46c0fc652 | ||
![]() |
3884716948 | ||
![]() |
8de1427803 | ||
![]() |
bab08f1c89 | ||
![]() |
d63e32a377 | ||
![]() |
52b88e0991 | ||
![]() |
3e8427799c | ||
![]() |
2963782992 | ||
![]() |
77f599885d | ||
![]() |
7b07b68bfd | ||
![]() |
fb90477354 | ||
![]() |
cbda329bfd | ||
![]() |
5d186639c9 | ||
![]() |
e2cfc6b838 | ||
![]() |
3c1be60c66 | ||
![]() |
5f4449f0a1 | ||
![]() |
558ec3891b | ||
![]() |
dcbfb83031 | ||
![]() |
3524fc414b | ||
![]() |
420b85da98 | ||
![]() |
28c2759ae1 | ||
![]() |
374e3e7e11 | ||
![]() |
904ef0d4be | ||
![]() |
99ee26b001 | ||
![]() |
ee049641ba | ||
![]() |
4f47f90336 | ||
![]() |
2d90cc59b6 | ||
![]() |
5576dea00b | ||
![]() |
8323f81ab5 | ||
![]() |
f5f5ce0d33 | ||
![]() |
88f4747437 | ||
![]() |
b79ede4edb | ||
![]() |
70a96fff80 | ||
![]() |
7bf2854e94 | ||
![]() |
f0d8c009ae | ||
![]() |
0ae486f07c | ||
![]() |
79a6235811 | ||
![]() |
c99fc5108e | ||
![]() |
09fa002818 | ||
![]() |
ee795150fa | ||
![]() |
f97f39987c | ||
![]() |
5631f822bd | ||
![]() |
ca13c2ed0c | ||
![]() |
058af472ea | ||
![]() |
3d5a408177 | ||
![]() |
9281e477eb | ||
![]() |
76536fe24b | ||
![]() |
1bcf500eca | ||
![]() |
522af9f477 | ||
![]() |
1c98e6b698 | ||
![]() |
4dada32693 | ||
![]() |
34aea08ba2 | ||
![]() |
6b2823775e | ||
![]() |
d999b3ed53 | ||
![]() |
5f5d191d88 | ||
![]() |
dd468e9ef9 | ||
![]() |
302d84cedc | ||
![]() |
ad8a5a95b2 | ||
![]() |
29d505c98e | ||
![]() |
688045307a | ||
![]() |
72eb2632cc | ||
![]() |
e3b2485453 | ||
![]() |
60232810d8 | ||
![]() |
d1133ca8d3 | ||
![]() |
13bef7aa02 | ||
![]() |
b574e105dd | ||
![]() |
4dfffff19b | ||
![]() |
9417b9969d | ||
![]() |
46a7822eee | ||
![]() |
501ef80bed | ||
![]() |
7ca6397223 | ||
![]() |
e2173922f0 | ||
![]() |
96fa716525 | ||
![]() |
4bc339ea4e | ||
![]() |
0bc71d84f8 | ||
![]() |
2168d8aa1a | ||
![]() |
cafc66a3c1 | ||
![]() |
4c9d0f16a5 | ||
![]() |
80b3c4cd2b | ||
![]() |
5bcddca5e1 | ||
![]() |
c286bea8e1 | ||
![]() |
4fb3103dfa | ||
![]() |
cf6d2e3985 | ||
![]() |
7447b3e1da | ||
![]() |
cf2975d062 | ||
![]() |
af1eb5453a | ||
![]() |
05f8e83ba9 | ||
![]() |
21a01ec870 | ||
![]() |
ae6adb173b | ||
![]() |
90e1ed2b5e | ||
![]() |
17878550b1 | ||
![]() |
7afa0b09ab | ||
![]() |
0a27525a4b | ||
![]() |
3e88156817 | ||
![]() |
897179a06c | ||
![]() |
8f91ed81c5 | ||
![]() |
d17a0cee1a | ||
![]() |
302ec438dd | ||
![]() |
cac2a66deb | ||
![]() |
78b4494e2b | ||
![]() |
caa7bc366b | ||
![]() |
6ad8323860 | ||
![]() |
9f2fc81df2 | ||
![]() |
8a4e28f81d | ||
![]() |
4b93349db5 | ||
![]() |
11cf455fe0 | ||
![]() |
b0a0c5d431 | ||
![]() |
f2d61d4043 | ||
![]() |
0ff26f527f | ||
![]() |
5c32cf2095 | ||
![]() |
64f6c74c9a | ||
![]() |
2e26ce235d | ||
![]() |
ae2d0d4cd8 | ||
![]() |
26833f5aae | ||
![]() |
ea5b00528b | ||
![]() |
e4e315bbfc | ||
![]() |
27df983ee0 | ||
![]() |
5a041a6af5 | ||
![]() |
3d6696f6c9 | ||
![]() |
d53b6f4381 | ||
![]() |
48374c85dd | ||
![]() |
f74791ed7b | ||
![]() |
f232f34981 | ||
![]() |
9811a37690 | ||
![]() |
dcd6942ed1 | ||
![]() |
c320a21f2b | ||
![]() |
80eb4f3f50 | ||
![]() |
30941c0dd1 | ||
![]() |
cf71e1242e | ||
![]() |
0da7c499b6 | ||
![]() |
0b65b44a78 | ||
![]() |
46e7a26770 | ||
![]() |
c9ac176fa7 | ||
![]() |
c0983f3400 | ||
![]() |
30c8058fca | ||
![]() |
c60cc9ee18 | ||
![]() |
6dac1efefe | ||
![]() |
8b3603cd48 | ||
![]() |
3fa6fdacf2 | ||
![]() |
90c62c4cc0 | ||
![]() |
4f1bee3165 | ||
![]() |
dcf5f45f68 | ||
![]() |
af890cf210 | ||
![]() |
c9e30f7754 | ||
![]() |
03cc031d00 | ||
![]() |
7d1d9ff143 | ||
![]() |
bdb450fccb | ||
![]() |
179f2f9e4f | ||
![]() |
41c5f3a017 | ||
![]() |
847944e240 | ||
![]() |
b10425492a | ||
![]() |
8bbbe8cd76 | ||
![]() |
037edbaa13 | ||
![]() |
bc08271da3 | ||
![]() |
cd7f25830b | ||
![]() |
706755d146 | ||
![]() |
0e29aa2951 | ||
![]() |
d84f922372 | ||
![]() |
76ff4d220e | ||
![]() |
86fbf4fd8f | ||
![]() |
d38d7a1bed | ||
![]() |
8c5d403dda | ||
![]() |
f575935ace | ||
![]() |
ea4b5552c2 | ||
![]() |
b46a800597 | ||
![]() |
b62bbb78ed | ||
![]() |
5107a2dc40 | ||
![]() |
ded07690fd | ||
![]() |
83dbc07650 | ||
![]() |
e060944b34 | ||
![]() |
075f51e0a3 | ||
![]() |
f0ada8c40d | ||
![]() |
9737c58054 | ||
![]() |
529d20ee6a | ||
![]() |
ad3d270c42 | ||
![]() |
454b422fd6 | ||
![]() |
4d78d27bd9 | ||
![]() |
6db44500b7 | ||
![]() |
6acfda599e | ||
![]() |
5c112ff542 | ||
![]() |
aee5d9a390 | ||
![]() |
1ddf594d15 | ||
![]() |
9799856ad4 | ||
![]() |
b7f8e97b03 | ||
![]() |
ac44db26a2 | ||
![]() |
c85cd29049 | ||
![]() |
3d0208223a | ||
![]() |
dc4d5dabcd | ||
![]() |
f7d4951165 | ||
![]() |
0bcb873cbb | ||
![]() |
29761c2519 | ||
![]() |
eeb151586f | ||
![]() |
7ab008878a | ||
![]() |
ec72a8868e | ||
![]() |
ba60918eaa | ||
![]() |
e660700924 | ||
![]() |
fd67e31f63 | ||
![]() |
8301980ba8 | ||
![]() |
5f73850fa6 | ||
![]() |
e94acf86f8 | ||
![]() |
d6feeb14ff | ||
![]() |
9d09ada33b | ||
![]() |
c3208c5cd6 | ||
![]() |
4636e3367c | ||
![]() |
f2152aa391 | ||
![]() |
2646ed0393 | ||
![]() |
9ef0240e99 | ||
![]() |
790bc72806 | ||
![]() |
289a53221d | ||
![]() |
a2a3d3aeb6 | ||
![]() |
17732fa9c4 | ||
![]() |
fa98289ddb | ||
![]() |
0e6d1cb272 | ||
![]() |
cc39b4660a | ||
![]() |
fa3112b40e | ||
![]() |
6ca1fd59a9 | ||
![]() |
1fb874cdc5 | ||
![]() |
34e5fcf47e | ||
![]() |
a1038f61b6 | ||
![]() |
5f1e8b8278 | ||
![]() |
91f1f324c0 | ||
![]() |
eb36c351cf | ||
![]() |
f707c1ca46 | ||
![]() |
299ae7a4bd | ||
![]() |
3104d3d6cd | ||
![]() |
04d9deac92 | ||
![]() |
f12754b01f | ||
![]() |
f9bbce0da7 | ||
![]() |
62087d21cc | ||
![]() |
89a84a621b | ||
![]() |
1c370f5a17 | ||
![]() |
cb05c51911 | ||
![]() |
ec2cbaa5eb | ||
![]() |
173529e048 | ||
![]() |
9639b14e1b | ||
![]() |
17eefed08f | ||
![]() |
2e5d898443 | ||
![]() |
6b5e18e6bf | ||
![]() |
0da88ac5c5 | ||
![]() |
c8a30b262d | ||
![]() |
284eaf1576 | ||
![]() |
c1e49d2b13 | ||
![]() |
cde2c1aa6d | ||
![]() |
aa22d97983 | ||
![]() |
4b51248372 | ||
![]() |
1d545449bb | ||
![]() |
78b502b0bf | ||
![]() |
3b67a4cfba | ||
![]() |
1a2a44200a | ||
![]() |
9361615786 | ||
![]() |
0133917bf9 | ||
![]() |
b6cec214bd | ||
![]() |
a66c8531d6 | ||
![]() |
37cc45a0a8 | ||
![]() |
a04a7b6ea5 | ||
![]() |
f2f4079411 | ||
![]() |
565b1089bd | ||
![]() |
06a8d7eb06 | ||
![]() |
108055cd62 | ||
![]() |
66b096d978 | ||
![]() |
1136d4222f | ||
![]() |
136408d8b8 | ||
![]() |
ee9bf76ae9 | ||
![]() |
a3f16c8459 | ||
![]() |
956a6e6f77 | ||
![]() |
8b7ca8b670 | ||
![]() |
35ee4e52c8 | ||
![]() |
ea7afc8ec8 | ||
![]() |
db3dd9d200 | ||
![]() |
60223a358b | ||
![]() |
c453ac8265 | ||
![]() |
269b120104 | ||
![]() |
584e74c676 | ||
![]() |
fa78023aa4 | ||
![]() |
ebc2b9a286 | ||
![]() |
5e45c3c824 | ||
![]() |
e2ba22ec59 | ||
![]() |
49df957058 | ||
![]() |
95c1bf9544 | ||
![]() |
db4585b3e2 | ||
![]() |
d6bc7b8877 | ||
![]() |
ee52b13ae6 | ||
![]() |
d0e26247f4 | ||
![]() |
0caf925d5d | ||
![]() |
dc68205a18 | ||
![]() |
7128ef686d | ||
![]() |
d728494099 | ||
![]() |
5bcda7bf15 | ||
![]() |
9e7a3b7017 | ||
![]() |
530e520727 | ||
![]() |
2e3e62a413 | ||
![]() |
4d8f18e00b | ||
![]() |
ea8363a3b0 | ||
![]() |
c5931c75c6 | ||
![]() |
d07e4f44f1 | ||
![]() |
dcabb49244 | ||
![]() |
18a13679fd | ||
![]() |
6ee5718b2e | ||
![]() |
d0e7195a16 | ||
![]() |
7053724fd6 | ||
![]() |
c9d22c7a14 | ||
![]() |
893facdf6d | ||
![]() |
78e4772f21 | ||
![]() |
305efcf5ad | ||
![]() |
0d911127d7 | ||
![]() |
5ea18b9426 | ||
![]() |
d8bd8634ab | ||
![]() |
dcbf2a0e0c | ||
![]() |
fffbf48dec | ||
![]() |
a167067cbd | ||
![]() |
4476a9e241 | ||
![]() |
4011c13d4b | ||
![]() |
6106ab8a2e | ||
![]() |
1674465bdc | ||
![]() |
8ca6f8c6ec | ||
![]() |
04caf1c262 | ||
![]() |
68088bc5be | ||
![]() |
0dfc7fffff |
70
.gitignore
vendored
@@ -1,11 +1,17 @@
|
||||
# Ignore generated files
|
||||
# ...
|
||||
|
||||
# Ignore VIM's backup generated files
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# Ignore Android generated files and folders
|
||||
src_android/obj/
|
||||
templates/android_project/bin/
|
||||
templates/android_project/obj/
|
||||
templates/android_project/libs/
|
||||
local.properties
|
||||
|
||||
# Ignore thumbnails created by windows
|
||||
Thumbs.db
|
||||
@@ -36,6 +42,7 @@ Thumbs.db
|
||||
*.sbr
|
||||
*.sdf
|
||||
obj/
|
||||
# [Rr]elease/
|
||||
[Rr]elease.win32/
|
||||
_ReSharper*/
|
||||
[Tt]est[Rr]esult*
|
||||
@@ -45,7 +52,29 @@ ipch/
|
||||
# Ignore compiled binaries
|
||||
*.o
|
||||
*.exe
|
||||
!tools/rrem.exe
|
||||
!tools/rREM/rrem.exe
|
||||
|
||||
# Ignore all examples files
|
||||
examples/*
|
||||
# Unignore all examples dirs
|
||||
!examples/*/
|
||||
# Unignore all examples files with extension
|
||||
!examples/*.c
|
||||
!examples/*.lua
|
||||
!examples/*.png
|
||||
# Unignore examples Makefile
|
||||
!examples/Makefile
|
||||
|
||||
# Ignore all games files
|
||||
games/*
|
||||
# Unignore all games dirs
|
||||
!games/*/
|
||||
# Unignore all games files with extension
|
||||
!games/*.c
|
||||
!games/*.lua
|
||||
!games/*.png
|
||||
# Unignore games makefile
|
||||
!games/Makefile
|
||||
|
||||
# Ignore files build by xcode
|
||||
*.mode*v*
|
||||
@@ -61,4 +90,41 @@ xcschememanagement.plist
|
||||
xcuserdata/
|
||||
DerivedData/
|
||||
*.dll
|
||||
src/libraylib.a
|
||||
|
||||
# external libraries DLLs
|
||||
!src/external/glfw3/lib/win32/glfw3.dll
|
||||
!src/external/openal_soft/lib/win32/OpenAL32.dll
|
||||
|
||||
# Visual Studio project
|
||||
project/vs2015/*.db
|
||||
project/vs2015/*.opendb
|
||||
!project/vs2015/raylib.sln
|
||||
!project/vs2015/raylib/*.vcxproj
|
||||
!project/vs2015/examples/*.vcxproj
|
||||
!project/vs2015/external/glfw3/lib/win32/glfw3.dll
|
||||
!project/vs2015/external/openal_soft/lib/win32/OpenAL32.dll
|
||||
!project/vs2015/external/openal_soft/lib/win64/OpenAL32.dll
|
||||
!project/vs2015/external/lua/lib/win32/lua53.dll
|
||||
|
||||
# Web examples
|
||||
docs/examples/web/*.html
|
||||
docs/examples/web/*/*.html
|
||||
!docs/examples/web/loader.html
|
||||
!docs/examples/web/core/loader.html
|
||||
!docs/examples/web/shapes/loader.html
|
||||
!docs/examples/web/text/loader.html
|
||||
!docs/examples/web/textures/loader.html
|
||||
!docs/examples/web/audio/loader.html
|
||||
!docs/examples/web/physac/loader.html
|
||||
!docs/examples/web/shaders/loader.html
|
||||
!docs/examples/web/models/loader.html
|
||||
|
||||
# raylib release libs
|
||||
src/libraylib.a
|
||||
src/libraylib.bc
|
||||
!release/android/armeabi-v7a/libraylib.a
|
||||
!release/android/armeabi-v7a/libraylib.so
|
||||
!release/linux/libraylib.a
|
||||
!release/linux/libraylib.so
|
||||
!release/rpi/libraylib.a
|
||||
|
||||
|
253
CHANGELOG
@@ -1,16 +1,257 @@
|
||||
changelog
|
||||
---------
|
||||
|
||||
Current Release: raylib 1.4.0 (22 February 2016)
|
||||
Current Release: raylib 1.7.0 (20 May 2017)
|
||||
|
||||
NOTE: Only versions marked as 'Release' are available in installer, updates are only available as source.
|
||||
NOTE: Current Release includes all previous updates.
|
||||
-----------------------------------------------
|
||||
Release: raylib 1.7.0 (20 May 2017)
|
||||
-----------------------------------------------
|
||||
NOTE:
|
||||
In this new raylib release, multiple parts of the library have been reviewed for consistency and simplification.
|
||||
It exposes almost 300 functions, around 30 new functions in comparison with previous version and, again,
|
||||
it sets a stepping stone towards raylib future.
|
||||
|
||||
BIG changes:
|
||||
- More than 30 new functions added to the library, check list below.
|
||||
- Support of configuration flags on every raylib module, to customize library build.
|
||||
- Improved build system for all supported platforms with a unique Makefile to compile sources.
|
||||
- Complete review of examples and sample games, added new sample material.
|
||||
- Support automatic GIF recording of current window, just pressing Ctrl+F12
|
||||
- Improved library consistency and organization in general.
|
||||
|
||||
other changes:
|
||||
[core] Added function: SetWindowIcon(), to setup icon by code
|
||||
[core] Added function: SetWindowMonitor(), to set current display monitor
|
||||
[core] Added function: SetWindowMinSize(), to set minimum resize size
|
||||
[core] Added function: TakeScreenshot(), made public to API (also launched internally with F12)
|
||||
[core] Added function: GetDirectoryPath(), get directory for a given fileName (with path)
|
||||
[core] Added function: GetWorkingDirectory(), get current working directory
|
||||
[core] Added function: ChangeDirectory(), change working directory
|
||||
[core] Added function: TraceLog(), made public to API
|
||||
[core] Improved timming system to avoid busy wait loop on frame sync: Wait()
|
||||
[core] Added support for gamepad on HTML5 platform
|
||||
[core] Support mouse lock, useful for camera system
|
||||
[core] Review functions description comments
|
||||
[rlgl] Removed function: GetStandardShader(), removed internal standard shader
|
||||
[rlgl] Removed function: CreateLight(), removed internal lighting system
|
||||
[rlgl] Removed function: DestroyLight(), removed internal lighting system
|
||||
[rlgl] Removed function: InitVrDevice(), removed VR device render, using simulator
|
||||
[rlgl] Removed function: CloseVrDevice(), removed VR device render, using simulator
|
||||
[rlgl] Removed function: IsVrDeviceReady(), removed VR device render, using simulator
|
||||
[rlgl] Removed function: IsVrSimulator(), removed VR device render, using simulator
|
||||
[rlgl] Added function: InitVrSimulator(), init VR simulator for selected device
|
||||
[rlgl] Added function: CloseVrSimulator(), close VR simulator for current device
|
||||
[rlgl] Added function: IsVrSimulatorReady(), detect if VR device is ready
|
||||
[rlgl] Added function: BeginVrDrawing(), begin VR simulator stereo rendering
|
||||
[rlgl] Added function: EndVrDrawing(), end VR simulator stereo rendering
|
||||
[rlgl] Renamed function: ReadTextFile() to LoadText() and exposed to API
|
||||
[rlgl] Removed internal lighting system and standard shader, moved to example
|
||||
[rlgl] Removed Oculus Rift support, moved to oculus_rift example
|
||||
[rlgl] Removed VR device support and replaced by VR simulator
|
||||
[shapes] Added function: DrawLineEx(), draw line with QUADS, supports custom line thick
|
||||
[shapes] Added function: DrawLineBezier(), draw a line using cubic-bezier curves in-out
|
||||
[shapes] Added function: DrawRectanglePro(), draw a color-filled rectangle with pro parameters
|
||||
[textures] Removed function: LoadImageFromRES(), redesigning custom RRES fileformat
|
||||
[textures] Removed function: LoadTextureFromRES(), redesigning custom RRES fileformat
|
||||
[textures] Removed function: LoadTextureEx(), use instead Image -> LoadImagePro(), LoadImageEx()
|
||||
[textures] Added function: LoadImagePro()), load image from raw data with parameters
|
||||
[textures] Review TraceLog() message when image file not found
|
||||
[text] Renamed function: LoadSpriteFontTTF() to LoadSpriteFontEx(), for consistency
|
||||
[text] Removed rBMF fileformat support, replaced by .png
|
||||
[text] Refactor SpriteFont struct (better for rres custom fileformat)
|
||||
[text] Renamed some variables for consistency
|
||||
[models] Added function: LoadMesh(), load mesh from file
|
||||
[models] Added function: LoadMeshEx(), load mesh from vertex data
|
||||
[models] Added function: UnloadMesh(), unload mesh from memory (RAM and/or VRAM)
|
||||
[models] Added function: GetCollisionRayMesh(), get collision info between ray and mesh
|
||||
[models] Added function: GetCollisionRayTriangle(), get collision info between ray and triangle
|
||||
[models] Added function: GetCollisionRayGround(), get collision info between ray and ground plane
|
||||
[models] Renamed function: LoadModelEx() to LoadModelFromMesh()
|
||||
[models] Removed function: DrawLight(), removed internal lighting system
|
||||
[models] Renamed function: LoadModelEx() to LoadModelFromMesh() for consistency
|
||||
[models] Removed function: LoadStandardMaterial(), removed internal standard shader
|
||||
[models] Removed function: LoadModelFromRES(), redesigning custom RRES fileformat
|
||||
[models] Renamed multiple variables for consistency
|
||||
[audio] Added function: SetMasterVolume(), define listener volume
|
||||
[audio] Added function: ResumeSound(), resume a paused sound
|
||||
[audio] Added function: SetMusicLoopCount(), set number of repeats for a music
|
||||
[audio] Added function: LoadWaveEx(), load wave from raw audio data
|
||||
[audio] Added function: WaveCrop(), crop wave audio data
|
||||
[audio] Added function: WaveFormat(), format audio data
|
||||
[audio] Removed function: LoadSoundFromRES(), redesigning custom RRES fileformat
|
||||
[audio] Added support for 32bit audio samples
|
||||
[audio] Preliminary support for multichannel, limited to mono and stereo
|
||||
[audio] Make sure buffers are ready for update: UpdateMusicStream()
|
||||
[utils] Replaced function: GetExtension() by IsFileExtension() and made public to API
|
||||
[utils] Unified function: TraceLog() between Android and other platforms
|
||||
[utils] Removed internal function: GetNextPOT(), simplified implementation
|
||||
[raymath] Added function: QuaternionToEuler(), to work with Euler angles
|
||||
[raymath] Added function: QuaternionFromEuler(), to work with Euler angles
|
||||
[raymath] Added multiple Vector2 math functions
|
||||
[build] Integrate Android source building into Makefile
|
||||
[example] Added example: shapes_lines_bezier
|
||||
[example] Added example: text_input_box
|
||||
[github] Moved gh-pages branch to master/docs
|
||||
[github] Moved rlua.h and Lua examples to own repo: raylib-lua
|
||||
[games] Reviewed full games collection
|
||||
[games] New game added to collection: Koala Seasons
|
||||
[*] Reviewed and improved examples collection (new assets)
|
||||
[*] Reorganized library functions, structs, enums
|
||||
[*] Updated STB libraries to latest version
|
||||
|
||||
-----------------------------------------------
|
||||
Release: raylib 1.6.0 (20 November 2016)
|
||||
-----------------------------------------------
|
||||
NOTE:
|
||||
This new raylib version commemorates raylib 3rd anniversary and represents another complete review of the library.
|
||||
It includes some interesting new features and is a stepping stone towards raylib future.
|
||||
|
||||
HUGE changes:
|
||||
[rlua] Lua BINDING: Complete raylib Lua binding, ALL raylib functions ported to Lua plus the +60 code examples.
|
||||
[audio] COMPLETE REDESIGN: Improved music support and also raw audio data processing and playing, +20 new functions added.
|
||||
[physac] COMPLETE REWRITE: Improved performance, functionality and simplified usage, moved to own repository and added multiple examples!
|
||||
|
||||
other changes:
|
||||
|
||||
[core] Corrected issue on OSX with HighDPI display
|
||||
[core] Added flag to allow resizable window
|
||||
[core] Allow no default font loading
|
||||
[core] Corrected old issue with mouse buttons on web
|
||||
[core] Improved gamepad support, unified across platforms
|
||||
[core] Gamepad id functionality: GetGamepadName(), IsGamepadName()
|
||||
[core] Gamepad buttons/axis checking functionality:
|
||||
[core] Reviewed Android key inputs system, unified with desktop
|
||||
[rlgl] Redesigned lighting shader system
|
||||
[rlgl] Updated standard shader for better performance
|
||||
[rlgl] Support alpha on framebuffer: rlglLoadRenderTexture()
|
||||
[rlgl] Reviewed UpdateVrTracking() to update camera
|
||||
[rlgl] Added IsVrSimulator() to check for VR simulator
|
||||
[shapes] Corrected issue on DrawPolyEx()
|
||||
[textures] Simplified supported image formats support
|
||||
[textures] Improved text drawing within an image: ImageDrawText()
|
||||
[textures] Support image alpha mixing: ImageAlphaMask()
|
||||
[textures] Support textures filtering: SetTextureFilter()
|
||||
[textures] Support textures wrap modes: SetTextureWrap()
|
||||
[text] Improved TTF spritefont generation: LoadSpriteFontTTF()
|
||||
[text] Improved AngelCode fonts support (unordered chars)
|
||||
[text] Added TraceLog info on image spritefont loading
|
||||
[text] Improved text measurement: MeasureTextEx()
|
||||
[models] Improved OBJ loading flexibility
|
||||
[models] Reviewed functions: DrawLine3D(), DrawCircle3D()
|
||||
[models] Removed function: ResolveCollisionCubicmap()
|
||||
[camera] Redesigned camera system and ported to header-only
|
||||
[camera] Removed function: UpdateCameraPlayer()
|
||||
[gestures] Redesigned gestures module to header-only
|
||||
[audio] Simplified Music loading and playing system
|
||||
[audio] Added trace on audio device closing
|
||||
[audio] Reviewed Wave struct, improved flexibility
|
||||
[audio] Support sound data update: UpdateSound()
|
||||
[audio] Added support for FLAC audio loading/streaming
|
||||
[raygui] Removed raygui from raylib repo (moved to own repo)
|
||||
[build] Added OpenAL static library
|
||||
[build] Added Visual Studio 2015 projects
|
||||
[build] Support shared/dynamic raylib compilation
|
||||
[*] Updated LibOVR to SDK version 1.8
|
||||
[*] Updated games to latest raylib version
|
||||
[*] Improved examples and added new ones
|
||||
[*] Improved Android support
|
||||
|
||||
-----------------------------------------------
|
||||
Release: raylib 1.5.0 (18 July 2016)
|
||||
-----------------------------------------------
|
||||
NOTE:
|
||||
Probably this new version is the biggest boost of the library ever, lots of parts of the library have been redesigned,
|
||||
lots of bugs have been solved and some **AMAZING** new features have been added.
|
||||
|
||||
HUGE changes:
|
||||
[rlgl] OCULUS RIFT CV1: Added support for VR, not oly Oculus Rift CV1 but also stereo rendering simulator (multiplatform).
|
||||
[rlgl] MATERIALS SYSTEM: Added support for Materials (.mtl) and multiple material properties: diffuse, specular, normal.
|
||||
[rlgl] LIGHTING SYSTEM: Added support for up to 8 lights of 3 different types: Omni, Directional and Spot.
|
||||
[physac] REDESIGNED: Improved performance and simplified usage, physic objects now are managed internally in a second thread!
|
||||
[audio] CHIPTUNES: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels supported.
|
||||
|
||||
other changes:
|
||||
|
||||
[core] Review Android button inputs
|
||||
[core] Support Android internal data storage
|
||||
[core] Renamed WorldToScreen() to GetWorldToScreen()
|
||||
[core] Removed function SetCustomCursor()
|
||||
[core] Removed functions BeginDrawingEx(), BeginDrawingPro()
|
||||
[core] Replaced functions InitDisplay() + InitGraphics() with: InitGraphicsDevice()
|
||||
[core] Added support for field-of-view Y (fovy) on 3d Camera
|
||||
[core] Added 2D camera mode functions: Begin2dMode() - End2dMode()
|
||||
[core] Translate mouse inputs to Android touch/gestures internally
|
||||
[core] Translate mouse inputs as touch inputs in HTML5
|
||||
[core] Improved function GetKeyPressed() to support multiple keys (including function keys)
|
||||
[core] Improved gamepad support, specially for RaspberryPi (including multiple gamepads support)
|
||||
[rlgl] Support stereo rendering simulation (duplicate draw calls by viewport, optimized)
|
||||
[rlgl] Added distortion shader (embeded) to support custom VR simulator: shader_distortion.h
|
||||
[rlgl] Added support for OpenGL 2.1 on desktop
|
||||
[rlgl] Improved 2D vs 3D drawing system (lines, triangles, quads)
|
||||
[rlgl] Improved DXT-ETC1 support on HTML5
|
||||
[rlgl] Review function: rlglUnproject()
|
||||
[rlgl] Removed function: rlglInitGraphics(), integrated into rlglInit()
|
||||
[rlgl] Updated Mesh and Shader structs
|
||||
[rlgl] Simplified internal (default) dynamic buffers
|
||||
[rlgl] Added support for indexed and dynamic mesh data
|
||||
[rlgl] Set fixed vertex attribs location points
|
||||
[rlgl] Improved mesh data loading support
|
||||
[rlgl] Added standard shader (embeded) to support materials and lighting: shader_standard.h
|
||||
[rlgl] Added light functions: CreateLight(), DestroyLight()
|
||||
[rlgl] Added wire mode functions: rlDisableWireMode(), rlEnableWireMode()
|
||||
[rlgl] Review function consistency, added: rlglLoadMesh(), rlglUpdateMesh(), rlglDrawMesh(), rlglUnloadMesh()
|
||||
[rlgl] Replaced SetCustomShader() by: BeginShaderMode() - EndShaderMode()
|
||||
[rlgl] Replaced SetBlendMode() by: BeginBlendMode() - EndBlendMode()
|
||||
[rlgl] Added functions to customize internal matrices: SetMatrixProjection(), SetMatrixModelview()
|
||||
[rlgl] Unified internal shaders to only one default shader
|
||||
[rlgl] Added support for render to texture (RenderTexture2D):
|
||||
LoadRenderTexture() - UnloadRenderTexture()
|
||||
BeginTextureMode() - EndTextureMode()
|
||||
[rlgl] Removed SetShaderMap*() functions
|
||||
[rlgl] Redesigned default buffers usage functions:
|
||||
LoadDefaultBuffers() - UnloadDefaultBuffers()
|
||||
UpdateDefaultBuffers() - DrawDefaultBuffers()
|
||||
[shapes] Corrected bug on GetCollisionRec()
|
||||
[textures] Added support for Nearest-Neighbor image scaling
|
||||
[textures] Added functions to draw text on image: ImageDrawText(), ImageDrawTextEx()
|
||||
[text] Reorganized internal functions: Added LoadImageFont()
|
||||
[text] Security check for unsupported BMFonts
|
||||
[models] Split mesh creation from model loading on heightmap and cubicmap
|
||||
[models] Updated BoundingBox collision detections
|
||||
[models] Added color parameter to DrawBoundigBox()
|
||||
[models] Removed function: DrawQuad()
|
||||
[models] Removed function: SetModelTexture()
|
||||
[models] Redesigned DrawPlane() to use RL_TRIANGLES
|
||||
[models] Redesigned DrawRectangleV() to use RL_TRIANGLES
|
||||
[models] Redesign to accomodate new materials system: LoadMaterial()
|
||||
[models] Added material functions: LoadDefaultMaterial(), LoadStandardMaterial()
|
||||
[models] Added MTL material loading support: LoadMTL()
|
||||
[models] Added function: DrawLight()
|
||||
[audio] Renamed SoundIsPlaying() to IsSoundPlaying()
|
||||
[audio] Renamed MusicIsPlaying() to IsMusicPlaying()
|
||||
[audio] Support multiple Music streams (indexed)
|
||||
[audio] Support multiple mixing channels
|
||||
[gestures] Improved and reviewed gestures system
|
||||
[raymath] Added QuaternionInvert()
|
||||
[raymath] Removed function: PrintMatrix()
|
||||
[raygui] Ported to header-only library (https://github.com/raysan5/raygui)
|
||||
[shaders] Added depth drawing shader (requires a depth texture)
|
||||
[shaders] Reviewed included shaders and added comments
|
||||
[OpenAL Soft] Updated to latest version (1.17.2)
|
||||
[GLFW3] Updated to latest version (3.2)
|
||||
[stb] Updated to latest headers versions
|
||||
[GLAD] Converted to header only library and simplified to only used extensions
|
||||
[*] Reorganize library folders: external libs moved to src/external folder
|
||||
[*] Reorganize src folder for Android library
|
||||
[*] Review external dependencies usage
|
||||
[*] Improved Linux and OSX build systems
|
||||
[*] Lots of tweaks and bugs corrected all around
|
||||
|
||||
-----------------------------------------------
|
||||
Release: raylib 1.4.0 (22 February 2016)
|
||||
-----------------------------------------------
|
||||
NOTE:
|
||||
This version supposed another big improvement for raylib, inlcuding new modules and new features.
|
||||
This version supposed another big improvement for raylib, including new modules and new features.
|
||||
More than 30 new functions have been added to previous raylib version.
|
||||
Around 8 new examples and +10 new game samples have been added.
|
||||
|
||||
@@ -21,6 +262,7 @@ BIG changes:
|
||||
[physac] NEW MODULE: Basic 2D physics support, use colliders and rigidbodies; apply forces to physic objects.
|
||||
|
||||
other changes:
|
||||
|
||||
[rlgl] Removed GLEW library dependency, now using GLAD
|
||||
[rlgl] Implemented alternative to glGetTexImage() on OpenGL ES
|
||||
[rlgl] Using depth data on batch drawing
|
||||
@@ -59,7 +301,8 @@ BIG changes:
|
||||
[gestures] NEW MODULE: Gestures system for Android and HTML5 platforms
|
||||
[raygui] NEW MODULE: Set of IMGUI elements for tools development (experimental)
|
||||
|
||||
smaller changes:
|
||||
other changes:
|
||||
|
||||
[rlgl] Added check for OpenGL supported extensions
|
||||
[rlgl] Added function SetBlenMode() to select some predefined blending modes
|
||||
[core] Added support for drop&drag of external files into running program
|
||||
|
14
HELPME.md
@@ -7,23 +7,21 @@ please, [let me know][raysan5].
|
||||
The following help is highly appreciated:
|
||||
|
||||
- C programming - Can you write / review / test / improve the code?
|
||||
- Translators / Localizators - Can you translate raylib to another language?
|
||||
- Documentation / Tutorials / Example writters - Can you write some tutorial / example?
|
||||
- Web Development - Can you help with the web? Can you setup a forum?
|
||||
- Porting to Linux, OSX... - Can you compile and test raylib on another OS?
|
||||
- Porting to Linux, OSX, RaspberryPi, consoles... - Can you compile and test raylib on another systems?
|
||||
- Testers of current features and multiple systems - Can you find some bug on raylib?
|
||||
|
||||
If you can not help on any of the above points but you still want to contribute in some way... please, consider helping
|
||||
with a small [donation](http://www.raylib.com/helpme.htm) (just some euros...). It will really motivate to continue improving this project (and pay some bills… or some coffee).
|
||||
with a small [donation](http://www.raylib.com/helpme.html) or contributing with [raylib patreon](https://www.patreon.com/raysan5). It will really motivate to continue improving this project (and pay some bills… or some coffee).
|
||||
|
||||
raylib philosophy
|
||||
------------------
|
||||
|
||||
* raylib is a tool to LEARN videogames programming, every single function in raylib should be a tutorial on itself (clear code).
|
||||
* raylib is SIMPLE and EASY-TO-USE, I tried to keep it compact with a small set of functions, if a function is too complex or
|
||||
has not a clear usefulness, better not to include it.
|
||||
* raylib is a tool to LEARN videogames programming, every single function in raylib should be a tutorial on itself.
|
||||
* raylib is SIMPLE and EASY-TO-USE, I tried to keep it compact with a small set of functions, if a function is too complex or has not a clear usefulness, better not to include it.
|
||||
* raylib is open source and free; educators and institutions can use this tool to TEACH videogames programming completely by free.
|
||||
* raylib is, hopefully, collaborative; contribution of tutorials / code-examples / bugs-solving / code-comments are highly appreciated.
|
||||
* raylib is collaborative; contribution of tutorials / code-examples / bugs-solving / code-comments are highly appreciated.
|
||||
* raylib's license (and its external libs respective licenses) allow using it for commercial products.
|
||||
|
||||
contact
|
||||
@@ -36,4 +34,4 @@ contact
|
||||
* Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
|
||||
* Patreon: [https://www.patreon.com/raysan5](https://www.patreon.com/raysan5)
|
||||
|
||||
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
|
||||
[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San"
|
||||
|
184
HISTORY.md
Normal file
@@ -0,0 +1,184 @@
|
||||
<img src="https://github.com/raysan5/raylib/blob/master/logo/logo256x256.png" width=256>
|
||||
|
||||
history
|
||||
-------
|
||||
|
||||
I've developed videogames for some years and 4 years ago I started teaching videogames development
|
||||
to young people with artistic profile, most of them had never written a single line of code.
|
||||
|
||||
I started with C language basis and, after searching for the most simple and easy-to-use library to teach
|
||||
videogames programming, I found WinBGI; it was great and it worked very well with students, in just a
|
||||
couple of weeks that people that had never written a single line of code were able to program (and understand)
|
||||
a simple PONG and some of them even a BREAKOUT!
|
||||
|
||||
But WinBGI was not the clearer and most organized lib. There were a lot of things I found useless and
|
||||
confusing and some function names were not clear enough for most of the students; not to mention points
|
||||
like no transparencies support or no hardware acceleration.
|
||||
|
||||
So, I decided to create my own lib, hardware accelerated, clear function names, quite organized, well structured,
|
||||
plain C coding and, the most important, primarily intended to LEARN videogames programming.
|
||||
|
||||
I've coded quite a lot in C# and XNA and I really love it (in fact, my students learn C# after C),
|
||||
so, I decided to use C# language notation and XNA naming conventions. That way, students can jump from
|
||||
raylib to XNA, MonoGame or similar libs extremely easily.
|
||||
|
||||
raylib started as a weekend project and after three months of hard work, raylib 1.0 was published on November 2013.
|
||||
|
||||
Enjoy it.
|
||||
|
||||
notes on raylib 1.1
|
||||
-------------------
|
||||
|
||||
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a
|
||||
complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
|
||||
|
||||
A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style
|
||||
immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
|
||||
|
||||
[rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes
|
||||
a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
|
||||
|
||||
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the
|
||||
support of DDS texture files (compressed and uncompressed) along with mipmaps support.
|
||||
|
||||
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1.
|
||||
|
||||
notes on raylib 1.2
|
||||
-------------------
|
||||
|
||||
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a
|
||||
complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
|
||||
|
||||
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the user.
|
||||
On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input
|
||||
system has been written from scratch.
|
||||
|
||||
A new display initialization system has been created to support multiple resolutions, adding black bars if required;
|
||||
user only defines desired screen size and it gets properly displayed.
|
||||
|
||||
Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
|
||||
|
||||
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
|
||||
|
||||
In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/).
|
||||
|
||||
notes on raylib 1.3
|
||||
-------------------
|
||||
|
||||
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality,
|
||||
improves tremendously textures module and also provides some new modules (camera system, gestures system, IMGUI).
|
||||
|
||||
Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be
|
||||
attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included
|
||||
in this release, check raylib/shaders folder.
|
||||
|
||||
Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
|
||||
A brand new [camera](https://github.com/raysan5/raylib/blob/develop/src/camera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person).
|
||||
Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_first_person.c).
|
||||
|
||||
New [gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.h) module simplifies gestures detection on Android and HTML5 programs.
|
||||
|
||||
[raygui](https://github.com/raysan5/raylib/blob/develop/src/raygui.h), the new IMGUI (Immediate Mode GUI) module offers a set of functions to create simple user interfaces,
|
||||
primary intended for tools development. It's still in experimental state but already fully functional.
|
||||
|
||||
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
|
||||
|
||||
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3.
|
||||
|
||||
notes on raylib 1.4
|
||||
-------------------
|
||||
|
||||
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version,
|
||||
lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
|
||||
|
||||
First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/develop/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image.
|
||||
Now a basic image processing can be done before converting the image to texture for usage.
|
||||
|
||||
SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library).
|
||||
Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
|
||||
|
||||
New [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) physics module for basic 2D physics support. Still in development but already functional.
|
||||
Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
|
||||
|
||||
[raymath](https://github.com/raysan5/raylib/blob/develop/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
|
||||
|
||||
[gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse.
|
||||
This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
|
||||
|
||||
Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`).
|
||||
Gamepad support has also been added (experimental).
|
||||
|
||||
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions,
|
||||
and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported).
|
||||
A simple [easings](https://github.com/raysan5/raylib/blob/develop/src/easings.h) module has also been added for values animation.
|
||||
|
||||
Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn
|
||||
how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.
|
||||
|
||||
Lots of code changes and lots of hours of hard work have concluded in this amazing new raylib 1.4.
|
||||
|
||||
notes on raylib 1.5
|
||||
-------------------
|
||||
|
||||
On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added.
|
||||
|
||||
VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/develop/examples/core_oculus_rift.c).
|
||||
|
||||
New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
|
||||
|
||||
New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
|
||||
|
||||
Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
|
||||
|
||||
Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/develop/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
|
||||
|
||||
Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
|
||||
|
||||
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/develop/examples/core_2d_camera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/develop/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
|
||||
|
||||
This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/develop/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/develop/CHANGELOG) file for a more detailed list of changes.
|
||||
|
||||
Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/develop/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/develop/examples/audio_standalone.c) raylib modules as standalone libraries.
|
||||
|
||||
Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5.
|
||||
|
||||
notes on raylib 1.6
|
||||
-------------------
|
||||
|
||||
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
|
||||
|
||||
Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality.
|
||||
|
||||
Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/develop/src/audio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/develop/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
|
||||
|
||||
[Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
|
||||
|
||||
Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
|
||||
|
||||
Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
|
||||
|
||||
Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
|
||||
|
||||
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
|
||||
|
||||
New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.
|
||||
|
||||
notes on raylib 1.7
|
||||
-------------------
|
||||
|
||||
On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are:
|
||||
|
||||
More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, funtions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
|
||||
|
||||
Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality.
|
||||
|
||||
Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
|
||||
|
||||
New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems.
|
||||
|
||||
Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
|
||||
|
||||
Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timming improvements, public log system, rres file format support, automatic GIF recording...
|
||||
|
||||
And here it is another version of **raylib, a simple and easy-to-use library to learn videogames programming**. Enjoy it.
|
||||
|
348
LICENSE.md
@@ -7,7 +7,7 @@ source code
|
||||
raylib is 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 Ramon Santamaria (Ray San - raysan@raysanweb.com)
|
||||
Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
|
||||
|
||||
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.
|
||||
@@ -27,7 +27,7 @@ applications, and to alter it and redistribute it freely, subject to the followi
|
||||
fonts
|
||||
------
|
||||
|
||||
All rBMF fonts provided with raylib are free to use (freeware) and have been designed by the following people:
|
||||
The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/develop/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:
|
||||
|
||||
* Alpha Beta - Brian Kent (AEnigma)
|
||||
* Setback - Brian Kent (AEnigma)
|
||||
@@ -37,345 +37,13 @@ All rBMF fonts provided with raylib are free to use (freeware) and have been des
|
||||
* Mecha - Captain Falcon
|
||||
* PixelPlay - Aleksander Shevchuk
|
||||
* PixAntiqua - Gerhard Großmann
|
||||
|
||||
2d art
|
||||
------
|
||||
|
||||
[scarfy spritesheet](https://github.com/raysan5/raylib/blob/develop/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/develop/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
|
||||
|
||||
3d models
|
||||
---------
|
||||
|
||||
dwarf 3d model used in examples is created by David Moreno and licensed as Creative Commons Attribution-NonCommercial 3.0
|
||||
|
||||
Full license provided below:
|
||||
|
||||
Creative Commons Legal Code
|
||||
|
||||
Attribution-NonCommercial 3.0 Unported
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
|
||||
DAMAGES RESULTING FROM ITS USE.
|
||||
|
||||
License
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
|
||||
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
|
||||
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
|
||||
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
|
||||
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
|
||||
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
|
||||
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
|
||||
CONDITIONS.
|
||||
|
||||
1. Definitions
|
||||
|
||||
a. "Adaptation" means a work based upon the Work, or upon the Work and
|
||||
other pre-existing works, such as a translation, adaptation,
|
||||
derivative work, arrangement of music or other alterations of a
|
||||
literary or artistic work, or phonogram or performance and includes
|
||||
cinematographic adaptations or any other form in which the Work may be
|
||||
recast, transformed, or adapted including in any form recognizably
|
||||
derived from the original, except that a work that constitutes a
|
||||
Collection will not be considered an Adaptation for the purpose of
|
||||
this License. For the avoidance of doubt, where the Work is a musical
|
||||
work, performance or phonogram, the synchronization of the Work in
|
||||
timed-relation with a moving image ("synching") will be considered an
|
||||
Adaptation for the purpose of this License.
|
||||
b. "Collection" means a collection of literary or artistic works, such as
|
||||
encyclopedias and anthologies, or performances, phonograms or
|
||||
broadcasts, or other works or subject matter other than works listed
|
||||
in Section 1(f) below, which, by reason of the selection and
|
||||
arrangement of their contents, constitute intellectual creations, in
|
||||
which the Work is included in its entirety in unmodified form along
|
||||
with one or more other contributions, each constituting separate and
|
||||
independent works in themselves, which together are assembled into a
|
||||
collective whole. A work that constitutes a Collection will not be
|
||||
considered an Adaptation (as defined above) for the purposes of this
|
||||
License.
|
||||
c. "Distribute" means to make available to the public the original and
|
||||
copies of the Work or Adaptation, as appropriate, through sale or
|
||||
other transfer of ownership.
|
||||
d. "Licensor" means the individual, individuals, entity or entities that
|
||||
offer(s) the Work under the terms of this License.
|
||||
e. "Original Author" means, in the case of a literary or artistic work,
|
||||
the individual, individuals, entity or entities who created the Work
|
||||
or if no individual or entity can be identified, the publisher; and in
|
||||
addition (i) in the case of a performance the actors, singers,
|
||||
musicians, dancers, and other persons who act, sing, deliver, declaim,
|
||||
play in, interpret or otherwise perform literary or artistic works or
|
||||
expressions of folklore; (ii) in the case of a phonogram the producer
|
||||
being the person or legal entity who first fixes the sounds of a
|
||||
performance or other sounds; and, (iii) in the case of broadcasts, the
|
||||
organization that transmits the broadcast.
|
||||
f. "Work" means the literary and/or artistic work offered under the terms
|
||||
of this License including without limitation any production in the
|
||||
literary, scientific and artistic domain, whatever may be the mode or
|
||||
form of its expression including digital form, such as a book,
|
||||
pamphlet and other writing; a lecture, address, sermon or other work
|
||||
of the same nature; a dramatic or dramatico-musical work; a
|
||||
choreographic work or entertainment in dumb show; a musical
|
||||
composition with or without words; a cinematographic work to which are
|
||||
assimilated works expressed by a process analogous to cinematography;
|
||||
a work of drawing, painting, architecture, sculpture, engraving or
|
||||
lithography; a photographic work to which are assimilated works
|
||||
expressed by a process analogous to photography; a work of applied
|
||||
art; an illustration, map, plan, sketch or three-dimensional work
|
||||
relative to geography, topography, architecture or science; a
|
||||
performance; a broadcast; a phonogram; a compilation of data to the
|
||||
extent it is protected as a copyrightable work; or a work performed by
|
||||
a variety or circus performer to the extent it is not otherwise
|
||||
considered a literary or artistic work.
|
||||
g. "You" means an individual or entity exercising rights under this
|
||||
License who has not previously violated the terms of this License with
|
||||
respect to the Work, or who has received express permission from the
|
||||
Licensor to exercise rights under this License despite a previous
|
||||
violation.
|
||||
h. "Publicly Perform" means to perform public recitations of the Work and
|
||||
to communicate to the public those public recitations, by any means or
|
||||
process, including by wire or wireless means or public digital
|
||||
performances; to make available to the public Works in such a way that
|
||||
members of the public may access these Works from a place and at a
|
||||
place individually chosen by them; to perform the Work to the public
|
||||
by any means or process and the communication to the public of the
|
||||
performances of the Work, including by public digital performance; to
|
||||
broadcast and rebroadcast the Work by any means including signs,
|
||||
sounds or images.
|
||||
i. "Reproduce" means to make copies of the Work by any means including
|
||||
without limitation by sound or visual recordings and the right of
|
||||
fixation and reproducing fixations of the Work, including storage of a
|
||||
protected performance or phonogram in digital form or other electronic
|
||||
medium.
|
||||
|
||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
|
||||
limit, or restrict any uses free from copyright or rights arising from
|
||||
limitations or exceptions that are provided for in connection with the
|
||||
copyright protection under copyright law or other applicable laws.
|
||||
|
||||
3. License Grant. Subject to the terms and conditions of this License,
|
||||
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
||||
perpetual (for the duration of the applicable copyright) license to
|
||||
exercise the rights in the Work as stated below:
|
||||
|
||||
a. to Reproduce the Work, to incorporate the Work into one or more
|
||||
Collections, and to Reproduce the Work as incorporated in the
|
||||
Collections;
|
||||
b. to create and Reproduce Adaptations provided that any such Adaptation,
|
||||
including any translation in any medium, takes reasonable steps to
|
||||
clearly label, demarcate or otherwise identify that changes were made
|
||||
to the original Work. For example, a translation could be marked "The
|
||||
original work was translated from English to Spanish," or a
|
||||
modification could indicate "The original work has been modified.";
|
||||
c. to Distribute and Publicly Perform the Work including as incorporated
|
||||
in Collections; and,
|
||||
d. to Distribute and Publicly Perform Adaptations.
|
||||
|
||||
The above rights may be exercised in all media and formats whether now
|
||||
known or hereafter devised. The above rights include the right to make
|
||||
such modifications as are technically necessary to exercise the rights in
|
||||
other media and formats. Subject to Section 8(f), all rights not expressly
|
||||
granted by Licensor are hereby reserved, including but not limited to the
|
||||
rights set forth in Section 4(d).
|
||||
|
||||
4. Restrictions. The license granted in Section 3 above is expressly made
|
||||
subject to and limited by the following restrictions:
|
||||
|
||||
a. You may Distribute or Publicly Perform the Work only under the terms
|
||||
of this License. You must include a copy of, or the Uniform Resource
|
||||
Identifier (URI) for, this License with every copy of the Work You
|
||||
Distribute or Publicly Perform. You may not offer or impose any terms
|
||||
on the Work that restrict the terms of this License or the ability of
|
||||
the recipient of the Work to exercise the rights granted to that
|
||||
recipient under the terms of the License. You may not sublicense the
|
||||
Work. You must keep intact all notices that refer to this License and
|
||||
to the disclaimer of warranties with every copy of the Work You
|
||||
Distribute or Publicly Perform. When You Distribute or Publicly
|
||||
Perform the Work, You may not impose any effective technological
|
||||
measures on the Work that restrict the ability of a recipient of the
|
||||
Work from You to exercise the rights granted to that recipient under
|
||||
the terms of the License. This Section 4(a) applies to the Work as
|
||||
incorporated in a Collection, but this does not require the Collection
|
||||
apart from the Work itself to be made subject to the terms of this
|
||||
License. If You create a Collection, upon notice from any Licensor You
|
||||
must, to the extent practicable, remove from the Collection any credit
|
||||
as required by Section 4(c), as requested. If You create an
|
||||
Adaptation, upon notice from any Licensor You must, to the extent
|
||||
practicable, remove from the Adaptation any credit as required by
|
||||
Section 4(c), as requested.
|
||||
b. You may not exercise any of the rights granted to You in Section 3
|
||||
above in any manner that is primarily intended for or directed toward
|
||||
commercial advantage or private monetary compensation. The exchange of
|
||||
the Work for other copyrighted works by means of digital file-sharing
|
||||
or otherwise shall not be considered to be intended for or directed
|
||||
toward commercial advantage or private monetary compensation, provided
|
||||
there is no payment of any monetary compensation in connection with
|
||||
the exchange of copyrighted works.
|
||||
c. If You Distribute, or Publicly Perform the Work or any Adaptations or
|
||||
Collections, You must, unless a request has been made pursuant to
|
||||
Section 4(a), keep intact all copyright notices for the Work and
|
||||
provide, reasonable to the medium or means You are utilizing: (i) the
|
||||
name of the Original Author (or pseudonym, if applicable) if supplied,
|
||||
and/or if the Original Author and/or Licensor designate another party
|
||||
or parties (e.g., a sponsor institute, publishing entity, journal) for
|
||||
attribution ("Attribution Parties") in Licensor's copyright notice,
|
||||
terms of service or by other reasonable means, the name of such party
|
||||
or parties; (ii) the title of the Work if supplied; (iii) to the
|
||||
extent reasonably practicable, the URI, if any, that Licensor
|
||||
specifies to be associated with the Work, unless such URI does not
|
||||
refer to the copyright notice or licensing information for the Work;
|
||||
and, (iv) consistent with Section 3(b), in the case of an Adaptation,
|
||||
a credit identifying the use of the Work in the Adaptation (e.g.,
|
||||
"French translation of the Work by Original Author," or "Screenplay
|
||||
based on original Work by Original Author"). The credit required by
|
||||
this Section 4(c) may be implemented in any reasonable manner;
|
||||
provided, however, that in the case of a Adaptation or Collection, at
|
||||
a minimum such credit will appear, if a credit for all contributing
|
||||
authors of the Adaptation or Collection appears, then as part of these
|
||||
credits and in a manner at least as prominent as the credits for the
|
||||
other contributing authors. For the avoidance of doubt, You may only
|
||||
use the credit required by this Section for the purpose of attribution
|
||||
in the manner set out above and, by exercising Your rights under this
|
||||
License, You may not implicitly or explicitly assert or imply any
|
||||
connection with, sponsorship or endorsement by the Original Author,
|
||||
Licensor and/or Attribution Parties, as appropriate, of You or Your
|
||||
use of the Work, without the separate, express prior written
|
||||
permission of the Original Author, Licensor and/or Attribution
|
||||
Parties.
|
||||
d. For the avoidance of doubt:
|
||||
|
||||
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme cannot be waived, the Licensor
|
||||
reserves the exclusive right to collect such royalties for any
|
||||
exercise by You of the rights granted under this License;
|
||||
ii. Waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme can be waived, the Licensor reserves
|
||||
the exclusive right to collect such royalties for any exercise by
|
||||
You of the rights granted under this License if Your exercise of
|
||||
such rights is for a purpose or use which is otherwise than
|
||||
noncommercial as permitted under Section 4(b) and otherwise waives
|
||||
the right to collect royalties through any statutory or compulsory
|
||||
licensing scheme; and,
|
||||
iii. Voluntary License Schemes. The Licensor reserves the right to
|
||||
collect royalties, whether individually or, in the event that the
|
||||
Licensor is a member of a collecting society that administers
|
||||
voluntary licensing schemes, via that society, from any exercise
|
||||
by You of the rights granted under this License that is for a
|
||||
purpose or use which is otherwise than noncommercial as permitted
|
||||
under Section 4(c).
|
||||
e. Except as otherwise agreed in writing by the Licensor or as may be
|
||||
otherwise permitted by applicable law, if You Reproduce, Distribute or
|
||||
Publicly Perform the Work either by itself or as part of any
|
||||
Adaptations or Collections, You must not distort, mutilate, modify or
|
||||
take other derogatory action in relation to the Work which would be
|
||||
prejudicial to the Original Author's honor or reputation. Licensor
|
||||
agrees that in those jurisdictions (e.g. Japan), in which any exercise
|
||||
of the right granted in Section 3(b) of this License (the right to
|
||||
make Adaptations) would be deemed to be a distortion, mutilation,
|
||||
modification or other derogatory action prejudicial to the Original
|
||||
Author's honor and reputation, the Licensor will waive or not assert,
|
||||
as appropriate, this Section, to the fullest extent permitted by the
|
||||
applicable national law, to enable You to reasonably exercise Your
|
||||
right under Section 3(b) of this License (right to make Adaptations)
|
||||
but not otherwise.
|
||||
|
||||
5. Representations, Warranties and Disclaimer
|
||||
|
||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
|
||||
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
|
||||
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
|
||||
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
|
||||
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
|
||||
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
|
||||
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
||||
|
||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
|
||||
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
|
||||
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
|
||||
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. Termination
|
||||
|
||||
a. This License and the rights granted hereunder will terminate
|
||||
automatically upon any breach by You of the terms of this License.
|
||||
Individuals or entities who have received Adaptations or Collections
|
||||
from You under this License, however, will not have their licenses
|
||||
terminated provided such individuals or entities remain in full
|
||||
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
|
||||
survive any termination of this License.
|
||||
b. Subject to the above terms and conditions, the license granted here is
|
||||
perpetual (for the duration of the applicable copyright in the Work).
|
||||
Notwithstanding the above, Licensor reserves the right to release the
|
||||
Work under different license terms or to stop distributing the Work at
|
||||
any time; provided, however that any such election will not serve to
|
||||
withdraw this License (or any other license that has been, or is
|
||||
required to be, granted under the terms of this License), and this
|
||||
License will continue in full force and effect unless terminated as
|
||||
stated above.
|
||||
|
||||
8. Miscellaneous
|
||||
|
||||
a. Each time You Distribute or Publicly Perform the Work or a Collection,
|
||||
the Licensor offers to the recipient a license to the Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
|
||||
offers to the recipient a license to the original Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
c. If any provision of this License is invalid or unenforceable under
|
||||
applicable law, it shall not affect the validity or enforceability of
|
||||
the remainder of the terms of this License, and without further action
|
||||
by the parties to this agreement, such provision shall be reformed to
|
||||
the minimum extent necessary to make such provision valid and
|
||||
enforceable.
|
||||
d. No term or provision of this License shall be deemed waived and no
|
||||
breach consented to unless such waiver or consent shall be in writing
|
||||
and signed by the party to be charged with such waiver or consent.
|
||||
e. This License constitutes the entire agreement between the parties with
|
||||
respect to the Work licensed here. There are no understandings,
|
||||
agreements or representations with respect to the Work not specified
|
||||
here. Licensor shall not be bound by any additional provisions that
|
||||
may appear in any communication from You. This License may not be
|
||||
modified without the mutual written agreement of the Licensor and You.
|
||||
f. The rights granted under, and the subject matter referenced, in this
|
||||
License were drafted utilizing the terminology of the Berne Convention
|
||||
for the Protection of Literary and Artistic Works (as amended on
|
||||
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
|
||||
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
|
||||
and the Universal Copyright Convention (as revised on July 24, 1971).
|
||||
These rights and subject matter take effect in the relevant
|
||||
jurisdiction in which the License terms are sought to be enforced
|
||||
according to the corresponding provisions of the implementation of
|
||||
those treaty provisions in the applicable national law. If the
|
||||
standard suite of rights granted under applicable copyright law
|
||||
includes additional rights not granted under this License, such
|
||||
additional rights are deemed to be included in the License; this
|
||||
License is not intended to restrict the license of any rights under
|
||||
applicable law.
|
||||
|
||||
|
||||
Creative Commons Notice
|
||||
|
||||
Creative Commons is not a party to this License, and makes no warranty
|
||||
whatsoever in connection with the Work. Creative Commons will not be
|
||||
liable to You or any party on any legal theory for any damages
|
||||
whatsoever, including without limitation any general, special,
|
||||
incidental or consequential damages arising in connection to this
|
||||
license. Notwithstanding the foregoing two (2) sentences, if Creative
|
||||
Commons has expressly identified itself as the Licensor hereunder, it
|
||||
shall have all rights and obligations of Licensor.
|
||||
|
||||
Except for the limited purpose of indicating to the public that the
|
||||
Work is licensed under the CCPL, Creative Commons does not authorize
|
||||
the use by either party of the trademark "Creative Commons" or any
|
||||
related trademark or logo of Creative Commons without the prior
|
||||
written consent of Creative Commons. Any permitted use will be in
|
||||
compliance with Creative Commons' then-current trademark usage
|
||||
guidelines, as may be published on its website or otherwise made
|
||||
available upon request from time to time. For the avoidance of doubt,
|
||||
this trademark restriction does not form part of the License.
|
||||
|
||||
Creative Commons may be contacted at https://creativecommons.org/.
|
||||
[dwarf 3d model and textures](https://github.com/raysan5/raylib/tree/develop/examples/models/resources/model) have been created by David Moreno and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
|
||||
|
202
README.md
@@ -1,4 +1,4 @@
|
||||
<img src="http://www.raylib.com/img/fb_raylib_logo.png" width=256>
|
||||
<img src="https://github.com/raysan5/raylib/blob/master/logo/logo256x256.png" width=256>
|
||||
|
||||
about
|
||||
-----
|
||||
@@ -9,170 +9,49 @@ raylib is highly inspired by Borland BGI graphics lib and by XNA framework.
|
||||
|
||||
NOTE for ADVENTURERS: raylib is a programming library to learn videogames programming;
|
||||
no fancy interface, no visual helpers, no auto-debugging... just coding in the most
|
||||
pure spartan-programmers way. Are you ready to learn? Jump to [code examples!](http://www.raylib.com/examples.htm)
|
||||
|
||||
history
|
||||
-------
|
||||
|
||||
I've developed videogames for some years and 4 years ago I started teaching videogames development
|
||||
to young people with artistic profile, most of them had never written a single line of code.
|
||||
|
||||
I started with C language basis and, after searching for the most simple and easy-to-use library to teach
|
||||
videogames programming, I found WinBGI; it was great and it worked very well with students, in just a
|
||||
couple of weeks that people that had never written a single line of code were able to program (and understand)
|
||||
a simple PONG and some of them even a BREAKOUT!
|
||||
|
||||
But WinBGI was not the clearer and most organized lib. There were a lot of things I found useless and
|
||||
confusing and some function names were not clear enough for most of the students; not to mention points
|
||||
like no transparencies support or no hardware acceleration.
|
||||
|
||||
So, I decided to create my own lib, hardware accelerated, clear function names, quite organized, well structured,
|
||||
plain C coding and, the most important, primarily intended to LEARN videogames programming.
|
||||
|
||||
I've coded quite a lot in C# and XNA and I really love it (in fact, my students learn C# after C),
|
||||
so, I decided to use C# language notation and XNA naming conventions. That way, students can jump from
|
||||
raylib to XNA, MonoGame or similar libs extremely easily.
|
||||
|
||||
raylib started as a weekend project and after three months of hard work, raylib 1.0 was published on November 2013.
|
||||
|
||||
Enjoy it.
|
||||
|
||||
notes on raylib 1.1
|
||||
-------------------
|
||||
|
||||
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a
|
||||
complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
|
||||
|
||||
A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translate raylib-OpenGL-style
|
||||
immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
|
||||
|
||||
[rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes
|
||||
a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
|
||||
|
||||
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the
|
||||
support of DDS texture files (compressed and uncompressed) along with mipmaps support.
|
||||
|
||||
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1.
|
||||
|
||||
notes on raylib 1.2
|
||||
-------------------
|
||||
|
||||
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a
|
||||
complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
|
||||
|
||||
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the user.
|
||||
On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input
|
||||
system has been written from scratch.
|
||||
|
||||
A new display initialization system has been created to support multiple resolutions, adding black bars if required;
|
||||
user only defines desired screen size and it gets properly displayed.
|
||||
|
||||
Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
|
||||
|
||||
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
|
||||
|
||||
In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/).
|
||||
|
||||
notes on raylib 1.3
|
||||
-------------------
|
||||
|
||||
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality,
|
||||
improves tremendously textures module and also provides some new modules (camera system, gestures system, IMGUI).
|
||||
|
||||
Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be
|
||||
attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included
|
||||
in this release, check raylib/shaders folder.
|
||||
|
||||
Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.),
|
||||
including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
|
||||
|
||||
A brand new [camera](https://github.com/raysan5/raylib/blob/develop/src/camera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person).
|
||||
Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_first_person.c).
|
||||
|
||||
New [gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.h) module simplifies gestures detection on Android and HTML5 programs.
|
||||
|
||||
[raygui](https://github.com/raysan5/raylib/blob/develop/src/raygui.h), the new IMGUI (Immediate Mode GUI) module offers a set of functions to create simple user interfaces,
|
||||
primary intended for tools development. It's still in experimental state but already fully functional.
|
||||
|
||||
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
|
||||
|
||||
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3.
|
||||
|
||||
notes on raylib 1.4
|
||||
-------------------
|
||||
|
||||
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
|
||||
|
||||
First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/develop/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage.
|
||||
|
||||
SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
|
||||
|
||||
New [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) physics module for basic 2D physics support. Still in development but already functional. Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
|
||||
|
||||
[raymath](https://github.com/raysan5/raylib/blob/develop/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
|
||||
|
||||
[gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
|
||||
|
||||
Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental).
|
||||
|
||||
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions, and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple [easings](https://github.com/raysan5/raylib/blob/develop/src/easings.h) module has also been added for values animation.
|
||||
|
||||
Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.
|
||||
|
||||
Lots of code changes and lots of hours of hard work have concluded in this amazing new raylib 1.4.
|
||||
pure spartan-programmers way. Are you ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html)
|
||||
|
||||
features
|
||||
--------
|
||||
|
||||
* Written in plain C code (C99)
|
||||
* Uses C# PascalCase/camelCase notation
|
||||
* Hardware accelerated with OpenGL (1.1, 3.3 or ES2)
|
||||
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c)
|
||||
* Powerful fonts module with multiple SpriteFonts formats support (XNA bitmap fonts, AngelCode fonts, TTF)
|
||||
* Uses PascalCase/camelCase notation
|
||||
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2)
|
||||
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c)
|
||||
* Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF)
|
||||
* Outstanding texture formats support, including compressed formats (DXT, ETC, PVRT, ASTC)
|
||||
* Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps
|
||||
* Powerful math module for Vector and Matrix operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.c)
|
||||
* Audio loading and playing with streaming support (WAV and OGG)
|
||||
* Custom color palette for fancy visuals on raywhite background
|
||||
* Basic 3d support for Geometrics, Models, Billboards, Heightmaps and Cubicmaps
|
||||
* Flexible Materials system, supporting by default diffuse, normal and specular maps
|
||||
* Shaders support, including Model shaders and Postprocessing shaders
|
||||
* Powerful math module for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.c)
|
||||
* Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
|
||||
* Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5**
|
||||
* VR stereo rendering support with configurable HMD device parameters
|
||||
* Custom color palette for fancy visuals on raywhite background
|
||||
* Minimal external dependencies (GLFW3, OpenGL, OpenAL)
|
||||
* Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go))
|
||||
|
||||
raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option by far I found for
|
||||
multiplatform (Windows, Linux, Mac) window/context and input management (clean, focused, great license, well documented, modern, ...).
|
||||
raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for
|
||||
multiplatform (Windows, Linux, Mac) window/context and input management (clean, focused, great license, well documented, modern, maintained, ...).
|
||||
|
||||
raylib uses on its [audio](https://github.com/raysan5/raylib/blob/master/src/audio.c) module, [OpenAL Soft](http://kcat.strangesoft.net/openal.html) audio library, in multiple flavours,
|
||||
to accomodate to Android, Raspberry Pi and HTML5.
|
||||
|
||||
On Android, raylib uses `native_app_glue module` (provided on Android NDK) and native Android libraries to manage window/context, inputs and activity cycle.
|
||||
*On Android, `native_app_glue module` (provided by Android NDK) and native Android libraries are used to manage window/context, inputs and activity life cycle.*
|
||||
|
||||
On Raspberry Pi, raylib uses Videocore API and EGL for window/context management and raw inputs reading.
|
||||
*On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.*
|
||||
|
||||
raylib is licensed under a zlib/libpng license. View [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE.md).
|
||||
building
|
||||
--------
|
||||
|
||||
tools requirements
|
||||
------------------
|
||||
For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
|
||||
|
||||
raylib has been developed using exclusively two tools:
|
||||
|
||||
* Notepad++ (text editor) - [http://notepad-plus-plus.org/](http://notepad-plus-plus.org/)
|
||||
* MinGW (GCC compiler) - [http://www.mingw.org/](http://www.mingw.org/)
|
||||
|
||||
Those are the tools I recommend to develop with raylib, in fact, those are the tools my students use.
|
||||
I believe those are the best tools to train spartan-programmers.
|
||||
|
||||
Someone could argue about debugging. raylib is a library intended for learning and I think C it's a clear enough language
|
||||
to allow writing small-mid size programs with a printf-based debugging. All raylib examples have also been written this way.
|
||||
|
||||
Since raylib v1.1, you can download a Windows Installer package for easy installation and configuration. Check [raylib Webpage](http://www.raylib.com/)
|
||||
|
||||
building source (generate libraylib.a)
|
||||
--------------------------------------
|
||||
|
||||
Check raylib wiki page: [Building source](https://github.com/raysan5/raylib/wiki/Building-source)
|
||||
|
||||
building examples
|
||||
-----------------
|
||||
|
||||
Check raylib wiki page: [Building examples](https://github.com/raysan5/raylib/wiki/Building-examples)
|
||||
Those are the tools recommended to develop with raylib, in fact, those are the tools my students use.
|
||||
|
||||
contact
|
||||
-------
|
||||
@@ -186,26 +65,47 @@ contact
|
||||
|
||||
If you are using raylib and you enjoy it, please, [let me know][raysan5].
|
||||
|
||||
If you feel you can help, then, [helpme!](http://www.raylib.com/helpme.htm)
|
||||
If you feel you can help, then, [helpme!](http://www.raylib.com/helpme.html)
|
||||
|
||||
acknowledgements
|
||||
---------------
|
||||
|
||||
The following people have contributed in some way to make raylib project a reality. Big thanks to them!
|
||||
I believe that time is the most valuable resource and the following people have invested part of their time
|
||||
contributing (in some way or another) to make raylib project better. Huge thanks!
|
||||
|
||||
- [Zopokx](https://github.com/Zopokx) for testing the web.
|
||||
- [Elendow](http://www.elendow.com) for testing and helping on web development.
|
||||
- Victor Dual for implementating and testing of 3D shapes functions.
|
||||
- Marc Palau for implementating and testing of 3D shapes functions and helping on development of camera and getures modules.
|
||||
- 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 for helping on raygui development and tools development.
|
||||
- Victor Fisac for developing physics raylib module (physac) and implementing light shaders and raycast system... and multiple tools and games.
|
||||
- [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 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 his help on OSX to solve High DPI display issue. Thanks Marcelo!
|
||||
- [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for his amazing contribution with raylib Lua module, I just work over his code to implement [rlua](https://github.com/raysan5/raylib/blob/master/src/rlua.h)
|
||||
- [Teodor Stoenescu](https://github.com/teodor-stoenescu) for his 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
|
||||
|
||||
Please, if I forget someone in this list, excuse me and write me an email to remind me to add you!
|
||||
|
||||
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
|
||||
license
|
||||
-------
|
||||
|
||||
raylib 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](LICENSE.md) for further details.
|
||||
|
||||
[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San"
|
||||
|
||||
|
64
ROADMAP.md
@@ -1,37 +1,49 @@
|
||||
roadmap
|
||||
-------
|
||||
|
||||
Current version of raylib is quite complete and functional but there is still a lot of things to add and improve.
|
||||
Here it is a wish list of features I would like to add and functions to improve.
|
||||
Current version of raylib is complete and functional but there is still a lot of room for improvement.
|
||||
Here it is a wish-list with features and ideas to improve the library.
|
||||
|
||||
Note that around the raylib source code there are multiple TODO points with pending revisions/bugs. Check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
|
||||
Note that [raylib source code](https://github.com/raysan5/raylib/tree/develop/src) has some *TODO* marks around code with pending things to review and improve. Check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
|
||||
|
||||
raylib 1.5
|
||||
**raylib 1.x**
|
||||
- [ ] Improved Materials system with PBR support
|
||||
- [ ] Basic GPU stats sytem (memory, draws, time...)
|
||||
- [ ] Improved custom file-format (.rres) and packaging tool
|
||||
- [ ] Procedural image generation functions (spot, gradient, noise...)
|
||||
- [ ] Procedural mesh generation functions (cube, cone, sphere...)
|
||||
- [ ] Touch-based camera controls for Android
|
||||
|
||||
Redesign Shaders/Textures system, use Materials
|
||||
Redesign physics module (physac)
|
||||
Basic GPU stats sytem (memory, draws, time...)
|
||||
Procedural image generation functions (spot, gradient, noise...)
|
||||
Procedural mesh generation functions (cube, cone, sphere...)
|
||||
Touch-based camera controls for Android
|
||||
Skybox and Fog support
|
||||
[IN PROGRESS] LUA scripting support (wrapper to lua lib)
|
||||
**raylib 1.7**
|
||||
- [x] Support configuration flags
|
||||
- [x] Improved build system for Android
|
||||
- [x] Gamepad support on HTML5
|
||||
|
||||
**raylib 1.6**
|
||||
- [x] Lua scripting support (raylib Lua wrapper)
|
||||
- [x] Redesigned audio module
|
||||
- [x] Support FLAC file format
|
||||
|
||||
raylib 1.4
|
||||
**raylib 1.5**
|
||||
- [x] Support Oculus Rift CV1 and VR stereo rendering (simulator)
|
||||
- [x] Redesign Shaders/Textures system -> New Materials system
|
||||
- [x] Support lighting: Omni, Directional and Spot lights
|
||||
- [x] Redesign physics module (physac)
|
||||
- [x] Chiptunes audio modules support
|
||||
|
||||
[DONE] TTF fonts support (using stb_truetype)
|
||||
[DONE] Raycast system for 3D picking (including collisions detection)
|
||||
[DONE] Floyd-Steinberg dithering on 16bit image format conversion
|
||||
[DONE] Basic image manipulation functions (crop, resize, draw...)
|
||||
[DONE] Storage load/save data functionality
|
||||
[DONE] Add Physics module (physac)
|
||||
[DONE] Remove GLEW dependency -> Replaced by GLAD
|
||||
[DONE] Redesign Raspberry PI inputs system
|
||||
[DONE] Redesign gestures module to be multiplatform
|
||||
[DONE] Module raymath as header-only and functions inline
|
||||
[DONE] Add Easings module (easings.h)
|
||||
**raylib 1.4**
|
||||
- [x] TTF fonts support (using stb_truetype)
|
||||
- [x] Raycast system for 3D picking (including collisions detection)
|
||||
- [x] Floyd-Steinberg dithering on 16bit image format conversion
|
||||
- [x] Basic image manipulation functions (crop, resize, draw...)
|
||||
- [x] Storage load/save data functionality
|
||||
- [x] Add Physics module (physac)
|
||||
- [x] Remove GLEW dependency -> Replaced by GLAD
|
||||
- [x] Redesign Raspberry PI inputs system
|
||||
- [x] Redesign gestures module to be multiplatform
|
||||
- [x] Module raymath as header-only and functions inline
|
||||
- [x] Add Easings module (easings.h)
|
||||
|
||||
Any feature missing? Do you have a request? [Let me know!][raysan5]
|
||||
|
||||
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
|
||||
[isssues]: https://github.com/raysan5/raylib/issues
|
||||
[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San"
|
||||
|
156
docs/404.html
Normal file
@@ -0,0 +1,156 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>page not found... :(</title>
|
||||
<style>
|
||||
::-moz-selection {
|
||||
background: #b3d4fc;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #b3d4fc;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
html {
|
||||
padding: 30px 10px;
|
||||
font-size: 20px;
|
||||
line-height: 1.4;
|
||||
color: #737373;
|
||||
background: #f0f0f0;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
html,
|
||||
input {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
max-width: 500px;
|
||||
_width: 500px;
|
||||
padding: 30px 20px 50px;
|
||||
border: 1px solid #b3b3b3;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
|
||||
background: #fcfcfc;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 10px;
|
||||
font-size: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 span {
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 1.5em 0 0.5em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0 0 0 40px;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 380px;
|
||||
_width: 380px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* google search */
|
||||
|
||||
#goog-fixurl ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#goog-fixurl form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#goog-wm-qt,
|
||||
#goog-wm-sb {
|
||||
border: 1px solid #bbb;
|
||||
font-size: 16px;
|
||||
line-height: normal;
|
||||
vertical-align: top;
|
||||
color: #444;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#goog-wm-qt {
|
||||
width: 220px;
|
||||
height: 20px;
|
||||
padding: 5px;
|
||||
margin: 5px 10px 0 0;
|
||||
box-shadow: inset 0 1px 1px #ccc;
|
||||
}
|
||||
|
||||
#goog-wm-sb {
|
||||
display: inline-block;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
margin: 5px 0 0;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
background-color: #f5f5f5;
|
||||
background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
|
||||
background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
|
||||
background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
|
||||
background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
*overflow: visible;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
#goog-wm-sb:hover,
|
||||
#goog-wm-sb:focus {
|
||||
border-color: #aaa;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
#goog-wm-qt:hover,
|
||||
#goog-wm-qt:focus {
|
||||
border-color: #105cb6;
|
||||
outline: 0;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
input::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>not found <span>:(</span></h1>
|
||||
<p>Sorry, but the page you were trying to view does not exist.</p>
|
||||
<p>It looks like this was the result of either:</p>
|
||||
<ul>
|
||||
<li>a mistyped address</li>
|
||||
<li>an out-of-date link</li>
|
||||
</ul>
|
||||
<script>
|
||||
var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
|
||||
</script>
|
||||
<script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
docs/CNAME
Normal file
@@ -0,0 +1 @@
|
||||
www.raylib.com
|
173
docs/cheatsheet/cheatsheet.html
Normal file
@@ -0,0 +1,173 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
|
||||
<title>raylib - cheatsheet</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
|
||||
<meta name="title" content="raylib - cheatsheet">
|
||||
<meta name="description" content="raylib is a simple and easy-to-use library to learn videogames programming. Don't miss latest functions added to raylib... check raylib cheatsheet">
|
||||
<meta name="keywords" content="raylib, videogames, programming, C, C++, library, learn, study, simple, easy, free, open source, raysan">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<!-- Facebook metatags for sharing -->
|
||||
<meta property="og:title" content="raylib - cheatsheet"/>
|
||||
<meta property="og:image" content="http://www.raylib.com/common/img/fb_raylib_logo.png"/>
|
||||
<meta property="og:url" content="http://www.raylib.com" />
|
||||
<meta property="og:site_name" content="raylib"/>
|
||||
<meta property="og:description" content="don't miss latest functions added to raylib... check raylib cheatsheet"/>
|
||||
|
||||
<!-- Add jQuery library -->
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
|
||||
|
||||
<!-- hightlight.js - Syntax highlighting for the Web -->
|
||||
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/docco.min.css">
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'grixel_acme_7_wide_xtnd';
|
||||
src: url('../common/font/acme_7_wide_xtnd.eot');
|
||||
src: url('../common/font/acme_7_wide_xtnd.eot?#iefix') format('embedded-opentype'),
|
||||
url('../common/font/acme_7_wide_xtnd.woff') format('woff'),
|
||||
url('../common/font/acme_7_wide_xtnd.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size-adjust:0.49;
|
||||
}
|
||||
body{background-color:#f5f5f5;}
|
||||
#fulldata{width: 1315px!important;}
|
||||
.eximage img{ margin: 0 auto; border: 1px solid; border-color: black; width:770px; height:auto;}
|
||||
pre code{ width: auto!important; border: 1px solid; border-color:#b0b0b0; width:758px; height:auto; }
|
||||
.exdownbtn{width:250px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px;
|
||||
line-height:30px; text-align: center; border-width:5px; background-color:#e1e1e1; color:#5c5a5a;
|
||||
border:4px solid #898888; font-family: grixel_acme_7_wide_xtnd, Courier New, Verdana, Arial;}
|
||||
.exdownbtn:hover{background-color:#f0d6d6; color:#c55757; border:4px solid #e66666;}
|
||||
#core pre code{border:10px solid; border-color:#888888; background-color:#dbdbe1; }
|
||||
#shapes pre code{border:10px solid; border-color:#e66666; background-color:#e9d0d6; }
|
||||
#textures pre code{border:10px solid; border-color:#75a06d; background-color:#c3e4bf; }
|
||||
#text pre code{border:10px solid; border-color:#52b296; background-color:#b9e9dd; }
|
||||
#models pre code{border:10px solid; border-color:#5d9cbd; background-color:#b9d6e8; }
|
||||
#shaders pre code{border:10px solid; border-color:#a864d2; background-color:#e0c6f1; }
|
||||
#audio pre code{border:10px solid; border-color:#d3b157; background-color:#e5d7ae; }
|
||||
#structs pre code{border:10px solid; border-color:#d2c9c6; background-color:#f8f8ff; height: 440px!important}
|
||||
#colors pre code{border:10px solid; border-color:#c6d2c6; background-color:#e9f1f2; width:600px!important; }
|
||||
#logo{width:128px; height:128px; float:left; position:relative; background-image:url(../common/img/raylib_logo.png);}
|
||||
p{font-family: grixel_acme_7_wide_xtnd, Courier New, Verdana, Arial; font-size:13px; line-height:24px;}
|
||||
#header{position:relative; height:110px; width: 1000px;}
|
||||
#title, #plinks, #version{position:relative; float:left; margin:0px; margin-left:10px; margin-top:10px;}
|
||||
#plinks{color: gray;}
|
||||
#plinks a, #copyright a{color: gray; text-decoration:none;}
|
||||
#plinks a:hover{color: black;}
|
||||
#version {margin-top: 23px;}
|
||||
#pcore{margin-bottom:-12px; margin-left:12px; color:#5c5a5a;}
|
||||
#pshapes{margin-bottom:-12px; margin-left:12px; color:#c55757;}
|
||||
#ptextures{margin-bottom:-12px; margin-left:12px; color:#60815a;}
|
||||
#ptext{margin-bottom:-12px; margin-left:12px; color:#377764;}
|
||||
#pmodels{margin-bottom:-12px; margin-left:12px; color:#417794;}
|
||||
#pshaders{margin-bottom:-12px; margin-left:12px; color:#a864d2;}
|
||||
#paudio{margin-bottom:-12px; margin-left:12px; color:#8c7539;}
|
||||
#pstructs{margin-bottom:-12px; margin-left:12px; color:#bcbccd;}
|
||||
#pcolors{margin-bottom:-12px; margin-left:12px; color:#bcbccd;}
|
||||
|
||||
#leftgroup{position:relative; float:left; width:680px; }
|
||||
#structs{width:660px!important;}
|
||||
#colors{position:relative; float:left; width: auto; }
|
||||
|
||||
#copyright{color:#8b8b8b; font-size:10px; margin-left:590px; display:inline; }
|
||||
#copyright a:hover{color:black;}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$.get('raylib_core.c', function(data) {
|
||||
$('#core pre code').text(data);
|
||||
$('#core pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_shapes.c', function(data) {
|
||||
$('#shapes pre code').text(data);
|
||||
$('#shapes pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_textures.c', function(data) {
|
||||
$('#textures pre code').text(data);
|
||||
$('#textures pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_text.c', function(data) {
|
||||
$('#text pre code').text(data);
|
||||
$('#text pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_models.c', function(data) {
|
||||
$('#models pre code').text(data);
|
||||
$('#models pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_shaders.c', function(data) {
|
||||
$('#shaders pre code').text(data);
|
||||
$('#shaders pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_audio.c', function(data) {
|
||||
$('#audio pre code').text(data);
|
||||
$('#audio pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_colors.c', function(data) {
|
||||
$('#colors pre code').text(data);
|
||||
$('#colors pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
$.get('raylib_structs.c', function(data) {
|
||||
$('#structs pre code').text(data);
|
||||
$('#structs pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
}, 'text');
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<a id="logo" href="http://www.raylib.com/index.html"></a>
|
||||
<p id="title">[simple and easy-to-use library to learn videogames programming]</p>
|
||||
<p id="plinks">[<a href="http://www.facebook.com/raylibgames" target="_blank">www.facebook.com/raylibgames</a>][<a href="https://github.com/raysan5/raylib">github.com/raysan5/raylib</a>]</p>
|
||||
<p id="version">v1.7.0 quick reference card</p>
|
||||
</div>
|
||||
<br>
|
||||
<div id="fulldata">
|
||||
<p id="pcore">module: core</p>
|
||||
<div id="core"><pre><code class="cpp"></code></pre></div>
|
||||
<p id="pshapes">module: shapes</p>
|
||||
<div id="shapes"><pre><code class="cpp"></code></pre></div>
|
||||
<p id="ptextures">module: textures</p>
|
||||
<div id="textures"><pre><code class="cpp"></code></pre></div>
|
||||
<p id="ptext">module: text</p>
|
||||
<div id="text"><pre><code class="cpp"></code></pre></div>
|
||||
<p id="pmodels">module: models</p>
|
||||
<div id="models"><pre><code class="cpp"></code></pre></div>
|
||||
<p id="pshaders">module: shaders (rlgl)</p>
|
||||
<div id="shaders"><pre><code class="cpp"></code></pre></div>
|
||||
<p id="paudio">module: audio</p>
|
||||
<div id="audio"><pre><code class="cpp"></code></pre></div>
|
||||
|
||||
<div id="fullgroup">
|
||||
<div id="leftgroup">
|
||||
<p id="pstructs">structs</p>
|
||||
<div id="structs"><pre><code class="cpp"></code></pre></div>
|
||||
</div>
|
||||
<p id="pcolors">colors</p>
|
||||
<div id="colors"><pre><code class="cpp"></code></pre></div>
|
||||
</div>
|
||||
<p id="copyright">raylib quick reference card - Copyright (c) 2013-2017 Ramon Santamaria (<a href="http://www.twitter.com/raysan5">@raysan5</a>)</p>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Google Analytics tracking code -->
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','http://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-45733555-1', 'raylib.com');
|
||||
ga('require', 'linkid', 'linkid.js');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
56
docs/cheatsheet/raylib_audio.c
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
// Audio device management functions
|
||||
void InitAudioDevice(void); // Initialize audio device and context
|
||||
void CloseAudioDevice(void); // Close the audio device and context (and music stream)
|
||||
bool IsAudioDeviceReady(void); // Check if audio device is ready
|
||||
void SetMasterVolume(float volume); // Set master volume (listener)
|
||||
|
||||
// Wave/Sound loading/unloading functions
|
||||
Wave LoadWave(const char *fileName); // Load wave data from file into RAM
|
||||
Wave LoadWaveEx(float *data, int sampleCount, int sampleRate,
|
||||
int sampleSize, int channels); // Load wave data from float array data (32bit)
|
||||
Sound LoadSound(const char *fileName); // Load sound to memory
|
||||
Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data
|
||||
void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data
|
||||
void UnloadWave(Wave wave); // Unload wave data
|
||||
void UnloadSound(Sound sound); // Unload sound
|
||||
|
||||
// Wave/Sound management functions
|
||||
void PlaySound(Sound sound); // Play a sound
|
||||
void PauseSound(Sound sound); // Pause a sound
|
||||
void ResumeSound(Sound sound); // Resume a paused sound
|
||||
void StopSound(Sound sound); // Stop playing a sound
|
||||
bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
|
||||
void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
|
||||
void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
||||
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
||||
Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
||||
void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
|
||||
float *GetWaveData(Wave wave); // Get samples data from wave as a floats array
|
||||
|
||||
// Music management functions
|
||||
Music LoadMusicStream(const char *fileName); // Load music stream from file
|
||||
void UnloadMusicStream(Music music); // Unload music stream
|
||||
void PlayMusicStream(Music music); // Start music playing
|
||||
void UpdateMusicStream(Music music); // Updates buffers for music streaming
|
||||
void StopMusicStream(Music music); // Stop music playing
|
||||
void PauseMusicStream(Music music); // Pause music playing
|
||||
void ResumeMusicStream(Music music); // Resume playing paused music
|
||||
bool IsMusicPlaying(Music music); // Check if music is playing
|
||||
void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
||||
void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
||||
void SetMusicLoopCount(Music music, float count); // Set music loop count (loop repeats)
|
||||
float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||
float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||
|
||||
// AudioStream management functions
|
||||
AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize,
|
||||
unsigned int channels); // Init audio stream (to stream raw audio pcm data)
|
||||
void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data
|
||||
void CloseAudioStream(AudioStream stream); // Close audio stream and free memory
|
||||
bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
|
||||
void PlayAudioStream(AudioStream stream); // Play audio stream
|
||||
void PauseAudioStream(AudioStream stream); // Pause audio stream
|
||||
void ResumeAudioStream(AudioStream stream); // Resume audio stream
|
||||
void StopAudioStream(AudioStream stream); // Stop audio stream
|
||||
|
30
docs/cheatsheet/raylib_colors.c
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
// Custom raylib color palette for amazing visuals
|
||||
#define LIGHTGRAY (Color){ 200, 200, 200, 255 } // Light Gray
|
||||
#define GRAY (Color){ 130, 130, 130, 255 } // Gray
|
||||
#define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray
|
||||
#define YELLOW (Color){ 253, 249, 0, 255 } // Yellow
|
||||
#define GOLD (Color){ 255, 203, 0, 255 } // Gold
|
||||
#define ORANGE (Color){ 255, 161, 0, 255 } // Orange
|
||||
#define PINK (Color){ 255, 109, 194, 255 } // Pink
|
||||
#define RED (Color){ 230, 41, 55, 255 } // Red
|
||||
#define MAROON (Color){ 190, 33, 55, 255 } // Maroon
|
||||
#define GREEN (Color){ 0, 228, 48, 255 } // Green
|
||||
#define LIME (Color){ 0, 158, 47, 255 } // Lime
|
||||
#define DARKGREEN (Color){ 0, 117, 44, 255 } // Dark Green
|
||||
#define SKYBLUE (Color){ 102, 191, 255, 255 } // Sky Blue
|
||||
#define BLUE (Color){ 0, 121, 241, 255 } // Blue
|
||||
#define DARKBLUE (Color){ 0, 82, 172, 255 } // Dark Blue
|
||||
#define PURPLE (Color){ 200, 122, 255, 255 } // Purple
|
||||
#define VIOLET (Color){ 135, 60, 190, 255 } // Violet
|
||||
#define DARKPURPLE (Color){ 112, 31, 126, 255 } // Dark Purple
|
||||
#define BEIGE (Color){ 211, 176, 131, 255 } // Beige
|
||||
#define BROWN (Color){ 127, 106, 79, 255 } // Brown
|
||||
#define DARKBROWN (Color){ 76, 63, 47, 255 } // Dark Brown
|
||||
|
||||
#define WHITE (Color){ 255, 255, 255, 255 } // White
|
||||
#define BLACK (Color){ 0, 0, 0, 255 } // Black
|
||||
#define BLANK (Color){ 0, 0, 0, 0 } // Transparent
|
||||
#define MAGENTA (Color){ 255, 0, 255, 255 } // Magenta
|
||||
#define RAYWHITE (Color){ 245, 245, 245, 255 } // Ray White
|
||||
|
128
docs/cheatsheet/raylib_core.c
Normal file
@@ -0,0 +1,128 @@
|
||||
|
||||
// Window-related functions
|
||||
void InitWindow(int width, int height, char* title); // Initialize Window and Graphics Context (OpenGL)
|
||||
void CloseWindow(void); // Close window and unload OpenGL context
|
||||
bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
|
||||
bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus)
|
||||
void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP)
|
||||
void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP)
|
||||
void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
|
||||
void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
|
||||
void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
|
||||
int GetScreenWidth(void); // Get current screen width
|
||||
int GetScreenHeight(void); // Get current screen height
|
||||
|
||||
// Cursor-related functions
|
||||
void ShowCursor(void); // Shows cursor
|
||||
void HideCursor(void); // Hides cursor
|
||||
bool IsCursorHidden(void); // Check if cursor is not visible
|
||||
void EnableCursor(void); // Enables cursor (unlock cursor)
|
||||
void DisableCursor(void); // Disables cursor (lock cursor)
|
||||
|
||||
// Drawing-related functions
|
||||
void ClearBackground(Color color); // Set background color (framebuffer clear color)
|
||||
void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing
|
||||
void EndDrawing(void); // End canvas drawing and swap buffers (double buffering)
|
||||
void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera (2D)
|
||||
void End2dMode(void); // Ends 2D mode with custom camera
|
||||
void Begin3dMode(Camera camera); // Initializes 3D mode with custom camera (3D)
|
||||
void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode
|
||||
void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing
|
||||
void EndTextureMode(void); // Ends drawing to render texture
|
||||
|
||||
// Screen-space-related functions
|
||||
Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position
|
||||
Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position
|
||||
Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix)
|
||||
|
||||
// Timming-related functions
|
||||
void SetTargetFPS(int fps); // Set target FPS (maximum)
|
||||
int GetFPS(void); // Returns current FPS
|
||||
float GetFrameTime(void); // Returns time in seconds for last frame drawn
|
||||
|
||||
// Color-related functions
|
||||
int GetHexValue(Color color); // Returns hexadecimal value for a Color
|
||||
Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
|
||||
Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
|
||||
float *ColorToFloat(Color color); // Converts Color to float array and normalizes
|
||||
float *VectorToFloat(Vector3 vec); // Converts Vector3 to float array
|
||||
float *MatrixToFloat(Matrix mat); // Converts Matrix to float array
|
||||
|
||||
// Misc. functions
|
||||
void ShowLogo(void); // Activate raylib logo at startup (can be done with flags)
|
||||
void SetConfigFlags(char flags); // Setup window configuration flags (view FLAGS)
|
||||
void TraceLog(int logType, const char *text, ...); // Show trace log messages (INFO, WARNING, ERROR, DEBUG)
|
||||
void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png)
|
||||
int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
|
||||
|
||||
// Files management functions
|
||||
bool IsFileExtension(const char *fileName, const char *ext); // Check file extension
|
||||
const char *GetDirectoryPath(const char *fileName); // Get directory for a given fileName (with path)
|
||||
const char *GetWorkingDirectory(void); // Get current working directory
|
||||
bool ChangeDirectory(const char *dir); // Change working directory, returns true if success
|
||||
bool IsFileDropped(void); // Check if a file has been dropped into window
|
||||
char **GetDroppedFiles(int *count); // Get dropped files names
|
||||
void ClearDroppedFiles(void); // Clear dropped files paths buffer
|
||||
|
||||
// Persistent storage management
|
||||
void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position)
|
||||
int StorageLoadValue(int position); // Load integer value from storage file (from defined position)
|
||||
|
||||
// Input-related functions: keyboard
|
||||
bool IsKeyPressed(int key); // Detect if a key has been pressed once
|
||||
bool IsKeyDown(int key); // Detect if a key is being pressed
|
||||
bool IsKeyReleased(int key); // Detect if a key has been released once
|
||||
bool IsKeyUp(int key); // Detect if a key is NOT being pressed
|
||||
int GetKeyPressed(void); // Get latest key pressed
|
||||
void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
|
||||
|
||||
// Input-related functions: gamepads
|
||||
bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available
|
||||
bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available)
|
||||
const char *GetGamepadName(int gamepad); // Return gamepad internal name id
|
||||
bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once
|
||||
bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed
|
||||
bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once
|
||||
bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed
|
||||
int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
|
||||
int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad
|
||||
float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis
|
||||
|
||||
// Input-related functions: mouse
|
||||
bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once
|
||||
bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed
|
||||
bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once
|
||||
bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed
|
||||
int GetMouseX(void); // Returns mouse position X
|
||||
int GetMouseY(void); // Returns mouse position Y
|
||||
Vector2 GetMousePosition(void); // Returns mouse position XY
|
||||
void SetMousePosition(Vector2 position); // Set mouse position XY
|
||||
int GetMouseWheelMove(void); // Returns mouse wheel movement Y
|
||||
|
||||
// Input-related functions: touch
|
||||
int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size)
|
||||
int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size)
|
||||
Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size)
|
||||
|
||||
// Gestures-related functions
|
||||
void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags
|
||||
bool IsGestureDetected(int gesture); // Check if a gesture have been detected
|
||||
int GetGestureDetected(void); // Get latest detected gesture
|
||||
int GetTouchPointsCount(void); // Get touch points count
|
||||
float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
|
||||
Vector2 GetGestureDragVector(void); // Get gesture drag vector
|
||||
float GetGestureDragAngle(void); // Get gesture drag angle
|
||||
Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
|
||||
float GetGesturePinchAngle(void); // Get gesture pinch angle
|
||||
|
||||
// Camera-related functions
|
||||
SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
|
||||
void UpdateCamera(Camera *camera); // Update camera position for selected mode
|
||||
void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera)
|
||||
void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera)
|
||||
void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera)
|
||||
void SetCameraMoveControls(int frontKey, int backKey,
|
||||
int rightKey, int leftKey,
|
||||
int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras)
|
||||
|
||||
|
82
docs/cheatsheet/raylib_defines.c
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
|
||||
// Keyboard Function Keys
|
||||
#define KEY_SPACE 32
|
||||
#define KEY_ESCAPE 256
|
||||
#define KEY_ENTER 257
|
||||
#define KEY_BACKSPACE 259
|
||||
#define KEY_RIGHT 262
|
||||
#define KEY_LEFT 263
|
||||
#define KEY_DOWN 264
|
||||
#define KEY_UP 265
|
||||
#define KEY_F1 290
|
||||
#define KEY_F2 291
|
||||
#define KEY_F3 292
|
||||
#define KEY_F4 293
|
||||
#define KEY_F5 294
|
||||
#define KEY_F6 295
|
||||
#define KEY_F7 296
|
||||
#define KEY_F8 297
|
||||
#define KEY_F9 298
|
||||
#define KEY_F10 299
|
||||
#define KEY_LEFT_SHIFT 340
|
||||
#define KEY_LEFT_CONTROL 341
|
||||
#define KEY_LEFT_ALT 342
|
||||
#define KEY_RIGHT_SHIFT 344
|
||||
#define KEY_RIGHT_CONTROL 345
|
||||
#define KEY_RIGHT_ALT 346
|
||||
|
||||
// Mouse Buttons
|
||||
#define MOUSE_LEFT_BUTTON 0
|
||||
#define MOUSE_RIGHT_BUTTON 1
|
||||
#define MOUSE_MIDDLE_BUTTON 2
|
||||
|
||||
// Gamepad Number
|
||||
#define GAMEPAD_PLAYER1 0
|
||||
#define GAMEPAD_PLAYER2 1
|
||||
#define GAMEPAD_PLAYER3 2
|
||||
#define GAMEPAD_PLAYER4 3
|
||||
|
||||
// Gamepad Buttons
|
||||
// NOTE: Adjusted for a PS3 USB Controller
|
||||
#define GAMEPAD_BUTTON_A 2
|
||||
#define GAMEPAD_BUTTON_B 1
|
||||
#define GAMEPAD_BUTTON_X 3
|
||||
#define GAMEPAD_BUTTON_Y 4
|
||||
#define GAMEPAD_BUTTON_R1 7
|
||||
#define GAMEPAD_BUTTON_R2 5
|
||||
#define GAMEPAD_BUTTON_L1 6
|
||||
#define GAMEPAD_BUTTON_L2 8
|
||||
#define GAMEPAD_BUTTON_SELECT 9
|
||||
#define GAMEPAD_BUTTON_START 10
|
||||
|
||||
|
||||
// Some Basic Colors
|
||||
// NOTE: Custom raylib color palette for amazing visuals
|
||||
#define LIGHTGRAY (Color){ 200, 200, 200, 255 } // Light Gray
|
||||
#define GRAY (Color){ 130, 130, 130, 255 } // Gray
|
||||
#define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray
|
||||
#define YELLOW (Color){ 253, 249, 0, 255 } // Yellow
|
||||
#define GOLD (Color){ 255, 203, 0, 255 } // Gold
|
||||
#define ORANGE (Color){ 255, 161, 0, 255 } // Orange
|
||||
#define PINK (Color){ 255, 109, 194, 255 } // Pink
|
||||
#define RED (Color){ 230, 41, 55, 255 } // Red
|
||||
#define MAROON (Color){ 190, 33, 55, 255 } // Maroon
|
||||
#define GREEN (Color){ 0, 228, 48, 255 } // Green
|
||||
#define LIME (Color){ 0, 158, 47, 255 } // Lime
|
||||
#define DARKGREEN (Color){ 0, 117, 44, 255 } // Dark Green
|
||||
#define SKYBLUE (Color){ 102, 191, 255, 255 } // Sky Blue
|
||||
#define BLUE (Color){ 0, 121, 241, 255 } // Blue
|
||||
#define DARKBLUE (Color){ 0, 82, 172, 255 } // Dark Blue
|
||||
#define PURPLE (Color){ 200, 122, 255, 255 } // Purple
|
||||
#define VIOLET (Color){ 135, 60, 190, 255 } // Violet
|
||||
#define DARKPURPLE (Color){ 112, 31, 126, 255 } // Dark Purple
|
||||
#define BEIGE (Color){ 211, 176, 131, 255 } // Beige
|
||||
#define BROWN (Color){ 127, 106, 79, 255 } // Brown
|
||||
#define DARKBROWN (Color){ 76, 63, 47, 255 } // Dark Brown
|
||||
|
||||
#define WHITE (Color){ 255, 255, 255, 255 } // White
|
||||
#define BLACK (Color){ 0, 0, 0, 255 } // Black
|
||||
#define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent)
|
||||
#define MAGENTA (Color){ 255, 0, 255, 255 } // Magenta
|
||||
#define RAYWHITE (Color){ 245, 245, 245, 255 } // Ray White (raylib logo)
|
61
docs/cheatsheet/raylib_models.c
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
// Basic geometric 3D shapes drawing functions
|
||||
void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
|
||||
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis,
|
||||
float rotationAngle, Color color); // Draw a circle in 3D world space
|
||||
void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube
|
||||
void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
|
||||
void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires
|
||||
void DrawCubeTexture(Texture2D texture, Vector3 position, float width,
|
||||
float height, float lenght, Color color); // Draw cube textured
|
||||
void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere
|
||||
void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters
|
||||
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
|
||||
void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom,
|
||||
float height, int slices, Color color); // Draw a cylinder/cone
|
||||
void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom,
|
||||
float height, int slices, Color color); // Draw a cylinder/cone wires
|
||||
void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
|
||||
void DrawRay(Ray ray, Color color); // Draw a ray line
|
||||
void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
|
||||
void DrawGizmo(Vector3 position); // Draw simple gizmo
|
||||
|
||||
// Model loading/unloading functions
|
||||
Mesh LoadMesh(const char *fileName); // Load mesh from file
|
||||
Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData); // Load mesh from vertex data
|
||||
Model LoadModel(const char *fileName); // Load model from file
|
||||
Model LoadModelFromMesh(Mesh data, bool dynamic); // Load model from mesh data
|
||||
Model LoadHeightmap(Image heightmap, Vector3 size); // Load heightmap model from image data
|
||||
Model LoadCubicmap(Image cubicmap); // Load cubes-based map model from image data
|
||||
void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM)
|
||||
void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM)
|
||||
|
||||
// Material loading/unloading functions
|
||||
Material LoadMaterial(const char *fileName); // Load material data (from file)
|
||||
Material LoadDefaultMaterial(void); // Load default material (uses default models shader)
|
||||
void UnloadMaterial(Material material); // Unload material textures from VRAM
|
||||
|
||||
// Model drawing functions
|
||||
void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
|
||||
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis,
|
||||
float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
|
||||
void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
|
||||
void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis,
|
||||
float rotationAngle, Vector3 scale, Color tint); // Draw a model wires
|
||||
void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
|
||||
void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture
|
||||
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec,
|
||||
Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec
|
||||
|
||||
// Collision detection functions
|
||||
bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres
|
||||
bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2); // Detect collision between two boxes
|
||||
bool CheckCollisionBoxSphere(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere
|
||||
bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere
|
||||
bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere ex.
|
||||
bool CheckCollisionRayBox(Ray ray, Vector3 minBBox, Vector3 maxBBox); // Detect collision between ray and box
|
||||
BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits
|
||||
RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh); // Get collision info between ray and mesh
|
||||
RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||
RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
|
||||
|
32
docs/cheatsheet/raylib_shaders.c
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
// Shader loading/unloading functions
|
||||
char *LoadText(const char *fileName); // Load chars array from text file
|
||||
Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations
|
||||
void UnloadShader(Shader shader); // Unload a custom shader from memory
|
||||
|
||||
Shader GetDefaultShader(void); // Get default shader
|
||||
Texture2D GetDefaultTexture(void); // Get default texture
|
||||
|
||||
// Shader access functions
|
||||
int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
|
||||
void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float)
|
||||
void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int)
|
||||
void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
|
||||
void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
|
||||
void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
|
||||
|
||||
// Shading beegin/end functions
|
||||
void BeginShaderMode(Shader shader); // Begin custom shader drawing
|
||||
void EndShaderMode(void); // End custom shader drawing (use default shader)
|
||||
void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied)
|
||||
void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
|
||||
|
||||
// VR control functions
|
||||
void InitVrSimulator(int vrDevice); // Init VR simulator for selected device
|
||||
void CloseVrSimulator(void); // Close VR simulator for current device
|
||||
bool IsVrSimulatorReady(void); // Detect if VR simulator is ready
|
||||
void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera
|
||||
void ToggleVrMode(void); // Enable/Disable VR experience
|
||||
void BeginVrDrawing(void); // Begin VR simulator stereo rendering
|
||||
void EndVrDrawing(void); // End VR simulator stereo rendering
|
||||
|
33
docs/cheatsheet/raylib_shapes.c
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
// Basic shapes drawing functions
|
||||
void DrawPixel(int posX, int posY, Color color); // Draw a pixel
|
||||
void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
|
||||
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
|
||||
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version)
|
||||
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness
|
||||
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out
|
||||
void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
|
||||
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
|
||||
void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
|
||||
void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
|
||||
void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
|
||||
void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
|
||||
void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
|
||||
void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle
|
||||
void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
|
||||
void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
||||
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle
|
||||
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline
|
||||
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
|
||||
void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points
|
||||
void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines
|
||||
|
||||
// Basic shapes collision detection functions
|
||||
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
|
||||
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
|
||||
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
|
||||
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
|
||||
bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
|
||||
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
|
||||
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
|
||||
|
29
docs/cheatsheet/raylib_structs.c
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
struct Color; // Color type, RGBA (32bit)
|
||||
struct Rectangle; // Rectangle type
|
||||
struct Vector2; // Vector2 type
|
||||
struct Vector3; // Vector3 type
|
||||
struct Matrix; // Matrix type (OpenGL style 4x4)
|
||||
|
||||
struct Image; // Image type (multiple data formats supported)
|
||||
// NOTE: Data stored in CPU memory (RAM)
|
||||
struct Texture2D; // Texture2D type (multiple internal formats supported)
|
||||
// NOTE: Data stored in GPU memory (VRAM)
|
||||
struct RenderTexture2D; // RenderTexture2D type, for texture rendering
|
||||
struct SpriteFont; // SpriteFont type, includes texture and chars data
|
||||
|
||||
struct Camera; // Camera type, defines 3d camera position/orientation
|
||||
struct Camera2D; // Camera2D type, defines a 2d camera
|
||||
struct Mesh; // Vertex data definning a mesh
|
||||
struct Shader; // Shader type (generic shader)
|
||||
struct Material; // Material type
|
||||
struct Light; // Light type, defines light properties
|
||||
struct Model; // Basic 3d Model type
|
||||
struct Ray; // Ray type (useful for raycast)
|
||||
struct RayHitInfo; // Raycast hit information
|
||||
|
||||
struct Wave; // Wave type, defines audio wave data
|
||||
struct Sound; // Basic Sound source and buffer
|
||||
struct Music; // Music type (file streaming from memory)
|
||||
struct AudioStream; // Raw audio stream type
|
||||
|
19
docs/cheatsheet/raylib_text.c
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
// SpriteFont loading/unloading functions
|
||||
SpriteFont GetDefaultFont(void); // Get the default SpriteFont
|
||||
SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory
|
||||
SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int numChars, int *fontChars); // Load a SpriteFont from TTF font with parameters
|
||||
void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory
|
||||
|
||||
// Text drawing functions
|
||||
void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner
|
||||
void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||
void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters
|
||||
int fontSize, int spacing, Color tint);
|
||||
|
||||
// Text misc. functions
|
||||
int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||
Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing); // Measure string size for SpriteFont
|
||||
const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
|
||||
const char *SubText(const char *text, int position, int length); // Get a piece of a text string
|
||||
|
52
docs/cheatsheet/raylib_textures.c
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
// Image/Texture2D data loading/unloading functions
|
||||
Image LoadImage(const char *fileName); // Load an image into CPU memory (RAM)
|
||||
Image LoadImageEx(Color *pixels, int width, int height); // Load image data from Color array data (RGBA - 32bit)
|
||||
Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters
|
||||
Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image data from RAW file
|
||||
Texture2D LoadTexture(const char *fileName); // Load an image as texture into GPU memory
|
||||
Texture2D LoadTextureFromImage(Image image); // Load a texture from image data
|
||||
RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering
|
||||
void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
||||
void UnloadTexture(Texture2D texture); // Unload texture from GPU memory
|
||||
void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory
|
||||
Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
|
||||
Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
|
||||
void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data
|
||||
|
||||
// Image manipulation functions
|
||||
void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two)
|
||||
void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
|
||||
void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
||||
void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
||||
Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
|
||||
void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
||||
void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering)
|
||||
void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm)
|
||||
Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
||||
Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font)
|
||||
void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image
|
||||
void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination)
|
||||
void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text,
|
||||
int fontSize, int spacing, Color color); // Draw text (custom sprite font) within image
|
||||
void ImageFlipVertical(Image *image); // Flip image vertically
|
||||
void ImageFlipHorizontal(Image *image); // Flip image horizontally
|
||||
void ImageColorTint(Image *image, Color color); // Modify image color: tint
|
||||
void ImageColorInvert(Image *image); // Modify image color: invert
|
||||
void ImageColorGrayscale(Image *image); // Modify bimage color: grayscale
|
||||
void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
||||
void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
||||
|
||||
// Texture2D configuration functions
|
||||
void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
|
||||
void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode
|
||||
void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode
|
||||
|
||||
// Texture2D drawing functions
|
||||
void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D
|
||||
void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
|
||||
void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
||||
void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
||||
void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, // Draw a part of a texture defined by a rectangle with 'pro' parameters
|
||||
float rotation, Color tint);
|
||||
|
66
docs/common/css/examples.css
Normal file
@@ -0,0 +1,66 @@
|
||||
#container .mix{ position: relative; display: none; }
|
||||
#container .extext { top: 160px!important; width: 400px!important; }
|
||||
|
||||
#filter_menu { width: 820px; height: 80px; margin-left: 18px; }
|
||||
|
||||
.legendButton { padding:5px 15px; float:left; margin-left:10px; margin-right:10px; margin-bottom: 20px; }
|
||||
#core { cursor:pointer; background-color:#e1e1e1; color:#5c5a5a; border:3px solid #898888; }
|
||||
#shapes { cursor:pointer; background-color:#f0d6d6; color:#c55757; border:3px solid #e66666; }
|
||||
#textures { cursor:pointer; background-color:#c8eabf; color:#60815a; border:3px solid #75a06d; }
|
||||
#text { cursor:pointer; background-color:#bef0dd; color:#377764; border:3px solid #52b296; }
|
||||
#models { cursor:pointer; background-color:#bedce8; color:#417794; border:3px solid #5d9cbd; }
|
||||
#shaders { cursor:pointer; background-color:#e2c3f5; color:#a864d2; border:3px solid #a864d2; }
|
||||
#audio { cursor:pointer; background-color:#ebddae; color:#8c7539; border:3px solid #d3b157; }
|
||||
|
||||
.core:hover { background-color:#e1e1e1; color:#5c5a5a; border:4px solid #898888; }
|
||||
.shapes:hover { background-color:#f0d6d6; color:#c55757; border:4px solid #e66666; }
|
||||
.textures:hover { background-color:#c8eabf; color:#60815a; border:4px solid #75a06d; }
|
||||
.text:hover { background-color:#bef0dd; color:#377764; border:4px solid #52b296; }
|
||||
.models:hover { background-color:#bedce8; color:#417794; border:4px solid #5d9cbd; }
|
||||
.audio:hover { background-color:#ebddae; color:#8c7539; border:4px solid #d3b157; }
|
||||
|
||||
.fcore { border: 1px solid #898888; margin-left: 12px; }
|
||||
.fshapes { border: 1px solid #e66666; margin-left: 12px; }
|
||||
.ftextures { border: 1px solid #75a06d; margin-left: 12px; }
|
||||
.ftext { border: 1px solid #52b296; margin-left: 12px; }
|
||||
.fmodels { border: 1px solid #5d9cbd; margin-left: 12px; }
|
||||
.fshaders { border: 1px solid #a864d2; margin-left: 12px; }
|
||||
.faudio { border: 1px solid #d3b157; margin-left: 12px; }
|
||||
|
||||
.fcore p { color:#5c5a5a!important; }
|
||||
.fshapes p { color:#c55757!important; }
|
||||
.ftextures p { color:#60815a!important; }
|
||||
.ftext p { color:#377764!important; }
|
||||
.fmodels p { color:#417794!important; }
|
||||
.fshaders p { color:#a864d2!important; }
|
||||
.faudio p { color:#8c7539!important; }
|
||||
|
||||
#container .fcore a img, #container .fcore a { border: none; overflow: hidden; float: left; background-color: #e1e1e1; opacity: 1; }
|
||||
#container .fcore a:hover { border: 10px solid #898888; }
|
||||
#container .fcore a:hover img { margin: -10px; opacity: 0.4; }
|
||||
|
||||
#container .fshapes a img, #container .fshapes a { border: none; overflow: hidden; float: left; background-color: #f0d6d6; opacity: 1; }
|
||||
#container .fshapes a:hover { border: 10px solid #e66666; }
|
||||
#container .fshapes a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .ftextures a img, #container .ftextures a { border: none; overflow: hidden; float: left; background-color: #c8eabf; opacity: 1; }
|
||||
#container .ftextures a:hover { border: 10px solid #75a06d; }
|
||||
#container .ftextures a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .ftext a img, #container .ftext a { border: none; overflow: hidden; float: left; background-color: #bef0dd; opacity: 1; }
|
||||
#container .ftext a:hover { border: 10px solid #52b296; }
|
||||
#container .ftext a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .fmodels a img, #container .fmodels a { border: none; overflow: hidden; float: left; background-color: #bedce8; opacity: 1; }
|
||||
#container .fmodels a:hover { border: 10px solid #5d9cbd; }
|
||||
#container .fmodels a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .fshaders a img, #container .fshaders a { border: none; overflow: hidden; float: left; background-color: #e0c6f1; opacity: 1; }
|
||||
#container .fshaders a:hover { border: 10px solid #a864d2; }
|
||||
#container .fshaders a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .faudio a img, #container .faudio a { border: none; overflow: hidden; float: left; background-color: #ebddae; opacity: 1; }
|
||||
#container .faudio a:hover { border: 10px solid #d3b157; }
|
||||
#container .faudio a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .extext { position:absolute; top:140px; width:320px; text-align: center; display: none; }
|
35
docs/common/css/games.css
Normal file
@@ -0,0 +1,35 @@
|
||||
#container .mix{ position: relative; display: none; }
|
||||
#container .extext { top: 160px!important; width: 400px!important; }
|
||||
|
||||
#filter_menu { width: 820px; height: 80px; margin-left: 18px; }
|
||||
|
||||
.legendButton { padding:5px 15px; float:left; margin-left:10px; margin-right:10px; margin-bottom: 20px; }
|
||||
#sample { cursor:pointer; background-color:#e1e1e1; color:#5c5a5a; border:3px solid #898888; }
|
||||
#game { cursor:pointer; background-color:#f0d6d6; color:#c55757; border:3px solid #e66666; }
|
||||
#user { cursor:pointer; background-color:#bedce8; color:#417794; border:3px solid #5d9cbd; }
|
||||
|
||||
.sample:hover { background-color:#e1e1e1; color:#5c5a5a; border:4px solid #898888; }
|
||||
.game:hover { background-color:#f0d6d6; color:#c55757; border:4px solid #e66666; }
|
||||
.user:hover { background-color:#bedce8; color:#417794; border:4px solid #5d9cbd; }
|
||||
|
||||
.fsample { border: 1px solid #898888; margin-left: 12px; }
|
||||
.fgame { border: 1px solid #e66666; margin-left: 12px; }
|
||||
.fuser { border: 1px solid #5d9cbd; margin-left: 12px; }
|
||||
|
||||
.fsample p { color:#5c5a5a!important; }
|
||||
.fgame p { color:#c55757!important; }
|
||||
.fuser p { color:#417794!important; }
|
||||
|
||||
#container .fsample a img, #container .fsample a { border: none; overflow: hidden; float: left; background-color: #e1e1e1; opacity: 1; }
|
||||
#container .fsample a:hover { border: 10px solid #898888; }
|
||||
#container .fsample a:hover img { margin: -10px; opacity: 0.4; }
|
||||
|
||||
#container .fgame a img, #container .fgame a { border: none; overflow: hidden; float: left; background-color: #f0d6d6; opacity: 1; }
|
||||
#container .fgame a:hover { border: 10px solid #e66666; }
|
||||
#container .fgame a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .fuser a img, #container .fuser a { border: none; overflow: hidden; float: left; background-color: #bedce8; opacity: 1; }
|
||||
#container .fuser a:hover { border: 10px solid #5d9cbd; }
|
||||
#container .fuser a:hover img { margin: -10px; opacity: 0.3; }
|
||||
|
||||
#container .extext { position:absolute; top:140px; width:320px; text-align: center; display: none; }
|
111
docs/common/css/main.css
Normal file
@@ -0,0 +1,111 @@
|
||||
@font-face {
|
||||
font-family: 'grixel_acme_7_wide_xtnd';
|
||||
src: url('../font/acme_7_wide_xtnd.eot');
|
||||
src: url('../font/acme_7_wide_xtnd.eot?#iefix') format('embedded-opentype'),
|
||||
url('../font/acme_7_wide_xtnd.woff') format('woff'),
|
||||
url('../font/acme_7_wide_xtnd.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size-adjust:0.49;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar { width: 10px; height: 10px; }
|
||||
::-webkit-scrollbar-button:start:decrement,
|
||||
::-webkit-scrollbar-button:end:increment { display: block; height: 10px; }
|
||||
::-webkit-scrollbar-button:vertical:increment { background-color: #fff; }
|
||||
::-webkit-scrollbar-track-piece { background-color: #bdbdbd; }
|
||||
::-webkit-scrollbar-thumb:vertical { height: 50px; background-color: #000000; }
|
||||
::-webkit-scrollbar-thumb:horizontal { width: 50px; background-color: #000000; }
|
||||
|
||||
*{padding:0px; margin:0px; font-family: grixel_acme_7_wide_xtnd, Courier New, Verdana, Arial; -moz-font-smoothing: none;-webkit-font-smoothing: none; line-height:24px;}
|
||||
a{text-decoration: none; color:black;}
|
||||
body{background-color:#f5f5f5;}
|
||||
p a:hover{text-decoration: none; color:gray;}
|
||||
|
||||
.page{width:840px; margin:0 auto;}
|
||||
|
||||
.header{width:100%; float:left; position:relative; height:128px; font-size:10pt; margin-top:40px; margin-left:10px;}
|
||||
.content{font-size:8pt; width:840px; padding:10px; padding-top:30px; float:left; position:relative; padding-bottom:50px;}
|
||||
.footer{width:100%; float:left; position:relative; border-top:1px solid black; text-align: right; height:40px; padding-top:10px;}
|
||||
.footer p a{color:#aaaaaa;}
|
||||
.footer p a:hover{color:#444;}
|
||||
.footer p { font-size:6pt; color:#aaaaaa; margin-top:-8px; }
|
||||
.simplelink { font-weight: bold; color: #ff6060; }
|
||||
|
||||
/* font change for better reading... */
|
||||
.content p, .content a, .content p strong, .content strong, .content .downloadText{font-family: Courier New, Verdana, Arial!important; font-size: medium; line-height: 200%; }
|
||||
.downloadButtonInstaller { font-size: x-small; }
|
||||
.list, .list strong {font-family: Courier New, Verdana, Arial!important; font-size: medium; line-height: 200%; }
|
||||
|
||||
#logo{width:128px; height:128px; float:left; position:relative; background-image:url(../img/raylib_logo.png);}
|
||||
.menu{width:680px; height:39px; text-align:right; right:0px; bottom:7px; position:relative; float:left; margin-left: 30px;}
|
||||
.menu a{padding:5px 20px; color:black; font-size:12pt; float:left; position:relative; border-bottom:1px solid black;}
|
||||
.menu a:hover{margin-top:-20px; padding:15px 15px; background: rgb(254,255,255);
|
||||
background: -moz-linear-gradient(top, rgba(245,245,245,1) 0%, rgba(224,224,224,1) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(245,245,245,1)), color-stop(100%,rgba(224,224,224,1)));
|
||||
background: -webkit-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
background: -o-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
background: -ms-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
background: linear-gradient(to bottom, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e0e0e0',GradientType=0 ); }
|
||||
|
||||
#active{
|
||||
padding:5px 15px; color:#707070; font-size:12pt; float:left; position:relative; border-bottom:1px solid black;
|
||||
margin-top:-20px; padding:15px 15px; background: rgb(254,255,255);
|
||||
background: -moz-linear-gradient(top, rgba(245,245,245,1) 0%, rgba(224,224,224,1) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(245,245,245,1)), color-stop(100%,rgba(224,224,224,1)));
|
||||
background: -webkit-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
background: -o-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
background: -ms-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
background: linear-gradient(to bottom, rgba(245,245,245,1) 0%,rgba(224,224,224,1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e0e0e0',GradientType=0 );
|
||||
}
|
||||
|
||||
#social{ width:372px; height:50px; position:relative; float:right; margin-right:8px; margin-top:20px; margin-bottom:20px; }
|
||||
#social a:hover{ background-position: 0 -36px;}
|
||||
#youtube{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_youtube.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#handmade{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_handmade.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#twitch{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_twitch.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#patreon{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_patreon.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#itchio{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_itchio.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#reddit{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_reddit.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#freenode{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_freenode_irc.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#facebook{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_facebook.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#twitter{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_twitter.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
#github{ width:36px; height:36px; float:left; position:relative; background-image: url(../img/icon_github.png); cursor: pointer; background-repeat:no-repeat; background-position: 0 0;}
|
||||
.list{margin-top:10px; margin-left:30px; display: inline-block}
|
||||
|
||||
#licensebox { width:808px; height:400px; border:12px solid; border-color:#d0d0d0; background-color:#e4e4e4;}
|
||||
#licensebox p { font-size:12px; margin-top: 15px; margin-left: 10px;}
|
||||
.licensepoint { margin-left: 25px!important;}
|
||||
|
||||
.downloadText{width:420px; height:40px; float:left; position:relative; margin-left:40px;}
|
||||
.downloadButton{width:220px; height:35px; float:left; position: relative; cursor:pointer; font-weight: bold; line-height:35px; text-align: center; border-width:5px!important;}
|
||||
.downloadButtonInstaller{width:460px; height:35px; position: relative; margin: auto auto; margin-top:20px!important; cursor:pointer; font-weight: bold; line-height:35px; text-align: center; border-width:5px!important;}
|
||||
#btngit{background-color:#e1e1e1; color:#5c5a5a; border:4px solid #898888;}
|
||||
#btngit:hover{background-color:#bedce8; color:#417794; border:4px solid #5d9cbd;}
|
||||
#btnlib{background-color:#e1e1e1; color:#5c5a5a; border:4px solid #898888; margin-top: 15px;}
|
||||
#btnlib:hover{background-color:#f0d6d6; color:#c55757; border:4px solid #e66666; margin-top: 15px;}
|
||||
#btnmac{font-weight: normal; cursor:default; background-color:#f0f0f0; color:#5c5a5a; border:4px solid #d3d3d3;}
|
||||
#newVersion{background-color:#f0d6d6; color:#e55757; border:1px solid #f66666; margin-top: 15px; margin-left: -5px; width:100%; height:30px; position: relative; margin: auto auto; line-height:30px; text-align: center;}
|
||||
#raylib13{position:relative; background-color:#222222; color:#f5f5f5; width:100vw; left:calc(-52vw + 50%); padding:30px; text-align:center; margin: 10px;}
|
||||
|
||||
#basicgrid{width:580px; margin-left:60px; float:left; position:relative; text-align: center}
|
||||
#advgrid{width:560px; margin-left:70px; float:left; position:relative; text-align: center}
|
||||
.exampleBox{cursor:pointer; margin:15px 20px; width:54px; padding-right:2px; height:56px; border:4px solid black; display:inline-block; text-align: right; font-weight: bold; vertical-align: bottom;}
|
||||
.exampleBox .in{display: table-cell; vertical-align: bottom; width:52px; height:56px;}
|
||||
|
||||
.specialBox{cursor:pointer; vertical-align: bottom; color:#818181; width:56px; height:58px; padding-right:2px; padding-top:4px; padding-left:4px; margin:15px 20px; display:inline-block; border:1px solid #b9b9b9; text-align:right;}
|
||||
.specialBox .in{display: table-cell; vertical-align: bottom; width:52px; height:52px; border:1px solid #b9b9b9; margin-top:-5px;}
|
||||
.specialBox:hover{ color: black; border:1px solid black; }
|
||||
.specialBox .in:hover{ color: black; border:1px solid black; }
|
||||
.boxintext{margin-bottom: 3px; margin-right: 2px; line-height:10px; font-size:6pt;}
|
||||
.boxintextex{margin-bottom: 3px; margin-right: -2px; line-height:10px; font-size:6pt; width:54px!important; height:53px!important; font-weight: normal!important;}
|
||||
.boxtodo{margin-bottom: 13px; margin-right: 7px;}
|
||||
|
||||
.help{font-size:8px; margin-left: 25px;}
|
||||
#paypalbox{width:200px; height:50px; border:12px solid; border-color:#d0d0d0; background-color:#e4e4e4; margin:0 auto;}
|
||||
#paypalform input {margin-top: 12px; margin-left: 50px;}
|
||||
#forum{color: maroon;}
|
||||
|
||||
#itchioframe{display:block;text-align:center;}
|
BIN
docs/common/font/acme_7_wide_xtnd.eot
Normal file
BIN
docs/common/font/acme_7_wide_xtnd.ttf
Normal file
BIN
docs/common/font/acme_7_wide_xtnd.woff
Normal file
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
docs/common/img/icon_facebook.png
Normal file
After Width: | Height: | Size: 583 B |
BIN
docs/common/img/icon_freenode_irc.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
docs/common/img/icon_github.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
docs/common/img/icon_handmade.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
docs/common/img/icon_itchio.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
docs/common/img/icon_patreon.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
docs/common/img/icon_reddit.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
docs/common/img/icon_twitch.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
docs/common/img/icon_twitter.png
Normal file
After Width: | Height: | Size: 856 B |
BIN
docs/common/img/icon_youtube.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
docs/common/img/ln_raylib_logo.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
docs/common/img/raylib_logo_64x64.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
89
docs/common/js/examples.js
Normal file
@@ -0,0 +1,89 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
// Init fancybox
|
||||
$('.fancybox').fancybox();
|
||||
|
||||
var exampleName = [
|
||||
'core_basic_window',
|
||||
'core_input_keys',
|
||||
'core_input_mouse',
|
||||
'core_mouse_wheel',
|
||||
'core_input_gamepad',
|
||||
'core_random_values',
|
||||
'core_color_select',
|
||||
'core_drop_files',
|
||||
'core_storage_values',
|
||||
'core_gestures_detection',
|
||||
'core_3d_mode',
|
||||
'core_3d_picking',
|
||||
'core_3d_camera_free',
|
||||
'core_3d_camera_first_person',
|
||||
'core_2d_camera',
|
||||
'core_world_screen',
|
||||
'core_vr_simulator',
|
||||
'shapes_logo_raylib',
|
||||
'shapes_basic_shapes',
|
||||
'shapes_colors_palette',
|
||||
'shapes_logo_raylib_anim',
|
||||
'shapes_lines_bezier',
|
||||
'textures_logo_raylib',
|
||||
'textures_image_loading',
|
||||
'textures_rectangle',
|
||||
'textures_srcrec_dstrec',
|
||||
'textures_to_image',
|
||||
'textures_raw_data',
|
||||
'textures_image_processing',
|
||||
'textures_image_drawing',
|
||||
'text_sprite_fonts',
|
||||
'text_bmfont_ttf',
|
||||
'text_raylib_fonts',
|
||||
'text_format_text',
|
||||
'text_writing_anim',
|
||||
'text_ttf_loading',
|
||||
'text_bmfont_unordered',
|
||||
'text_input_box',
|
||||
'models_geometric_shapes',
|
||||
'models_box_collisions',
|
||||
'models_billboard',
|
||||
'models_obj_loading',
|
||||
'models_heightmap',
|
||||
'models_cubicmap',
|
||||
'models_mesh_picking',
|
||||
'shaders_model_shader',
|
||||
'shaders_shapes_textures',
|
||||
'shaders_custom_uniform',
|
||||
'shaders_postprocessing',
|
||||
'audio_sound_loading',
|
||||
'audio_music_stream',
|
||||
'audio_module_playing',
|
||||
'audio_raw_stream'];
|
||||
|
||||
for (var i = 0; i < exampleName.length; i++)
|
||||
{
|
||||
var filterType = exampleName[i].substring(0, exampleName[i].indexOf("_"));
|
||||
var exampleBase = exampleName[i].slice(exampleName[i].indexOf('_') + 1);
|
||||
var exampleDesc = exampleBase.replace('_', ' ');
|
||||
|
||||
$('#container').append(
|
||||
'<div class="mix f' + filterType + '">' +
|
||||
'<a class="fancybox fancybox.iframe" href="examples/web/' + filterType + '/' + 'loader.html?name=' + exampleName[i] + '" title="' + exampleDesc + '">' +
|
||||
'<img width="400" height="225" src="../examples/web/' + filterType + '/' + exampleName[i] + '.png"><div class="extext"><p>' + exampleDesc + '</p></div></a>' +
|
||||
'</div>');
|
||||
|
||||
$('#container a .extext').hide();
|
||||
}
|
||||
|
||||
// Instantiate MixItUp:
|
||||
$('#container').mixItUp();
|
||||
|
||||
$("#container a").hover(
|
||||
function(){ $(this).find(".extext").show(); },
|
||||
function(){ $(this).find(".extext").hide(); });
|
||||
|
||||
/*
|
||||
$("#container a img").hover(
|
||||
function() { $(this).stop().animate({ opacity:0.6 }, 200, "easeOutQuad" ); },
|
||||
function() { $(this).stop().animate({ opacity:0 }, 200, "easeOutQuad" ); }
|
||||
)
|
||||
*/
|
||||
});
|
103
docs/common/js/games.js
Normal file
@@ -0,0 +1,103 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
// Init fancybox
|
||||
$('.fancybox').fancybox();
|
||||
|
||||
var exampleName = [
|
||||
'sample_arkanoid',
|
||||
'sample_missile_commander',
|
||||
'sample_gorilas',
|
||||
'sample_snake',
|
||||
'sample_asteroids',
|
||||
'sample_asteroids_survival',
|
||||
'sample_pang',
|
||||
'sample_space_invaders',
|
||||
'sample_floppy',
|
||||
'sample_tetris',
|
||||
'game_drturtle',
|
||||
'game_just_do',
|
||||
'game_skully_escape',
|
||||
'game_koala_seasons',
|
||||
'game_light_my_ritual',
|
||||
'game_wave_collector',
|
||||
'user_raymario',
|
||||
'user_crazyball',
|
||||
'user_tictactoe',
|
||||
'user_super_red_rope',
|
||||
'user_taptojamp',
|
||||
'user_funwithsat'];
|
||||
|
||||
var exampleDesc = [
|
||||
'arkanoid',
|
||||
'missile commander',
|
||||
'gorilas',
|
||||
'snake',
|
||||
'asteroids',
|
||||
'asteroids survival',
|
||||
'pang',
|
||||
'space invaders',
|
||||
'floppy',
|
||||
'tetris',
|
||||
'Dr Turtle & Mr Gamera',
|
||||
'JUST DO',
|
||||
'Skully Escape',
|
||||
'Koala Seasons',
|
||||
'LIGHT MY RITUAL',
|
||||
'Wave Collector',
|
||||
'RayMario (Victor Fisac)',
|
||||
'CrazyBall (Victor Fisac)',
|
||||
'Tic-Tac-Toe (LelixSuper)',
|
||||
'Super Red Rope Puzzles (Kurnic)',
|
||||
'TapToJAmp (MarcMDE)',
|
||||
'FunWithSATCollisions (MarcMDE)'];
|
||||
|
||||
for (var i = 0; i < exampleName.length; i++)
|
||||
{
|
||||
var filterType = exampleName[i].substring(0, exampleName[i].indexOf("_"));
|
||||
|
||||
var linkTag;
|
||||
|
||||
if (filterType == 'sample') linkTag = '<a class="fancybox fancybox.iframe" href="games/loader.html?name=' + exampleName[i] + '" title="' + exampleDesc[i] + '">';
|
||||
else if (filterType == 'game') linkTag = '<a target="_blank" href="games/' + exampleName[i].substring(5) + '.html" title="' + exampleDesc[i] + '">';
|
||||
else if (filterType == 'user')
|
||||
{
|
||||
switch (exampleName[i])
|
||||
{
|
||||
case 'user_raymario': linkTag = '<a target="_blank" href="https://github.com/victorfisac/RayMario" title="' + exampleDesc[i] + '">'; break;
|
||||
case 'user_crazyball': linkTag = '<a target="_blank" href="https://github.com/victorfisac/CrazyBall" title="' + exampleDesc[i] + '">'; break;
|
||||
case 'user_tictactoe': linkTag = '<a target="_blank" href="https://github.com/LelixSuper/TicTacToe" title="' + exampleDesc[i] + '">'; break;
|
||||
case 'user_super_red_rope': linkTag = '<a target="_blank" href="https://kurnic.itch.io/super-red-rope-puzzles" title="' + exampleDesc[i] + '">'; break;
|
||||
case 'user_taptojamp': linkTag = '<a target="_blank" href="http://marcmde.github.io/TapToJAmp_v2_0/" title="' + exampleDesc[i] + '">'; break;
|
||||
case 'user_funwithsat': linkTag = '<a target="_blank" href="http://marcmde.github.io/FunWithSATCollisions_v_1_0_Browser/" title="' + exampleDesc[i] + '">'; break;
|
||||
default: break;
|
||||
}
|
||||
/*
|
||||
https://github.com/MarcMDE/TapToJump //http://marcmde.github.io/TapToJump_v1_0_Browser/
|
||||
https://github.com/MarcMDE/TapToJAmp //http://marcmde.github.io/TapToJAmp_v2_0/
|
||||
https://github.com/MarcMDE/FunWithSATCollisions //http://marcmde.github.io/FunWithSATCollisions_v_1_0_Browser/
|
||||
https://kurnic.wordpress.com/portfolio/flappy-jetpack/
|
||||
*/
|
||||
}
|
||||
|
||||
$('#container').append(
|
||||
'<div class="mix f' + filterType + '">' + linkTag +
|
||||
'<img width="400" height="225" src="../games/img/' + exampleName[i] + '.png"><div class="extext"><p>' + exampleDesc[i] + '</p></div></a>' +
|
||||
'</div>');
|
||||
|
||||
$('#container a .extext').hide();
|
||||
}
|
||||
|
||||
// Instantiate MixItUp:
|
||||
$('#container').mixItUp();
|
||||
|
||||
$("#container a").hover(
|
||||
function(){ $(this).find(".extext").show(); },
|
||||
function(){ $(this).find(".extext").hide(); });
|
||||
|
||||
/*
|
||||
$("#container a img").hover(
|
||||
function() { $(this).stop().animate({ opacity:0.6 }, 200, "easeOutQuad" ); },
|
||||
function() { $(this).stop().animate({ opacity:0 }, 200, "easeOutQuad" ); }
|
||||
)
|
||||
*/
|
||||
});
|
BIN
docs/common/libs/fancybox/blank.gif
Normal file
After Width: | Height: | Size: 43 B |
BIN
docs/common/libs/fancybox/fancybox_loading.gif
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
docs/common/libs/fancybox/fancybox_loading@2x.gif
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/common/libs/fancybox/fancybox_overlay.png
Normal file
After Width: | Height: | Size: 1003 B |
BIN
docs/common/libs/fancybox/fancybox_sprite.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
docs/common/libs/fancybox/fancybox_sprite@2x.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
docs/common/libs/fancybox/helpers/fancybox_buttons.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,97 @@
|
||||
#fancybox-buttons {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
#fancybox-buttons.top {
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
#fancybox-buttons.bottom {
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
#fancybox-buttons ul {
|
||||
display: block;
|
||||
width: 166px;
|
||||
height: 30px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
border: 1px solid #111;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
|
||||
-moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
|
||||
box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
|
||||
background: rgb(50,50,50);
|
||||
background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51)));
|
||||
background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
|
||||
}
|
||||
|
||||
#fancybox-buttons ul li {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#fancybox-buttons a {
|
||||
display: block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-indent: -9999px;
|
||||
background-color: transparent;
|
||||
background-image: url('fancybox_buttons.png');
|
||||
background-repeat: no-repeat;
|
||||
outline: none;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
#fancybox-buttons a:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnPrev {
|
||||
background-position: 5px 0;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnNext {
|
||||
background-position: -33px 0;
|
||||
border-right: 1px solid #3e3e3e;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnPlay {
|
||||
background-position: 0 -30px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnPlayOn {
|
||||
background-position: -30px -30px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnToggle {
|
||||
background-position: 3px -60px;
|
||||
border-left: 1px solid #111;
|
||||
border-right: 1px solid #3e3e3e;
|
||||
width: 35px
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnToggleOn {
|
||||
background-position: -27px -60px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnClose {
|
||||
border-left: 1px solid #111;
|
||||
width: 35px;
|
||||
background-position: -56px 0px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnDisabled {
|
||||
opacity : 0.4;
|
||||
cursor: default;
|
||||
}
|
122
docs/common/libs/fancybox/helpers/jquery.fancybox-buttons.js
Normal file
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* Buttons helper for fancyBox
|
||||
* version: 1.0.5 (Mon, 15 Oct 2012)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* buttons: {
|
||||
* position : 'top'
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox;
|
||||
|
||||
//Add helper object
|
||||
F.helpers.buttons = {
|
||||
defaults : {
|
||||
skipSingle : false, // disables if gallery contains single image
|
||||
position : 'top', // 'top' or 'bottom'
|
||||
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
|
||||
},
|
||||
|
||||
list : null,
|
||||
buttons: null,
|
||||
|
||||
beforeLoad: function (opts, obj) {
|
||||
//Remove self if gallery do not have at least two items
|
||||
|
||||
if (opts.skipSingle && obj.group.length < 2) {
|
||||
obj.helpers.buttons = false;
|
||||
obj.closeBtn = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Increase top margin to give space for buttons
|
||||
obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
|
||||
},
|
||||
|
||||
onPlayStart: function () {
|
||||
if (this.buttons) {
|
||||
this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
|
||||
}
|
||||
},
|
||||
|
||||
onPlayEnd: function () {
|
||||
if (this.buttons) {
|
||||
this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
|
||||
}
|
||||
},
|
||||
|
||||
afterShow: function (opts, obj) {
|
||||
var buttons = this.buttons;
|
||||
|
||||
if (!buttons) {
|
||||
this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
|
||||
|
||||
buttons = {
|
||||
prev : this.list.find('.btnPrev').click( F.prev ),
|
||||
next : this.list.find('.btnNext').click( F.next ),
|
||||
play : this.list.find('.btnPlay').click( F.play ),
|
||||
toggle : this.list.find('.btnToggle').click( F.toggle ),
|
||||
close : this.list.find('.btnClose').click( F.close )
|
||||
}
|
||||
}
|
||||
|
||||
//Prev
|
||||
if (obj.index > 0 || obj.loop) {
|
||||
buttons.prev.removeClass('btnDisabled');
|
||||
} else {
|
||||
buttons.prev.addClass('btnDisabled');
|
||||
}
|
||||
|
||||
//Next / Play
|
||||
if (obj.loop || obj.index < obj.group.length - 1) {
|
||||
buttons.next.removeClass('btnDisabled');
|
||||
buttons.play.removeClass('btnDisabled');
|
||||
|
||||
} else {
|
||||
buttons.next.addClass('btnDisabled');
|
||||
buttons.play.addClass('btnDisabled');
|
||||
}
|
||||
|
||||
this.buttons = buttons;
|
||||
|
||||
this.onUpdate(opts, obj);
|
||||
},
|
||||
|
||||
onUpdate: function (opts, obj) {
|
||||
var toggle;
|
||||
|
||||
if (!this.buttons) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
|
||||
|
||||
//Size toggle button
|
||||
if (obj.canShrink) {
|
||||
toggle.addClass('btnToggleOn');
|
||||
|
||||
} else if (!obj.canExpand) {
|
||||
toggle.addClass('btnDisabled');
|
||||
}
|
||||
},
|
||||
|
||||
beforeClose: function () {
|
||||
if (this.list) {
|
||||
this.list.remove();
|
||||
}
|
||||
|
||||
this.list = null;
|
||||
this.buttons = null;
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
199
docs/common/libs/fancybox/helpers/jquery.fancybox-media.js
Normal file
@@ -0,0 +1,199 @@
|
||||
/*!
|
||||
* Media helper for fancyBox
|
||||
* version: 1.0.6 (Fri, 14 Jun 2013)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: true
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Set custom URL parameters:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: {
|
||||
* youtube : {
|
||||
* params : {
|
||||
* autoplay : 0
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Or:
|
||||
* $(".fancybox").fancybox({,
|
||||
* helpers : {
|
||||
* media: true
|
||||
* },
|
||||
* youtube : {
|
||||
* autoplay: 0
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Supports:
|
||||
*
|
||||
* Youtube
|
||||
* http://www.youtube.com/watch?v=opj24KnzrWo
|
||||
* http://www.youtube.com/embed/opj24KnzrWo
|
||||
* http://youtu.be/opj24KnzrWo
|
||||
* http://www.youtube-nocookie.com/embed/opj24KnzrWo
|
||||
* Vimeo
|
||||
* http://vimeo.com/40648169
|
||||
* http://vimeo.com/channels/staffpicks/38843628
|
||||
* http://vimeo.com/groups/surrealism/videos/36516384
|
||||
* http://player.vimeo.com/video/45074303
|
||||
* Metacafe
|
||||
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
||||
* http://www.metacafe.com/watch/7635964/
|
||||
* Dailymotion
|
||||
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
||||
* Twitvid
|
||||
* http://twitvid.com/QY7MD
|
||||
* Twitpic
|
||||
* http://twitpic.com/7p93st
|
||||
* Instagram
|
||||
* http://instagr.am/p/IejkuUGxQn/
|
||||
* http://instagram.com/p/IejkuUGxQn/
|
||||
* Google maps
|
||||
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
||||
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
||||
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox,
|
||||
format = function( url, rez, params ) {
|
||||
params = params || '';
|
||||
|
||||
if ( $.type( params ) === "object" ) {
|
||||
params = $.param(params, true);
|
||||
}
|
||||
|
||||
$.each(rez, function(key, value) {
|
||||
url = url.replace( '$' + key, value || '' );
|
||||
});
|
||||
|
||||
if (params.length) {
|
||||
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
//Add helper object
|
||||
F.helpers.media = {
|
||||
defaults : {
|
||||
youtube : {
|
||||
matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
autohide : 1,
|
||||
fs : 1,
|
||||
rel : 0,
|
||||
hd : 1,
|
||||
wmode : 'opaque',
|
||||
enablejsapi : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.youtube.com/embed/$3'
|
||||
},
|
||||
vimeo : {
|
||||
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
hd : 1,
|
||||
show_title : 1,
|
||||
show_byline : 1,
|
||||
show_portrait : 0,
|
||||
fullscreen : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//player.vimeo.com/video/$1'
|
||||
},
|
||||
metacafe : {
|
||||
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
|
||||
params : {
|
||||
autoPlay : 'yes'
|
||||
},
|
||||
type : 'swf',
|
||||
url : function( rez, params, obj ) {
|
||||
obj.swf.flashVars = 'playerVars=' + $.param( params, true );
|
||||
|
||||
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
|
||||
}
|
||||
},
|
||||
dailymotion : {
|
||||
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
|
||||
params : {
|
||||
additionalInfos : 0,
|
||||
autoStart : 1
|
||||
},
|
||||
type : 'swf',
|
||||
url : '//www.dailymotion.com/swf/video/$1'
|
||||
},
|
||||
twitvid : {
|
||||
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
|
||||
params : {
|
||||
autoplay : 0
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.twitvid.com/embed.php?guid=$1'
|
||||
},
|
||||
twitpic : {
|
||||
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
|
||||
type : 'image',
|
||||
url : '//twitpic.com/show/full/$1/'
|
||||
},
|
||||
instagram : {
|
||||
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
|
||||
type : 'image',
|
||||
url : '//$1/p/$2/media/?size=l'
|
||||
},
|
||||
google_maps : {
|
||||
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
|
||||
type : 'iframe',
|
||||
url : function( rez ) {
|
||||
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeLoad : function(opts, obj) {
|
||||
var url = obj.href || '',
|
||||
type = false,
|
||||
what,
|
||||
item,
|
||||
rez,
|
||||
params;
|
||||
|
||||
for (what in opts) {
|
||||
if (opts.hasOwnProperty(what)) {
|
||||
item = opts[ what ];
|
||||
rez = url.match( item.matcher );
|
||||
|
||||
if (rez) {
|
||||
type = item.type;
|
||||
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
|
||||
|
||||
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type) {
|
||||
obj.href = url;
|
||||
obj.type = type;
|
||||
|
||||
obj.autoHeight = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
55
docs/common/libs/fancybox/helpers/jquery.fancybox-thumbs.css
Normal file
@@ -0,0 +1,55 @@
|
||||
#fancybox-thumbs {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
#fancybox-thumbs.bottom {
|
||||
bottom: 2px;
|
||||
}
|
||||
|
||||
#fancybox-thumbs.top {
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li {
|
||||
float: left;
|
||||
padding: 1px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li.active {
|
||||
opacity: 0.75;
|
||||
padding: 0;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li a {
|
||||
display: block;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid #222;
|
||||
background: #111;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li img {
|
||||
display: block;
|
||||
position: relative;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
max-width: none;
|
||||
}
|
162
docs/common/libs/fancybox/helpers/jquery.fancybox-thumbs.js
Normal file
@@ -0,0 +1,162 @@
|
||||
/*!
|
||||
* Thumbnail helper for fancyBox
|
||||
* version: 1.0.7 (Mon, 01 Oct 2012)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* thumbs: {
|
||||
* width : 50,
|
||||
* height : 50
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox;
|
||||
|
||||
//Add helper object
|
||||
F.helpers.thumbs = {
|
||||
defaults : {
|
||||
width : 50, // thumbnail width
|
||||
height : 50, // thumbnail height
|
||||
position : 'bottom', // 'top' or 'bottom'
|
||||
source : function ( item ) { // function to obtain the URL of the thumbnail image
|
||||
var href;
|
||||
|
||||
if (item.element) {
|
||||
href = $(item.element).find('img').attr('src');
|
||||
}
|
||||
|
||||
if (!href && item.type === 'image' && item.href) {
|
||||
href = item.href;
|
||||
}
|
||||
|
||||
return href;
|
||||
}
|
||||
},
|
||||
|
||||
wrap : null,
|
||||
list : null,
|
||||
width : 0,
|
||||
|
||||
init: function (opts, obj) {
|
||||
var that = this,
|
||||
list,
|
||||
thumbWidth = opts.width,
|
||||
thumbHeight = opts.height,
|
||||
thumbSource = opts.source;
|
||||
|
||||
//Build list structure
|
||||
list = '';
|
||||
|
||||
for (var n = 0; n < obj.group.length; n++) {
|
||||
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
|
||||
}
|
||||
|
||||
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
|
||||
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
|
||||
|
||||
//Load each thumbnail
|
||||
$.each(obj.group, function (i) {
|
||||
var href = thumbSource( obj.group[ i ] );
|
||||
|
||||
if (!href) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("<img />").load(function () {
|
||||
var width = this.width,
|
||||
height = this.height,
|
||||
widthRatio, heightRatio, parent;
|
||||
|
||||
if (!that.list || !width || !height) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Calculate thumbnail width/height and center it
|
||||
widthRatio = width / thumbWidth;
|
||||
heightRatio = height / thumbHeight;
|
||||
|
||||
parent = that.list.children().eq(i).find('a');
|
||||
|
||||
if (widthRatio >= 1 && heightRatio >= 1) {
|
||||
if (widthRatio > heightRatio) {
|
||||
width = Math.floor(width / heightRatio);
|
||||
height = thumbHeight;
|
||||
|
||||
} else {
|
||||
width = thumbWidth;
|
||||
height = Math.floor(height / widthRatio);
|
||||
}
|
||||
}
|
||||
|
||||
$(this).css({
|
||||
width : width,
|
||||
height : height,
|
||||
top : Math.floor(thumbHeight / 2 - height / 2),
|
||||
left : Math.floor(thumbWidth / 2 - width / 2)
|
||||
});
|
||||
|
||||
parent.width(thumbWidth).height(thumbHeight);
|
||||
|
||||
$(this).hide().appendTo(parent).fadeIn(300);
|
||||
|
||||
}).attr('src', href);
|
||||
});
|
||||
|
||||
//Set initial width
|
||||
this.width = this.list.children().eq(0).outerWidth(true);
|
||||
|
||||
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
|
||||
},
|
||||
|
||||
beforeLoad: function (opts, obj) {
|
||||
//Remove self if gallery do not have at least two items
|
||||
if (obj.group.length < 2) {
|
||||
obj.helpers.thumbs = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Increase bottom margin to give space for thumbs
|
||||
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
|
||||
},
|
||||
|
||||
afterShow: function (opts, obj) {
|
||||
//Check if exists and create or update list
|
||||
if (this.list) {
|
||||
this.onUpdate(opts, obj);
|
||||
|
||||
} else {
|
||||
this.init(opts, obj);
|
||||
}
|
||||
|
||||
//Set active element
|
||||
this.list.children().removeClass('active').eq(obj.index).addClass('active');
|
||||
},
|
||||
|
||||
//Center list
|
||||
onUpdate: function (opts, obj) {
|
||||
if (this.list) {
|
||||
this.list.stop(true).animate({
|
||||
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
|
||||
}, 150);
|
||||
}
|
||||
},
|
||||
|
||||
beforeClose: function () {
|
||||
if (this.wrap) {
|
||||
this.wrap.remove();
|
||||
}
|
||||
|
||||
this.wrap = null;
|
||||
this.list = null;
|
||||
this.width = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}(jQuery));
|
284
docs/common/libs/fancybox/jquery.fancybox.css
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
|
||||
.fancybox-wrap,
|
||||
.fancybox-skin,
|
||||
.fancybox-outer,
|
||||
.fancybox-inner,
|
||||
.fancybox-image,
|
||||
.fancybox-wrap iframe,
|
||||
.fancybox-wrap object,
|
||||
.fancybox-nav,
|
||||
.fancybox-nav span,
|
||||
.fancybox-tmp
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
outline: none;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Ray: modified for raylib examples */
|
||||
.fancybox-inner
|
||||
{
|
||||
overflow: hidden!important;
|
||||
min-height: 520px!important;
|
||||
}
|
||||
|
||||
/* Ray: modified for raylib examples */
|
||||
.fancybox-wrap {
|
||||
width: 860px!important;
|
||||
}
|
||||
|
||||
.fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 8020;
|
||||
border: 4px solid;
|
||||
}
|
||||
|
||||
.fancybox-skin {
|
||||
position: relative;
|
||||
background: #f9f9f9;
|
||||
color: #444;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.fancybox-opened {
|
||||
z-index: 8030;
|
||||
}
|
||||
|
||||
.fancybox-opened .fancybox-skin {
|
||||
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.fancybox-outer, .fancybox-inner {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Ray: modified for raylib examples */
|
||||
.fancybox-inner {
|
||||
overflow: hidden;
|
||||
width: 850px!important;
|
||||
}
|
||||
|
||||
.fancybox-type-iframe .fancybox-inner {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.fancybox-error {
|
||||
color: #444;
|
||||
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Ray: modified for raylib examples */
|
||||
.fancybox-image, .fancybox-iframe {
|
||||
display: block;
|
||||
width: 830px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fancybox-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
||||
background-image: url('fancybox_sprite.png');
|
||||
}
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -22px;
|
||||
margin-left: -22px;
|
||||
background-position: 0 -108px;
|
||||
opacity: 0.8;
|
||||
cursor: pointer;
|
||||
z-index: 8060;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: url('fancybox_loading.gif') center center no-repeat;
|
||||
}
|
||||
|
||||
.fancybox-close {
|
||||
position: absolute;
|
||||
top: -18px;
|
||||
right: -18px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
cursor: pointer;
|
||||
z-index: 8040;
|
||||
}
|
||||
|
||||
.fancybox-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
background: transparent url('blank.gif'); /* helps IE */
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
z-index: 8040;
|
||||
}
|
||||
|
||||
.fancybox-prev {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.fancybox-next {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.fancybox-nav span {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 36px;
|
||||
height: 34px;
|
||||
margin-top: -18px;
|
||||
cursor: pointer;
|
||||
z-index: 8040;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.fancybox-prev span {
|
||||
left: 10px;
|
||||
background-position: 0 -36px;
|
||||
}
|
||||
|
||||
.fancybox-next span {
|
||||
right: 10px;
|
||||
background-position: 0 -72px;
|
||||
}
|
||||
|
||||
.fancybox-nav:hover span {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-tmp {
|
||||
position: absolute;
|
||||
top: -99999px;
|
||||
left: -99999px;
|
||||
visibility: hidden;
|
||||
max-width: 99999px;
|
||||
max-height: 99999px;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* Overlay helper */
|
||||
|
||||
.fancybox-lock {
|
||||
overflow: hidden !important;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.fancybox-lock body {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.fancybox-lock-test {
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
.fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
z-index: 8010;
|
||||
background: url('fancybox_overlay.png');
|
||||
}
|
||||
|
||||
.fancybox-overlay-fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.fancybox-lock .fancybox-overlay {
|
||||
overflow: auto;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
/* Title helper */
|
||||
|
||||
.fancybox-title {
|
||||
visibility: hidden;
|
||||
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
position: relative;
|
||||
text-shadow: none;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
.fancybox-opened .fancybox-title {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-title-float-wrap {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 50%;
|
||||
margin-bottom: -35px;
|
||||
z-index: 8050;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fancybox-title-float-wrap .child {
|
||||
display: inline-block;
|
||||
margin-right: -100%;
|
||||
padding: 2px 20px;
|
||||
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
text-shadow: 0 1px 2px #222;
|
||||
color: #FFF;
|
||||
font-size: 10px;
|
||||
line-height: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fancybox-title-outside-wrap {
|
||||
position: relative;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-inside-wrap {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.fancybox-title-over-wrap {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
background: #000;
|
||||
background: rgba(0, 0, 0, .8);
|
||||
}
|
||||
|
||||
/*Retina graphics!*/
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
||||
only screen and (min--moz-device-pixel-ratio: 1.5),
|
||||
only screen and (min-device-pixel-ratio: 1.5){
|
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
||||
background-image: url('fancybox_sprite@2x.png');
|
||||
background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
background-image: url('fancybox_loading@2x.gif');
|
||||
background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
|
||||
}
|
||||
}
|
2020
docs/common/libs/fancybox/jquery.fancybox.js
vendored
Normal file
46
docs/common/libs/fancybox/jquery.fancybox.pack.js
Normal file
@@ -0,0 +1,46 @@
|
||||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
|
||||
(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
|
||||
width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
|
||||
keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
|
||||
(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
|
||||
openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
|
||||
isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
|
||||
c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
|
||||
k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
|
||||
b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
|
||||
setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
|
||||
d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
|
||||
a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
|
||||
b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
|
||||
y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
|
||||
if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
|
||||
(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
|
||||
{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
|
||||
mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
|
||||
!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
|
||||
"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
|
||||
this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
|
||||
f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
|
||||
e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
|
||||
outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
|
||||
g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
|
||||
"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
|
||||
h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
|
||||
h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
|
||||
"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
|
||||
y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
|
||||
!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
|
||||
b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
|
||||
a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
|
||||
(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
|
||||
f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
|
||||
{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
|
||||
b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
|
||||
f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
|
||||
b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
|
||||
p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
|
||||
f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
|
||||
b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
|
||||
e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
|
||||
":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
|
||||
d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
|
205
docs/common/libs/jquery.easing.1.3.js
Normal file
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
8
docs/common/libs/jquery.mousewheel.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* jQuery Mousewheel 3.1.13
|
||||
*
|
||||
* Copyright 2015 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
137
docs/examples.html
Normal file
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
|
||||
<title>raylib - examples</title>
|
||||
|
||||
<meta name="title" content="raylib - examples">
|
||||
<meta name="description" content="raylib is a simple and easy-to-use library to learn videogames programming. Check the full set of raylib examples">
|
||||
<meta name="keywords" content="raylib, videogames, programming, C, C++, library, learn, study, simple, easy, free, open source, raysan">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<!-- Facebook metatags for sharing -->
|
||||
<meta property="og:title" content="raylib - examples"/>
|
||||
<meta property="og:image" content="http://www.raylib.com/common/img/fb_raylib_logo.png"/>
|
||||
<meta property="og:url" content="http://www.raylib.com" />
|
||||
<meta property="og:site_name" content="raylib"/>
|
||||
<meta property="og:description" content="check the full set of raylib examples... they are amazing!"/>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="common/css/main.css">
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="common/css/examples.css">
|
||||
|
||||
<!-- NOTE: JavaScript code added at the end of body! -->
|
||||
|
||||
<!-- Enabling HTML5 tags for older IE browsers -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page">
|
||||
<!--[if lt IE 7]>
|
||||
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
|
||||
<![endif]-->
|
||||
|
||||
<div class="header">
|
||||
<a id="logo" href="index.html"></a>
|
||||
<div id="social">
|
||||
<a id="itchio" href="https://raysan5.itch.io" target="_blank"></a>
|
||||
<a id="handmade" href="https://raylib.handmade.network/" target="_blank"></a>
|
||||
<a id="patreon" href="https://www.patreon.com/raysan5" target="_blank"></a>
|
||||
<a id="twitch" href="http://www.twitch.tv/raysan5" target="_blank"></a>
|
||||
<a id="reddit" href="https://www.reddit.com/r/raylib/" target="_blank"></a>
|
||||
<a id="freenode" href="http://webchat.freenode.net/?channels=#raylib" target="_blank"></a>
|
||||
<a id="facebook" href="http://www.facebook.com/raylibgames" target="_blank"></a>
|
||||
<a id="twitter" href="http://www.twitter.com/raysan5" target="_blank"></a>
|
||||
<a id="github" href="http://github.com/raysan5/raylib" target="_blank"></a>
|
||||
<a id="youtube" href="https://www.youtube.com/channel/UC8WIBkhYb5sBNqXO1mZ7WSQ" target="_blank"></a>
|
||||
</div>
|
||||
<div class="menu">
|
||||
<a href="index.html">about</a>
|
||||
<div id="active">examples</div>
|
||||
<a href="games.html">games</a>
|
||||
<a href="helpme.html">helpme!</a>
|
||||
<a id="forum" href="http://forum.raylib.com">forum</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<p>Examples are organized by colors depending on the raylib module features
|
||||
they are teaching. Currently, raylib main modules are 7.</p>
|
||||
<br>
|
||||
<p>Wanna see all functions available in raylib? <a class="simplelink" href="cheatsheet/cheatsheet.html">Check cheatsheet</a></p>
|
||||
<br>
|
||||
<p>Click to filter by module:</p>
|
||||
<br>
|
||||
|
||||
<!-- Filtering controls
|
||||
<div class="filter" data-filter="all">Show All</div>
|
||||
<div class="filter" data-filter=".category-1">Category 1</div>
|
||||
<div class="filter" data-filter=".category-2">Category 2</div>
|
||||
-->
|
||||
<!-- Sorting controls
|
||||
<div class="sort" data-sort="default">Default</div>
|
||||
<div class="sort" data-sort="myorder:asc">Ascending</div>
|
||||
<div class="sort" data-sort="myorder:desc">Descending</div>
|
||||
<div class="sort" data-sort="random">Random</div>
|
||||
-->
|
||||
<!--<div class="filter legendButton" data-filter="all">ALL</div> -->
|
||||
<div id="filter_menu">
|
||||
<div class="filter legendButton" id="core" data-filter=".fcore">core</div>
|
||||
<div class="filter legendButton" id="shapes" data-filter=".fshapes">shapes</div>
|
||||
<div class="filter legendButton" id="textures" data-filter=".ftextures">textures</div>
|
||||
<div class="filter legendButton" id="text" data-filter=".ftext">text</div>
|
||||
<div class="filter legendButton" id="models" data-filter=".fmodels">models</div>
|
||||
<div class="filter legendButton" id="shaders" data-filter=".fshaders">shaders</div>
|
||||
<div class="filter legendButton" id="audio" data-filter=".faudio">audio</div>
|
||||
</div>
|
||||
|
||||
<!-- Items container, filled when loading -->
|
||||
<div id="container"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p>Web developed by <a href="http://www.raysanweb.com" target="_blank">RaySan</a> and <a href="http://www.elendow.com" target="_blank">Elendow</a></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Add jQuery library -->
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
|
||||
|
||||
<!-- Add jQuery easing plugin -->
|
||||
<script src="common/libs/jquery.easing.1.3.js"></script>
|
||||
|
||||
<!-- Add fancyBox main JS and CSS files -->
|
||||
<script src="common/libs/fancybox/jquery.fancybox.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="common/libs/fancybox/jquery.fancybox.css" media="screen" />
|
||||
|
||||
<!-- Add Button helper -->
|
||||
<link rel="stylesheet" type="text/css" href="common/libs/fancybox/helpers/jquery.fancybox-buttons.css" />
|
||||
<script src="common/libs/fancybox/helpers/jquery.fancybox-buttons.js"></script>
|
||||
|
||||
<!-- Add jQuery Mix-It Up plugin -->
|
||||
<script src="http://cdn.jsdelivr.net/jquery.mixitup/latest/jquery.mixitup.min.js"></script>
|
||||
|
||||
<!-- Add own script code -->
|
||||
<script src="common/js/examples.js"></script>
|
||||
|
||||
<!-- Google Analytics tracking code -->
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','http://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-45733555-1', 'raylib.com');
|
||||
ga('require', 'linkid', 'linkid.js');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
141
docs/examples/src/audio/audio_module_playing.c
Normal file
@@ -0,0 +1,141 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [audio] example - Module playing (streaming)
|
||||
*
|
||||
* NOTE: This example requires OpenAL Soft library installed
|
||||
*
|
||||
* This example has been created using raylib 1.5 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define MAX_CIRCLES 64
|
||||
|
||||
typedef struct {
|
||||
Vector2 position;
|
||||
float radius;
|
||||
float alpha;
|
||||
float speed;
|
||||
Color color;
|
||||
} CircleWave;
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");
|
||||
|
||||
InitAudioDevice(); // Initialize audio device
|
||||
|
||||
Color colors[14] = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
|
||||
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE };
|
||||
|
||||
// Creates ome circles for visual effect
|
||||
CircleWave circles[MAX_CIRCLES];
|
||||
|
||||
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
|
||||
{
|
||||
circles[i].alpha = 0.0f;
|
||||
circles[i].radius = GetRandomValue(10, 40);
|
||||
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius);
|
||||
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius);
|
||||
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
|
||||
circles[i].color = colors[GetRandomValue(0, 13)];
|
||||
}
|
||||
|
||||
Music xm = LoadMusicStream("resources/mini1111.xm");
|
||||
|
||||
PlayMusicStream(xm);
|
||||
|
||||
float timePlayed = 0.0f;
|
||||
bool pause = false;
|
||||
|
||||
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(xm); // Update music buffer with new stream data
|
||||
|
||||
// Restart music playing (stop and play)
|
||||
if (IsKeyPressed(KEY_SPACE))
|
||||
{
|
||||
StopMusicStream(xm);
|
||||
PlayMusicStream(xm);
|
||||
}
|
||||
|
||||
// Pause/Resume music playing
|
||||
if (IsKeyPressed(KEY_P))
|
||||
{
|
||||
pause = !pause;
|
||||
|
||||
if (pause) PauseMusicStream(xm);
|
||||
else ResumeMusicStream(xm);
|
||||
}
|
||||
|
||||
// Get timePlayed scaled to bar dimensions
|
||||
timePlayed = GetMusicTimePlayed(xm)/GetMusicTimeLength(xm)*(screenWidth - 40);
|
||||
|
||||
// Color circles animation
|
||||
for (int i = MAX_CIRCLES - 1; (i >= 0) && !pause; i--)
|
||||
{
|
||||
circles[i].alpha += circles[i].speed;
|
||||
circles[i].radius += circles[i].speed*10.0f;
|
||||
|
||||
if (circles[i].alpha > 1.0f) circles[i].speed *= -1;
|
||||
|
||||
if (circles[i].alpha <= 0.0f)
|
||||
{
|
||||
circles[i].alpha = 0.0f;
|
||||
circles[i].radius = GetRandomValue(10, 40);
|
||||
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius);
|
||||
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius);
|
||||
circles[i].color = colors[GetRandomValue(0, 13)];
|
||||
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
|
||||
{
|
||||
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
|
||||
}
|
||||
|
||||
// Draw time bar
|
||||
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY);
|
||||
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
|
||||
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadMusicStream(xm); // Unload music stream buffers from RAM
|
||||
|
||||
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -24,11 +24,12 @@ int main()
|
||||
|
||||
InitAudioDevice(); // Initialize audio device
|
||||
|
||||
PlayMusicStream("resources/audio/guitar_noodling.ogg"); // Play music stream
|
||||
Music music = LoadMusicStream("resources/guitar_noodling.ogg");
|
||||
|
||||
PlayMusicStream(music);
|
||||
|
||||
int framesCounter = 0;
|
||||
float timePlayed = 0.0f;
|
||||
//float volume = 1.0;
|
||||
bool pause = false;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -38,32 +39,26 @@ int main()
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
framesCounter++;
|
||||
|
||||
// Testing music fading from one file to another
|
||||
/*
|
||||
if (framesCounter > 600) // Wait for 10 seconds (600 frames)
|
||||
{
|
||||
volume -= 0.01; // Decrement music volume level
|
||||
|
||||
// When music volume level equal or lower than 0,
|
||||
// restore volume level and init another music file
|
||||
if (volume <= 0)
|
||||
{
|
||||
volume = 1.0;
|
||||
framesCounter = 0;
|
||||
PlayMusicStream("resources/audio/another_file.ogg");
|
||||
}
|
||||
|
||||
SetMusicVolume(volume);
|
||||
}
|
||||
*/
|
||||
if (IsWindowMinimized()) PauseMusicStream();
|
||||
else ResumeMusicStream();
|
||||
|
||||
timePlayed = GetMusicTimePlayed()/GetMusicTimeLength()*100*4; // We scale by 4 to fit 400 pixels
|
||||
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||
|
||||
UpdateMusicStream(); // 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);
|
||||
}
|
||||
|
||||
// Get timePlayed scaled to bar dimensions (400 pixels)
|
||||
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*400;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@@ -72,10 +67,14 @@ int main()
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText("MUSIC SHOULD BE PLAYING!", 255, 200, 20, LIGHTGRAY);
|
||||
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
|
||||
|
||||
DrawRectangle(200, 250, 400, 12, LIGHTGRAY);
|
||||
DrawRectangle(200, 250, (int)timePlayed, 12, MAROON);
|
||||
DrawRectangle(200, 200, 400, 12, LIGHTGRAY);
|
||||
DrawRectangle(200, 200, (int)timePlayed, 12, MAROON);
|
||||
DrawRectangleLines(200, 200, 400, 12, GRAY);
|
||||
|
||||
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, LIGHTGRAY);
|
||||
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
@@ -83,9 +82,11 @@ int main()
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||
UnloadMusicStream(music); // Unload music stream buffers from RAM
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
114
docs/examples/src/audio/audio_raw_stream.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [audio] example - Raw audio streaming
|
||||
*
|
||||
* NOTE: This example requires OpenAL Soft library installed
|
||||
*
|
||||
* This example has been created using raylib 1.6 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include <stdlib.h> // Required for: malloc(), free()
|
||||
#include <math.h> // Required for: sinf()
|
||||
|
||||
#define MAX_SAMPLES 22050
|
||||
#define MAX_SAMPLES_PER_UPDATE 4096
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [audio] example - raw audio streaming");
|
||||
|
||||
InitAudioDevice(); // Initialize audio device
|
||||
|
||||
// Init raw audio stream (sample rate: 22050, sample size: 16bit-short, channels: 1-mono)
|
||||
AudioStream stream = InitAudioStream(22050, 16, 1);
|
||||
|
||||
// Generate samples data from sine wave
|
||||
short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES);
|
||||
|
||||
// TODO: Review data generation, it seems data is discontinued for loop,
|
||||
// for that reason, there is a clip everytime audio stream is looped...
|
||||
for (int i = 0; i < MAX_SAMPLES; i++)
|
||||
{
|
||||
data[i] = (short)(sinf(((2*PI*(float)i)/2)*DEG2RAD)*32000);
|
||||
}
|
||||
|
||||
PlayAudioStream(stream); // Start processing stream buffer (no data loaded currently)
|
||||
|
||||
int totalSamples = MAX_SAMPLES;
|
||||
int samplesLeft = totalSamples;
|
||||
|
||||
Vector2 position = { 0, 0 };
|
||||
|
||||
SetTargetFPS(30); // Set our game to run at 30 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Refill audio stream if required
|
||||
// NOTE: Every update we check if stream data has been already consumed and we update
|
||||
// buffer with new data from the generated samples, we upload data at a rate (MAX_SAMPLES_PER_UPDATE),
|
||||
// but notice that at some point we update < MAX_SAMPLES_PER_UPDATE data...
|
||||
if (IsAudioBufferProcessed(stream))
|
||||
{
|
||||
int numSamples = 0;
|
||||
if (samplesLeft >= MAX_SAMPLES_PER_UPDATE) numSamples = MAX_SAMPLES_PER_UPDATE;
|
||||
else numSamples = samplesLeft;
|
||||
|
||||
UpdateAudioStream(stream, data + (totalSamples - samplesLeft), numSamples);
|
||||
|
||||
samplesLeft -= numSamples;
|
||||
|
||||
// Reset samples feeding (loop audio)
|
||||
if (samplesLeft <= 0) samplesLeft = totalSamples;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText("SINE WAVE SHOULD BE PLAYING!", 240, 140, 20, LIGHTGRAY);
|
||||
|
||||
// NOTE: Draw a part of the sine wave (only screen width, proportional values)
|
||||
for (int i = 0; i < GetScreenWidth(); i++)
|
||||
{
|
||||
position.x = i;
|
||||
position.y = 250 + 50*data[i]/32000;
|
||||
|
||||
DrawPixelV(position, RED);
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
free(data); // Unload sine wave data
|
||||
|
||||
CloseAudioStream(stream); // Close raw audio stream and delete buffers from RAM
|
||||
|
||||
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -24,8 +24,8 @@ int main()
|
||||
|
||||
InitAudioDevice(); // Initialize audio device
|
||||
|
||||
Sound fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
|
||||
Sound fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
|
||||
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
|
||||
Sound fxOgg = LoadSound("resources/tanatana.ogg"); // Load OGG audio file
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -36,7 +36,6 @@ int main()
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed(KEY_SPACE)) PlaySound(fxWav); // Play WAV sound
|
||||
|
||||
if (IsKeyPressed(KEY_ENTER)) PlaySound(fxOgg); // Play OGG sound
|
||||
//----------------------------------------------------------------------------------
|
||||
|
139
docs/examples/src/core/core_2d_camera.c
Normal file
@@ -0,0 +1,139 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [core] example - 2d camera
|
||||
*
|
||||
* This example has been created using raylib 1.5 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define MAX_BUILDINGS 100
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera");
|
||||
|
||||
Rectangle player = { 400, 280, 40, 40 };
|
||||
Rectangle buildings[MAX_BUILDINGS];
|
||||
Color buildColors[MAX_BUILDINGS];
|
||||
|
||||
int spacing = 0;
|
||||
|
||||
for (int i = 0; i < MAX_BUILDINGS; i++)
|
||||
{
|
||||
buildings[i].width = GetRandomValue(50, 200);
|
||||
buildings[i].height = GetRandomValue(100, 800);
|
||||
buildings[i].y = screenHeight - 130 - buildings[i].height;
|
||||
buildings[i].x = -6000 + spacing;
|
||||
|
||||
spacing += buildings[i].width;
|
||||
|
||||
buildColors[i] = (Color){ GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255 };
|
||||
}
|
||||
|
||||
Camera2D camera;
|
||||
|
||||
camera.target = (Vector2){ player.x + 20, player.y + 20 };
|
||||
camera.offset = (Vector2){ 0, 0 };
|
||||
camera.rotation = 0.0f;
|
||||
camera.zoom = 1.0f;
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyDown(KEY_RIGHT))
|
||||
{
|
||||
player.x += 2; // Player movement
|
||||
camera.offset.x -= 2; // Camera displacement with player movement
|
||||
}
|
||||
else if (IsKeyDown(KEY_LEFT))
|
||||
{
|
||||
player.x -= 2; // Player movement
|
||||
camera.offset.x += 2; // Camera displacement with player movement
|
||||
}
|
||||
|
||||
// Camera target follows player
|
||||
camera.target = (Vector2){ player.x + 20, player.y + 20 };
|
||||
|
||||
// Camera rotation controls
|
||||
if (IsKeyDown(KEY_A)) camera.rotation--;
|
||||
else if (IsKeyDown(KEY_S)) camera.rotation++;
|
||||
|
||||
// Limit camera rotation to 80 degrees (-40 to 40)
|
||||
if (camera.rotation > 40) camera.rotation = 40;
|
||||
else if (camera.rotation < -40) camera.rotation = -40;
|
||||
|
||||
// Camera zoom controls
|
||||
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
|
||||
|
||||
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
||||
else if (camera.zoom < 0.1f) camera.zoom = 0.1f;
|
||||
|
||||
// Camera reset (zoom and rotation)
|
||||
if (IsKeyPressed(KEY_R))
|
||||
{
|
||||
camera.zoom = 1.0f;
|
||||
camera.rotation = 0.0f;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
Begin2dMode(camera);
|
||||
|
||||
DrawRectangle(-6000, 320, 13000, 8000, DARKGRAY);
|
||||
|
||||
for (int i = 0; i < MAX_BUILDINGS; i++) DrawRectangleRec(buildings[i], buildColors[i]);
|
||||
|
||||
DrawRectangleRec(player, RED);
|
||||
|
||||
DrawRectangle(camera.target.x, -500, 1, screenHeight*4, GREEN);
|
||||
DrawRectangle(-500, camera.target.y, screenWidth*4, 1, GREEN);
|
||||
|
||||
End2dMode();
|
||||
|
||||
DrawText("SCREEN AREA", 640, 10, 20, RED);
|
||||
|
||||
DrawRectangle(0, 0, screenWidth, 5, RED);
|
||||
DrawRectangle(0, 5, 5, screenHeight - 10, RED);
|
||||
DrawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, RED);
|
||||
DrawRectangle(0, screenHeight - 5, screenWidth, 5, RED);
|
||||
|
||||
DrawRectangle( 10, 10, 250, 113, Fade(SKYBLUE, 0.5f));
|
||||
DrawRectangleLines( 10, 10, 250, 113, BLUE);
|
||||
|
||||
DrawText("Free 2d camera controls:", 20, 20, 10, BLACK);
|
||||
DrawText("- Right/Left to move Offset", 40, 40, 10, DARKGRAY);
|
||||
DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, DARKGRAY);
|
||||
DrawText("- A / S to Rotate", 40, 80, 10, DARKGRAY);
|
||||
DrawText("- R to reset Zoom and Rotation", 40, 100, 10, DARKGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -23,7 +23,7 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera first person");
|
||||
|
||||
// Define the camera to look into our 3d world (position, target, up vector)
|
||||
Camera camera = {{ 0.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 4.0f, 2.0f, 4.0f }, { 0.0f, 1.8f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 60.0f };
|
||||
|
||||
// Generates some random columns
|
||||
float heights[MAX_COLUMNS];
|
||||
@@ -37,9 +37,7 @@ int main()
|
||||
colors[i] = (Color){ GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255 };
|
||||
}
|
||||
|
||||
Vector3 playerPosition = { 4.0f, 2.0f, 4.0f }; // Define player position
|
||||
|
||||
SetCameraMode(CAMERA_FIRST_PERSON); // Set a first person camera mode
|
||||
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -49,7 +47,7 @@ int main()
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCameraPlayer(&camera, &playerPosition); // Update camera and player position
|
||||
UpdateCamera(&camera); // Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@@ -73,10 +71,13 @@ int main()
|
||||
}
|
||||
|
||||
End3dMode();
|
||||
|
||||
DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5f));
|
||||
DrawRectangleLines( 10, 10, 220, 70, BLUE);
|
||||
|
||||
DrawText("First person camera default controls:", 20, 20, 10, GRAY);
|
||||
DrawText("- Move with keys: W, A, S, D", 40, 50, 10, DARKGRAY);
|
||||
DrawText("- Mouse move to look around", 40, 70, 10, DARKGRAY);
|
||||
DrawText("First person camera default controls:", 20, 20, 10, BLACK);
|
||||
DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY);
|
||||
DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
@@ -22,15 +22,14 @@ int main()
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera;
|
||||
camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; // Camera position
|
||||
camera.position = (Vector3){ 10.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
|
||||
|
||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
SetCameraMode(CAMERA_FREE); // Set a free camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -40,7 +39,9 @@ int main()
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
|
||||
if (IsKeyDown('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@@ -57,13 +58,16 @@ int main()
|
||||
DrawGrid(10, 1.0f);
|
||||
|
||||
End3dMode();
|
||||
|
||||
DrawText("Free camera default controls:", 20, 20, 10, GRAY);
|
||||
DrawText("- Mouse Wheel to Zoom in-out", 40, 50, 10, DARKGRAY);
|
||||
DrawText("- Mouse Wheel Pressed to Pan", 40, 70, 10, DARKGRAY);
|
||||
DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 90, 10, DARKGRAY);
|
||||
DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 110, 10, DARKGRAY);
|
||||
DrawText("- Z to zoom to (0, 0, 0)", 40, 130, 10, DARKGRAY);
|
||||
|
||||
DrawRectangle( 10, 10, 320, 133, Fade(SKYBLUE, 0.5f));
|
||||
DrawRectangleLines( 10, 10, 320, 133, BLUE);
|
||||
|
||||
DrawText("Free camera default controls:", 20, 20, 10, BLACK);
|
||||
DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, DARKGRAY);
|
||||
DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, DARKGRAY);
|
||||
DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, DARKGRAY);
|
||||
DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, DARKGRAY);
|
||||
DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, DARKGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
@@ -25,6 +25,7 @@ int main()
|
||||
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
|
||||
|
||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||
|
@@ -22,9 +22,10 @@ int main()
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera;
|
||||
camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; // Camera position
|
||||
camera.position = (Vector3){ 10.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
|
||||
|
||||
Vector3 cubePosition = { 0.0f, 1.0f, 0.0f };
|
||||
Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };
|
||||
@@ -33,8 +34,7 @@ int main()
|
||||
|
||||
bool collision = false;
|
||||
|
||||
SetCameraMode(CAMERA_FREE); // Set a free camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -44,7 +44,7 @@ int main()
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
|
||||
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
||||
{
|
||||
@@ -53,8 +53,8 @@ int main()
|
||||
|
||||
// Check collision between ray and box
|
||||
collision = CheckCollisionRayBox(ray,
|
||||
(Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 },
|
||||
(Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 });
|
||||
(BoundingBox){(Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 },
|
||||
(Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 }});
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
@@ -66,8 +66,18 @@ int main()
|
||||
|
||||
Begin3dMode(camera);
|
||||
|
||||
DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, GRAY);
|
||||
DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, DARKGRAY);
|
||||
if (collision)
|
||||
{
|
||||
DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RED);
|
||||
DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, MAROON);
|
||||
|
||||
DrawCubeWires(cubePosition, cubeSize.x + 0.2f, cubeSize.y + 0.2f, cubeSize.z + 0.2f, GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, GRAY);
|
||||
DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, DARKGRAY);
|
||||
}
|
||||
|
||||
DrawRay(ray, MAROON);
|
||||
|
||||
@@ -75,7 +85,7 @@ int main()
|
||||
|
||||
End3dMode();
|
||||
|
||||
DrawText("Try selecting the box with mouse!", 240, 10, 20, GRAY);
|
||||
DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY);
|
||||
|
||||
if(collision) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, screenHeight * 0.1f, 30, GREEN);
|
||||
|
54
docs/examples/src/core/core_basic_window.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [core] example - Basic window
|
||||
*
|
||||
* Welcome to raylib!
|
||||
*
|
||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
// TODO: Update your variables here
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -16,7 +16,7 @@ int main()
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 400;
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - color selection (collision detection)");
|
||||
|
||||
@@ -30,7 +30,7 @@ int main()
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
colorsRecs[i].x = 20 + 100*(i%7) + 10*(i%7);
|
||||
colorsRecs[i].y = 40 + 100*(i/7) + 10*(i/7);
|
||||
colorsRecs[i].y = 60 + 100*(i/7) + 10*(i/7);
|
||||
colorsRecs[i].width = 100;
|
||||
colorsRecs[i].height = 100;
|
||||
}
|
@@ -23,7 +23,7 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - drop files");
|
||||
|
||||
int count = 0;
|
||||
char **droppedFiles;
|
||||
char **droppedFiles = { 0 };
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
@@ -34,7 +34,7 @@ int main()
|
||||
|
||||
//SetGesturesEnabled(0b0000000000001001); // Enable only some gestures to be detected
|
||||
|
||||
SetTargetFPS(30);
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
@@ -43,12 +43,11 @@ int main()
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
lastGesture = currentGesture;
|
||||
currentGesture = GetGestureDetected();
|
||||
touchPosition = GetTouchPosition(0);
|
||||
|
||||
if (CheckCollisionPointRec(touchPosition, touchArea) && IsGestureDetected())
|
||||
|
||||
if (CheckCollisionPointRec(touchPosition, touchArea) && (currentGesture != GESTURE_NONE))
|
||||
{
|
||||
currentGesture = GetGestureType();
|
||||
|
||||
if (currentGesture != lastGesture)
|
||||
{
|
||||
// Store gesture string
|
||||
@@ -62,6 +61,8 @@ int main()
|
||||
case GESTURE_SWIPE_LEFT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
|
||||
case GESTURE_SWIPE_UP: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
|
||||
case GESTURE_SWIPE_DOWN: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
|
||||
case GESTURE_PINCH_IN: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH IN"); break;
|
||||
case GESTURE_PINCH_OUT: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH OUT"); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -76,7 +77,6 @@ int main()
|
||||
}
|
||||
}
|
||||
}
|
||||
else currentGesture = GESTURE_NONE;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
194
docs/examples/src/core/core_input_gamepad.c
Normal file
@@ -0,0 +1,194 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [core] example - Gamepad input
|
||||
*
|
||||
* NOTE: This example requires a Gamepad connected to the system
|
||||
* raylib is configured to work with the following gamepads:
|
||||
* - Xbox 360 Controller (Xbox 360, Xbox One)
|
||||
* - PLAYSTATION(R)3 Controller
|
||||
* Check raylib.h for buttons configuration
|
||||
*
|
||||
* This example has been created using raylib 1.6 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
// NOTE: Gamepad name ID depends on drivers and OS
|
||||
#if defined(PLATFORM_RPI)
|
||||
#define XBOX360_NAME_ID "Microsoft X-Box 360 pad"
|
||||
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
|
||||
#else
|
||||
#define XBOX360_NAME_ID "Xbox 360 Controller"
|
||||
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT); // Set MSAA 4X hint before windows creation
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad input");
|
||||
|
||||
Texture2D texPs3Pad = LoadTexture("resources/ps3.png");
|
||||
Texture2D texXboxPad = LoadTexture("resources/xbox.png");
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
// ...
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
if (IsGamepadAvailable(GAMEPAD_PLAYER1))
|
||||
{
|
||||
DrawText(FormatText("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK);
|
||||
|
||||
if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID))
|
||||
{
|
||||
DrawTexture(texXboxPad, 0, 0, DARKGRAY);
|
||||
|
||||
// Draw buttons: xbox home
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_HOME)) DrawCircle(394, 89, 19, RED);
|
||||
|
||||
// Draw buttons: basic
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_START)) DrawCircle(436, 150, 9, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_SELECT)) DrawCircle(352, 150, 9, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_X)) DrawCircle(501, 151, 15, BLUE);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_A)) DrawCircle(536, 187, 15, LIME);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_B)) DrawCircle(572, 151, 15, MAROON);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_Y)) DrawCircle(536, 115, 15, GOLD);
|
||||
|
||||
// Draw buttons: d-pad
|
||||
DrawRectangle(317, 202, 19, 71, BLACK);
|
||||
DrawRectangle(293, 228, 69, 19, BLACK);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_UP)) DrawRectangle(317, 202, 19, 26, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_LEFT)) DrawRectangle(292, 228, 25, 19, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED);
|
||||
|
||||
// Draw buttons: left-right back
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_LB)) DrawCircle(259, 61, 20, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_RB)) DrawCircle(536, 61, 20, RED);
|
||||
|
||||
// Draw axis: left joystick
|
||||
DrawCircle(259, 152, 39, BLACK);
|
||||
DrawCircle(259, 152, 34, LIGHTGRAY);
|
||||
DrawCircle(259 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X)*20),
|
||||
152 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y)*20), 25, BLACK);
|
||||
|
||||
// Draw axis: right joystick
|
||||
DrawCircle(461, 237, 38, BLACK);
|
||||
DrawCircle(461, 237, 33, LIGHTGRAY);
|
||||
DrawCircle(461 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RIGHT_X)*20),
|
||||
237 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RIGHT_Y)*20), 25, BLACK);
|
||||
|
||||
// Draw axis: left-right triggers
|
||||
DrawRectangle(170, 30, 15, 70, GRAY);
|
||||
DrawRectangle(604, 30, 15, 70, GRAY);
|
||||
DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LT))/2.0f)*70), RED);
|
||||
DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RT))/2.0f)*70), RED);
|
||||
|
||||
//DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LT)), 10, 40, 10, BLACK);
|
||||
//DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RT)), 10, 60, 10, BLACK);
|
||||
}
|
||||
else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID))
|
||||
{
|
||||
DrawTexture(texPs3Pad, 0, 0, DARKGRAY);
|
||||
|
||||
// Draw buttons: ps
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_PS)) DrawCircle(396, 222, 13, RED);
|
||||
|
||||
// Draw buttons: basic
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_SELECT)) DrawRectangle(328, 170, 32, 13, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_START)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_TRIANGLE)) DrawCircle(557, 144, 13, LIME);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_CIRCLE)) DrawCircle(586, 173, 13, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_CROSS)) DrawCircle(557, 203, 13, VIOLET);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_SQUARE)) DrawCircle(527, 173, 13, PINK);
|
||||
|
||||
// Draw buttons: d-pad
|
||||
DrawRectangle(225, 132, 24, 84, BLACK);
|
||||
DrawRectangle(195, 161, 84, 25, BLACK);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_UP)) DrawRectangle(225, 132, 24, 29, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_LEFT)) DrawRectangle(195, 161, 30, 25, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED);
|
||||
|
||||
// Draw buttons: left-right back buttons
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_L1)) DrawCircle(239, 82, 20, RED);
|
||||
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_R1)) DrawCircle(557, 82, 20, RED);
|
||||
|
||||
// Draw axis: left joystick
|
||||
DrawCircle(319, 255, 35, BLACK);
|
||||
DrawCircle(319, 255, 31, LIGHTGRAY);
|
||||
DrawCircle(319 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_LEFT_X)*20),
|
||||
255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_LEFT_Y)*20), 25, BLACK);
|
||||
|
||||
// Draw axis: right joystick
|
||||
DrawCircle(475, 255, 35, BLACK);
|
||||
DrawCircle(475, 255, 31, LIGHTGRAY);
|
||||
DrawCircle(475 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_RIGHT_X)*20),
|
||||
255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_RIGHT_Y)*20), 25, BLACK);
|
||||
|
||||
// Draw axis: left-right triggers
|
||||
DrawRectangle(169, 48, 15, 70, GRAY);
|
||||
DrawRectangle(611, 48, 15, 70, GRAY);
|
||||
DrawRectangle(169, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_L2))/2.0f)*70), RED);
|
||||
DrawRectangle(611, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_R2))/2.0f)*70), RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawText("- GENERIC GAMEPAD -", 280, 180, 20, GRAY);
|
||||
|
||||
// TODO: Draw generic gamepad
|
||||
}
|
||||
|
||||
DrawText(FormatText("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON);
|
||||
|
||||
for (int i = 0; i < GetGamepadAxisCount(GAMEPAD_PLAYER1); i++)
|
||||
{
|
||||
DrawText(FormatText("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
||||
}
|
||||
|
||||
if (GetGamepadButtonPressed() != -1) DrawText(FormatText("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
||||
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawText("GP1: NOT DETECTED", 10, 10, 10, GRAY);
|
||||
|
||||
DrawTexture(texXboxPad, 0, 0, LIGHTGRAY);
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadTexture(texPs3Pad);
|
||||
UnloadTexture(texXboxPad);
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
84
docs/examples/src/core/core_vr_simulator.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
|
||||
*
|
||||
* This example has been created using raylib 1.7 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2017 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 1080;
|
||||
int screenHeight = 600;
|
||||
|
||||
// NOTE: screenWidth/screenHeight should match VR device aspect ratio
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
|
||||
|
||||
InitVrSimulator(HMD_OCULUS_RIFT_CV1); // Init VR simulator (Oculus Rift CV1 parameters)
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera;
|
||||
camera.position = (Vector3){ 5.0f, 2.0f, 5.0f }; // Camera position
|
||||
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.fovy = 60.0f; // Camera field-of-view Y
|
||||
|
||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set first person camera mode
|
||||
|
||||
SetTargetFPS(90); // Set our game to run at 90 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update camera (simulator mode)
|
||||
|
||||
if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
BeginVrDrawing();
|
||||
|
||||
Begin3dMode(camera);
|
||||
|
||||
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
|
||||
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
|
||||
|
||||
DrawGrid(40, 1.0f);
|
||||
|
||||
End3dMode();
|
||||
|
||||
EndVrDrawing();
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseVrSimulator(); // Close VR simulator
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -21,15 +21,13 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera free");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 0.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 10.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
Vector2 cubeScreenPosition;
|
||||
|
||||
SetCameraMode(CAMERA_FREE); // Set a free camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -39,10 +37,10 @@ int main()
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
|
||||
// Calculate cube screen space position (with a little offset to be in top)
|
||||
cubeScreenPosition = WorldToScreen((Vector3){cubePosition.x, cubePosition.y + 2.5f, cubePosition.z}, camera);
|
||||
cubeScreenPosition = GetWorldToScreen((Vector3){cubePosition.x, cubePosition.y + 2.5f, cubePosition.z}, camera);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@@ -62,7 +60,6 @@ int main()
|
||||
|
||||
DrawText("Enemy: 100 / 100", cubeScreenPosition.x - MeasureText("Enemy: 100 / 100", 20) / 2, 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);
|
||||
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
@@ -21,24 +21,22 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - drawing billboards");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 5.0f, 4.0f, 5.0f }, { 0.0f, 2.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 5.0f, 4.0f, 5.0f }, { 0.0f, 2.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Texture2D bill = LoadTexture("resources/billboard.png"); // Our texture billboard
|
||||
Vector3 billPosition = { 0.0f, 2.0f, 0.0f }; // Position where draw billboard
|
||||
|
||||
SetCameraMode(CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
||||
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
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
@@ -21,7 +21,7 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - box collisions");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 0.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 0.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Vector3 playerPosition = { 0.0f, 1.0f, 2.0f };
|
||||
Vector3 playerSize = { 1.0f, 2.0f, 1.0f };
|
||||
@@ -53,27 +53,29 @@ int main()
|
||||
collision = false;
|
||||
|
||||
// Check collisions player vs enemy-box
|
||||
if (CheckCollisionBoxes((Vector3){ playerPosition.x - playerSize.x/2,
|
||||
playerPosition.y - playerSize.y/2,
|
||||
playerPosition.z - playerSize.z/2 },
|
||||
(Vector3){ playerPosition.x + playerSize.x/2,
|
||||
playerPosition.y + playerSize.y/2,
|
||||
playerPosition.z + playerSize.z/2 },
|
||||
(Vector3){ enemyBoxPos.x - enemyBoxSize.x/2,
|
||||
enemyBoxPos.y - enemyBoxSize.y/2,
|
||||
enemyBoxPos.z - enemyBoxSize.z/2 },
|
||||
(Vector3){ enemyBoxPos.x + enemyBoxSize.x/2,
|
||||
enemyBoxPos.y + enemyBoxSize.y/2,
|
||||
enemyBoxPos.z + enemyBoxSize.z/2 })) collision = true;
|
||||
if (CheckCollisionBoxes(
|
||||
(BoundingBox){(Vector3){ playerPosition.x - playerSize.x/2,
|
||||
playerPosition.y - playerSize.y/2,
|
||||
playerPosition.z - playerSize.z/2 },
|
||||
(Vector3){ playerPosition.x + playerSize.x/2,
|
||||
playerPosition.y + playerSize.y/2,
|
||||
playerPosition.z + playerSize.z/2 }},
|
||||
(BoundingBox){(Vector3){ enemyBoxPos.x - enemyBoxSize.x/2,
|
||||
enemyBoxPos.y - enemyBoxSize.y/2,
|
||||
enemyBoxPos.z - enemyBoxSize.z/2 },
|
||||
(Vector3){ enemyBoxPos.x + enemyBoxSize.x/2,
|
||||
enemyBoxPos.y + enemyBoxSize.y/2,
|
||||
enemyBoxPos.z + enemyBoxSize.z/2 }})) collision = true;
|
||||
|
||||
// Check collisions player vs enemy-sphere
|
||||
if (CheckCollisionBoxSphere((Vector3){ playerPosition.x - playerSize.x/2,
|
||||
playerPosition.y - playerSize.y/2,
|
||||
playerPosition.z - playerSize.z/2 },
|
||||
(Vector3){ playerPosition.x + playerSize.x/2,
|
||||
playerPosition.y + playerSize.y/2,
|
||||
playerPosition.z + playerSize.z/2 },
|
||||
enemySpherePos, enemySphereSize)) collision = true;
|
||||
if (CheckCollisionBoxSphere(
|
||||
(BoundingBox){(Vector3){ playerPosition.x - playerSize.x/2,
|
||||
playerPosition.y - playerSize.y/2,
|
||||
playerPosition.z - playerSize.z/2 },
|
||||
(Vector3){ playerPosition.x + playerSize.x/2,
|
||||
playerPosition.y + playerSize.y/2,
|
||||
playerPosition.z + playerSize.z/2 }},
|
||||
enemySpherePos, enemySphereSize)) collision = true;
|
||||
|
||||
if (collision) playerColor = RED;
|
||||
else playerColor = GREEN;
|
@@ -21,7 +21,7 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - cubesmap loading and drawing");
|
||||
|
||||
// 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 }};
|
||||
Camera camera = {{ 16.0f, 14.0f, 16.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
|
||||
Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM)
|
||||
@@ -29,24 +29,23 @@ int main()
|
||||
|
||||
// NOTE: By default each cube is mapped to one part of texture atlas
|
||||
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture
|
||||
SetModelTexture(&map, texture); // Bind texture to map model
|
||||
map.material.texDiffuse = texture; // Set map diffuse texture
|
||||
|
||||
Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position
|
||||
|
||||
UnloadImage(image); // Unload cubesmap image from RAM, already uploaded to VRAM
|
||||
|
||||
SetCameraMode(CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our custom camera position
|
||||
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
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
@@ -21,7 +21,7 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - geometric shapes");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 0.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 0.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
@@ -21,28 +21,27 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - heightmap loading and drawing");
|
||||
|
||||
// Define our custom camera to look into our 3d world
|
||||
Camera camera = {{ 18.0f, 16.0f, 18.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 18.0f, 16.0f, 18.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
|
||||
Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
|
||||
Model map = LoadHeightmap(image, (Vector3){ 16, 8, 16 }); // Load heightmap model with defined size
|
||||
SetModelTexture(&map, texture); // Bind texture to model
|
||||
map.material.texDiffuse = texture; // Set map diffuse texture
|
||||
Vector3 mapPosition = { -8.0f, 0.0f, -8.0f }; // Set model position (depends on model scaling!)
|
||||
|
||||
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
|
||||
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
|
||||
|
||||
SetCameraMode(CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our custom camera position
|
||||
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
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
195
docs/examples/src/models/models_mesh_picking.c
Normal file
@@ -0,0 +1,195 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [models] example - Mesh picking in 3d mode, ground plane, triangle, mesh
|
||||
*
|
||||
* This example has been created using raylib 1.7 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||
* Example contributed by Joel Davis (@joeld42)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
#include "raymath.h"
|
||||
|
||||
#define FLT_MAX 3.40282347E+38F // Maximum value of a float, defined in <float.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - mesh picking");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera;
|
||||
camera.position = (Vector3){ 10.0f, 8.0f, 10.0f }; // Camera position
|
||||
camera.target = (Vector3){ 0.0f, 2.3f, 0.0f }; // Camera looking at point
|
||||
camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target)
|
||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||
|
||||
Ray ray; // Picking ray
|
||||
|
||||
Model tower = LoadModel("resources/tower.obj"); // Load OBJ model
|
||||
Texture2D texture = LoadTexture("resources/tower.png"); // Load model texture
|
||||
tower.material.texDiffuse = texture; // Set model diffuse texture
|
||||
|
||||
Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
BoundingBox towerBBox = CalculateBoundingBox(tower.mesh);
|
||||
bool hitMeshBBox = false;
|
||||
bool hitTriangle = false;
|
||||
|
||||
// Test triangle
|
||||
Vector3 ta = (Vector3){ -25.0, 0.5, 0.0 };
|
||||
Vector3 tb = (Vector3){ -4.0, 2.5, 1.0 };
|
||||
Vector3 tc = (Vector3){ -8.0, 6.5, 0.0 };
|
||||
|
||||
Vector3 bary = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
|
||||
|
||||
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); // Update camera
|
||||
|
||||
// Display information about closest hit
|
||||
RayHitInfo nearestHit;
|
||||
char *hitObjectName = "None";
|
||||
nearestHit.distance = FLT_MAX;
|
||||
nearestHit.hit = false;
|
||||
Color cursorColor = WHITE;
|
||||
|
||||
// Get ray and test against ground, triangle, and mesh
|
||||
ray = GetMouseRay(GetMousePosition(), camera);
|
||||
|
||||
// Check ray collision aginst ground plane
|
||||
RayHitInfo groundHitInfo = GetCollisionRayGround(ray, 0.0f);
|
||||
|
||||
if ((groundHitInfo.hit) && (groundHitInfo.distance < nearestHit.distance))
|
||||
{
|
||||
nearestHit = groundHitInfo;
|
||||
cursorColor = GREEN;
|
||||
hitObjectName = "Ground";
|
||||
}
|
||||
|
||||
// Check ray collision against test triangle
|
||||
RayHitInfo triHitInfo = GetCollisionRayTriangle(ray, ta, tb, tc);
|
||||
|
||||
if ((triHitInfo.hit) && (triHitInfo.distance < nearestHit.distance))
|
||||
{
|
||||
nearestHit = triHitInfo;
|
||||
cursorColor = PURPLE;
|
||||
hitObjectName = "Triangle";
|
||||
|
||||
bary = VectorBarycenter(nearestHit.hitPosition, ta, tb, tc);
|
||||
hitTriangle = true;
|
||||
}
|
||||
else hitTriangle = false;
|
||||
|
||||
RayHitInfo meshHitInfo;
|
||||
|
||||
// Check ray collision against bounding box first, before trying the full ray-mesh test
|
||||
if (CheckCollisionRayBox(ray, towerBBox))
|
||||
{
|
||||
hitMeshBBox = true;
|
||||
|
||||
// Check ray collision against mesh
|
||||
meshHitInfo = GetCollisionRayMesh(ray, &tower.mesh);
|
||||
|
||||
if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance))
|
||||
{
|
||||
nearestHit = meshHitInfo;
|
||||
cursorColor = ORANGE;
|
||||
hitObjectName = "Mesh";
|
||||
}
|
||||
|
||||
} hitMeshBBox = false;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
Begin3dMode(camera);
|
||||
|
||||
// Draw the tower
|
||||
DrawModel(tower, towerPos, 1.0, WHITE);
|
||||
|
||||
// Draw the test triangle
|
||||
DrawLine3D(ta, tb, PURPLE);
|
||||
DrawLine3D(tb, tc, PURPLE);
|
||||
DrawLine3D(tc, ta, PURPLE);
|
||||
|
||||
// Draw the mesh bbox if we hit it
|
||||
if (hitMeshBBox) DrawBoundingBox(towerBBox, LIME);
|
||||
|
||||
// If we hit something, draw the cursor at the hit point
|
||||
if (nearestHit.hit)
|
||||
{
|
||||
DrawCube(nearestHit.hitPosition, 0.3, 0.3, 0.3, cursorColor);
|
||||
DrawCubeWires(nearestHit.hitPosition, 0.3, 0.3, 0.3, RED);
|
||||
|
||||
Vector3 normalEnd;
|
||||
normalEnd.x = nearestHit.hitPosition.x + nearestHit.hitNormal.x;
|
||||
normalEnd.y = nearestHit.hitPosition.y + nearestHit.hitNormal.y;
|
||||
normalEnd.z = nearestHit.hitPosition.z + nearestHit.hitNormal.z;
|
||||
|
||||
DrawLine3D(nearestHit.hitPosition, normalEnd, RED);
|
||||
}
|
||||
|
||||
DrawRay(ray, MAROON);
|
||||
|
||||
DrawGrid(100, 1.0f);
|
||||
|
||||
End3dMode();
|
||||
|
||||
// Draw some debug GUI text
|
||||
DrawText(FormatText("Hit Object: %s", hitObjectName), 10, 50, 10, BLACK);
|
||||
|
||||
if (nearestHit.hit)
|
||||
{
|
||||
int ypos = 70;
|
||||
|
||||
DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK);
|
||||
|
||||
DrawText(FormatText("Hit Pos: %3.2f %3.2f %3.2f",
|
||||
nearestHit.hitPosition.x,
|
||||
nearestHit.hitPosition.y,
|
||||
nearestHit.hitPosition.z), 10, ypos + 15, 10, BLACK);
|
||||
|
||||
DrawText(FormatText("Hit Norm: %3.2f %3.2f %3.2f",
|
||||
nearestHit.hitNormal.x,
|
||||
nearestHit.hitNormal.y,
|
||||
nearestHit.hitNormal.z), 10, ypos + 30, 10, BLACK);
|
||||
|
||||
if (hitTriangle) DrawText(FormatText("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);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadModel(tower); // Unload model
|
||||
UnloadTexture(texture); // Unload texture
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -21,11 +21,11 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - obj model loading");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture
|
||||
SetModelTexture(&dwarf, texture); // Bind texture to model
|
||||
dwarf.material.texDiffuse = texture; // Set dwarf model diffuse texture
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
@@ -49,7 +49,7 @@ int main()
|
||||
|
||||
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture
|
||||
|
||||
DrawGrid(10, 1.0f); // Draw a grid
|
||||
DrawGrid(10, 1.0f); // Draw a grid
|
||||
|
||||
DrawGizmo(position); // Draw gizmo
|
||||
|
128
docs/examples/src/physac/physics_demo.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* Physac - Physics demo
|
||||
*
|
||||
* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
|
||||
* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
|
||||
*
|
||||
* Use the following line to compile:
|
||||
*
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
|
||||
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
|
||||
*
|
||||
* Copyright (c) 2017 Victor Fisac
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics demo");
|
||||
SetTargetFPS(60);
|
||||
|
||||
// Physac logo drawing position
|
||||
int logoX = screenWidth - MeasureText("Physac", 30) - 10;
|
||||
int logoY = 15;
|
||||
|
||||
// Initialize physics and default physics bodies
|
||||
InitPhysics();
|
||||
|
||||
// Create floor rectangle physics body
|
||||
PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, 500, 100, 10);
|
||||
floor->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
|
||||
// Create obstacle circle physics body
|
||||
PhysicsBody circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2, screenHeight/2 }, 45, 10);
|
||||
circle->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed('R')) // Reset physics input
|
||||
{
|
||||
ResetPhysics();
|
||||
|
||||
floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, 500, 100, 10);
|
||||
floor->enabled = false;
|
||||
|
||||
circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2, screenHeight/2 }, 45, 10);
|
||||
circle->enabled = false;
|
||||
}
|
||||
|
||||
// Physics body creation inputs
|
||||
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) CreatePhysicsBodyPolygon(GetMousePosition(), GetRandomValue(20, 80), GetRandomValue(3, 8), 10);
|
||||
else if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) CreatePhysicsBodyCircle(GetMousePosition(), GetRandomValue(10, 45), 10);
|
||||
|
||||
// Destroy falling physics bodies
|
||||
int bodiesCount = GetPhysicsBodiesCount();
|
||||
for (int i = bodiesCount - 1; i >= 0; i--)
|
||||
{
|
||||
PhysicsBody body = GetPhysicsBody(i);
|
||||
if (body != NULL && (body->position.y > screenHeight*2)) DestroyPhysicsBody(body);
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(BLACK);
|
||||
|
||||
DrawFPS(screenWidth - 90, screenHeight - 30);
|
||||
|
||||
// Draw created physics bodies
|
||||
bodiesCount = GetPhysicsBodiesCount();
|
||||
for (int i = 0; i < bodiesCount; i++)
|
||||
{
|
||||
PhysicsBody body = GetPhysicsBody(i);
|
||||
|
||||
if (body != NULL)
|
||||
{
|
||||
int vertexCount = GetPhysicsShapeVerticesCount(i);
|
||||
for (int j = 0; j < vertexCount; j++)
|
||||
{
|
||||
// Get physics bodies shape vertices to draw lines
|
||||
// Note: GetPhysicsShapeVertex() already calculates rotation transformations
|
||||
Vector2 vertexA = GetPhysicsShapeVertex(body, j);
|
||||
|
||||
int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
|
||||
Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
|
||||
|
||||
DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DrawText("Left mouse button to create a polygon", 10, 10, 10, WHITE);
|
||||
DrawText("Right mouse button to create a circle", 10, 25, 10, WHITE);
|
||||
DrawText("Press 'R' to reset example", 10, 40, 10, WHITE);
|
||||
|
||||
DrawText("Physac", logoX, logoY, 30, WHITE);
|
||||
DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
ClosePhysics(); // Uninitialize physics
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
143
docs/examples/src/physac/physics_friction.c
Normal file
@@ -0,0 +1,143 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* Physac - Physics friction
|
||||
*
|
||||
* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
|
||||
* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
|
||||
*
|
||||
* Use the following line to compile:
|
||||
*
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
|
||||
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
|
||||
*
|
||||
* Copyright (c) 2017 Victor Fisac
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics friction");
|
||||
SetTargetFPS(60);
|
||||
|
||||
// Physac logo drawing position
|
||||
int logoX = screenWidth - MeasureText("Physac", 30) - 10;
|
||||
int logoY = 15;
|
||||
|
||||
// Initialize physics and default physics bodies
|
||||
InitPhysics();
|
||||
|
||||
// Create floor rectangle physics body
|
||||
PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, screenWidth, 100, 10);
|
||||
floor->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
PhysicsBody wall = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight*0.8f }, 10, 80, 10);
|
||||
wall->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
|
||||
// Create left ramp physics body
|
||||
PhysicsBody rectLeft = CreatePhysicsBodyRectangle((Vector2){ 25, screenHeight - 5 }, 250, 250, 10);
|
||||
rectLeft->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
SetPhysicsBodyRotation(rectLeft, 30*DEG2RAD);
|
||||
|
||||
// Create right ramp physics body
|
||||
PhysicsBody rectRight = CreatePhysicsBodyRectangle((Vector2){ screenWidth - 25, screenHeight - 5 }, 250, 250, 10);
|
||||
rectRight->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
SetPhysicsBodyRotation(rectRight, 330*DEG2RAD);
|
||||
|
||||
// Create dynamic physics bodies
|
||||
PhysicsBody bodyA = CreatePhysicsBodyRectangle((Vector2){ 35, screenHeight*0.6f }, 40, 40, 10);
|
||||
bodyA->staticFriction = 0.1f;
|
||||
bodyA->dynamicFriction = 0.1f;
|
||||
SetPhysicsBodyRotation(bodyA, 30*DEG2RAD);
|
||||
|
||||
PhysicsBody bodyB = CreatePhysicsBodyRectangle((Vector2){ screenWidth - 35, screenHeight*0.6f }, 40, 40, 10);
|
||||
bodyB->staticFriction = 1;
|
||||
bodyB->dynamicFriction = 1;
|
||||
SetPhysicsBodyRotation(bodyB, 330*DEG2RAD);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed('R')) // Reset physics input
|
||||
{
|
||||
// Reset dynamic physics bodies position, velocity and rotation
|
||||
bodyA->position = (Vector2){ 35, screenHeight*0.6f };
|
||||
bodyA->velocity = (Vector2){ 0, 0 };
|
||||
bodyA->angularVelocity = 0;
|
||||
SetPhysicsBodyRotation(bodyA, 30*DEG2RAD);
|
||||
|
||||
bodyB->position = (Vector2){ screenWidth - 35, screenHeight*0.6f };
|
||||
bodyB->velocity = (Vector2){ 0, 0 };
|
||||
bodyB->angularVelocity = 0;
|
||||
SetPhysicsBodyRotation(bodyB, 330*DEG2RAD);
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(BLACK);
|
||||
|
||||
DrawFPS(screenWidth - 90, screenHeight - 30);
|
||||
|
||||
// Draw created physics bodies
|
||||
int bodiesCount = GetPhysicsBodiesCount();
|
||||
for (int i = 0; i < bodiesCount; i++)
|
||||
{
|
||||
PhysicsBody body = GetPhysicsBody(i);
|
||||
|
||||
if (body != NULL)
|
||||
{
|
||||
int vertexCount = GetPhysicsShapeVerticesCount(i);
|
||||
for (int j = 0; j < vertexCount; j++)
|
||||
{
|
||||
// Get physics bodies shape vertices to draw lines
|
||||
// Note: GetPhysicsShapeVertex() already calculates rotation transformations
|
||||
Vector2 vertexA = GetPhysicsShapeVertex(body, j);
|
||||
|
||||
int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
|
||||
Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
|
||||
|
||||
DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DrawRectangle(0, screenHeight - 49, screenWidth, 49, BLACK);
|
||||
|
||||
DrawText("Friction amount", (screenWidth - MeasureText("Friction amount", 30))/2, 75, 30, WHITE);
|
||||
DrawText("0.1", bodyA->position.x - MeasureText("0.1", 20)/2, bodyA->position.y - 7, 20, WHITE);
|
||||
DrawText("1", bodyB->position.x - MeasureText("1", 20)/2, bodyB->position.y - 7, 20, WHITE);
|
||||
|
||||
DrawText("Press 'R' to reset example", 10, 10, 10, WHITE);
|
||||
|
||||
DrawText("Physac", logoX, logoY, 30, WHITE);
|
||||
DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
ClosePhysics(); // Uninitialize physics
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
129
docs/examples/src/physac/physics_movement.c
Normal file
@@ -0,0 +1,129 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* Physac - Physics movement
|
||||
*
|
||||
* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
|
||||
* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
|
||||
*
|
||||
* Use the following line to compile:
|
||||
*
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
|
||||
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
|
||||
*
|
||||
* Copyright (c) 2017 Victor Fisac
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
|
||||
#define VELOCITY 0.5f
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics movement");
|
||||
SetTargetFPS(60);
|
||||
|
||||
// Physac logo drawing position
|
||||
int logoX = screenWidth - MeasureText("Physac", 30) - 10;
|
||||
int logoY = 15;
|
||||
|
||||
// Initialize physics and default physics bodies
|
||||
InitPhysics();
|
||||
|
||||
// Create floor and walls rectangle physics body
|
||||
PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, screenWidth, 100, 10);
|
||||
PhysicsBody platformLeft = CreatePhysicsBodyRectangle((Vector2){ screenWidth*0.25f, screenHeight*0.6f }, screenWidth*0.25f, 10, 10);
|
||||
PhysicsBody platformRight = CreatePhysicsBodyRectangle((Vector2){ screenWidth*0.75f, screenHeight*0.6f }, screenWidth*0.25f, 10, 10);
|
||||
PhysicsBody wallLeft = CreatePhysicsBodyRectangle((Vector2){ -5, screenHeight/2 }, 10, screenHeight, 10);
|
||||
PhysicsBody wallRight = CreatePhysicsBodyRectangle((Vector2){ screenWidth + 5, screenHeight/2 }, 10, screenHeight, 10);
|
||||
|
||||
// Disable dynamics to floor and walls physics bodies
|
||||
floor->enabled = false;
|
||||
platformLeft->enabled = false;
|
||||
platformRight->enabled = false;
|
||||
wallLeft->enabled = false;
|
||||
wallRight->enabled = false;
|
||||
|
||||
// Create movement physics body
|
||||
PhysicsBody body = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight/2 }, 50, 50, 1);
|
||||
body->freezeOrient = true; // Constrain body rotation to avoid little collision torque amounts
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed('R')) // Reset physics input
|
||||
{
|
||||
// Reset movement physics body position, velocity and rotation
|
||||
body->position = (Vector2){ screenWidth/2, screenHeight/2 };
|
||||
body->velocity = (Vector2){ 0, 0 };
|
||||
SetPhysicsBodyRotation(body, 0);
|
||||
}
|
||||
|
||||
// Horizontal movement input
|
||||
if (IsKeyDown(KEY_RIGHT)) body->velocity.x = VELOCITY;
|
||||
else if (IsKeyDown(KEY_LEFT)) body->velocity.x = -VELOCITY;
|
||||
|
||||
// Vertical movement input checking if player physics body is grounded
|
||||
if (IsKeyDown(KEY_UP) && body->isGrounded) body->velocity.y = -VELOCITY*4;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(BLACK);
|
||||
|
||||
DrawFPS(screenWidth - 90, screenHeight - 30);
|
||||
|
||||
// Draw created physics bodies
|
||||
int bodiesCount = GetPhysicsBodiesCount();
|
||||
for (int i = 0; i < bodiesCount; i++)
|
||||
{
|
||||
PhysicsBody body = GetPhysicsBody(i);
|
||||
|
||||
int vertexCount = GetPhysicsShapeVerticesCount(i);
|
||||
for (int j = 0; j < vertexCount; j++)
|
||||
{
|
||||
// Get physics bodies shape vertices to draw lines
|
||||
// Note: GetPhysicsShapeVertex() already calculates rotation transformations
|
||||
Vector2 vertexA = GetPhysicsShapeVertex(body, j);
|
||||
|
||||
int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
|
||||
Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
|
||||
|
||||
DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
|
||||
}
|
||||
}
|
||||
|
||||
DrawText("Use 'ARROWS' to move player", 10, 10, 10, WHITE);
|
||||
DrawText("Press 'R' to reset example", 10, 30, 10, WHITE);
|
||||
|
||||
DrawText("Physac", logoX, logoY, 30, WHITE);
|
||||
DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
ClosePhysics(); // Uninitialize physics
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
122
docs/examples/src/physac/physics_restitution.c
Normal file
@@ -0,0 +1,122 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* Physac - Physics restitution
|
||||
*
|
||||
* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
|
||||
* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
|
||||
*
|
||||
* Use the following line to compile:
|
||||
*
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
|
||||
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
|
||||
*
|
||||
* Copyright (c) 2017 Victor Fisac
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics restitution");
|
||||
SetTargetFPS(60);
|
||||
|
||||
// Physac logo drawing position
|
||||
int logoX = screenWidth - MeasureText("Physac", 30) - 10;
|
||||
int logoY = 15;
|
||||
|
||||
// Initialize physics and default physics bodies
|
||||
InitPhysics();
|
||||
|
||||
// Create floor rectangle physics body
|
||||
PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, screenWidth, 100, 10);
|
||||
floor->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
|
||||
floor->restitution = 1;
|
||||
|
||||
// Create circles physics body
|
||||
PhysicsBody circleA = CreatePhysicsBodyCircle((Vector2){ screenWidth*0.25f, screenHeight/2 }, 30, 10);
|
||||
circleA->restitution = 0;
|
||||
PhysicsBody circleB = CreatePhysicsBodyCircle((Vector2){ screenWidth*0.5f, screenHeight/2 }, 30, 10);
|
||||
circleB->restitution = 0.5f;
|
||||
PhysicsBody circleC = CreatePhysicsBodyCircle((Vector2){ screenWidth*0.75f, screenHeight/2 }, 30, 10);
|
||||
circleC->restitution = 1;
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed('R')) // Reset physics input
|
||||
{
|
||||
// Reset circles physics bodies position and velocity
|
||||
circleA->position = (Vector2){ screenWidth*0.25f, screenHeight/2 };
|
||||
circleA->velocity = (Vector2){ 0, 0 };
|
||||
circleB->position = (Vector2){ screenWidth*0.5f, screenHeight/2 };
|
||||
circleB->velocity = (Vector2){ 0, 0 };
|
||||
circleC->position = (Vector2){ screenWidth*0.75f, screenHeight/2 };
|
||||
circleC->velocity = (Vector2){ 0, 0 };
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(BLACK);
|
||||
|
||||
DrawFPS(screenWidth - 90, screenHeight - 30);
|
||||
|
||||
// Draw created physics bodies
|
||||
int bodiesCount = GetPhysicsBodiesCount();
|
||||
for (int i = 0; i < bodiesCount; i++)
|
||||
{
|
||||
PhysicsBody body = GetPhysicsBody(i);
|
||||
|
||||
int vertexCount = GetPhysicsShapeVerticesCount(i);
|
||||
for (int j = 0; j < vertexCount; j++)
|
||||
{
|
||||
// Get physics bodies shape vertices to draw lines
|
||||
// Note: GetPhysicsShapeVertex() already calculates rotation transformations
|
||||
Vector2 vertexA = GetPhysicsShapeVertex(body, j);
|
||||
|
||||
int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
|
||||
Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
|
||||
|
||||
DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
|
||||
}
|
||||
}
|
||||
|
||||
DrawText("Restitution amount", (screenWidth - MeasureText("Restitution amount", 30))/2, 75, 30, WHITE);
|
||||
DrawText("0", circleA->position.x - MeasureText("0", 20)/2, circleA->position.y - 7, 20, WHITE);
|
||||
DrawText("0.5", circleB->position.x - MeasureText("0.5", 20)/2, circleB->position.y - 7, 20, WHITE);
|
||||
DrawText("1", circleC->position.x - MeasureText("1", 20)/2, circleC->position.y - 7, 20, WHITE);
|
||||
|
||||
DrawText("Press 'R' to reset example", 10, 10, 10, WHITE);
|
||||
|
||||
DrawText("Physac", logoX, logoY, 30, WHITE);
|
||||
DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
ClosePhysics(); // Uninitialize physics
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
114
docs/examples/src/physac/physics_shatter.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* Physac - Body shatter
|
||||
*
|
||||
* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
|
||||
* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
|
||||
*
|
||||
* Use the following line to compile:
|
||||
*
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
|
||||
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
|
||||
*
|
||||
* Copyright (c) 2017 Victor Fisac
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Body shatter");
|
||||
SetTargetFPS(60);
|
||||
|
||||
// Physac logo drawing position
|
||||
int logoX = screenWidth - MeasureText("Physac", 30) - 10;
|
||||
int logoY = 15;
|
||||
|
||||
// Initialize physics and default physics bodies
|
||||
InitPhysics();
|
||||
SetPhysicsGravity(0, 0);
|
||||
|
||||
// Create random polygon physics body to shatter
|
||||
PhysicsBody body = CreatePhysicsBodyPolygon((Vector2){ screenWidth/2, screenHeight/2 }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed('R')) // Reset physics input
|
||||
{
|
||||
ResetPhysics();
|
||||
|
||||
// Create random polygon physics body to shatter
|
||||
body = CreatePhysicsBodyPolygon((Vector2){ screenWidth/2, screenHeight/2 }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10);
|
||||
}
|
||||
|
||||
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) // Physics shatter input
|
||||
{
|
||||
// Note: some values need to be stored in variables due to asynchronous changes during main thread
|
||||
int count = GetPhysicsBodiesCount();
|
||||
for (int i = count - 1; i >= 0; i--)
|
||||
{
|
||||
PhysicsBody currentBody = GetPhysicsBody(i);
|
||||
if (currentBody != NULL) PhysicsShatter(currentBody, GetMousePosition(), 10/currentBody->inverseMass);
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(BLACK);
|
||||
|
||||
// Draw created physics bodies
|
||||
int bodiesCount = GetPhysicsBodiesCount();
|
||||
for (int i = 0; i < bodiesCount; i++)
|
||||
{
|
||||
PhysicsBody currentBody = GetPhysicsBody(i);
|
||||
|
||||
int vertexCount = GetPhysicsShapeVerticesCount(i);
|
||||
for (int j = 0; j < vertexCount; j++)
|
||||
{
|
||||
// Get physics bodies shape vertices to draw lines
|
||||
// Note: GetPhysicsShapeVertex() already calculates rotation transformations
|
||||
Vector2 vertexA = GetPhysicsShapeVertex(currentBody, j);
|
||||
|
||||
int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
|
||||
Vector2 vertexB = GetPhysicsShapeVertex(currentBody, jj);
|
||||
|
||||
DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
|
||||
}
|
||||
}
|
||||
|
||||
DrawText("Left mouse button in polygon area to shatter body\nPress 'R' to reset example", 10, 10, 10, WHITE);
|
||||
|
||||
DrawText("Physac", logoX, logoY, 30, WHITE);
|
||||
DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
ClosePhysics(); // Uninitialize physics
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -30,16 +30,16 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - custom uniform variable");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture
|
||||
SetModelTexture(&dwarf, texture); // Bind texture to model
|
||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
|
||||
dwarf.material.texDiffuse = texture; // Set dwarf model diffuse texture
|
||||
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
Shader shader = LoadShader("resources/shaders/base.vs",
|
||||
"resources/shaders/swirl.fs"); // Load postpro shader
|
||||
Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
|
||||
"resources/shaders/glsl330/swirl.fs"); // Load postpro shader
|
||||
|
||||
// Get variable (uniform) location on the shader to connect with the program
|
||||
// NOTE: If uniform variable could not be found in the shader, function returns -1
|
||||
@@ -47,12 +47,11 @@ int main()
|
||||
|
||||
float swirlCenter[2] = { (float)screenWidth/2, (float)screenHeight/2 };
|
||||
|
||||
SetPostproShader(shader); // Set fullscreen postprocessing shader
|
||||
// Create a RenderTexture2D to be used for render to texture
|
||||
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
|
||||
|
||||
// Setup orbital camera
|
||||
SetCameraMode(CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -70,7 +69,7 @@ int main()
|
||||
// Send new value to the shader to be used on drawing
|
||||
SetShaderValue(shader, swirlCenterLoc, swirlCenter, 2);
|
||||
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@@ -78,14 +77,27 @@ int main()
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
BeginTextureMode(target); // Enable drawing to texture
|
||||
|
||||
Begin3dMode(camera);
|
||||
Begin3dMode(camera);
|
||||
|
||||
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture
|
||||
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture
|
||||
|
||||
DrawGrid(10, 1.0f); // Draw a grid
|
||||
DrawGrid(10, 1.0f); // Draw a grid
|
||||
|
||||
End3dMode();
|
||||
End3dMode();
|
||||
|
||||
DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, RED);
|
||||
|
||||
EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)
|
||||
|
||||
BeginShaderMode(shader);
|
||||
|
||||
// NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
|
||||
DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);
|
||||
|
||||
EndShaderMode();
|
||||
|
||||
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, GRAY);
|
||||
|
||||
@@ -97,11 +109,12 @@ int main()
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadShader(shader); // Unload shader
|
||||
UnloadTexture(texture); // Unload texture
|
||||
UnloadModel(dwarf); // Unload model
|
||||
UnloadShader(shader); // Unload shader
|
||||
UnloadTexture(texture); // Unload texture
|
||||
UnloadModel(dwarf); // Unload model
|
||||
UnloadRenderTexture(target); // Unload render texture
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
@@ -30,32 +30,29 @@ int main()
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - model shader");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture
|
||||
Shader shader = LoadShader("resources/shaders/base.vs",
|
||||
"resources/shaders/grayscale.fs"); // Load model shader
|
||||
Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
|
||||
"resources/shaders/glsl330/grayscale.fs"); // Load model shader
|
||||
|
||||
SetModelShader(&dwarf, shader); // Set shader effect to 3d model
|
||||
SetModelTexture(&dwarf, texture); // Bind texture to model
|
||||
dwarf.material.shader = shader; // Set shader effect to 3d model
|
||||
dwarf.material.texDiffuse = texture; // Bind texture to model
|
||||
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
// Setup orbital camera
|
||||
SetCameraMode(CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
||||
SetCameraMode(camera, CAMERA_FREE); // 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
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update internal camera and our camera
|
||||
UpdateCamera(&camera); // Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@@ -73,6 +70,9 @@ int main()
|
||||
End3dMode();
|
||||
|
||||
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, GRAY);
|
||||
|
||||
DrawText(FormatText("Camera position: (%.2f, %.2f, %.2f)", camera.position.x, camera.position.y, camera.position.z), 600, 20, 10, BLACK);
|
||||
DrawText(FormatText("Camera target: (%.2f, %.2f, %.2f)", camera.target.x, camera.target.y, camera.target.z), 600, 40, 10, GRAY);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
180
docs/examples/src/shaders/shaders_postprocessing.c
Normal file
@@ -0,0 +1,180 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [shaders] example - Apply a postprocessing shader to a scene
|
||||
*
|
||||
* NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support,
|
||||
* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version.
|
||||
*
|
||||
* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example
|
||||
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
||||
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
||||
*
|
||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_DESKTOP)
|
||||
#define GLSL_VERSION 330
|
||||
#define DEFAULT_VERTEX_SHADER "resources/shaders/glsl330/base.vs"
|
||||
#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
|
||||
#define GLSL_VERSION 100
|
||||
#define DEFAULT_VERTEX_SHADER "resources/shaders/glsl100/base.vs"
|
||||
#endif
|
||||
|
||||
#define MAX_POSTPRO_SHADERS 12
|
||||
|
||||
typedef enum {
|
||||
FX_GRAYSCALE = 0,
|
||||
FX_POSTERIZATION,
|
||||
FX_DREAM_VISION,
|
||||
FX_PIXELIZER,
|
||||
FX_CROSS_HATCHING,
|
||||
FX_CROSS_STITCHING,
|
||||
FX_PREDATOR_VIEW,
|
||||
FX_SCANLINES,
|
||||
FX_FISHEYE,
|
||||
FX_SOBEL,
|
||||
FX_BLOOM,
|
||||
FX_BLUR,
|
||||
//FX_FXAA
|
||||
} PostproShader;
|
||||
|
||||
static const char *postproShaderText[] = {
|
||||
"GRAYSCALE",
|
||||
"POSTERIZATION",
|
||||
"DREAM_VISION",
|
||||
"PIXELIZER",
|
||||
"CROSS_HATCHING",
|
||||
"CROSS_STITCHING",
|
||||
"PREDATOR_VIEW",
|
||||
"SCANLINES",
|
||||
"FISHEYE",
|
||||
"SOBEL",
|
||||
"BLOOM",
|
||||
"BLUR",
|
||||
//"FXAA"
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - postprocessing shader");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||
|
||||
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
|
||||
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
|
||||
dwarf.material.texDiffuse = texture; // Set dwarf model diffuse texture
|
||||
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
// Load all postpro shaders
|
||||
// NOTE 1: All postpro shader use the base vertex shader (DEFAULT_VERTEX_SHADER)
|
||||
// NOTE 2: We load the correct shader depending on GLSL version
|
||||
Shader shaders[MAX_POSTPRO_SHADERS];
|
||||
|
||||
shaders[FX_GRAYSCALE] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
shaders[FX_POSTERIZATION] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/posterization.fs", GLSL_VERSION));
|
||||
shaders[FX_DREAM_VISION] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/dream_vision.fs", GLSL_VERSION));
|
||||
shaders[FX_PIXELIZER] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/pixelizer.fs", GLSL_VERSION));
|
||||
shaders[FX_CROSS_HATCHING] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/cross_hatching.fs", GLSL_VERSION));
|
||||
shaders[FX_CROSS_STITCHING] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/cross_stitching.fs", GLSL_VERSION));
|
||||
shaders[FX_PREDATOR_VIEW] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/predator.fs", GLSL_VERSION));
|
||||
shaders[FX_SCANLINES] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
|
||||
shaders[FX_FISHEYE] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
|
||||
shaders[FX_SOBEL] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
|
||||
shaders[FX_BLOOM] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
|
||||
shaders[FX_BLUR] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
|
||||
|
||||
int currentShader = FX_GRAYSCALE;
|
||||
|
||||
// Create a RenderTexture2D to be used for render to texture
|
||||
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
|
||||
|
||||
// Setup orbital camera
|
||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
||||
|
||||
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); // Update camera
|
||||
|
||||
if (IsKeyPressed(KEY_RIGHT)) currentShader++;
|
||||
else if (IsKeyPressed(KEY_LEFT)) currentShader--;
|
||||
|
||||
if (currentShader >= MAX_POSTPRO_SHADERS) currentShader = 0;
|
||||
else if (currentShader < 0) currentShader = MAX_POSTPRO_SHADERS - 1;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
BeginTextureMode(target); // Enable drawing to texture
|
||||
|
||||
Begin3dMode(camera);
|
||||
|
||||
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture
|
||||
|
||||
DrawGrid(10, 1.0f); // Draw a grid
|
||||
|
||||
End3dMode();
|
||||
|
||||
EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)
|
||||
|
||||
// Render previously generated texture using selected postpro shader
|
||||
BeginShaderMode(shaders[currentShader]);
|
||||
|
||||
// NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
|
||||
DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);
|
||||
|
||||
EndShaderMode();
|
||||
|
||||
DrawRectangle(0, 9, 580, 30, Fade(LIGHTGRAY, 0.7f));
|
||||
|
||||
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, DARKGRAY);
|
||||
|
||||
DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, BLACK);
|
||||
DrawText(postproShaderText[currentShader], 330, 15, 20, RED);
|
||||
DrawText("< >", 540, 10, 30, DARKBLUE);
|
||||
|
||||
DrawFPS(700, 15);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Unload all postpro shaders
|
||||
for (int i = 0; i < MAX_POSTPRO_SHADERS; i++) UnloadShader(shaders[i]);
|
||||
|
||||
UnloadTexture(texture); // Unload texture
|
||||
UnloadModel(dwarf); // Unload model
|
||||
UnloadRenderTexture(target); // Unload render texture
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
||||
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
||||
*
|
||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
||||
* This example has been created using raylib 1.7 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||
@@ -18,9 +18,6 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
@@ -30,15 +27,12 @@ int main()
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - shapes and texture shaders");
|
||||
|
||||
Texture2D sonic = LoadTexture("resources/texture_formats/sonic.png");
|
||||
Texture2D fudesumi = LoadTexture("resources/fudesumi.png");
|
||||
|
||||
// NOTE: Using GLSL 330 shader version, on OpenGL ES 2.0 use GLSL 100 shader version
|
||||
Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
|
||||
"resources/shaders/glsl330/grayscale.fs");
|
||||
|
||||
// NOTE: This shader is a bit different than model/postprocessing shaders,
|
||||
// it requires the color data for every vertice to use it in every shape or texture independently
|
||||
Shader shader = LoadShader("resources/shaders/shapes_base.vs",
|
||||
"resources/shaders/shapes_grayscale.fs");
|
||||
|
||||
// Shader usage is also different than models/postprocessing, shader is just activated when required
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@@ -66,16 +60,16 @@ int main()
|
||||
|
||||
|
||||
// Activate our custom shader to be applied on next shapes/textures drawings
|
||||
SetCustomShader(shader);
|
||||
BeginShaderMode(shader);
|
||||
|
||||
DrawText("USING CUSTOM SHADER", 190, 40, 10, RED);
|
||||
DrawText("USING CUSTOM SHADER", 190, 40, 10, RED);
|
||||
|
||||
DrawRectangle(250 - 60, 90, 120, 60, RED);
|
||||
DrawRectangleGradient(250 - 90, 170, 180, 130, MAROON, GOLD);
|
||||
DrawRectangleLines(250 - 40, 320, 80, 60, ORANGE);
|
||||
DrawRectangle(250 - 60, 90, 120, 60, RED);
|
||||
DrawRectangleGradient(250 - 90, 170, 180, 130, MAROON, GOLD);
|
||||
DrawRectangleLines(250 - 40, 320, 80, 60, ORANGE);
|
||||
|
||||
// Activate our default shader for next drawings
|
||||
SetDefaultShader();
|
||||
EndShaderMode();
|
||||
|
||||
DrawText("USING DEFAULT SHADER", 370, 40, 10, RED);
|
||||
|
||||
@@ -90,12 +84,14 @@ int main()
|
||||
DrawPoly((Vector2){430, 320}, 6, 80, 0, BROWN);
|
||||
|
||||
// Activate our custom shader to be applied on next shapes/textures drawings
|
||||
SetCustomShader(shader);
|
||||
BeginShaderMode(shader);
|
||||
|
||||
DrawTexture(sonic, 380, -10, WHITE); // Using custom shader
|
||||
DrawTexture(fudesumi, 500, -30, WHITE); // Using custom shader
|
||||
|
||||
// Activate our default shader for next drawings
|
||||
SetDefaultShader();
|
||||
EndShaderMode();
|
||||
|
||||
DrawText("(c) Fudesumi sprite by Eiden Marsal", 380, screenHeight - 20, 10, GRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
@@ -103,10 +99,10 @@ int main()
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadShader(shader); // Unload shader
|
||||
UnloadTexture(sonic); // Unload texture
|
||||
UnloadShader(shader); // Unload shader
|
||||
UnloadTexture(fudesumi); // Unload texture
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
59
docs/examples/src/shapes/shapes_lines_bezier.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [shapes] example - Cubic-bezier lines
|
||||
*
|
||||
* This example has been created using raylib 1.7 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Copyright (c) 2017 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - cubic-bezier lines");
|
||||
|
||||
Vector2 start = { 0, 0 };
|
||||
Vector2 end = { screenWidth, screenHeight };
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) start = GetMousePosition();
|
||||
else if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) end = GetMousePosition();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, GRAY);
|
||||
|
||||
DrawLineBezier(start, end, 2.0f, RED);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|