Compare commits
848 Commits
5.5
...
79497e1c88
| Author | SHA1 | Date | |
|---|---|---|---|
| 79497e1c88 | |||
| 2e95cdb2b5 | |||
| c9564c0de8 | |||
| e796b00eb0 | |||
| 04a3ab0ca7 | |||
| 52980c947d | |||
| 4d0c3affaa | |||
| 0e5837fb86 | |||
| f60333d9b2 | |||
| 785965fcef | |||
| d0e6f60ef3 | |||
| 6c4f220e89 | |||
| c95630b7d0 | |||
| e9f655d002 | |||
| 41211b0c8c | |||
| d320a029c8 | |||
| f83c5cb6e1 | |||
| 69021939e6 | |||
| 9cc9f3bbbe | |||
| 3c9c66e72b | |||
| c6d7694286 | |||
| 11bf3996cf | |||
| a7aeb2f2b5 | |||
| 500494f791 | |||
| 1d17be6c1c | |||
| ce1cd0d7e6 | |||
| 566eb34ff8 | |||
| 8b0cbb6f47 | |||
| ce8bcb332b | |||
| fc082edccc | |||
| 4e71e91a4a | |||
| 18c50bb01b | |||
| 09bd2df17b | |||
| 0aa5e8169d | |||
| 5d9c8c365e | |||
| 2deae294c6 | |||
| 238163c6ca | |||
| 99cb82a82c | |||
| c3c33e9654 | |||
| a99649b455 | |||
| df200b942c | |||
| cb05945e76 | |||
| 5b88e4fe5f | |||
| 15baf176b2 | |||
| d9392b94c4 | |||
| 572230c8ad | |||
| fd44c26584 | |||
| 0658abc64c | |||
| 8ba4ff2143 | |||
| 25d00130a8 | |||
| 01c68d7e75 | |||
| 291042352b | |||
| 44207b293e | |||
| 8562841c63 | |||
| f1796ff143 | |||
| 4492707e0e | |||
| e3d714ae41 | |||
| df886a8abb | |||
| 915c02adf3 | |||
| f0471aaddb | |||
| e38e7a8141 | |||
| df1244688e | |||
| 87d3066428 | |||
| 8bc9f30d87 | |||
| e9b1bb25ab | |||
| 304045c63a | |||
| a3da39cd81 | |||
| 87731e3db4 | |||
| cf1217f5c1 | |||
| a338b9694c | |||
| 1098f41885 | |||
| b1f6ab38b5 | |||
| 595befec40 | |||
| 0a513e6fbe | |||
| 60b46062c6 | |||
| 6bf8249f75 | |||
| a8dfd9db76 | |||
| 8772b0287c | |||
| 284d9ddd89 | |||
| dcd012e00f | |||
| 24d1d64417 | |||
| 6da0a180e6 | |||
| 16bd18070f | |||
| 0dc4ba53dc | |||
| e4dfb6dbb5 | |||
| 2e652bbef1 | |||
| 5236b2420a | |||
| 73950befca | |||
| d1b535c7b8 | |||
| ed06cdbbe4 | |||
| 81615a91a6 | |||
| 6252d92f79 | |||
| a65bdd6cca | |||
| afdc7972d6 | |||
| 3ef5ee878c | |||
| 28b804a6ba | |||
| 7037f131dc | |||
| a9970484f3 | |||
| be974bb67e | |||
| eae1296b08 | |||
| 59c979a59d | |||
| 93f86fa074 | |||
| 3c9d3d9bef | |||
| f0131f6ee6 | |||
| b17f00b6d9 | |||
| ddebf5d7ac | |||
| a7e66df56d | |||
| 800be084b6 | |||
| ef81145776 | |||
| 74339d2008 | |||
| 8c7b3b7323 | |||
| 601091b69e | |||
| 388bc5075e | |||
| b7265c3df1 | |||
| cd1c206676 | |||
| 76284f1a16 | |||
| dd19b8d2c2 | |||
| 195b968b86 | |||
| 95e4494cfe | |||
| c4414fa1ed | |||
| bab234a160 | |||
| db2abfb9be | |||
| 13e384ce71 | |||
| 9aa1b86fdf | |||
| 503e6d8bb5 | |||
| 9b598f6bcf | |||
| 8dae39fbda | |||
| 00f7121b1c | |||
| 705ce45a33 | |||
| 9ff8862826 | |||
| 71b7734ce4 | |||
| e17e0933af | |||
| 27d7e61f28 | |||
| 9582d25217 | |||
| 852c51343d | |||
| 7bc22f71bd | |||
| 60826855c4 | |||
| 5daeffd91b | |||
| e11bf1c978 | |||
| c6241b91a2 | |||
| f73b04c42c | |||
| d6f9988e82 | |||
| c2f2878575 | |||
| c25e9f641d | |||
| 17aec580f8 | |||
| c6171d339c | |||
| df40357f19 | |||
| 570082deba | |||
| 6792e6e2dd | |||
| 2365ac8def | |||
| 54473e2c2b | |||
| 47d1cc200d | |||
| 8da4887c2d | |||
| ea3932949c | |||
| a06962ee38 | |||
| c19c6fc6e0 | |||
| 948b48430d | |||
| 881c68e323 | |||
| ca61b8d555 | |||
| f0889a74fe | |||
| 9f07cfe0b7 | |||
| f02c7fca8a | |||
| d45b00b191 | |||
| 7e597dd574 | |||
| 9003cd32ba | |||
| 366887b863 | |||
| 64fbf07e7b | |||
| 5d4a233f52 | |||
| fd79b44920 | |||
| 5eacc872c7 | |||
| 1fadc67fb3 | |||
| ff1087480c | |||
| c91c185221 | |||
| 89e6ed2697 | |||
| fa5560881e | |||
| 36dc70443a | |||
| 1c2ecfd6ab | |||
| 5dc304b5a7 | |||
| a6f29e4f19 | |||
| b3513e4719 | |||
| c3a4217148 | |||
| 533f06109d | |||
| c6f8f06f7e | |||
| f64d405ef3 | |||
| c477c68419 | |||
| 2878f7db22 | |||
| 8bc1d62e88 | |||
| 59546eb54a | |||
| c95fd5a803 | |||
| c3cad65d30 | |||
| 095319602c | |||
| 68a1190bf2 | |||
| 64921e2d8a | |||
| 81eb48cad8 | |||
| f306685469 | |||
| 99a43457e8 | |||
| 90cf6a18da | |||
| 1f2b5d6282 | |||
| 7b93591676 | |||
| 02992ce63b | |||
| b683af298c | |||
| cdbe9d75ef | |||
| 7267c1c8a1 | |||
| e09c9ce281 | |||
| 945f1410d2 | |||
| f5e95029b1 | |||
| 47c186dd87 | |||
| cdfb9d7a0b | |||
| a436d935f1 | |||
| 1293461f5e | |||
| a457ab154e | |||
| 1f5fec851d | |||
| bc0f93baea | |||
| e130775e0d | |||
| 80dd72ce12 | |||
| d8952958db | |||
| 72de562542 | |||
| d43470a3d4 | |||
| d182ae7837 | |||
| b11d089202 | |||
| d194b8d503 | |||
| 8f8a5ada60 | |||
| b4ecfb648d | |||
| 603219d6d6 | |||
| c146be16cb | |||
| 6ddc9251c2 | |||
| 73baaeeb2e | |||
| 361e730f83 | |||
| ffe76a4b67 | |||
| 1948453394 | |||
| b044b52955 | |||
| 528ad4964d | |||
| e76c5f7d64 | |||
| 0533987f80 | |||
| e01f3f158e | |||
| 42619ea2df | |||
| c60763d19e | |||
| 1c8eef9b0b | |||
| d3fe9e5036 | |||
| 159a9eac4a | |||
| c4d733e864 | |||
| bf536d68e1 | |||
| b01c8a7a90 | |||
| a36905607c | |||
| 3e65b23f89 | |||
| 8adccfd521 | |||
| fde3166e6a | |||
| 9477838193 | |||
| cb91c02bea | |||
| a872de82ed | |||
| 9d07be6bde | |||
| 234f4b2b10 | |||
| 10079e4e65 | |||
| 6b0174d034 | |||
| 9fa53aac6f | |||
| 43bc00379c | |||
| ba798e9155 | |||
| 121c996c6e | |||
| e7bd177826 | |||
| 65e3d67eb9 | |||
| 58e3c8604a | |||
| e0b58b7eee | |||
| d88f27f08d | |||
| 4b2654f851 | |||
| 968385b5f4 | |||
| 38ff5d00a0 | |||
| 11ccf11814 | |||
| 305c7a2ef9 | |||
| b273ba930b | |||
| 756203581e | |||
| 50acba3ce8 | |||
| 18ae6a377c | |||
| e662ac80d5 | |||
| 12f0943bd9 | |||
| b40e53f11c | |||
| 414235dd17 | |||
| 37104195b4 | |||
| 138010c1eb | |||
| 5ca6bff8ca | |||
| 70daf39eaf | |||
| 47df461047 | |||
| b230720842 | |||
| 1da6b281de | |||
| 1fc0b4955f | |||
| eb7f8912f8 | |||
| 8343aed4f6 | |||
| c9f9219fa6 | |||
| 5c680739bd | |||
| 86d9afc10c | |||
| 715e174d13 | |||
| 7262be85fd | |||
| 4da399141a | |||
| d7893141f3 | |||
| 94d8d7133b | |||
| 32960af1dc | |||
| 9a042bc9ad | |||
| d6a897e551 | |||
| dfa21c2d1f | |||
| 5434ae1100 | |||
| 10fadd9185 | |||
| b6ae5af4e3 | |||
| 8a0ab163d3 | |||
| f3854cb406 | |||
| f1714a6234 | |||
| 7b017b60d9 | |||
| dedf382f64 | |||
| 36364192d5 | |||
| 9b6c09c32f | |||
| 0b125a5fd7 | |||
| 0b7dda8ab1 | |||
| 3d93b30262 | |||
| 78a06990c7 | |||
| 82b80a6998 | |||
| 71b302846a | |||
| 8823aba9df | |||
| 6b9a685bae | |||
| 14582a9f06 | |||
| 093e5200d0 | |||
| 0405de794a | |||
| d03ac97eff | |||
| 34af70866c | |||
| e00c5eb8b1 | |||
| cbea2ff502 | |||
| 3320a2c837 | |||
| 8388160c32 | |||
| e7c043529c | |||
| 85bf04c7bf | |||
| 44ebf32389 | |||
| 901afadbf1 | |||
| f34e240688 | |||
| fce3102f1c | |||
| 9f03d7c426 | |||
| 0c69c43c3a | |||
| 9e908e4a76 | |||
| 20a07a65d7 | |||
| 8dbacafbe6 | |||
| 55a5674714 | |||
| 930890555c | |||
| defbeee1a7 | |||
| d972582bc7 | |||
| 5957564983 | |||
| eaea8e0b0a | |||
| 8ef51850bf | |||
| 32026ca78b | |||
| 86d2db2aa9 | |||
| 9a578dbce0 | |||
| a94feef6d0 | |||
| 897a8fbc9f | |||
| 510dc763e9 | |||
| a92f67bf34 | |||
| 205b6a0926 | |||
| 9f6d37ecb4 | |||
| d4f09984ac | |||
| 5b182139ae | |||
| de62be0ec5 | |||
| 79c29cbe24 | |||
| e91a3697ff | |||
| 910f4083e1 | |||
| 7f8dfc6c69 | |||
| f1600a0c7e | |||
| 46f01e315d | |||
| 2e74133a62 | |||
| 7f32b9a964 | |||
| 8cf932c822 | |||
| ed509193d9 | |||
| f86295732a | |||
| bee524e5e6 | |||
| eef1bac3e2 | |||
| 0cae8890b8 | |||
| 1db006b082 | |||
| 8f50436dc9 | |||
| 6e9c3acaa4 | |||
| bdda18656b | |||
| d659037fbe | |||
| c35e136471 | |||
| 44f670899c | |||
| e09dcf6112 | |||
| 6266d0f419 | |||
| ed022e89e5 | |||
| f6b7168ed4 | |||
| fa9653d179 | |||
| fca2317640 | |||
| a2cf878190 | |||
| 4233544670 | |||
| 4d5a56a5f8 | |||
| eee9dd8c94 | |||
| b677376088 | |||
| 1abac023bd | |||
| 8b0230f5b1 | |||
| 518ad8b018 | |||
| 4bc8d3761c | |||
| 43bad2612b | |||
| fd4375a74e | |||
| 17a618758f | |||
| abf255fbe7 | |||
| 106bcf460a | |||
| 96c898852c | |||
| 3e336e4470 | |||
| 59bcf680aa | |||
| 8a3a8ee8e3 | |||
| 533c12c386 | |||
| 060bd787b1 | |||
| 5f497d0687 | |||
| cb369f8df7 | |||
| 3f228f4594 | |||
| 8d319b1004 | |||
| d218db9eec | |||
| 59338c2c29 | |||
| 714de02a88 | |||
| c81097505c | |||
| 53faf7ae74 | |||
| bb5b5434a7 | |||
| 51958d6e2c | |||
| b52a9f8a04 | |||
| 19ae6f2c2d | |||
| 58a6846c8f | |||
| 296e3af470 | |||
| 924c87db33 | |||
| 6eeaf1dd5b | |||
| c1bb53738e | |||
| 9bf4388a4f | |||
| 3414d96eaf | |||
| 20c0c92bdb | |||
| bc2b2864e0 | |||
| b26f6d34ba | |||
| b9c2ecc447 | |||
| 8f2ecfba4d | |||
| 3418172617 | |||
| 015db1641f | |||
| a9525bfbc2 | |||
| 16f398b464 | |||
| 6d5aedbd38 | |||
| 913c236487 | |||
| 341bfb22cc | |||
| 2afae1b3e1 | |||
| f9fa63366c | |||
| c0cf57f8f0 | |||
| 299f5350a4 | |||
| f7fe8b88cb | |||
| 2d952d8e94 | |||
| d7148f5f9d | |||
| 5ddd13b775 | |||
| 8ef6473d33 | |||
| cf2099f18a | |||
| 8d9c1cecb7 | |||
| afb52b19a4 | |||
| 21f0fe2a73 | |||
| e3b9dbe75b | |||
| b6daa48a9c | |||
| a1d57e83f0 | |||
| 21e711b13f | |||
| 5da2d10118 | |||
| 2be18e2c54 | |||
| 358917ffc3 | |||
| d0d42e78ea | |||
| b618d7b35b | |||
| 0ffc8c517f | |||
| 8c99a508c6 | |||
| a51d334440 | |||
| 9d4c31533d | |||
| 15a0cf89b8 | |||
| ba31219141 | |||
| 5076d5743b | |||
| 4a1e9931a6 | |||
| aa684a33de | |||
| d135eef462 | |||
| 6f11e27bbe | |||
| dea6a24777 | |||
| 63b988ade9 | |||
| f7d03efb49 | |||
| 3083f0cd43 | |||
| 693c9c292a | |||
| 4ac31f7cde | |||
| ebaa922f6b | |||
| 7e07278368 | |||
| 1402e830b4 | |||
| 6fad12db73 | |||
| 35de7b26a4 | |||
| eae3fd83d5 | |||
| c4b9c0e039 | |||
| a15548fb5a | |||
| 3d6e24af4f | |||
| 512b1bed4f | |||
| e07e3354a3 | |||
| ee2ab11cc5 | |||
| 95c96b345c | |||
| 31d63d08e2 | |||
| a7ad2d1965 | |||
| 3d292a6c3c | |||
| e53a43b7b5 | |||
| 38aec920b5 | |||
| 03988d2ce8 | |||
| c087144385 | |||
| 82c87d1f69 | |||
| 8533d284c1 | |||
| 94c5de33a0 | |||
| 3a1d6261e2 | |||
| 696f225f29 | |||
| 1ec281e86f | |||
| d1a3f93077 | |||
| f0de896f36 | |||
| ec5ce8c7fe | |||
| 1d020d6db1 | |||
| 629d4c1721 | |||
| 27a4fe8851 | |||
| 8d03636132 | |||
| 5c954c1f52 | |||
| 7c6537a34f | |||
| 10478ff756 | |||
| 12bf30ce04 | |||
| 77f31178ed | |||
| 461c9c9d90 | |||
| a7333a9dae | |||
| 688a81d333 | |||
| f3b68184c0 | |||
| 0f6b9ee738 | |||
| b185f482d0 | |||
| 73030e02d4 | |||
| cf1713e6dd | |||
| 6b85aa7f72 | |||
| fdc835d294 | |||
| f6d05cc5e6 | |||
| 869ae8bbd2 | |||
| 0b37251fbd | |||
| eb3d96a36a | |||
| 5185d4c427 | |||
| 42a40b3920 | |||
| b4f1ff9a00 | |||
| fdb92b373b | |||
| 5b940692ea | |||
| 80fcca4155 | |||
| cc5739a6d7 | |||
| cb111ad15e | |||
| ab901c58bb | |||
| 618adb858a | |||
| 5000f9f6f8 | |||
| 53cbd3cb11 | |||
| 0d86084709 | |||
| 3d792f3363 | |||
| 4184a5b251 | |||
| 5d7e8010a5 | |||
| 7a6b3ebf3a | |||
| 60eb3a14d7 | |||
| 59dc53d20e | |||
| d5733ffb9a | |||
| a5639bb186 | |||
| a554ef339b | |||
| 5aa3f0ccc3 | |||
| 636e239e07 | |||
| 4960cc74e0 | |||
| ceb1a5ea2b | |||
| f4f860b343 | |||
| 1c4aa1378f | |||
| b529f52dab | |||
| d0cf8961d3 | |||
| 33b2829a89 | |||
| 11e15ab2ac | |||
| 1a67dcb578 | |||
| d52687eeee | |||
| d4202a09e6 | |||
| f19d4c71ab | |||
| 902ffde898 | |||
| 336fd78f74 | |||
| 9a049d1d27 | |||
| 61aea2495a | |||
| 57a00b09b2 | |||
| 1f9d7c6f88 | |||
| af16f7823a | |||
| 44f4400f5b | |||
| 508ca5c80f | |||
| 00fb09cebf | |||
| 8749ba9ebf | |||
| 8ec52e3b25 | |||
| eeda7a4b82 | |||
| 001e78014c | |||
| e08fc8ab80 | |||
| 611c43719f | |||
| 55c6864092 | |||
| beaadc9185 | |||
| 3d83c1c796 | |||
| ac17de5074 | |||
| 909c83fd4a | |||
| 32c8f396c2 | |||
| 63e608d485 | |||
| f5c96302d5 | |||
| 8e9c3ceb57 | |||
| 46cd07d2c7 | |||
| 266fba1111 | |||
| add4da8fb3 | |||
| e140aca1b5 | |||
| 8b84c999d2 | |||
| cd9206956c | |||
| 589ad0a33d | |||
| 2f63a15630 | |||
| d56ab670c3 | |||
| bbbdd1f080 | |||
| 513753c394 | |||
| cb830bed72 | |||
| d0e638cc31 | |||
| 99a9ecfaac | |||
| 4bed3741c1 | |||
| 749a512f13 | |||
| 654d5c80c2 | |||
| a0318e67aa | |||
| fffbbad2f7 | |||
| daa2921476 | |||
| b80250bee4 | |||
| 0934cdba48 | |||
| 7dc409d060 | |||
| e7872a700d | |||
| 7f8bf2233c | |||
| bd8e59f18d | |||
| 4c8c72778d | |||
| 9c62a7823b | |||
| 0853c5b03f | |||
| 61a026f7ef | |||
| 5bda46960c | |||
| bbeade636c | |||
| 097e80d1c4 | |||
| f430d72a8c | |||
| 590f793755 | |||
| 9ba0cdbe6d | |||
| f1385f3aec | |||
| cb3168a048 | |||
| 34159399cf | |||
| 539c45ee23 | |||
| b99c2848c1 | |||
| 654131799e | |||
| a20d9dedf3 | |||
| eb8a343e31 | |||
| e4dcdfa1f2 | |||
| e4993c5557 | |||
| 557d071fa2 | |||
| 7cae259a6d | |||
| da8a08006a | |||
| 27af359d1c | |||
| e1ec595251 | |||
| 0037ee5420 | |||
| 256953957f | |||
| a979b10966 | |||
| 1e2fd94209 | |||
| 8edbd07b5e | |||
| 294da26042 | |||
| fc5ff8db5c | |||
| a5907bfdca | |||
| 85a87baf69 | |||
| 015ab9df18 | |||
| 99d2119dd6 | |||
| 4522ecae1a | |||
| c34ef35433 | |||
| 5ea60dd3ce | |||
| 32fcfd3549 | |||
| 77df0ab1e8 | |||
| 11090ab6cb | |||
| b49c079b1d | |||
| 2b59e7475f | |||
| c647d33703 | |||
| ee946b2f16 | |||
| 1d87932d93 | |||
| a1de60f3ba | |||
| a61c710b45 | |||
| 6a644b48f0 | |||
| cceabf6961 | |||
| cfe96931f5 | |||
| bddb5df0d4 | |||
| 5a254e3d5e | |||
| 4f5a20a634 | |||
| 1958de4a12 | |||
| e85ae86f70 | |||
| 99dfec070a | |||
| 1f6de0c507 | |||
| d46ba9a671 | |||
| 9789ff123b | |||
| 2492dd3d0a | |||
| 5504983c91 | |||
| f6f31a9f21 | |||
| 53ea275b9c | |||
| 861ebafe62 | |||
| 139de05e9d | |||
| 49d37b035f | |||
| 7bfc8e8ca7 | |||
| 87f17538d0 | |||
| 322ba54c08 | |||
| 2c50da9a6a | |||
| d48b8afbb5 | |||
| 77c509db6e | |||
| 773e3f5f9f | |||
| 10d0616d1f | |||
| e70f9157bc | |||
| 09272e2e11 | |||
| a16e26a52a | |||
| 896ff68540 | |||
| 945f181f1d | |||
| 74256943a4 | |||
| 8575150747 | |||
| 0275d13aa8 | |||
| 27e530eb18 | |||
| 7c7b087efb | |||
| 313067d749 | |||
| 94f261c6d7 | |||
| 7b570bdfdd | |||
| 6bf40eee4f | |||
| 5c1cce28a7 | |||
| 35a9257d20 | |||
| cfbba79bd3 | |||
| fddfb58f85 | |||
| af163ba22a | |||
| 1cdf3bb791 | |||
| da5a868e2a | |||
| 2f6230e366 | |||
| 4bceddd4de | |||
| a1896c7a90 | |||
| 43db59d1aa | |||
| e227371265 | |||
| 8e450e4446 | |||
| 49b905077d | |||
| 62d8969a56 | |||
| 2b2694a89f | |||
| 08b089f620 | |||
| 34f431b422 | |||
| 43dbaf21e7 | |||
| eee86dd7c9 | |||
| b554b53ede | |||
| 433cc23ea4 | |||
| bf8962dbc7 | |||
| ddd86a3387 | |||
| 5d9aed5d40 | |||
| fc29bc27fd | |||
| ad035edfac | |||
| 2f95e8382b | |||
| 05c4d8a652 | |||
| 97fa3a73e8 | |||
| 0f6e85a975 | |||
| fa0eada61a | |||
| d1315e8a04 | |||
| f355d6f1db | |||
| c0f2067dba | |||
| 5b822585e5 | |||
| 75b6b825df | |||
| e062dc085c | |||
| 7ecc47d12e | |||
| 4758867815 | |||
| 51b9a0acfc | |||
| b07967993f | |||
| c333e80497 | |||
| 873bf31be3 | |||
| ae3c0df206 | |||
| a7686c47b3 | |||
| 7868d600f4 | |||
| 4fc908b38f | |||
| e5d8de7c63 | |||
| a3a25da594 | |||
| 67b164bc04 | |||
| 6f0d8611fe | |||
| 0212ed0a4b | |||
| 26e12d6b35 | |||
| ab83e6dd41 | |||
| 03ff864087 | |||
| 6eb1206660 | |||
| 99cb4cbc36 | |||
| 783ca612cc | |||
| 58004723d8 | |||
| de6c09ee7a | |||
| f76734fc50 | |||
| 35c2408413 | |||
| cdaff163cb | |||
| 714cd5ef5c | |||
| bdfbd6e8cc | |||
| 79facde353 | |||
| d0504800d2 | |||
| 93a1e75741 | |||
| 0a26d9a26f | |||
| 8a5a95c13a | |||
| 1f704be4e4 | |||
| 6b220f2798 | |||
| b747eeefa4 | |||
| aeb33e6301 | |||
| 83f6f3dabe | |||
| 2a2acff2d5 | |||
| 732da949b7 | |||
| d2cd2a0152 | |||
| 93a67417b3 | |||
| 2820fcc29e | |||
| ca6c5f4f3c | |||
| 602583bcdb | |||
| 1f45e7af76 | |||
| 5feccb1bab | |||
| 1f0325b52c | |||
| e9e463e8b2 | |||
| 83587e94c8 | |||
| 402eab3837 | |||
| 87b3085f5c | |||
| f3f5f38c0f | |||
| e5e2bc83c3 | |||
| b50d418ec7 | |||
| dd26df0be8 | |||
| ff71e3a513 | |||
| e181069c62 | |||
| 962f1c26ff | |||
| 9047630ae7 | |||
| 503cd7ba34 | |||
| 1b4e73cf2f | |||
| 6fbf08cc1f | |||
| f9cf684356 | |||
| 698bfc48fe | |||
| 6c59dc4a65 | |||
| 645f9e31c9 | |||
| 9d318a6fbf | |||
| 58fe34d9cc | |||
| cd16c9ea91 | |||
| 31a1047782 | |||
| 2c4c6e6201 | |||
| ba1e14625a | |||
| 949c31605b | |||
| 623c4376cc | |||
| abb3c8e9f7 | |||
| c53dd8a931 | |||
| 79188f570b | |||
| 6141489b00 | |||
| e494c545b8 | |||
| a9aa6b4988 | |||
| 47f83aa58f | |||
| da6fa1d756 | |||
| 65e0d2cfda | |||
| 50a2afff9e | |||
| a53a8958f2 | |||
| 0d39e7137b | |||
| 11429b48eb | |||
| 415a98965a | |||
| 532167d28b | |||
| 6af664c04e | |||
| 57edbc3bab | |||
| a145779e21 | |||
| 481095226d | |||
| 26548c1062 | |||
| 9e4f513a43 | |||
| c78757a959 | |||
| 10789a4d49 | |||
| 95e766472f | |||
| bd706dfcf2 | |||
| 7127cba5cc | |||
| 21575856f4 | |||
| 65f955a4dc | |||
| f979cc62ee | |||
| 05b2603c45 | |||
| fde3779ebd | |||
| 8375581f87 | |||
| 71e0b8b581 |
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
# or to provide custom queries or build logic.
|
# or to provide custom queries or build logic.
|
||||||
name: "CodeQL"
|
name: Analyze raylib with CodeQL
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -26,7 +26,7 @@ jobs:
|
|||||||
# - https://gh.io/supported-runners-and-hardware-resources
|
# - https://gh.io/supported-runners-and-hardware-resources
|
||||||
# - https://gh.io/using-larger-runners
|
# - https://gh.io/using-larger-runners
|
||||||
# Consider using larger runners for possible analysis time improvements.
|
# Consider using larger runners for possible analysis time improvements.
|
||||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-20.04' }}
|
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Android
|
name: Build raylib - Android
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: CMakeBuilds
|
name: Build raylib CMake - Windows+Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Linux Examples
|
name: Build raylib examples - Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Windows Examples
|
name: Build raylib examples - Windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Linux
|
name: Build raylib - Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -22,22 +22,28 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # for actions/upload-release-asset to upload release asset
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
matrix:
|
matrix:
|
||||||
bits: [32, 64]
|
|
||||||
include:
|
include:
|
||||||
- bits: 32
|
- bits: 32
|
||||||
ARCH: "i386"
|
ARCH: "i386"
|
||||||
ARCH_NAME: "i386"
|
ARCH_NAME: "i386"
|
||||||
COMPILER_PATH: "/user/bin"
|
COMPILER_PATH: "/usr/bin"
|
||||||
|
runner: "ubuntu-latest"
|
||||||
- bits: 64
|
- bits: 64
|
||||||
ARCH: "x86_64"
|
ARCH: "x86_64"
|
||||||
ARCH_NAME: "amd64"
|
ARCH_NAME: "amd64"
|
||||||
COMPILER_PATH: "/user/bin"
|
COMPILER_PATH: "/usr/bin"
|
||||||
|
runner: "ubuntu-latest"
|
||||||
|
- bits: 64
|
||||||
|
ARCH: "aarch64"
|
||||||
|
ARCH_NAME: "arm64"
|
||||||
|
COMPILER_PATH: "/usr/bin"
|
||||||
|
runner: "ubuntu-24.04-arm"
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
env:
|
env:
|
||||||
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
|
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
|
||||||
|
|
||||||
@ -54,7 +60,6 @@ jobs:
|
|||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install gcc-multilib
|
|
||||||
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
|
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
@ -65,8 +70,13 @@ jobs:
|
|||||||
cd ../../../raylib
|
cd ../../../raylib
|
||||||
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
|
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
|
||||||
|
|
||||||
|
- name: Setup Environment (x86)
|
||||||
|
run : |
|
||||||
|
sudo apt-get install gcc-multilib
|
||||||
|
if: matrix.bits == 32 && matrix.ARCH == 'i386'
|
||||||
|
|
||||||
# TODO: Support 32bit (i386) static/shared library building
|
# TODO: Support 32bit (i386) static/shared library building
|
||||||
- name: Build Library
|
- name: Build Library (32-bit)
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
|
||||||
@ -74,13 +84,21 @@ jobs:
|
|||||||
cd ..
|
cd ..
|
||||||
if: matrix.bits == 32
|
if: matrix.bits == 32
|
||||||
|
|
||||||
- name: Build Library
|
- name: Build Library (64-bit x86)
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
cd ..
|
cd ..
|
||||||
if: matrix.bits == 64
|
if: matrix.bits == 64 && matrix.ARCH == 'x86_64'
|
||||||
|
|
||||||
|
- name: Build Library (64-bit ARM)
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
if: matrix.bits == 64 && matrix.ARCH == 'aarch64'
|
||||||
|
|
||||||
- name: Generate Artifacts
|
- name: Generate Artifacts
|
||||||
run: |
|
run: |
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: macOS
|
name: Build raylib - macOS
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: WebAssembly
|
name: Build raylib - WebAssembly
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Windows
|
name: Build raylib - Windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -28,27 +28,34 @@ jobs:
|
|||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
matrix:
|
matrix:
|
||||||
compiler: [mingw-w64, msvc16]
|
compiler: [mingw-w64, msvc16]
|
||||||
bits: [32, 64]
|
ziptarget: [ win32, win64, winarm64 ]
|
||||||
include:
|
include:
|
||||||
- compiler: mingw-w64
|
- compiler: mingw-w64
|
||||||
bits: 32
|
|
||||||
ARCH: "i686"
|
ARCH: "i686"
|
||||||
WINDRES_ARCH: pe-i386
|
WINDRES_ARCH: pe-i386
|
||||||
|
ziptarget: "win32"
|
||||||
- compiler: mingw-w64
|
- compiler: mingw-w64
|
||||||
bits: 64
|
|
||||||
ARCH: "x86_64"
|
ARCH: "x86_64"
|
||||||
WINDRES_ARCH: pe-x86-64
|
WINDRES_ARCH: pe-x86-64
|
||||||
|
ziptarget: "win64"
|
||||||
- compiler: msvc16
|
- compiler: msvc16
|
||||||
bits: 32
|
|
||||||
ARCH: "x86"
|
ARCH: "x86"
|
||||||
VSARCHPATH: "Win32"
|
VSARCHPATH: "Win32"
|
||||||
|
ziptarget: "win32"
|
||||||
- compiler: msvc16
|
- compiler: msvc16
|
||||||
bits: 64
|
|
||||||
ARCH: "x64"
|
ARCH: "x64"
|
||||||
VSARCHPATH: "x64"
|
VSARCHPATH: "x64"
|
||||||
|
ziptarget: "win64"
|
||||||
|
- compiler: msvc16
|
||||||
|
ARCH: "ARM64"
|
||||||
|
VSARCHPATH: "ARM64"
|
||||||
|
ziptarget: "winarm64"
|
||||||
|
exclude:
|
||||||
|
- compiler: mingw-w64
|
||||||
|
ziptarget: winarm64 # We don't build arm64 with mingw-w64 yet
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RELEASE_NAME: raylib-dev_win${{ matrix.bits }}_${{ matrix.compiler }}
|
RELEASE_NAME: raylib-dev_${{ matrix.ziptarget }}_${{ matrix.compiler }}
|
||||||
GNUTARGET: default
|
GNUTARGET: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -57,7 +64,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Release Version
|
- name: Setup Release Version
|
||||||
run: |
|
run: |
|
||||||
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_win${{ matrix.bits }}_${{ matrix.compiler }}" >> $GITHUB_ENV
|
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_${{ matrix.ziptarget }}_${{ matrix.compiler }}" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
if: github.event_name == 'release' && github.event.action == 'published'
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
@ -90,7 +97,7 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
if: |
|
if: |
|
||||||
matrix.compiler == 'mingw-w64' &&
|
matrix.compiler == 'mingw-w64' &&
|
||||||
matrix.bits == 32
|
matrix.arch == 'i686'
|
||||||
|
|
||||||
- name: Build Library (MinGW-w64 64bit)
|
- name: Build Library (MinGW-w64 64bit)
|
||||||
run: |
|
run: |
|
||||||
@ -105,7 +112,7 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
if: |
|
if: |
|
||||||
matrix.compiler == 'mingw-w64' &&
|
matrix.compiler == 'mingw-w64' &&
|
||||||
matrix.bits == 64
|
matrix.arch == 'x86_64'
|
||||||
|
|
||||||
- name: Build Library (MSVC16)
|
- name: Build Library (MSVC16)
|
||||||
run: |
|
run: |
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Parse raylib_api
|
name: Parse raylib API
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -14,7 +14,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Update parse files
|
- name: Update parse files
|
||||||
working-directory: parser
|
working-directory: tools/parser
|
||||||
run: |
|
run: |
|
||||||
make raylib_api
|
make raylib_api
|
||||||
mv raylib_api.* output
|
mv raylib_api.* output
|
||||||
@ -30,8 +30,8 @@ jobs:
|
|||||||
if: steps.diff.outcome == 'failure'
|
if: steps.diff.outcome == 'failure'
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git add parser
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add tools/parser
|
||||||
git commit -m "Update raylib_api.* by CI"
|
git commit -m "Update raylib_api.* by CI"
|
||||||
git push
|
git push
|
||||||
72
.github/workflows/update_examples.yml
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
name: Update examples collection
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'examples/**'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'examples/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup emsdk
|
||||||
|
uses: mymindstorm/setup-emsdk@v14
|
||||||
|
with:
|
||||||
|
version: 'latest'
|
||||||
|
actions-cache-folder: 'emsdk-cache'
|
||||||
|
|
||||||
|
- name: Clone raylib.com repo to update files
|
||||||
|
run: |
|
||||||
|
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/raysan5/raylib.com.git
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Build and run rexm tool (requires GNU Makefile)
|
||||||
|
# "rexm update" validates and updates all required examples in raylib and even raylib.com repos,
|
||||||
|
# note that it calls examples/Makefile.Web internally, so it requires [make] tool available
|
||||||
|
run: |
|
||||||
|
sudo apt-get update && sudo apt-get install -y libopengl0 libglu1-mesa libx11-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libgl1-mesa-dev libglu1-mesa-dev
|
||||||
|
cd "${{ github.workspace }}/src"
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP
|
||||||
|
sudo make install
|
||||||
|
make clean
|
||||||
|
make PLATFORM=PLATFORM_WEB
|
||||||
|
cd ../tools/rexm/
|
||||||
|
make
|
||||||
|
export REXM_EXAMPLES_BASE_PATH="${{ github.workspace }}/examples"
|
||||||
|
export REXM_EXAMPLES_WEB_PATH="${{ github.workspace }}/raylib.com/examples"
|
||||||
|
export REXM_EXAMPLES_TEMPLATE_FILE_PATH="${{ github.workspace }}/examples/examples_template.c"
|
||||||
|
export REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH="${{ github.workspace }}/examples/examples_template.png"
|
||||||
|
export REXM_EXAMPLES_COLLECTION_FILE_PATH="${{ github.workspace }}/examples/examples_list.txt"
|
||||||
|
export REXM_EXAMPLES_VS2022_SLN_FILE="${{ github.workspace }}/projects/VS2022/raylib.sln"
|
||||||
|
export EMSDK_PATH="${{ github.workspace }}/emsdk-cache/emsdk-main"
|
||||||
|
./rexm update
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Commit changes to raylib repo (DISABLED)
|
||||||
|
if: github.event_name == 'push' && false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add -A
|
||||||
|
git commit -m "Update examples collection" || echo "git exited with code 1, nothing changed"
|
||||||
|
git push
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Push changes to raylib.com repo (DISABLED)
|
||||||
|
if: github.event_name == 'push' && false
|
||||||
|
run: |
|
||||||
|
cd raylib.com
|
||||||
|
git add -A
|
||||||
|
git commit -m "Update web examples" || echo "git exited with code 1, nothing changed"
|
||||||
|
git push origin
|
||||||
|
shell: bash
|
||||||
10
.gitignore
vendored
@ -111,5 +111,11 @@ build/
|
|||||||
build-*/
|
build-*/
|
||||||
docgen_tmp/
|
docgen_tmp/
|
||||||
|
|
||||||
# Parser stuff
|
# Tools stuff
|
||||||
parser/raylib_parser
|
tools/parser/raylib_parser
|
||||||
|
tools/rexm/rexm.exe
|
||||||
|
tools/rexm/rexm
|
||||||
|
|
||||||
|
# CI
|
||||||
|
emsdk-cache/
|
||||||
|
raylib.com/
|
||||||
|
|||||||
79
BINDINGS.md
@ -6,74 +6,83 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||||||
|
|
||||||
| Name | raylib Version | Language | License |
|
| Name | raylib Version | Language | License |
|
||||||
| :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: |
|
| :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: |
|
||||||
| [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
|
| [raylib](https://github.com/raysan5/raylib) | **5.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
|
||||||
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.0** | [Beef](https://www.beeflang.org) | MIT |
|
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT |
|
||||||
| [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT |
|
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
||||||
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3](https://c3-lang.org) | MIT |
|
||||||
| [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||||
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||||
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||||
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
||||||
|
| [Raylib-cs.BleedingEdge](https://github.com/danilwhale/Raylib-cs.BleedingEdge) | **5.6-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||||
| [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT |
|
| [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT |
|
||||||
| [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
| [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
||||||
| [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 |
|
| [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 |
|
||||||
|
| [raylib](https://github.com/fosskers/raylib) | 5.5 | [Common Lisp](https://common-lisp.net) | MPL-2.0 |
|
||||||
| [chez-raylib](https://github.com/Yunoinsky/chez-raylib) | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme) | GPLv3 |
|
| [chez-raylib](https://github.com/Yunoinsky/chez-raylib) | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme) | GPLv3 |
|
||||||
|
| [CLIPSraylib](https://github.com/mrryanjohnston/CLIPSraylib) | **auto** | [CLIPS](https://www.clipsrules.net/) | MIT |
|
||||||
| [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 |
|
| [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 |
|
||||||
| [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT |
|
| [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT |
|
||||||
| [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT |
|
| [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT |
|
||||||
| [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 |
|
| [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 |
|
||||||
| [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 |
|
| [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 |
|
||||||
| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.0** | [D](https://dlang.org) | Zlib |
|
| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.5** | [D](https://dlang.org) | Zlib |
|
||||||
| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 |
|
| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 |
|
||||||
| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD |
|
| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD |
|
||||||
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
|
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
|
||||||
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | 4.5 | [Fortran](https://fortran-lang.org) | ISC |
|
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC |
|
||||||
| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.0** | [Go](https://golang.org) | Zlib |
|
| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.5** | [Go](https://golang.org) | Zlib |
|
||||||
| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib |
|
| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib |
|
||||||
| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** |
|
| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** |
|
||||||
| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 |
|
| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 |
|
||||||
| [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib |
|
| [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib |
|
||||||
| [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT |
|
| [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT |
|
||||||
| [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT |
|
| [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT |
|
||||||
| [jaylib](https://github.com/electronstudio/jaylib/) | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE |
|
| [jaylib](https://github.com/electronstudio/jaylib/) | **5.5** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE |
|
||||||
| [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib |
|
| [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib |
|
||||||
| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
|
| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
|
||||||
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
|
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
|
||||||
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
|
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
|
||||||
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 4.5 | [Lua](http://www.lua.org) | ISC |
|
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC |
|
||||||
| [raylua](https://github.com/Rabios/raylua) | 4.0 | [Lua](http://www.lua.org) | MIT |
|
| [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC |
|
||||||
| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT |
|
| [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT |
|
||||||
| [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib |
|
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib |
|
||||||
| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 4.5 | [Ruby](https://www.ruby-lang.org/en) | Zlib |
|
| [raylib-luajit](https://github.com/homma/raylib-luajit) | 5.5 | [Lua](http://www.lua.org) | MIT |
|
||||||
| [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT |
|
| [raylib-luajit-generated](https://github.com/james2doyle/raylib-luajit-generated) | 5.5 | [Lua](http://www.lua.org) | MIT |
|
||||||
|
| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** |
|
||||||
|
| [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.5** | [nelua](https://nelua.io) | Zlib |
|
||||||
|
| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib |
|
||||||
|
| [naylib](https://github.com/planetis-m/naylib) | **5.6-dev** | [Nim](https://nim-lang.org) | MIT |
|
||||||
| [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib |
|
| [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib |
|
||||||
| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.0** | [Odin](https://odin-lang.org) | BSD-3Clause |
|
| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | BSD-3Clause |
|
||||||
| [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT |
|
| [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT |
|
||||||
| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT |
|
| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT |
|
||||||
| [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT |
|
| [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT |
|
||||||
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
||||||
| [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
| [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
||||||
| [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib |
|
| [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib |
|
||||||
| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 4.2 | [Python](https://www.python.org) | EPL-2.0 |
|
| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [Python](https://www.python.org) | EPL-2.0 |
|
||||||
| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT |
|
| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 5.5 | [Python](https://www.python.org) | MIT |
|
||||||
| [raylib-py](https://github.com/overdev/raylib-py) | **5.0b1** | [Python](https://www.python.org) | MIT |
|
| [raylib-py](https://github.com/overdev/raylib-py) | 5.5 | [Python](https://www.python.org) | MIT |
|
||||||
| [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT |
|
| [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT |
|
||||||
| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 4.6-dev | [pocketpy](https://pocketpy.dev) | MIT |
|
| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 5.1-dev | [pocketpy](https://pocketpy.dev) | MIT |
|
||||||
| [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
|
| [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
|
||||||
| [raylib-phpcpp](https://github.com/oraoto/raylib-phpcpp) | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
|
| [raylib-phpcpp](https://github.com/oraoto/raylib-phpcpp) | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
|
||||||
| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT |
|
| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT |
|
||||||
| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 4.5 | [Rust](https://www.rust-lang.org) | GPLv3 |
|
| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 5.5 | [Rust](https://www.rust-lang.org) | GPLv3 |
|
||||||
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.0** | [Rust](https://www.rust-lang.org) | Zlib |
|
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib |
|
||||||
|
| [raylib-ruby](https://github.com/wilsonsilva/raylib-ruby) | 4.5 | [Ruby](https://www.ruby-lang.org) | Zlib |
|
||||||
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
|
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
|
||||||
| [racket-raylib](https://github.com/eutro/racket-raylib) | 4.0 | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
|
| [racket-raylib](https://github.com/eutro/racket-raylib) | **5.5** | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
|
||||||
| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT |
|
| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT |
|
||||||
| [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT |
|
| [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT |
|
||||||
| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.0** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 |
|
| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.5** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 |
|
||||||
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
|
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
|
||||||
|
| [raylib-v](https://github.com/vlang/raylib) | 5.5 | [V](https://vlang.io) | MIT/Unlicense |
|
||||||
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
|
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
|
||||||
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
|
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
|
||||||
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.0 | [Wren](http://wren.io) | ISC |
|
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
|
||||||
| [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.0** | [Zig](https://ziglang.org) | MIT |
|
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |
|
||||||
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
||||||
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
|
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
|
||||||
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
||||||
@ -84,15 +93,20 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||||||
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||||
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
||||||
| [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT |
|
| [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT |
|
||||||
|
| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT |
|
||||||
|
| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT |
|
||||||
|
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
|
||||||
|
|
||||||
### Utility Wrapers
|
### Utility Wrapers
|
||||||
|
|
||||||
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm.
|
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm.
|
||||||
| Name | raylib Version | Language | License |
|
| Name | raylib Version | Language | License |
|
||||||
| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: |
|
| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: |
|
||||||
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
|
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
|
||||||
| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
||||||
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||||
|
| [DOOR](https://github.com/RealDoigt/DOOR) | 4.0 | [D](https://dlang.org) | MIT |
|
||||||
|
| [Iris](https://github.com/Marcos-cat/iris) | **5.5** | [Uiua](https://www.uiua.org/) | MIT |
|
||||||
|
|
||||||
### Older or Unmaintained Language Bindings
|
### Older or Unmaintained Language Bindings
|
||||||
|
|
||||||
@ -131,7 +145,6 @@ These are older raylib bindings that are more than 2 versions old or have not be
|
|||||||
| [clj-raylib](https://github.com/lsevero/clj-raylib) | 3.0 | [Clojure](https://clojure.org) |
|
| [clj-raylib](https://github.com/lsevero/clj-raylib) | 3.0 | [Clojure](https://clojure.org) |
|
||||||
| [QuickJS-raylib](https://github.com/sntg-p/QuickJS-raylib) | 3.0 | [QuickJS](https://bellard.org/quickjs) |
|
| [QuickJS-raylib](https://github.com/sntg-p/QuickJS-raylib) | 3.0 | [QuickJS](https://bellard.org/quickjs) |
|
||||||
| [raylib-duktape](https://github.com/RobLoach/raylib-duktape) | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) |
|
| [raylib-duktape](https://github.com/RobLoach/raylib-duktape) | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) |
|
||||||
| [raylib-v7](https://github.com/Rabios/raylib-v7) | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) |
|
|
||||||
| [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) | 2.6 | [ChaiScript](http://chaiscript.com) |
|
| [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) | 2.6 | [ChaiScript](http://chaiscript.com) |
|
||||||
| [raylib-squirrel](https://github.com/RobLoach/raylib-squirrel) | 2.5 | [Squirrel](http://www.squirrel-lang.org) |
|
| [raylib-squirrel](https://github.com/RobLoach/raylib-squirrel) | 2.5 | [Squirrel](http://www.squirrel-lang.org) |
|
||||||
| [racket-raylib-2d](https://github.com/arvyy/racket-raylib-2d) | 2.5 | [Racket](https://racket-lang.org) |
|
| [racket-raylib-2d](https://github.com/arvyy/racket-raylib-2d) | 2.5 | [Racket](https://racket-lang.org) |
|
||||||
@ -152,7 +165,7 @@ These are older raylib bindings that are more than 2 versions old or have not be
|
|||||||
| [ray.mod](https://github.com/bmx-ng/ray.mod) | 3.0 | [BlitzMax](https://blitzmax.org) |
|
| [ray.mod](https://github.com/bmx-ng/ray.mod) | 3.0 | [BlitzMax](https://blitzmax.org) |
|
||||||
| [raylib-mosaic](https://github.com/pluckyporcupine/raylib-mosaic) | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) |
|
| [raylib-mosaic](https://github.com/pluckyporcupine/raylib-mosaic) | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) |
|
||||||
| [raylib-xdpw](https://github.com/vtereshkov/raylib-xdpw) | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) |
|
| [raylib-xdpw](https://github.com/vtereshkov/raylib-xdpw) | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) |
|
||||||
| [raylib-carp](https://github.com/sacredbirdman/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) |
|
| [raylib-carp](https://github.com/sacredbirdman/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) |
|
||||||
| [raylib-fb](https://github.com/IchMagBier/raylib-fb) | 3.0 | [FreeBasic](https://www.freebasic.net) |
|
| [raylib-fb](https://github.com/IchMagBier/raylib-fb) | 3.0 | [FreeBasic](https://www.freebasic.net) |
|
||||||
| [raylib-purebasic](https://github.com/D-a-n-i-l-o/raylib-purebasic) | 3.0 | [PureBasic](https://www.purebasic.com) |
|
| [raylib-purebasic](https://github.com/D-a-n-i-l-o/raylib-purebasic) | 3.0 | [PureBasic](https://www.purebasic.com) |
|
||||||
| [raylib-ats2](https://github.com/mephistopheles-8/raylib-ats2) | 3.0 | [ATS2](http://www.ats-lang.org) |
|
| [raylib-ats2](https://github.com/mephistopheles-8/raylib-ats2) | 3.0 | [ATS2](http://www.ats-lang.org) |
|
||||||
|
|||||||
@ -1671,7 +1671,7 @@ Detailed changes:
|
|||||||
[examples] ADDED: models_waving_cubes, by @codecat
|
[examples] ADDED: models_waving_cubes, by @codecat
|
||||||
[examples] ADDED: models_solar_system, by @aldrinmartoq
|
[examples] ADDED: models_solar_system, by @aldrinmartoq
|
||||||
[examples] ADDED: shaders_fog, by @chriscamacho
|
[examples] ADDED: shaders_fog, by @chriscamacho
|
||||||
[examples] ADDED: shaders_texture_waves, by @Anata
|
[examples] ADDED: shaders_texture_waves, by @anatagawa
|
||||||
[examples] ADDED: shaders_basic_lighting, by @chriscamacho
|
[examples] ADDED: shaders_basic_lighting, by @chriscamacho
|
||||||
[examples] ADDED: shaders_simple_mask, by @chriscamacho
|
[examples] ADDED: shaders_simple_mask, by @chriscamacho
|
||||||
[examples] ADDED: audio_multichannel_sound, by @chriscamacho
|
[examples] ADDED: audio_multichannel_sound, by @chriscamacho
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.25)
|
||||||
|
#this change avoid the warning that appear when we include raylib using Cmake fatch content
|
||||||
project(raylib)
|
project(raylib)
|
||||||
|
|
||||||
# Avoid excessive expansion of variables in conditionals. In particular, if
|
# Avoid excessive expansion of variables in conditionals. In particular, if
|
||||||
@ -22,21 +23,13 @@ cmake_policy(SET CMP0063 NEW)
|
|||||||
# Anywhere you see include(...) you can check <root>/cmake for that file
|
# Anywhere you see include(...) you can check <root>/cmake for that file
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
# RAYLIB_IS_MAIN determines whether the project is being used from root
|
|
||||||
# or if it is added as a dependency (through add_subdirectory for example).
|
|
||||||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
set(RAYLIB_IS_MAIN TRUE)
|
|
||||||
else()
|
|
||||||
set(RAYLIB_IS_MAIN FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Sets compiler flags and language standard
|
# Sets compiler flags and language standard
|
||||||
include(CompilerFlags)
|
include(CompilerFlags)
|
||||||
|
|
||||||
# Registers build options that are exposed to cmake
|
# Registers build options that are exposed to cmake
|
||||||
include(CMakeOptions.txt)
|
include(CMakeOptions.txt)
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM")
|
||||||
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
|
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
|
||||||
MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11")
|
MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11")
|
||||||
endif()
|
endif()
|
||||||
@ -45,8 +38,9 @@ endif()
|
|||||||
# Main sources directory (the second parameter sets the output directory name to raylib)
|
# Main sources directory (the second parameter sets the output directory name to raylib)
|
||||||
add_subdirectory(src raylib)
|
add_subdirectory(src raylib)
|
||||||
|
|
||||||
# Uninstall target
|
# Uninstall target, only create when building raylib by itself
|
||||||
if(NOT TARGET uninstall)
|
# Avoid conflicting target names when using raylib with other libraries
|
||||||
|
if(NOT TARGET uninstall AND PROJECT_IS_TOP_LEVEL)
|
||||||
configure_file(
|
configure_file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||||
|
|||||||
@ -2,12 +2,16 @@
|
|||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
include(EnumOption)
|
include(EnumOption)
|
||||||
|
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
# When configuring web builds with "emcmake cmake -B build -S .", set PLATFORM to Web by default
|
||||||
|
SET(PLATFORM Web CACHE STRING "Platform to build for.")
|
||||||
|
endif()
|
||||||
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM;SDL" "Platform to build for.")
|
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM;SDL" "Platform to build for.")
|
||||||
|
|
||||||
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?")
|
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?")
|
||||||
|
|
||||||
# Configuration options
|
# Configuration options
|
||||||
option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
|
option(BUILD_EXAMPLES "Build the examples." ${PROJECT_IS_TOP_LEVEL})
|
||||||
option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
|
option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
|
||||||
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
|
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
|
||||||
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
|
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
|
||||||
@ -24,7 +28,7 @@ enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system G
|
|||||||
option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF)
|
option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF)
|
||||||
option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)
|
option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)
|
||||||
|
|
||||||
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
|
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage)" OFF)
|
||||||
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
||||||
|
|
||||||
include(ParseConfigHeader)
|
include(ParseConfigHeader)
|
||||||
|
|||||||
@ -54,7 +54,7 @@ To open new issues for raylib (bug, enhancement, discussion...), just try to fol
|
|||||||
- If applicable, attach some screenshot of the issue and a .zip file with the code sample and required resources.
|
- If applicable, attach some screenshot of the issue and a .zip file with the code sample and required resources.
|
||||||
- On issue description, add a brackets tag about the raylib module that relates to this issue.
|
- On issue description, add a brackets tag about the raylib module that relates to this issue.
|
||||||
If don't know which module, just report the issue, I will review it.
|
If don't know which module, just report the issue, I will review it.
|
||||||
- You can check other issues to see how is being done!
|
- You can check other issues to see how it's being done!
|
||||||
|
|
||||||
### Sending a Pull-Request
|
### Sending a Pull-Request
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Local variables | lowerCase | `Vector2 playerPosition = { 0 };`
|
|||||||
Global variables | lowerCase | `bool windowReady = false;`
|
Global variables | lowerCase | `bool windowReady = false;`
|
||||||
Constants | lowerCase | `const int maxValue = 8;`
|
Constants | lowerCase | `const int maxValue = 8;`
|
||||||
Pointers | MyType *pointer | `Texture2D *array = NULL;`
|
Pointers | MyType *pointer | `Texture2D *array = NULL;`
|
||||||
float values | always x.xf | `float gravity = 10.0f`
|
float values | always x.xf | `float gravity = 10.0f` (avoid `10.f`)
|
||||||
Operators | value1*value2 | `int product = value*6;`
|
Operators | value1*value2 | `int product = value*6;`
|
||||||
Operators | value1/value2 | `int division = value/4;`
|
Operators | value1/value2 | `int division = value/4;`
|
||||||
Operators | value1 + value2 | `int sum = value + 10;`
|
Operators | value1 + value2 | `int sum = value + 10;`
|
||||||
@ -28,6 +28,10 @@ Some other conventions to follow:
|
|||||||
- **ALWAYS** initialize all defined variables.
|
- **ALWAYS** initialize all defined variables.
|
||||||
- **Do not use TABS**, use 4 spaces instead.
|
- **Do not use TABS**, use 4 spaces instead.
|
||||||
- Avoid trailing spaces, please, avoid them
|
- Avoid trailing spaces, please, avoid them
|
||||||
|
- Comments always start with space + capital letter and never end with a '.', place them **before** the line(s) they refer to
|
||||||
|
```c
|
||||||
|
// This is a comment in raylib or raylib examples
|
||||||
|
```
|
||||||
- Control flow statements always are followed **by a space**:
|
- Control flow statements always are followed **by a space**:
|
||||||
```c
|
```c
|
||||||
if (condition) value = 0;
|
if (condition) value = 0;
|
||||||
|
|||||||
2
FAQ.md
@ -90,7 +90,7 @@ I personally consider raylib a graphics library with some high-level features ra
|
|||||||
|
|
||||||
### What does raylib provide that other engines or libraries don't?
|
### What does raylib provide that other engines or libraries don't?
|
||||||
|
|
||||||
I would say "simplicity" and "enjoyment" at a really low level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
|
I would say "simplicity" and "enjoyment" at a really low level of coding but actually it is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
|
||||||
|
|
||||||
### How does raylib compare to Unity/Unreal/Godot?
|
### How does raylib compare to Unity/Unreal/Godot?
|
||||||
|
|
||||||
|
|||||||
@ -475,7 +475,7 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature
|
|||||||
notes on raylib 5.5
|
notes on raylib 5.5
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
One year after raylib 5.0 release, arribes `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date.
|
One year after raylib 5.0 release, arrives `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date.
|
||||||
|
|
||||||
Some numbers for this release:
|
Some numbers for this release:
|
||||||
|
|
||||||
|
|||||||
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||||
|
|
||||||
This software is provided "as-is", without any express or implied warranty. In no event
|
This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
will the authors be held liable for any damages arising from the use of this software.
|
will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@ -14,7 +14,7 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
|
|||||||
|
|
||||||
[](https://github.com/raysan5/raylib/releases)
|
[](https://github.com/raysan5/raylib/releases)
|
||||||
[](https://github.com/raysan5/raylib/stargazers)
|
[](https://github.com/raysan5/raylib/stargazers)
|
||||||
[](https://github.com/raysan5/raylib/commits/master)
|
[](https://github.com/raysan5/raylib/commits/master)
|
||||||
[](https://github.com/sponsors/raysan5)
|
[](https://github.com/sponsors/raysan5)
|
||||||
[](https://repology.org/project/raylib/versions)
|
[](https://repology.org/project/raylib/versions)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
@ -35,10 +35,10 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
|
|||||||
|
|
||||||
features
|
features
|
||||||
--------
|
--------
|
||||||
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
- **NO external dependencies**, all required libraries are [included into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
||||||
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
|
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
|
||||||
- Written in plain C code (C99) using PascalCase/camelCase notation
|
- Written in plain C code (C99) using PascalCase/camelCase notation
|
||||||
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**)
|
- Hardware accelerated with OpenGL: **1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**
|
||||||
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
||||||
- Multiple **Fonts** formats supported (TTF, OTF, FNT, BDF, sprite fonts)
|
- Multiple **Fonts** formats supported (TTF, OTF, FNT, BDF, sprite fonts)
|
||||||
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
||||||
@ -130,6 +130,7 @@ raylib is present in several networks and raylib community is growing everyday.
|
|||||||
- Webpage: [https://www.raylib.com](https://www.raylib.com)
|
- Webpage: [https://www.raylib.com](https://www.raylib.com)
|
||||||
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
|
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
|
||||||
- Twitter: [https://www.twitter.com/raysan5](https://www.twitter.com/raysan5)
|
- Twitter: [https://www.twitter.com/raysan5](https://www.twitter.com/raysan5)
|
||||||
|
- BlueSky: [https://bsky.app/profile/raysan5](https://bsky.app/profile/raysan5.bsky.social)
|
||||||
- Twitch: [https://www.twitch.tv/raysan5](https://www.twitch.tv/raysan5)
|
- Twitch: [https://www.twitch.tv/raysan5](https://www.twitch.tv/raysan5)
|
||||||
- Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
- Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
||||||
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
|
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
|
||||||
|
|||||||
@ -3,16 +3,18 @@
|
|||||||
Here is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
|
Here is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
|
||||||
|
|
||||||
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
|
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
|
||||||
|
- [GitHub PRs](https://github.com/raysan5/raylib/pulls) open with improvements to be reviewed.
|
||||||
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
|
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
|
||||||
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
|
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
|
||||||
- [raylib wishlist 2021](https://github.com/raysan5/raylib/discussions/1502)
|
- [raylib 6.0 wishlist](https://github.com/raysan5/raylib/discussions/4660)
|
||||||
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
|
|
||||||
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
|
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
|
||||||
|
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
|
||||||
|
- [raylib wishlist 2021](https://github.com/raysan5/raylib/discussions/1502)
|
||||||
|
|
||||||
_Current version of raylib is complete and functional but there is always room for improvements._
|
_Current version of raylib is complete and functional but there is always room for improvements._
|
||||||
|
|
||||||
**raylib 5.x**
|
**raylib 5.x**
|
||||||
- [ ] `rcore`: Support additional platforms: iOS, Xbox Series S|X
|
- [ ] `rcore`: Support additional platforms: iOS, consoles?
|
||||||
- [ ] `rcore_web`: Avoid GLFW dependency, functionality can be directly implemented using emscripten SDK
|
- [ ] `rcore_web`: Avoid GLFW dependency, functionality can be directly implemented using emscripten SDK
|
||||||
- [ ] `rlgl`: Review GLSL shaders naming conventions for consistency
|
- [ ] `rlgl`: Review GLSL shaders naming conventions for consistency
|
||||||
- [ ] `textures`: Improve compressed textures support, loading and saving
|
- [ ] `textures`: Improve compressed textures support, loading and saving
|
||||||
|
|||||||
443
build.zig
@ -2,7 +2,10 @@ const std = @import("std");
|
|||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
/// Minimum supported version of Zig
|
/// Minimum supported version of Zig
|
||||||
const min_ver = "0.13.0";
|
const min_ver = "0.15.1";
|
||||||
|
|
||||||
|
const emccOutputDir = "zig-out" ++ std.fs.path.sep_str ++ "htmlout" ++ std.fs.path.sep_str;
|
||||||
|
const emccOutputFile = "index.html";
|
||||||
|
|
||||||
comptime {
|
comptime {
|
||||||
const order = std.SemanticVersion.order;
|
const order = std.SemanticVersion.order;
|
||||||
@ -12,12 +15,11 @@ comptime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void {
|
fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void {
|
||||||
raylib.defineCMacro("PLATFORM_DESKTOP", null);
|
|
||||||
|
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
.glfw => raylib.defineCMacro("PLATFORM_DESKTOP_GLFW", null),
|
.glfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_GLFW", ""),
|
||||||
.rgfw => raylib.defineCMacro("PLATFORM_DESKTOP_RGFW", null),
|
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""),
|
||||||
.sdl => raylib.defineCMacro("PLATFORM_DESKTOP_SDL", null),
|
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""),
|
||||||
|
.android => raylib.root_module.addCMacro("PLATFORM_ANDROID", ""),
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,6 +48,26 @@ fn emSdkSetupStep(b: *std.Build, emsdk: *std.Build.Dependency) !?*std.Build.Step
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adapted from Not-Nik/raylib-zig
|
||||||
|
fn emscriptenRunStep(b: *std.Build, emsdk: *std.Build.Dependency, examplePath: []const u8) !*std.Build.Step.Run {
|
||||||
|
const dot_emsc_path = emsdk.path("upstream/emscripten/cache/sysroot/include").getPath(b);
|
||||||
|
// If compiling on windows , use emrun.bat.
|
||||||
|
const emrunExe = switch (builtin.os.tag) {
|
||||||
|
.windows => "emrun.bat",
|
||||||
|
else => "emrun",
|
||||||
|
};
|
||||||
|
var emrun_run_arg = try b.allocator.alloc(u8, dot_emsc_path.len + emrunExe.len + 1);
|
||||||
|
defer b.allocator.free(emrun_run_arg);
|
||||||
|
|
||||||
|
if (b.sysroot == null) {
|
||||||
|
emrun_run_arg = try std.fmt.bufPrint(emrun_run_arg, "{s}" ++ std.fs.path.sep_str ++ "{s}", .{ emsdk.path("upstream/emscripten").getPath(b), emrunExe });
|
||||||
|
} else {
|
||||||
|
emrun_run_arg = try std.fmt.bufPrint(emrun_run_arg, "{s}" ++ std.fs.path.sep_str ++ "{s}", .{ dot_emsc_path, emrunExe });
|
||||||
|
}
|
||||||
|
const run_cmd = b.addSystemCommand(&.{ emrun_run_arg, examplePath });
|
||||||
|
return run_cmd;
|
||||||
|
}
|
||||||
|
|
||||||
/// A list of all flags from `src/config.h` that one may override
|
/// A list of all flags from `src/config.h` that one may override
|
||||||
const config_h_flags = outer: {
|
const config_h_flags = outer: {
|
||||||
// Set this value higher if compile errors happen as `src/config.h` gets larger
|
// Set this value higher if compile errors happen as `src/config.h` gets larger
|
||||||
@ -58,6 +80,7 @@ const config_h_flags = outer: {
|
|||||||
var lines = std.mem.tokenizeScalar(u8, config_h, '\n');
|
var lines = std.mem.tokenizeScalar(u8, config_h, '\n');
|
||||||
while (lines.next()) |line| {
|
while (lines.next()) |line| {
|
||||||
if (!std.mem.containsAtLeast(u8, line, 1, "SUPPORT")) continue;
|
if (!std.mem.containsAtLeast(u8, line, 1, "SUPPORT")) continue;
|
||||||
|
if (std.mem.containsAtLeast(u8, line, 1, "MODULE")) continue;
|
||||||
if (std.mem.startsWith(u8, line, "//")) continue;
|
if (std.mem.startsWith(u8, line, "//")) continue;
|
||||||
if (std.mem.startsWith(u8, line, "#if")) continue;
|
if (std.mem.startsWith(u8, line, "#if")) continue;
|
||||||
|
|
||||||
@ -77,27 +100,32 @@ const config_h_flags = outer: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
|
fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
|
||||||
var raylib_flags_arr = std.ArrayList([]const u8).init(b.allocator);
|
var raylib_flags_arr: std.ArrayList([]const u8) = .empty;
|
||||||
defer raylib_flags_arr.deinit();
|
defer raylib_flags_arr.deinit(b.allocator);
|
||||||
|
|
||||||
try raylib_flags_arr.appendSlice(&[_][]const u8{
|
try raylib_flags_arr.appendSlice(
|
||||||
"-std=gnu99",
|
b.allocator,
|
||||||
"-D_GNU_SOURCE",
|
&[_][]const u8{
|
||||||
"-DGL_SILENCE_DEPRECATION=199309L",
|
"-std=gnu99",
|
||||||
"-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/3674
|
"-D_GNU_SOURCE",
|
||||||
});
|
"-DGL_SILENCE_DEPRECATION=199309L",
|
||||||
|
"-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/3674
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (options.shared) {
|
if (options.shared) {
|
||||||
try raylib_flags_arr.appendSlice(&[_][]const u8{
|
try raylib_flags_arr.appendSlice(
|
||||||
"-fPIC",
|
b.allocator,
|
||||||
"-DBUILD_LIBTYPE_SHARED",
|
&[_][]const u8{
|
||||||
});
|
"-fPIC",
|
||||||
|
"-DBUILD_LIBTYPE_SHARED",
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sets a flag indiciating the use of a custom `config.h`
|
||||||
|
try raylib_flags_arr.append(b.allocator, "-DEXTERNAL_CONFIG_FLAGS");
|
||||||
if (options.config.len > 0) {
|
if (options.config.len > 0) {
|
||||||
// Sets a flag indiciating the use of a custom `config.h`
|
|
||||||
try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS");
|
|
||||||
|
|
||||||
// Splits a space-separated list of config flags into multiple flags
|
// Splits a space-separated list of config flags into multiple flags
|
||||||
//
|
//
|
||||||
// Note: This means certain flags like `-x c++` won't be processed properly.
|
// Note: This means certain flags like `-x c++` won't be processed properly.
|
||||||
@ -106,7 +134,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
|
|
||||||
// Apply config flags supplied by the user
|
// Apply config flags supplied by the user
|
||||||
while (config_iter.next()) |config_flag|
|
while (config_iter.next()) |config_flag|
|
||||||
try raylib_flags_arr.append(config_flag);
|
try raylib_flags_arr.append(b.allocator, config_flag);
|
||||||
|
|
||||||
// Apply all relevant configs from `src/config.h` *except* the user-specified ones
|
// Apply all relevant configs from `src/config.h` *except* the user-specified ones
|
||||||
//
|
//
|
||||||
@ -124,22 +152,21 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, append default value from config.h to compile flags
|
// Otherwise, append default value from config.h to compile flags
|
||||||
try raylib_flags_arr.append(flag);
|
try raylib_flags_arr.append(b.allocator, flag);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Set default config if no custome config got set
|
||||||
|
try raylib_flags_arr.appendSlice(b.allocator, &config_h_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
const raylib = if (options.shared)
|
const raylib = b.addLibrary(.{
|
||||||
b.addSharedLibrary(.{
|
.name = "raylib",
|
||||||
.name = "raylib",
|
.linkage = if (options.shared) .dynamic else .static,
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
})
|
}),
|
||||||
else
|
});
|
||||||
b.addStaticLibrary(.{
|
|
||||||
.name = "raylib",
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
});
|
|
||||||
raylib.linkLibC();
|
raylib.linkLibC();
|
||||||
|
|
||||||
// No GLFW required on PLATFORM_DRM
|
// No GLFW required on PLATFORM_DRM
|
||||||
@ -147,32 +174,42 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
raylib.addIncludePath(b.path("src/external/glfw/include"));
|
raylib.addIncludePath(b.path("src/external/glfw/include"));
|
||||||
}
|
}
|
||||||
|
|
||||||
var c_source_files = try std.ArrayList([]const u8).initCapacity(b.allocator, 2);
|
var c_source_files: std.ArrayList([]const u8) = try .initCapacity(b.allocator, 2);
|
||||||
c_source_files.appendSliceAssumeCapacity(&.{ "src/rcore.c", "src/utils.c" });
|
c_source_files.appendSliceAssumeCapacity(&.{ "src/rcore.c", "src/utils.c" });
|
||||||
|
|
||||||
if (options.raudio) {
|
|
||||||
try c_source_files.append("src/raudio.c");
|
|
||||||
}
|
|
||||||
if (options.rmodels) {
|
|
||||||
try c_source_files.append("src/rmodels.c");
|
|
||||||
}
|
|
||||||
if (options.rshapes) {
|
if (options.rshapes) {
|
||||||
try c_source_files.append("src/rshapes.c");
|
try c_source_files.append(b.allocator, "src/rshapes.c");
|
||||||
}
|
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RSHAPES");
|
||||||
if (options.rtext) {
|
|
||||||
try c_source_files.append("src/rtext.c");
|
|
||||||
}
|
}
|
||||||
if (options.rtextures) {
|
if (options.rtextures) {
|
||||||
try c_source_files.append("src/rtextures.c");
|
try c_source_files.append(b.allocator, "src/rtextures.c");
|
||||||
|
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RTEXTURES");
|
||||||
|
}
|
||||||
|
if (options.rtext) {
|
||||||
|
try c_source_files.append(b.allocator, "src/rtext.c");
|
||||||
|
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RTEXT");
|
||||||
|
}
|
||||||
|
if (options.rmodels) {
|
||||||
|
try c_source_files.append(b.allocator, "src/rmodels.c");
|
||||||
|
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RMODELS");
|
||||||
|
}
|
||||||
|
if (options.raudio) {
|
||||||
|
try c_source_files.append(b.allocator, "src/raudio.c");
|
||||||
|
try raylib_flags_arr.append(b.allocator, "-DSUPPORT_MODULE_RAUDIO");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.opengl_version != .auto) {
|
if (options.opengl_version != .auto) {
|
||||||
raylib.defineCMacro(options.opengl_version.toCMacroStr(), null);
|
raylib.root_module.addCMacro(options.opengl_version.toCMacroStr(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
raylib.addIncludePath(b.path("src/platforms"));
|
||||||
switch (target.result.os.tag) {
|
switch (target.result.os.tag) {
|
||||||
.windows => {
|
.windows => {
|
||||||
try c_source_files.append("src/rglfw.c");
|
switch (options.platform) {
|
||||||
|
.glfw => try c_source_files.append(b.allocator, "src/rglfw.c"),
|
||||||
|
.rgfw, .sdl, .drm, .android => {},
|
||||||
|
}
|
||||||
|
|
||||||
raylib.linkSystemLibrary("winmm");
|
raylib.linkSystemLibrary("winmm");
|
||||||
raylib.linkSystemLibrary("gdi32");
|
raylib.linkSystemLibrary("gdi32");
|
||||||
raylib.linkSystemLibrary("opengl32");
|
raylib.linkSystemLibrary("opengl32");
|
||||||
@ -180,11 +217,78 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
setDesktopPlatform(raylib, options.platform);
|
setDesktopPlatform(raylib, options.platform);
|
||||||
},
|
},
|
||||||
.linux => {
|
.linux => {
|
||||||
if (options.platform != .drm) {
|
if (options.platform == .drm) {
|
||||||
try c_source_files.append("src/rglfw.c");
|
if (options.opengl_version == .auto) {
|
||||||
|
raylib.linkSystemLibrary("GLESv2");
|
||||||
|
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
raylib.linkSystemLibrary("EGL");
|
||||||
|
raylib.linkSystemLibrary("gbm");
|
||||||
|
raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force });
|
||||||
|
|
||||||
|
raylib.root_module.addCMacro("PLATFORM_DRM", "");
|
||||||
|
raylib.root_module.addCMacro("EGL_NO_X11", "");
|
||||||
|
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "");
|
||||||
|
} else if (target.result.abi.isAndroid()) {
|
||||||
|
|
||||||
|
//these are the only tag options per https://developer.android.com/ndk/guides/other_build_systems
|
||||||
|
const hostTuple = switch (builtin.target.os.tag) {
|
||||||
|
.linux => "linux-x86_64",
|
||||||
|
.windows => "windows-x86_64",
|
||||||
|
.macos => "darwin-x86_64",
|
||||||
|
else => @panic("unsupported host OS"),
|
||||||
|
};
|
||||||
|
|
||||||
|
const androidTriple = switch (target.result.cpu.arch) {
|
||||||
|
.x86 => "i686-linux-android",
|
||||||
|
.x86_64 => "x86_64-linux-android",
|
||||||
|
.arm => "arm-linux-androideabi",
|
||||||
|
.aarch64 => "aarch64-linux-android",
|
||||||
|
.riscv64 => "riscv64-linux-android",
|
||||||
|
else => error.InvalidAndroidTarget,
|
||||||
|
} catch @panic("invalid android target!");
|
||||||
|
const androidNdkPathString: []const u8 = options.android_ndk;
|
||||||
|
if (androidNdkPathString.len < 1) @panic("no ndk path provided and ANDROID_NDK_HOME is not set");
|
||||||
|
const androidApiLevel: []const u8 = options.android_api_version;
|
||||||
|
|
||||||
|
const androidSysroot = try std.fs.path.join(b.allocator, &.{ androidNdkPathString, "/toolchains/llvm/prebuilt/", hostTuple, "/sysroot" });
|
||||||
|
const androidLibPath = try std.fs.path.join(b.allocator, &.{ androidSysroot, "/usr/lib/", androidTriple });
|
||||||
|
const androidApiSpecificPath = try std.fs.path.join(b.allocator, &.{ androidLibPath, androidApiLevel });
|
||||||
|
const androidIncludePath = try std.fs.path.join(b.allocator, &.{ androidSysroot, "/usr/include" });
|
||||||
|
const androidArchIncludePath = try std.fs.path.join(b.allocator, &.{ androidIncludePath, androidTriple });
|
||||||
|
const androidAsmPath = try std.fs.path.join(b.allocator, &.{ androidIncludePath, "/asm-generic" });
|
||||||
|
const androidGluePath = try std.fs.path.join(b.allocator, &.{ androidNdkPathString, "/sources/android/native_app_glue/" });
|
||||||
|
|
||||||
|
raylib.addLibraryPath(.{ .cwd_relative = androidLibPath });
|
||||||
|
raylib.root_module.addLibraryPath(.{ .cwd_relative = androidApiSpecificPath });
|
||||||
|
raylib.addSystemIncludePath(.{ .cwd_relative = androidIncludePath });
|
||||||
|
raylib.addSystemIncludePath(.{ .cwd_relative = androidArchIncludePath });
|
||||||
|
raylib.addSystemIncludePath(.{ .cwd_relative = androidAsmPath });
|
||||||
|
raylib.addSystemIncludePath(.{ .cwd_relative = androidGluePath });
|
||||||
|
|
||||||
|
var libcData: std.ArrayList(u8) = .empty;
|
||||||
|
var aw: std.Io.Writer.Allocating = .fromArrayList(b.allocator, &libcData);
|
||||||
|
try (std.zig.LibCInstallation{
|
||||||
|
.include_dir = androidIncludePath,
|
||||||
|
.sys_include_dir = androidIncludePath,
|
||||||
|
.crt_dir = androidApiSpecificPath,
|
||||||
|
}).render(&aw.writer);
|
||||||
|
const libcFile = b.addWriteFiles().add("android-libc.txt", try libcData.toOwnedSlice(b.allocator));
|
||||||
|
raylib.setLibCFile(libcFile);
|
||||||
|
|
||||||
|
if (options.opengl_version == .auto) {
|
||||||
|
raylib.root_module.linkSystemLibrary("GLESv2", .{});
|
||||||
|
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
|
||||||
|
}
|
||||||
|
raylib.root_module.linkSystemLibrary("EGL", .{});
|
||||||
|
|
||||||
|
setDesktopPlatform(raylib, .android);
|
||||||
|
} else {
|
||||||
|
try c_source_files.append(b.allocator, "src/rglfw.c");
|
||||||
|
|
||||||
if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) {
|
if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) {
|
||||||
raylib.defineCMacro("_GLFW_X11", null);
|
raylib.root_module.addCMacro("_GLFW_X11", "");
|
||||||
raylib.linkSystemLibrary("GLX");
|
raylib.linkSystemLibrary("GLX");
|
||||||
raylib.linkSystemLibrary("X11");
|
raylib.linkSystemLibrary("X11");
|
||||||
raylib.linkSystemLibrary("Xcursor");
|
raylib.linkSystemLibrary("Xcursor");
|
||||||
@ -204,7 +308,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
, .{});
|
, .{});
|
||||||
@panic("`wayland-scanner` not found");
|
@panic("`wayland-scanner` not found");
|
||||||
};
|
};
|
||||||
raylib.defineCMacro("_GLFW_WAYLAND", null);
|
raylib.root_module.addCMacro("_GLFW_WAYLAND", "");
|
||||||
raylib.linkSystemLibrary("EGL");
|
raylib.linkSystemLibrary("EGL");
|
||||||
raylib.linkSystemLibrary("wayland-client");
|
raylib.linkSystemLibrary("wayland-client");
|
||||||
raylib.linkSystemLibrary("xkbcommon");
|
raylib.linkSystemLibrary("xkbcommon");
|
||||||
@ -218,25 +322,11 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
waylandGenerate(b, raylib, "xdg-activation-v1.xml", "xdg-activation-v1-client-protocol");
|
waylandGenerate(b, raylib, "xdg-activation-v1.xml", "xdg-activation-v1-client-protocol");
|
||||||
waylandGenerate(b, raylib, "idle-inhibit-unstable-v1.xml", "idle-inhibit-unstable-v1-client-protocol");
|
waylandGenerate(b, raylib, "idle-inhibit-unstable-v1.xml", "idle-inhibit-unstable-v1-client-protocol");
|
||||||
}
|
}
|
||||||
|
|
||||||
setDesktopPlatform(raylib, options.platform);
|
setDesktopPlatform(raylib, options.platform);
|
||||||
} else {
|
|
||||||
if (options.opengl_version == .auto) {
|
|
||||||
raylib.linkSystemLibrary("GLESv2");
|
|
||||||
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
raylib.linkSystemLibrary("EGL");
|
|
||||||
raylib.linkSystemLibrary("gbm");
|
|
||||||
raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force });
|
|
||||||
|
|
||||||
raylib.defineCMacro("PLATFORM_DRM", null);
|
|
||||||
raylib.defineCMacro("EGL_NO_X11", null);
|
|
||||||
raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.freebsd, .openbsd, .netbsd, .dragonfly => {
|
.freebsd, .openbsd, .netbsd, .dragonfly => {
|
||||||
try c_source_files.append("rglfw.c");
|
try c_source_files.append(b.allocator, "rglfw.c");
|
||||||
raylib.linkSystemLibrary("GL");
|
raylib.linkSystemLibrary("GL");
|
||||||
raylib.linkSystemLibrary("rt");
|
raylib.linkSystemLibrary("rt");
|
||||||
raylib.linkSystemLibrary("dl");
|
raylib.linkSystemLibrary("dl");
|
||||||
@ -259,7 +349,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On macos rglfw.c include Objective-C files.
|
// On macos rglfw.c include Objective-C files.
|
||||||
try raylib_flags_arr.append("-ObjC");
|
try raylib_flags_arr.append(b.allocator, "-ObjC");
|
||||||
raylib.root_module.addCSourceFile(.{
|
raylib.root_module.addCSourceFile(.{
|
||||||
.file = b.path("src/rglfw.c"),
|
.file = b.path("src/rglfw.c"),
|
||||||
.flags = raylib_flags_arr.items,
|
.flags = raylib_flags_arr.items,
|
||||||
@ -274,7 +364,6 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
setDesktopPlatform(raylib, options.platform);
|
setDesktopPlatform(raylib, options.platform);
|
||||||
},
|
},
|
||||||
.emscripten => {
|
.emscripten => {
|
||||||
// Include emscripten for cross compilation
|
|
||||||
if (b.lazyDependency("emsdk", .{})) |dep| {
|
if (b.lazyDependency("emsdk", .{})) |dep| {
|
||||||
if (try emSdkSetupStep(b, dep)) |emSdkStep| {
|
if (try emSdkSetupStep(b, dep)) |emSdkStep| {
|
||||||
raylib.step.dependOn(&emSdkStep.step);
|
raylib.step.dependOn(&emSdkStep.step);
|
||||||
@ -283,9 +372,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include"));
|
raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include"));
|
||||||
}
|
}
|
||||||
|
|
||||||
raylib.defineCMacro("PLATFORM_WEB", null);
|
raylib.root_module.addCMacro("PLATFORM_WEB", "");
|
||||||
if (options.opengl_version == .auto) {
|
if (options.opengl_version == .auto) {
|
||||||
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
|
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
@ -301,13 +390,15 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||||||
return raylib;
|
return raylib;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void {
|
pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency, options: Options) void {
|
||||||
|
const raylib_dep = b.dependencyFromBuildZig(@This(), options);
|
||||||
var gen_step = b.addWriteFiles();
|
var gen_step = b.addWriteFiles();
|
||||||
raylib.step.dependOn(&gen_step.step);
|
raylib.step.dependOn(&gen_step.step);
|
||||||
|
|
||||||
const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n");
|
const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n");
|
||||||
raylib.addCSourceFile(.{ .file = raygui_c_path });
|
raylib.addCSourceFile(.{ .file = raygui_c_path });
|
||||||
raylib.addIncludePath(raygui_dep.path("src"));
|
raylib.addIncludePath(raygui_dep.path("src"));
|
||||||
|
raylib.addIncludePath(raylib_dep.path("src"));
|
||||||
|
|
||||||
raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h");
|
raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h");
|
||||||
}
|
}
|
||||||
@ -322,12 +413,14 @@ pub const Options = struct {
|
|||||||
shared: bool = false,
|
shared: bool = false,
|
||||||
linux_display_backend: LinuxDisplayBackend = .Both,
|
linux_display_backend: LinuxDisplayBackend = .Both,
|
||||||
opengl_version: OpenglVersion = .auto,
|
opengl_version: OpenglVersion = .auto,
|
||||||
|
android_ndk: []const u8 = "",
|
||||||
|
android_api_version: []const u8 = "35",
|
||||||
/// config should be a list of space-separated cflags, eg, "-DSUPPORT_CUSTOM_FRAME_CONTROL"
|
/// config should be a list of space-separated cflags, eg, "-DSUPPORT_CUSTOM_FRAME_CONTROL"
|
||||||
config: []const u8 = &.{},
|
config: []const u8 = &.{},
|
||||||
|
|
||||||
const defaults = Options{};
|
const defaults = Options{};
|
||||||
|
|
||||||
fn getOptions(b: *std.Build) Options {
|
pub fn getOptions(b: *std.Build) Options {
|
||||||
return .{
|
return .{
|
||||||
.platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform,
|
.platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform,
|
||||||
.raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio,
|
.raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio,
|
||||||
@ -339,6 +432,8 @@ pub const Options = struct {
|
|||||||
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
|
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
|
||||||
.opengl_version = b.option(OpenglVersion, "opengl_version", "OpenGL version to use") orelse defaults.opengl_version,
|
.opengl_version = b.option(OpenglVersion, "opengl_version", "OpenGL version to use") orelse defaults.opengl_version,
|
||||||
.config = b.option([]const u8, "config", "Compile with custom define macros overriding config.h") orelse &.{},
|
.config = b.option([]const u8, "config", "Compile with custom define macros overriding config.h") orelse &.{},
|
||||||
|
.android_ndk = b.option([]const u8, "android_ndk", "specify path to android ndk") orelse std.process.getEnvVarOwned(b.allocator, "ANDROID_NDK_HOME") catch "",
|
||||||
|
.android_api_version = b.option([]const u8, "android_api_version", "specify target android API level") orelse defaults.android_api_version,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -376,6 +471,7 @@ pub const PlatformBackend = enum {
|
|||||||
rgfw,
|
rgfw,
|
||||||
sdl,
|
sdl,
|
||||||
drm,
|
drm,
|
||||||
|
android,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
pub fn build(b: *std.Build) !void {
|
||||||
@ -392,10 +488,21 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const lib = try compileRaylib(b, target, optimize, Options.getOptions(b));
|
const lib = try compileRaylib(b, target, optimize, Options.getOptions(b));
|
||||||
|
|
||||||
lib.installHeader(b.path("src/raylib.h"), "raylib.h");
|
lib.installHeader(b.path("src/raylib.h"), "raylib.h");
|
||||||
|
lib.installHeader(b.path("src/rcamera.h"), "rcamera.h");
|
||||||
lib.installHeader(b.path("src/raymath.h"), "raymath.h");
|
lib.installHeader(b.path("src/raymath.h"), "raymath.h");
|
||||||
lib.installHeader(b.path("src/rlgl.h"), "rlgl.h");
|
lib.installHeader(b.path("src/rlgl.h"), "rlgl.h");
|
||||||
|
|
||||||
b.installArtifact(lib);
|
b.installArtifact(lib);
|
||||||
|
|
||||||
|
const examples = b.step("examples", "Build/Install all examples");
|
||||||
|
examples.dependOn(try addExamples("audio", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("core", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("models", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("others", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("shaders", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("shapes", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("text", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("textures", b, target, optimize, lib));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn waylandGenerate(
|
fn waylandGenerate(
|
||||||
@ -420,3 +527,195 @@ fn waylandGenerate(
|
|||||||
raylib.step.dependOn(&client_step.step);
|
raylib.step.dependOn(&client_step.step);
|
||||||
raylib.step.dependOn(&private_step.step);
|
raylib.step.dependOn(&private_step.step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn addExamples(
|
||||||
|
comptime module: []const u8,
|
||||||
|
b: *std.Build,
|
||||||
|
target: std.Build.ResolvedTarget,
|
||||||
|
optimize: std.builtin.OptimizeMode,
|
||||||
|
raylib: *std.Build.Step.Compile,
|
||||||
|
) !*std.Build.Step {
|
||||||
|
const all = b.step(module, "All " ++ module ++ " examples");
|
||||||
|
const module_subpath = b.pathJoin(&.{ "examples", module });
|
||||||
|
const module_resources = b.pathJoin(&.{ module_subpath, "resources@resources" });
|
||||||
|
var dir = try std.fs.cwd().openDir(b.pathFromRoot(module_subpath), .{ .iterate = true });
|
||||||
|
defer if (comptime builtin.zig_version.minor >= 12) dir.close();
|
||||||
|
|
||||||
|
var iter = dir.iterate();
|
||||||
|
while (try iter.next()) |entry| {
|
||||||
|
if (entry.kind != .file) continue;
|
||||||
|
const extension_idx = std.mem.lastIndexOf(u8, entry.name, ".c") orelse continue;
|
||||||
|
const name = entry.name[0..extension_idx];
|
||||||
|
const path = b.pathJoin(&.{ module_subpath, entry.name });
|
||||||
|
|
||||||
|
// zig's mingw headers do not include pthread.h
|
||||||
|
if (std.mem.eql(u8, "core_loading_thread", name) and target.result.os.tag == .windows) continue;
|
||||||
|
|
||||||
|
if (target.result.os.tag == .emscripten) {
|
||||||
|
const exe_lib = b.addLibrary(.{
|
||||||
|
.name = name,
|
||||||
|
.linkage = .static,
|
||||||
|
.root_module = b.createModule(.{
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
exe_lib.addCSourceFile(.{
|
||||||
|
.file = b.path(path),
|
||||||
|
.flags = &.{},
|
||||||
|
});
|
||||||
|
exe_lib.linkLibC();
|
||||||
|
|
||||||
|
if (std.mem.eql(u8, name, "rlgl_standalone")) {
|
||||||
|
//TODO: Make rlgl_standalone example work
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (std.mem.eql(u8, name, "raylib_opengl_interop")) {
|
||||||
|
//TODO: Make raylib_opengl_interop example work
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
exe_lib.linkLibrary(raylib);
|
||||||
|
|
||||||
|
// Include emscripten for cross compilation
|
||||||
|
if (b.lazyDependency("emsdk", .{})) |emsdk_dep| {
|
||||||
|
if (try emSdkSetupStep(b, emsdk_dep)) |emSdkStep| {
|
||||||
|
exe_lib.step.dependOn(&emSdkStep.step);
|
||||||
|
}
|
||||||
|
|
||||||
|
exe_lib.addIncludePath(emsdk_dep.path("upstream/emscripten/cache/sysroot/include"));
|
||||||
|
|
||||||
|
// Create the output directory because emcc can't do it.
|
||||||
|
const emccOutputDirExample = b.pathJoin(&.{ emccOutputDir, name, std.fs.path.sep_str });
|
||||||
|
const mkdir_command = switch (builtin.os.tag) {
|
||||||
|
.windows => b.addSystemCommand(&.{ "cmd.exe", "/c", "if", "not", "exist", emccOutputDirExample, "mkdir", emccOutputDirExample }),
|
||||||
|
else => b.addSystemCommand(&.{ "mkdir", "-p", emccOutputDirExample }),
|
||||||
|
};
|
||||||
|
|
||||||
|
const emcc_exe = switch (builtin.os.tag) {
|
||||||
|
.windows => "emcc.bat",
|
||||||
|
else => "emcc",
|
||||||
|
};
|
||||||
|
|
||||||
|
const emcc_exe_path = b.pathJoin(&.{ emsdk_dep.path("upstream/emscripten").getPath(b), emcc_exe });
|
||||||
|
const emcc_command = b.addSystemCommand(&[_][]const u8{emcc_exe_path});
|
||||||
|
emcc_command.step.dependOn(&mkdir_command.step);
|
||||||
|
const emccOutputDirExampleWithFile = b.pathJoin(&.{ emccOutputDir, name, std.fs.path.sep_str, emccOutputFile });
|
||||||
|
emcc_command.addArgs(&[_][]const u8{
|
||||||
|
"-o",
|
||||||
|
emccOutputDirExampleWithFile,
|
||||||
|
"-sFULL-ES3=1",
|
||||||
|
"-sUSE_GLFW=3",
|
||||||
|
"-sSTACK_OVERFLOW_CHECK=1",
|
||||||
|
"-sEXPORTED_RUNTIME_METHODS=['requestFullscreen']",
|
||||||
|
"-sASYNCIFY",
|
||||||
|
"-O0",
|
||||||
|
"--emrun",
|
||||||
|
"--preload-file",
|
||||||
|
module_resources,
|
||||||
|
"--shell-file",
|
||||||
|
b.path("src/shell.html").getPath(b),
|
||||||
|
});
|
||||||
|
|
||||||
|
const link_items: []const *std.Build.Step.Compile = &.{
|
||||||
|
raylib,
|
||||||
|
exe_lib,
|
||||||
|
};
|
||||||
|
for (link_items) |item| {
|
||||||
|
emcc_command.addFileArg(item.getEmittedBin());
|
||||||
|
emcc_command.step.dependOn(&item.step);
|
||||||
|
}
|
||||||
|
|
||||||
|
const run_step = try emscriptenRunStep(b, emsdk_dep, emccOutputDirExampleWithFile);
|
||||||
|
run_step.step.dependOn(&emcc_command.step);
|
||||||
|
run_step.addArg("--no_browser");
|
||||||
|
const run_option = b.step(name, name);
|
||||||
|
|
||||||
|
run_option.dependOn(&run_step.step);
|
||||||
|
|
||||||
|
all.dependOn(&emcc_command.step);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const exe = b.addExecutable(.{
|
||||||
|
.name = name,
|
||||||
|
.root_module = b.createModule(.{
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
exe.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
|
||||||
|
exe.linkLibC();
|
||||||
|
|
||||||
|
// special examples that test using these external dependencies directly
|
||||||
|
// alongside raylib
|
||||||
|
if (std.mem.eql(u8, name, "rlgl_standalone")) {
|
||||||
|
exe.addIncludePath(b.path("src"));
|
||||||
|
exe.addIncludePath(b.path("src/external/glfw/include"));
|
||||||
|
if (!hasCSource(raylib.root_module, "rglfw.c")) {
|
||||||
|
exe.addCSourceFile(.{ .file = b.path("src/rglfw.c"), .flags = &.{} });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (std.mem.eql(u8, name, "raylib_opengl_interop")) {
|
||||||
|
exe.addIncludePath(b.path("src/external"));
|
||||||
|
}
|
||||||
|
|
||||||
|
exe.linkLibrary(raylib);
|
||||||
|
|
||||||
|
switch (target.result.os.tag) {
|
||||||
|
.windows => {
|
||||||
|
exe.linkSystemLibrary("winmm");
|
||||||
|
exe.linkSystemLibrary("gdi32");
|
||||||
|
exe.linkSystemLibrary("opengl32");
|
||||||
|
|
||||||
|
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
||||||
|
},
|
||||||
|
.linux => {
|
||||||
|
exe.linkSystemLibrary("GL");
|
||||||
|
exe.linkSystemLibrary("rt");
|
||||||
|
exe.linkSystemLibrary("dl");
|
||||||
|
exe.linkSystemLibrary("m");
|
||||||
|
exe.linkSystemLibrary("X11");
|
||||||
|
|
||||||
|
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
||||||
|
},
|
||||||
|
.macos => {
|
||||||
|
exe.linkFramework("Foundation");
|
||||||
|
exe.linkFramework("Cocoa");
|
||||||
|
exe.linkFramework("OpenGL");
|
||||||
|
exe.linkFramework("CoreAudio");
|
||||||
|
exe.linkFramework("CoreVideo");
|
||||||
|
exe.linkFramework("IOKit");
|
||||||
|
|
||||||
|
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
||||||
|
},
|
||||||
|
else => {
|
||||||
|
@panic("Unsupported OS");
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const install_cmd = b.addInstallArtifact(exe, .{});
|
||||||
|
|
||||||
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
|
run_cmd.cwd = b.path(module_subpath);
|
||||||
|
run_cmd.step.dependOn(&install_cmd.step);
|
||||||
|
|
||||||
|
const run_step = b.step(name, name);
|
||||||
|
run_step.dependOn(&run_cmd.step);
|
||||||
|
|
||||||
|
all.dependOn(&install_cmd.step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn hasCSource(module: *std.Build.Module, name: []const u8) bool {
|
||||||
|
for (module.link_objects.items) |o| switch (o) {
|
||||||
|
.c_source_file => |c| if (switch (c.file) {
|
||||||
|
.src_path => |s| std.ascii.endsWithIgnoreCase(s.sub_path, name),
|
||||||
|
.generated, .cwd_relative, .dependency => false,
|
||||||
|
}) return true,
|
||||||
|
.c_source_files => |s| for (s.files) |c| if (std.ascii.endsWithIgnoreCase(c, name)) return true,
|
||||||
|
else => {},
|
||||||
|
};
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,17 +1,19 @@
|
|||||||
.{
|
.{
|
||||||
.name = "raylib",
|
.name = .raylib,
|
||||||
.version = "5.5.0",
|
.version = "5.5.0",
|
||||||
.minimum_zig_version = "0.13.0",
|
.minimum_zig_version = "0.15.1",
|
||||||
|
|
||||||
|
.fingerprint = 0x13035e5cb8bc1ac2, // Changing this has security and trust implications.
|
||||||
|
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.xcode_frameworks = .{
|
.xcode_frameworks = .{
|
||||||
.url = "git+https://github.com/hexops/xcode-frameworks#a6bf82e032d4d9923ad5c222d466710fcc05f249",
|
.url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7",
|
||||||
.hash = "12208da4dfcd9b53fb367375fb612ec73f38e53015f1ce6ae6d6e8437a637078e170",
|
.hash = "N-V-__8AABHMqAWYuRdIlflwi8gksPnlUMQBiSxAqQAAZFms",
|
||||||
.lazy = true,
|
.lazy = true,
|
||||||
},
|
},
|
||||||
.emsdk = .{
|
.emsdk = .{
|
||||||
.url = "git+https://github.com/emscripten-core/emsdk#3.1.50",
|
.url = "git+https://github.com/emscripten-core/emsdk#4.0.9",
|
||||||
.hash = "1220e8fe9509f0843e5e22326300ca415c27afbfbba3992f3c3184d71613540b5564",
|
.hash = "N-V-__8AAJl1DwBezhYo_VE6f53mPVm00R-Fk28NPW7P14EQ",
|
||||||
.lazy = true,
|
.lazy = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -20,5 +22,7 @@
|
|||||||
"build.zig",
|
"build.zig",
|
||||||
"build.zig.zon",
|
"build.zig.zon",
|
||||||
"src",
|
"src",
|
||||||
|
"examples",
|
||||||
|
"LICENSE",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,6 +69,14 @@ elseif (${PLATFORM} MATCHES "Android")
|
|||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
list(APPEND raylib_sources ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
list(APPEND raylib_sources ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
||||||
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||||
|
|
||||||
|
# NOTE: We remove '-Wl,--no-undefined' (set by default) as it conflicts with '-Wl,-undefined,dynamic_lookup' needed
|
||||||
|
# for compiling with the missing 'void main(void)' declaration in `android_main()`.
|
||||||
|
# We also remove other unnecessary or problematic flags.
|
||||||
|
|
||||||
|
string(REPLACE "-Wl,--no-undefined -Qunused-arguments" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
string(REPLACE "-static-libstdc++" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup")
|
||||||
|
|
||||||
find_library(OPENGL_LIBRARY OpenGL)
|
find_library(OPENGL_LIBRARY OpenGL)
|
||||||
@ -93,10 +101,37 @@ elseif ("${PLATFORM}" MATCHES "DRM")
|
|||||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
|
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
|
||||||
|
|
||||||
elseif ("${PLATFORM}" MATCHES "SDL")
|
elseif ("${PLATFORM}" MATCHES "SDL")
|
||||||
find_package(SDL2 REQUIRED)
|
# First, check if SDL is included as a subdirectory
|
||||||
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
|
if(TARGET SDL3::SDL3)
|
||||||
set(LIBS_PRIVATE SDL2::SDL2)
|
message(STATUS "Using SDL3 from subdirectory")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
|
||||||
|
set(LIBS_PRIVATE SDL3::SDL3)
|
||||||
|
add_compile_definitions(USING_SDL3_PROJECT)
|
||||||
|
elseif(TARGET SDL2::SDL2)
|
||||||
|
message(STATUS "Using SDL2 from subdirectory")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
|
||||||
|
set(LIBS_PRIVATE SDL2::SDL2)
|
||||||
|
add_compile_definitions(USING_SDL2_PROJECT)
|
||||||
|
else()
|
||||||
|
# No SDL added via add_subdirectory(), try find_package()
|
||||||
|
message(STATUS "No SDL target from subdirectory, searching via find_package()...")
|
||||||
|
|
||||||
|
# First try SDL3
|
||||||
|
find_package(SDL3 QUIET)
|
||||||
|
if(SDL3_FOUND)
|
||||||
|
message(STATUS "Found SDL3 via find_package()")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
|
||||||
|
set(LIBS_PRIVATE SDL3::SDL3)
|
||||||
|
add_compile_definitions(USING_SDL3_PACKAGE)
|
||||||
|
else()
|
||||||
|
# Fallback to SDL2
|
||||||
|
find_package(SDL2 REQUIRED)
|
||||||
|
message(STATUS "Found SDL2 via find_package()")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
|
||||||
|
set(LIBS_PRIVATE SDL2::SDL2)
|
||||||
|
add_compile_definitions(USING_SDL2_PACKAGE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT ${OPENGL_VERSION} MATCHES "OFF")
|
if (NOT ${OPENGL_VERSION} MATCHES "OFF")
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# - Try to find raylib
|
# - Try to find raylib
|
||||||
# Options:
|
# Options:
|
||||||
# raylib_USE_STATIC_LIBS - OFF by default
|
# raylib_USE_STATIC_LIBS - ON by default
|
||||||
# raylib_VERBOSE - OFF by default
|
# raylib_VERBOSE - OFF by default
|
||||||
# Once done, this defines a raylib target that can be passed to
|
# Once done, this defines a raylib target that can be passed to
|
||||||
# target_link_libraries as well as following variables:
|
# target_link_libraries as well as following variables:
|
||||||
@ -11,6 +11,9 @@
|
|||||||
# raylib_LDFLAGS - The linker flags needed with raylib
|
# raylib_LDFLAGS - The linker flags needed with raylib
|
||||||
# raylib_DEFINITIONS - Compiler switches required for using raylib
|
# raylib_DEFINITIONS - Compiler switches required for using raylib
|
||||||
|
|
||||||
|
option(raylib_USE_STATIC_LIBS "Use static libs" ON)
|
||||||
|
option(raylib_VERBOSE "Show raylib verbose messages" OFF)
|
||||||
|
|
||||||
if (NOT TARGET raylib)
|
if (NOT TARGET raylib)
|
||||||
set(XPREFIX PC_RAYLIB)
|
set(XPREFIX PC_RAYLIB)
|
||||||
|
|
||||||
@ -25,23 +28,22 @@ if (NOT TARGET raylib)
|
|||||||
|
|
||||||
find_path(raylib_INCLUDE_DIR
|
find_path(raylib_INCLUDE_DIR
|
||||||
NAMES raylib.h
|
NAMES raylib.h
|
||||||
HINTS ${${XPREFIX}_INCLUDE_DIRS}
|
HINTS ${${XPREFIX}_INCLUDE_DIRS} ${raylib_DIR}/../../../include/
|
||||||
)
|
)
|
||||||
|
|
||||||
set(RAYLIB_NAMES raylib)
|
|
||||||
|
|
||||||
if (raylib_USE_STATIC_LIBS)
|
if (raylib_USE_STATIC_LIBS)
|
||||||
set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES})
|
set(RAYLIB_NAMES libraylib.a raylib.lib)
|
||||||
endif()
|
else ()
|
||||||
|
set(RAYLIB_NAMES raylib)
|
||||||
|
endif ()
|
||||||
|
|
||||||
find_library(raylib_LIBRARY
|
find_library(raylib_LIBRARY
|
||||||
NAMES ${RAYLIB_NAMES}
|
NAMES ${RAYLIB_NAMES}
|
||||||
HINTS ${${XPREFIX}_LIBRARY_DIRS}
|
HINTS ${${XPREFIX}_LIBRARY_DIRS} ${raylib_DIR}/../../
|
||||||
)
|
)
|
||||||
|
|
||||||
set(raylib_LIBRARIES ${raylib_LIBRARY})
|
set(raylib_LIBRARIES ${raylib_LIBRARY})
|
||||||
set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})
|
|
||||||
set(raylib_LIBRARY_DIR ${raylib_LIBRARY_DIRS})
|
|
||||||
set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR})
|
set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR})
|
||||||
set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS})
|
set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS})
|
||||||
|
|
||||||
|
|||||||
@ -90,6 +90,7 @@ if (${PLATFORM} MATCHES "Android")
|
|||||||
|
|
||||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_custom_uniform.c)
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_custom_uniform.c)
|
||||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_model_shader.c)
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_model_shader.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_view_depth.c)
|
||||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_postprocessing.c)
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_postprocessing.c)
|
||||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_raymarching.c)
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_raymarching.c)
|
||||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_palette_switch.c)
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_palette_switch.c)
|
||||||
@ -124,7 +125,21 @@ endif ()
|
|||||||
# The rlgl_standalone example only targets desktop, without shared libraries.
|
# The rlgl_standalone example only targets desktop, without shared libraries.
|
||||||
if (BUILD_SHARED_LIBS OR NOT ${PLATFORM} MATCHES "Desktop")
|
if (BUILD_SHARED_LIBS OR NOT ${PLATFORM} MATCHES "Desktop")
|
||||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# The audio examples fail to link if raylib is built without raudio
|
||||||
|
if (NOT SUPPORT_MODULE_RAUDIO)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_mixed_processor.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_module_playing.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_music_stream.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_raw_stream.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_loading.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_multi.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_stream_effects.c)
|
||||||
|
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/embedded_files_loading.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_button.c)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_explosion.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(BEFORE SYSTEM others/external/include)
|
include_directories(BEFORE SYSTEM others/external/include)
|
||||||
|
|||||||
@ -20,6 +20,8 @@
|
|||||||
# - Linux (X11 desktop mode)
|
# - Linux (X11 desktop mode)
|
||||||
# - macOS/OSX (x64, arm64 (not tested))
|
# - macOS/OSX (x64, arm64 (not tested))
|
||||||
# - Others (not tested)
|
# - Others (not tested)
|
||||||
|
# > PLATFORM_WEB_RGFW:
|
||||||
|
# - HTML5 (WebAssembly)
|
||||||
# > PLATFORM_WEB:
|
# > PLATFORM_WEB:
|
||||||
# - HTML5 (WebAssembly)
|
# - HTML5 (WebAssembly)
|
||||||
# > PLATFORM_DRM:
|
# > PLATFORM_DRM:
|
||||||
@ -28,7 +30,7 @@
|
|||||||
# > PLATFORM_ANDROID:
|
# > PLATFORM_ANDROID:
|
||||||
# - Android (ARM, ARM64)
|
# - Android (ARM, ARM64)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
@ -51,13 +53,18 @@
|
|||||||
|
|
||||||
# Define required environment variables
|
# Define required environment variables
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
|
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_WEB_RGFW
|
||||||
PLATFORM ?= PLATFORM_DESKTOP
|
PLATFORM ?= PLATFORM_DESKTOP
|
||||||
|
|
||||||
ifeq ($(PLATFORM), PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW))
|
||||||
TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW
|
TARGET_PLATFORM := $(PLATFORM)
|
||||||
|
override PLATFORM = PLATFORM_DESKTOP
|
||||||
else
|
else
|
||||||
TARGET_PLATFORM = $(PLATFORM)
|
ifeq ($(PLATFORM), PLATFORM_DESKTOP)
|
||||||
|
TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW
|
||||||
|
else
|
||||||
|
TARGET_PLATFORM = $(PLATFORM)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define required raylib variables
|
# Define required raylib variables
|
||||||
@ -89,7 +96,6 @@ SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
|
|||||||
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
||||||
SDL_LIBRARIES ?= -lSDL2 -lSDL2main
|
SDL_LIBRARIES ?= -lSDL2 -lSDL2main
|
||||||
|
|
||||||
|
|
||||||
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
||||||
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
||||||
USE_WAYLAND_DISPLAY ?= FALSE
|
USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
@ -100,9 +106,12 @@ BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
|
|||||||
BUILD_WEB_HEAP_SIZE ?= 134217728
|
BUILD_WEB_HEAP_SIZE ?= 134217728
|
||||||
BUILD_WEB_RESOURCES ?= TRUE
|
BUILD_WEB_RESOURCES ?= TRUE
|
||||||
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
|
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
|
||||||
|
# Use WebGL2 backend (OpenGL 3.0)
|
||||||
|
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
|
||||||
|
BUILD_WEB_WEBGL2 ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS when required
|
# Determine PLATFORM_OS when required
|
||||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB))
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
# ifeq ($(UNAME),Msys) -> Windows
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
@ -153,7 +162,7 @@ endif
|
|||||||
# Define raylib release directory for compiled library
|
# Define raylib release directory for compiled library
|
||||||
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/raylib/emsdk
|
EMSDK_PATH ?= C:/raylib/emsdk
|
||||||
@ -179,7 +188,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
|||||||
CC = clang
|
CC = clang
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
# HTML5 emscripten compiler
|
# HTML5 emscripten compiler
|
||||||
# WARNING: To compile to HTML5, code must be redesigned
|
# WARNING: To compile to HTML5, code must be redesigned
|
||||||
# to use emscripten.h and emscripten_set_main_loop()
|
# to use emscripten.h and emscripten_set_main_loop()
|
||||||
@ -198,7 +207,7 @@ endif
|
|||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||||
MAKE = mingw32-make
|
MAKE = mingw32-make
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
MAKE = mingw32-make
|
MAKE = mingw32-make
|
||||||
else
|
else
|
||||||
@ -226,11 +235,8 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
|||||||
|
|
||||||
ifeq ($(BUILD_MODE),DEBUG)
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g -D_DEBUG
|
CFLAGS += -g -D_DEBUG
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
|
||||||
CFLAGS += -sASSERTIONS=1 --profiling
|
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||||
CFLAGS += -O3
|
CFLAGS += -O3
|
||||||
else
|
else
|
||||||
@ -266,8 +272,8 @@ endif
|
|||||||
# NOTE: Some external/extras libraries could be required (stb, easings...)
|
# NOTE: Some external/extras libraries could be required (stb, easings...)
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS)
|
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS)
|
||||||
# Define additional directories containing required header files
|
|
||||||
|
|
||||||
|
# Define additional directories containing required header files
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
|
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
|
||||||
@ -284,11 +290,6 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
|||||||
INCLUDE_PATHS += -I/usr/include/libdrm
|
INCLUDE_PATHS += -I/usr/include/libdrm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include GLFW required for examples/others/rlgl_standalone.c
|
|
||||||
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
|
|
||||||
all others: INCLUDE_PATHS += -I$(RAYLIB_PATH)/src/external/glfw/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Define library paths containing required libs: LDFLAGS
|
# Define library paths containing required libs: LDFLAGS
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
@ -320,29 +321,41 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
|||||||
endif
|
endif
|
||||||
LDFLAGS += -L$(SDL_LIBRARY_PATH)
|
LDFLAGS += -L$(SDL_LIBRARY_PATH)
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
# -Os # size optimization
|
# -Os # size optimization
|
||||||
# -O2 # optimization level 2, if used, also set --memory-init-file 0
|
# -O2 # optimization level 2, if used, also set --memory-init-file 0
|
||||||
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
|
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
|
||||||
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
|
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
|
||||||
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
|
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
|
||||||
# -sUSE_PTHREADS=1 # multithreading support
|
# -sUSE_PTHREADS=1 # multithreading support
|
||||||
# -sWASM=0 # disable Web Assembly, emitted by default
|
# -sWASM=0 # disable Web Assembly, emitted by default
|
||||||
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||||
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||||
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||||
# -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading
|
# -sMINIFY_HTML=0 # minify generated html from shell.html
|
||||||
# --profiling # include information for code profiling
|
# --profiling # include information for code profiling
|
||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
# --source-map-base # allow debugging in browser with source map
|
# --source-map-base # allow debugging in browser with source map
|
||||||
LDFLAGS += -sUSE_GLFW=3 -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1
|
# --shell-file shell.html # define a custom shell .html and output extension
|
||||||
|
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sEXPORTED_RUNTIME_METHODS=ccall -sMINIFY_HTML=0
|
||||||
|
|
||||||
|
# Using GLFW3 library (instead of RGFW)
|
||||||
|
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
||||||
|
LDFLAGS += -sUSE_GLFW=3
|
||||||
|
endif
|
||||||
|
|
||||||
# Build using asyncify
|
# Build using asyncify
|
||||||
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||||
LDFLAGS += -sASYNCIFY
|
LDFLAGS += -sASYNCIFY
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0)
|
||||||
|
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
|
||||||
|
ifeq ($(BUILD_WEB_WEBGL2),TRUE)
|
||||||
|
LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
|
||||||
|
endif
|
||||||
|
|
||||||
# Add resources building if required
|
# Add resources building if required
|
||||||
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
|
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
|
||||||
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
|
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
|
||||||
@ -467,7 +480,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
|
|||||||
# NOTE: Required packages: libegl1-mesa-dev
|
# NOTE: Required packages: libegl1-mesa-dev
|
||||||
LDFLAGS += -L../src
|
LDFLAGS += -L../src
|
||||||
LDLIBS = -lraylib -lm
|
LDLIBS = -lraylib -lm
|
||||||
LDLIBS += -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
|
LDLIBS += -framework Foundation -framework AppKit -framework IOKit -framework OpenGL -framework CoreVideo
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||||
@ -475,13 +488,16 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
|||||||
# NOTE: Required packages: libasound2-dev (ALSA)
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
|
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||||
|
|
||||||
# Define source code object files required
|
# Define source code object files required
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
|
#EXAMPLES_LIST_START
|
||||||
CORE = \
|
CORE = \
|
||||||
core/core_2d_camera \
|
core/core_2d_camera \
|
||||||
core/core_2d_camera_mouse_zoom \
|
core/core_2d_camera_mouse_zoom \
|
||||||
@ -491,6 +507,7 @@ CORE = \
|
|||||||
core/core_3d_camera_free \
|
core/core_3d_camera_free \
|
||||||
core/core_3d_camera_mode \
|
core/core_3d_camera_mode \
|
||||||
core/core_3d_camera_split_screen \
|
core/core_3d_camera_split_screen \
|
||||||
|
core/core_3d_fps_controller \
|
||||||
core/core_3d_picking \
|
core/core_3d_picking \
|
||||||
core/core_automation_events \
|
core/core_automation_events \
|
||||||
core/core_basic_screen_manager \
|
core/core_basic_screen_manager \
|
||||||
@ -499,8 +516,8 @@ CORE = \
|
|||||||
core/core_custom_frame_control \
|
core/core_custom_frame_control \
|
||||||
core/core_custom_logging \
|
core/core_custom_logging \
|
||||||
core/core_drop_files \
|
core/core_drop_files \
|
||||||
|
core/core_high_dpi \
|
||||||
core/core_input_gamepad \
|
core/core_input_gamepad \
|
||||||
core/core_input_gamepad_info \
|
|
||||||
core/core_input_gestures \
|
core/core_input_gestures \
|
||||||
core/core_input_gestures_web \
|
core/core_input_gestures_web \
|
||||||
core/core_input_keys \
|
core/core_input_keys \
|
||||||
@ -525,6 +542,8 @@ SHAPES = \
|
|||||||
shapes/shapes_bouncing_ball \
|
shapes/shapes_bouncing_ball \
|
||||||
shapes/shapes_collision_area \
|
shapes/shapes_collision_area \
|
||||||
shapes/shapes_colors_palette \
|
shapes/shapes_colors_palette \
|
||||||
|
shapes/shapes_digital_clock \
|
||||||
|
shapes/shapes_double_pendulum \
|
||||||
shapes/shapes_draw_circle_sector \
|
shapes/shapes_draw_circle_sector \
|
||||||
shapes/shapes_draw_rectangle_rounded \
|
shapes/shapes_draw_rectangle_rounded \
|
||||||
shapes/shapes_draw_ring \
|
shapes/shapes_draw_ring \
|
||||||
@ -535,10 +554,10 @@ SHAPES = \
|
|||||||
shapes/shapes_lines_bezier \
|
shapes/shapes_lines_bezier \
|
||||||
shapes/shapes_logo_raylib \
|
shapes/shapes_logo_raylib \
|
||||||
shapes/shapes_logo_raylib_anim \
|
shapes/shapes_logo_raylib_anim \
|
||||||
|
shapes/shapes_rectangle_advanced \
|
||||||
shapes/shapes_rectangle_scaling \
|
shapes/shapes_rectangle_scaling \
|
||||||
shapes/shapes_splines_drawing \
|
shapes/shapes_splines_drawing \
|
||||||
shapes/shapes_top_down_lights \
|
shapes/shapes_top_down_lights
|
||||||
shapes/shapes_rectangle_advanced
|
|
||||||
|
|
||||||
TEXTURES = \
|
TEXTURES = \
|
||||||
textures/textures_background_scrolling \
|
textures/textures_background_scrolling \
|
||||||
@ -580,6 +599,7 @@ TEXT = \
|
|||||||
text/text_raylib_fonts \
|
text/text_raylib_fonts \
|
||||||
text/text_rectangle_bounds \
|
text/text_rectangle_bounds \
|
||||||
text/text_unicode \
|
text/text_unicode \
|
||||||
|
text/text_unicode_ranges \
|
||||||
text/text_writing_anim
|
text/text_writing_anim
|
||||||
|
|
||||||
MODELS = \
|
MODELS = \
|
||||||
@ -591,6 +611,7 @@ MODELS = \
|
|||||||
models/models_draw_cube_texture \
|
models/models_draw_cube_texture \
|
||||||
models/models_first_person_maze \
|
models/models_first_person_maze \
|
||||||
models/models_geometric_shapes \
|
models/models_geometric_shapes \
|
||||||
|
models/models_gpu_skinning \
|
||||||
models/models_heightmap \
|
models/models_heightmap \
|
||||||
models/models_loading \
|
models/models_loading \
|
||||||
models/models_loading_gltf \
|
models/models_loading_gltf \
|
||||||
@ -602,9 +623,9 @@ MODELS = \
|
|||||||
models/models_point_rendering \
|
models/models_point_rendering \
|
||||||
models/models_rlgl_solar_system \
|
models/models_rlgl_solar_system \
|
||||||
models/models_skybox \
|
models/models_skybox \
|
||||||
|
models/models_tesseract_view \
|
||||||
models/models_waving_cubes \
|
models/models_waving_cubes \
|
||||||
models/models_yaw_pitch_roll \
|
models/models_yaw_pitch_roll
|
||||||
models/models_gpu_skinning
|
|
||||||
|
|
||||||
SHADERS = \
|
SHADERS = \
|
||||||
shaders/shaders_basic_lighting \
|
shaders/shaders_basic_lighting \
|
||||||
@ -620,9 +641,11 @@ SHADERS = \
|
|||||||
shaders/shaders_mesh_instancing \
|
shaders/shaders_mesh_instancing \
|
||||||
shaders/shaders_model_shader \
|
shaders/shaders_model_shader \
|
||||||
shaders/shaders_multi_sample2d \
|
shaders/shaders_multi_sample2d \
|
||||||
|
shaders/shaders_normal_map \
|
||||||
shaders/shaders_palette_switch \
|
shaders/shaders_palette_switch \
|
||||||
shaders/shaders_postprocessing \
|
shaders/shaders_postprocessing \
|
||||||
shaders/shaders_raymarching \
|
shaders/shaders_raymarching \
|
||||||
|
shaders/shaders_rounded_rectangle \
|
||||||
shaders/shaders_shadowmap \
|
shaders/shaders_shadowmap \
|
||||||
shaders/shaders_shapes_textures \
|
shaders/shaders_shapes_textures \
|
||||||
shaders/shaders_simple_mask \
|
shaders/shaders_simple_mask \
|
||||||
@ -631,8 +654,9 @@ SHADERS = \
|
|||||||
shaders/shaders_texture_outline \
|
shaders/shaders_texture_outline \
|
||||||
shaders/shaders_texture_tiling \
|
shaders/shaders_texture_tiling \
|
||||||
shaders/shaders_texture_waves \
|
shaders/shaders_texture_waves \
|
||||||
shaders/shaders_write_depth \
|
shaders/shaders_vertex_displacement \
|
||||||
shaders/shaders_vertex_displacement
|
shaders/shaders_view_depth \
|
||||||
|
shaders/shaders_write_depth
|
||||||
|
|
||||||
AUDIO = \
|
AUDIO = \
|
||||||
audio/audio_mixed_processor \
|
audio/audio_mixed_processor \
|
||||||
@ -641,6 +665,7 @@ AUDIO = \
|
|||||||
audio/audio_raw_stream \
|
audio/audio_raw_stream \
|
||||||
audio/audio_sound_loading \
|
audio/audio_sound_loading \
|
||||||
audio/audio_sound_multi \
|
audio/audio_sound_multi \
|
||||||
|
audio/audio_sound_positioning \
|
||||||
audio/audio_stream_effects
|
audio/audio_stream_effects
|
||||||
|
|
||||||
OTHERS = \
|
OTHERS = \
|
||||||
@ -648,19 +673,14 @@ OTHERS = \
|
|||||||
others/embedded_files_loading \
|
others/embedded_files_loading \
|
||||||
others/raylib_opengl_interop \
|
others/raylib_opengl_interop \
|
||||||
others/raymath_vector_angle \
|
others/raymath_vector_angle \
|
||||||
others/rlgl_compute_shader
|
others/rlgl_compute_shader \
|
||||||
|
others/rlgl_standalone
|
||||||
ifeq ($(TARGET_PLATFORM), PLATFORM_DESKTOP_GFLW)
|
#EXAMPLES_LIST_END
|
||||||
OTHERS += others/rlgl_standalone
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
|
||||||
|
|
||||||
# Define processes to execute
|
# Define processes to execute
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
# Default target entry
|
# Default target entry
|
||||||
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO) $(OTHERS)
|
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
|
||||||
|
|
||||||
core: $(CORE)
|
core: $(CORE)
|
||||||
shapes: $(SHAPES)
|
shapes: $(SHAPES)
|
||||||
@ -669,14 +689,13 @@ text: $(TEXT)
|
|||||||
models: $(MODELS)
|
models: $(MODELS)
|
||||||
shaders: $(SHADERS)
|
shaders: $(SHADERS)
|
||||||
audio: $(AUDIO)
|
audio: $(AUDIO)
|
||||||
others: $(OTHERS)
|
|
||||||
|
|
||||||
# Generic compilation pattern
|
# Generic compilation pattern
|
||||||
# NOTE: Examples must be ready for Android compilation!
|
# NOTE: Examples must be ready for Android compilation!
|
||||||
%: %.c
|
%: %.c
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||||
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
|
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
|
||||||
else ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
else ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
$(MAKE) -f Makefile.Web $@
|
$(MAKE) -f Makefile.Web $@
|
||||||
else
|
else
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -D$(TARGET_PLATFORM)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -D$(TARGET_PLATFORM)
|
||||||
@ -705,7 +724,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
|||||||
find . -type f -executable -delete
|
find . -type f -executable -delete
|
||||||
rm -fv *.o
|
rm -fv *.o
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
del *.wasm *.html *.js *.data
|
del *.wasm *.html *.js *.data
|
||||||
else
|
else
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# raylib makefile for Android project (APK building)
|
# raylib makefile for Android project (APK building)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017-2024 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2017-2025 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@ -16,194 +16,225 @@ You may find it easier to use than other toolchains, especially when it comes to
|
|||||||
- `zig build [module]` to compile all examples for a module (e.g. `zig build core`)
|
- `zig build [module]` to compile all examples for a module (e.g. `zig build core`)
|
||||||
- `zig build [example]` to compile _and run_ a particular example (e.g. `zig build core_basic_window`)
|
- `zig build [example]` to compile _and run_ a particular example (e.g. `zig build core_basic_window`)
|
||||||
|
|
||||||
## EXAMPLES LIST
|
## EXAMPLES COLLECTION [TOTAL: 162]
|
||||||
|
|
||||||
### category: core
|
### category: core [37]
|
||||||
|
|
||||||
Examples using raylib core platform functionality like window creation, inputs, drawing modes and system functionality.
|
Examples using raylib[core](../src/rcore.c) platform functionality like window creation, inputs, drawing modes and system functionality.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 01 | [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
| [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 02 | [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
| [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 03 | [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="80"> | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="80"> | ⭐☆☆☆ | 1.0 | 5.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 04 | [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="80"> | ⭐️☆☆☆ | 1.1 | 1.3 | [Ray](https://github.com/raysan5) |
|
| [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="80"> | ⭐☆☆☆ | 1.1 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 05 | [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="80"> | ⭐️☆☆☆ | 1.1 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="80"> | ⭐☆☆☆ | 1.1 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 06 | [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="80"> | ⭐️☆☆☆ | 2.1 | 2.5 | [Berni](https://github.com/Berni8k) |
|
| [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="80"> | ⭐☆☆☆ | 2.1 | 2.5 | [Berni](https://github.com/Berni8k) |
|
||||||
| 07 | [core_input_gestures](core/core_input_gestures.c) | <img src="core/core_input_gestures.png" alt="core_input_gestures" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [core_input_gestures](core/core_input_gestures.c) | <img src="core/core_input_gestures.png" alt="core_input_gestures" width="80"> | ⭐⭐☆☆ | 1.4 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 08 | [core_input_virtual_controls](core/core_input_virtual_controls.c) | <img src="core/core_input_virtual_controls.png" alt="core_input_virtual_controls" width="80"> | ⭐️⭐️☆☆ | **5.0** | **5.0** | [oblerion](https://github.com/oblerion) |
|
| [core_input_virtual_controls](core/core_input_virtual_controls.c) | <img src="core/core_input_virtual_controls.png" alt="core_input_virtual_controls" width="80"> | ⭐⭐☆☆ | 5.0 | 5.0 | [oblerion](https://github.com/oblerion) |
|
||||||
| 09 | [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="80"> | ⭐️⭐️☆☆ | 1.5 | 3.0 | [Ray](https://github.com/raysan5) |
|
| [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="80"> | ⭐⭐☆☆ | 1.5 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 10 | [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | <img src="core/core_2d_camera_mouse_zoom.png" alt="core_2d_camera_mouse_zoom" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
|
| [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | <img src="core/core_2d_camera_mouse_zoom.png" alt="core_2d_camera_mouse_zoom" width="80"> | ⭐⭐☆☆ | 4.2 | 4.2 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
| 11 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [avyy](https://github.com/avyy) |
|
| [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.0 | [arvyy](https://github.com/arvyy) |
|
||||||
| 12 | [core_2d_camera_split_screen](core/core_2d_camera_split_screen.c) | <img src="core/core_2d_camera_split_screen.png" alt="core_2d_camera_split_screen" width="80"> | ⭐️⭐️⭐️⭐️ | **4.5** | **4.5** | [Gabriel dos Santos Sanches](https://github.com/gabrielssanches) |
|
| [core_2d_camera_split_screen](core/core_2d_camera_split_screen.c) | <img src="core/core_2d_camera_split_screen.png" alt="core_2d_camera_split_screen" width="80"> | ⭐⭐⭐⭐️ | 4.5 | 4.5 | [Gabriel dos Santos Sanches](https://github.com/gabrielssanches) |
|
||||||
| 13 | [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
| [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 14 | [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
| [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="80"> | ⭐☆☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 15 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
| [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="80"> | ⭐⭐☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 16 | [core_3d_camera:split_screen](core/core_3d_camera_split_screen.c) | <img src="core/core_3d_camera_split_screen.png" alt="core_3d_camera_split_screen" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.0** | [Jeffery Myers](https://github.com/JeffM2501) |
|
| [core_3d_camera_split_screen](core/core_3d_camera_split_screen.c) | <img src="core/core_3d_camera_split_screen.png" alt="core_3d_camera_split_screen" width="80"> | ⭐⭐⭐☆ | 3.7 | 4.0 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
| 17 | [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [core_3d_fps_controller](core/core_3d_fps_controller.c) | <img src="core/core_3d_fps_controller.png" alt="core_3d_fps_controller" width="80"> | ⭐⭐⭐☆ | 5.5 | 5.5 | [Agnis Aldins](https://github.com/nezvers) |
|
||||||
| 18 | [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.4 | [Ray](https://github.com/raysan5) |
|
| [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="80"> | ⭐⭐☆☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 19 | [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) |
|
| [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="80"> | ⭐⭐☆☆ | 1.3 | 1.4 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 20 | [core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="80"> | ⭐️⭐️⭐️☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) |
|
||||||
| 21 | [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Anata](https://github.com/anatagawa) |
|
| [core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="80"> | ⭐⭐⭐☆ | 3.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 22 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
| [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="80"> | ⭐⭐☆☆ | 2.5 | 4.0 | [Anata](https://github.com/anatagawa) |
|
||||||
| 23 | [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐☆☆☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 24 | [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="80"> | ⭐️☆☆☆ | 1.1 | 1.1 | [Ray](https://github.com/raysan5) |
|
| [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="80"> | ⭐⭐☆☆ | 1.3 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 25 | [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="80"> | ⭐☆☆☆ | 1.1 | 1.1 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 26 | [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="80"> | ⭐⭐☆☆ | 1.4 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 27 | [core_loading_thread](core/core_loading_thread.c) | <img src="core/core_loading_thread.png" alt="core_loading_thread" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [Ray](https://github.com/raysan5) |
|
| [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="80"> | ⭐⭐⭐☆ | 2.5 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 28 | [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="80"> | ⭐️☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
|
| [core_loading_thread](core/core_loading_thread.c) | <img src="core/core_loading_thread.png" alt="core_loading_thread" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 29 | [core_basic_screen_manager](core/core_basic_screen_manager.c) | <img src="core/core_basic_screen_manager.png" alt="core_basic_screen_manager" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
|
| [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="80"> | ⭐☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
|
||||||
| 30 | [core_custom_frame_control](core/core_custom_frame_control.c) | <img src="core/core_custom_frame_control.png" alt="core_custom_frame_control" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
|
| [core_basic_screen_manager](core/core_basic_screen_manager.c) | <img src="core/core_basic_screen_manager.png" alt="core_basic_screen_manager" width="80"> | ⭐☆☆☆ | 4.0 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 31 | [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | <img src="core/core_smooth_pixelperfect.png" alt="core_smooth_pixelperfect" width="80"> | ⭐️⭐️⭐️☆ | 3.7 | **4.0** | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) |
|
| [core_custom_frame_control](core/core_custom_frame_control.c) | <img src="core/core_custom_frame_control.png" alt="core_custom_frame_control" width="80"> | ⭐⭐⭐⭐️ | 4.0 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 32 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
| [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | <img src="core/core_smooth_pixelperfect.png" alt="core_smooth_pixelperfect" width="80"> | ⭐⭐⭐☆ | 3.7 | 4.0 | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) |
|
||||||
| 33 | [core_random_sequence](core/core_random_sequence.c) | <img src="core/core_random_sequence.png" alt="core_random_sequence" width="80"> | ⭐️☆☆☆ | **5.0** | **5.0** | [REDl3east](https://github.com/REDl3east) |
|
| [core_random_sequence](core/core_random_sequence.c) | <img src="core/core_random_sequence.png" alt="core_random_sequence" width="80"> | ⭐☆☆☆ | 5.0 | 5.0 | [Dalton Overmyer](https://github.com/REDl3east) |
|
||||||
|
| [core_basic_window_web](core/core_basic_window_web.c) | <img src="core/core_basic_window_web.png" alt="core_basic_window_web" width="80"> | ⭐☆☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [core_input_gestures_web](core/core_input_gestures_web.c) | <img src="core/core_input_gestures_web.png" alt="core_input_gestures_web" width="80"> | ⭐⭐☆☆ | 4.6 | 4.6 | [ubkp](https://github.com/ubkp) |
|
||||||
|
| [core_automation_events](core/core_automation_events.c) | <img src="core/core_automation_events.png" alt="core_automation_events" width="80"> | ⭐⭐⭐☆ | 5.0 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [core_high_dpi](core/core_high_dpi.c) | <img src="core/core_high_dpi.png" alt="core_high_dpi" width="80"> | ⭐☆☆☆ | 5.0 | 5.0 | [Jonathan Marler](https://github.com/marler8997) |
|
||||||
|
|
||||||
### category: shapes
|
### category: shapes [20]
|
||||||
|
|
||||||
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/shapes.c) module.
|
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/rshapes.c) module.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 34 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="80"> | ⭐☆☆☆ | 1.0 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 35 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="80"> | ⭐️☆☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="80"> | ⭐☆☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 36 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="80"> | ⭐️⭐️☆☆ | 1.0 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="80"> | ⭐⭐☆☆ | 1.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 37 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
| [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 38 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="80"> | ⭐⭐☆☆ | 2.5 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 39 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
| [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 40 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="80"> | ⭐️☆☆☆ | 1.7 | 1.7 | [Ray](https://github.com/raysan5) |
|
| [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="80"> | ⭐☆☆☆ | 1.7 | 1.7 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 41 | [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 42 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 43 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 44 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 45 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="80"> | ⭐⭐⭐☆ | 2.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 46 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
| [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 47 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
| [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 48 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
| [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="80"> | ⭐⭐⭐☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 49 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | <img src="shapes/shapes_top_down_lights.png" alt="shapes_top_down_lights" width="80"> | ⭐️⭐️⭐️⭐️ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
|
| [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | <img src="shapes/shapes_top_down_lights.png" alt="shapes_top_down_lights" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 4.2 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
| 50 | [shapes_rectangle_advanced](shapes/shapes_rectangle_advanced.c) | <img src="shapes/shapes_rectangle_advanced.png" alt="shapes_rectangle_advanced" width="80"> | ⭐️⭐️⭐️⭐️⭐️| **5.0** | **5.0** | [ExCyber](https://github.com/evertonse) |
|
| [shapes_rectangle_advanced](shapes/shapes_rectangle_advanced.c) | <img src="shapes/shapes_rectangle_advanced.png" alt="shapes_rectangle_advanced" width="80"> | ⭐⭐⭐⭐️ | 5.5 | 5.5 | [Everton Jr.](https://github.com/evertonse) |
|
||||||
|
| [shapes_splines_drawing](shapes/shapes_splines_drawing.c) | <img src="shapes/shapes_splines_drawing.png" alt="shapes_splines_drawing" width="80"> | ⭐⭐⭐☆ | 5.0 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [shapes_digital_clock](shapes/shapes_digital_clock.c) | <img src="shapes/shapes_digital_clock.png" alt="shapes_digital_clock" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [Hamza RAHAL](https://github.com/rhmz-rhl) |
|
||||||
|
| [shapes_double_pendulum](shapes/shapes_double_pendulum.c) | <img src="shapes/shapes_double_pendulum.png" alt="shapes_double_pendulum" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [JoeCheong](https://github.com/Joecheong2006) |
|
||||||
|
|
||||||
### category: textures
|
### category: textures [26]
|
||||||
|
|
||||||
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/textures.c) module.
|
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/rtextures.c) module.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 51 | [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
| [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 52 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
| [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="80"> | ⭐⭐⭐☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 53 | [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
|
| [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="80"> | ⭐⭐☆☆ | 1.4 | 1.4 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 54 | [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | 1.8 | [Ray](https://github.com/raysan5) |
|
| [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="80"> | ⭐⭐☆☆ | 1.8 | 1.8 | [Wilhem Barbier](https://github.com/nounoursheureux) |
|
||||||
| 55 | [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
| [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="80"> | ⭐☆☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 56 | [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="80"> | ⭐️⭐️⭐️☆ | 1.4 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="80"> | ⭐⭐⭐☆ | 1.4 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 57 | [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 58 | [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="80"> | ⭐️☆☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="80"> | ⭐☆☆☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 59 | [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="80"> | ⭐⭐⭐☆ | 1.3 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 60 | [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="80"> | ⭐️☆☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="80"> | ⭐☆☆☆ | 1.7 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 61 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="80"> | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) |
|
| [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="80"> | ⭐⭐⭐☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) |
|
||||||
| 62 | [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="80"> | ⭐️☆☆☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="80"> | ⭐☆☆☆ | 2.0 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 63 | [textures_sprite_anim](textures/textures_sprite_anim.c) | <img src="textures/textures_sprite_anim.png" alt="textures_sprite_anim" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
|
| [textures_sprite_anim](textures/textures_sprite_anim.c) | <img src="textures/textures_sprite_anim.png" alt="textures_sprite_anim" width="80"> | ⭐⭐☆☆ | 1.3 | 1.3 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 64 | [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="80"> | ⭐⭐☆☆ | 2.5 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 65 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="80"> | ⭐⭐☆☆ | 2.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 66 | [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | 2.5 | [Ray](https://github.com/raysan5) |
|
| [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="80"> | ⭐⭐⭐☆ | 1.6 | 2.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 67 | [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
|
| [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="80"> | ⭐⭐⭐☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
|
||||||
| 68 | [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="80"> | ⭐️☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) |
|
| [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="80"> | ⭐☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) |
|
||||||
| 69 | [textures_draw_tiled](textures/textures_draw_tiled.c) | <img src="textures/textures_draw_tiled.png" alt="textures_draw_tiled" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) |
|
| [textures_draw_tiled](textures/textures_draw_tiled.c) | <img src="textures/textures_draw_tiled.png" alt="textures_draw_tiled" width="80"> | ⭐⭐⭐☆ | 3.0 | 4.2 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 70 | [textures_polygon](textures/textures_polygon.c) | <img src="textures/textures_polygon.png" alt="textures_polygon" width="80"> | ⭐️☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
| [textures_polygon](textures/textures_polygon.c) | <img src="textures/textures_polygon.png" alt="textures_polygon" width="80"> | ⭐☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
|
||||||
| 71 | [textures_fog_of_war](textures/textures_fog_of_war.c) | <img src="textures/textures_fog_of_war.png" alt="textures_fog_of_war" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
| [textures_fog_of_war](textures/textures_fog_of_war.c) | <img src="textures/textures_fog_of_war.png" alt="textures_fog_of_war" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 72 | [textures_gif_player](textures/textures_gif_player.c) | <img src="textures/textures_gif_player.png" alt="textures_gif_player" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
| [textures_gif_player](textures/textures_gif_player.c) | <img src="textures/textures_gif_player.png" alt="textures_gif_player" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [textures_image_kernel](textures/textures_image_kernel.c) | <img src="textures/textures_image_kernel.png" alt="textures_image_kernel" width="80"> | ⭐⭐⭐⭐️ | 1.3 | 1.3 | [Karim Salem](https://github.com/kimo-s) |
|
||||||
|
| [textures_image_channel](textures/textures_image_channel.c) | <img src="textures/textures_image_channel.png" alt="textures_image_channel" width="80"> | ⭐⭐☆☆ | 5.1 | 5.1 | [Bruno Cabral](https://github.com/brccabral) |
|
||||||
|
| [textures_image_rotate](textures/textures_image_rotate.c) | <img src="textures/textures_image_rotate.png" alt="textures_image_rotate" width="80"> | ⭐⭐☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [textures_textured_curve](textures/textures_textured_curve.c) | <img src="textures/textures_textured_curve.png" alt="textures_textured_curve" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
|
|
||||||
### category: text
|
### category: text [13]
|
||||||
|
|
||||||
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/text.c) module.
|
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/rtext.c) module.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 73 | [text_raylib_fonts](text/text_raylib_fonts.c) | <img src="text/text_raylib_fonts.png" alt="text_raylib_fonts" width="80"> | ⭐️☆☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
|
| [text_raylib_fonts](text/text_raylib_fonts.c) | <img src="text/text_raylib_fonts.png" alt="text_raylib_fonts" width="80"> | ⭐☆☆☆ | 1.7 | 3.7 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 74 | [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
|
| [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="80"> | ⭐☆☆☆ | 1.0 | 1.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 75 | [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="80"> | ⭐⭐☆☆ | 1.3 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 76 | [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="80"> | ⭐️☆☆☆ | 1.4 | 3.0 | [Ray](https://github.com/raysan5) |
|
| [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="80"> | ⭐☆☆☆ | 1.4 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 77 | [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="80"> | ⭐⭐⭐☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 78 | [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="80"> | ⭐️☆☆☆ | 1.1 | 3.0 | [Ray](https://github.com/raysan5) |
|
| [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="80"> | ⭐☆☆☆ | 1.1 | 3.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 79 | [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="80"> | ⭐⭐☆☆ | 1.7 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 80 | [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
|
| [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="80"> | ⭐⭐☆☆ | 1.4 | 1.4 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 81 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
|
| [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 82 | [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
|
| [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 83 | [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="80"> | ⭐️⭐️⭐️⭐️ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
|
| [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="80"> | ⭐⭐⭐⭐️ | 3.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
| 84 | [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
|
| [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐⭐⭐☆ | 4.2 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [text_unicode_ranges](text/text_unicode_ranges.c) | <img src="text/text_unicode_ranges.png" alt="text_unicode_ranges" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Vlad Adrian](https://github.com/demizdor) |
|
||||||
|
|
||||||
### category: models
|
### category: models [23]
|
||||||
|
|
||||||
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/models.c) module.
|
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/rmodels.c) module.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 85 | [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [culacant](https://github.com/culacant) |
|
| [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="80"> | ⭐⭐☆☆ | 2.5 | 3.5 | [Culacant](https://github.com/culacant) |
|
||||||
| 86 | [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="80"> | ⭐⭐⭐☆ | 1.3 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 87 | [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="80"> | ⭐️☆☆☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="80"> | ⭐☆☆☆ | 1.3 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 88 | [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="80"> | ⭐️⭐️☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="80"> | ⭐⭐☆☆ | 1.8 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 89 | [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="80"> | ⭐⭐☆☆ | 2.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 90 | [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="80"> | ⭐☆☆☆ | 1.0 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 91 | [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 92 | [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="80"> | ⭐️⭐️⭐️☆ | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) |
|
| [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="80"> | ⭐⭐⭐☆ | 1.7 | 4.0 | [Joel Davis](https://github.com/joeld42) |
|
||||||
| 93 | [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="80"> | ⭐️☆☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="80"> | ⭐☆☆☆ | 2.0 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 94 | [models_loading_gltf](models/models_loading_gltf.c) | <img src="models/models_loading_gltf.png" alt="models_loading_gltf" width="80"> | ⭐️☆☆☆ | 3.7 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [models_loading_gltf](models/models_loading_gltf.c) | <img src="models/models_loading_gltf.png" alt="models_loading_gltf" width="80"> | ⭐☆☆☆ | 3.7 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 95 | [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) |
|
| [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐☆☆☆ | 4.0 | 4.0 | [Johann Nadalutti](https://github.com/procfxgen) |
|
||||||
| 96 | [models_loading_m3d](models/models_loading_m3d.c) | <img src="models/models_loading_m3d.png" alt="models_loading_m3d" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) |
|
| [models_loading_m3d](models/models_loading_m3d.c) | <img src="models/models_loading_m3d.png" alt="models_loading_m3d" width="80"> | ⭐⭐☆☆ | 4.5 | 4.5 | [bzt](https://github.com/model3d) |
|
||||||
| 97 | [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
|
| [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
|
||||||
| 98 | [models_point_rendering](models/models_point_rendering.c) | <img src="models/models_point_rendering.png" alt="models_point_rendering" width="80"> | ⭐️⭐️☆☆ | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) |
|
| [models_point_rendering](models/models_point_rendering.c) | <img src="models/models_point_rendering.png" alt="models_point_rendering" width="80"> | ⭐⭐⭐☆ | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) |
|
||||||
| 99 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐⭐⭐⭐️ | 2.5 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 100 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) |
|
| [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Berni](https://github.com/Berni8k) |
|
||||||
| 101 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) |
|
| [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.7 | [Codecat](https://github.com/codecat) |
|
||||||
| 102 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐☆☆☆ | 1.8 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 103 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐⭐☆☆ | 1.8 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [models_draw_cube_texture](models/models_draw_cube_texture.c) | <img src="models/models_draw_cube_texture.png" alt="models_draw_cube_texture" width="80"> | ⭐⭐☆☆ | 4.5 | 4.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [models_gpu_skinning](models/models_gpu_skinning.c) | <img src="models/models_gpu_skinning.png" alt="models_gpu_skinning" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Daniel Holden](https://github.com/orangeduck) |
|
||||||
|
| [models_bone_socket](models/models_bone_socket.c) | <img src="models/models_bone_socket.png" alt="models_bone_socket" width="80"> | ⭐⭐⭐⭐️ | 4.5 | 4.5 | [iP](https://github.com/ipzaur) |
|
||||||
|
| [models_tesseract_view](models/models_tesseract_view.c) | <img src="models/models_tesseract_view.png" alt="models_tesseract_view" width="80"> | ⭐⭐☆☆ | 5.6 | 5.6 | [Timothy van der Valk](https://github.com/arceryz) |
|
||||||
|
|
||||||
### category: shaders
|
### category: shaders [29]
|
||||||
|
|
||||||
Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.c) module.
|
Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.c) module.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 104 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) |
|
| [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐⭐⭐⭐️ | 3.0 | 4.2 | [Chris Camacho](https://github.com/chriscamacho) |
|
||||||
| 105 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) |
|
| [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐⭐☆☆ | 1.3 | 3.7 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 106 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
|
| [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐⭐☆☆ | 1.7 | 3.7 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 107 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐⭐☆☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 108 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐⭐⭐☆ | 1.3 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 109 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
|
| [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
|
||||||
| 110 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐⭐⭐⭐️ | 2.0 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 111 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) |
|
| [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐⭐☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/ciessielski) |
|
||||||
| 112 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) |
|
| [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐⭐⭐☆ | 4.0 | 4.0 | [Samuel Skiff](https://github.com/GoldenThumbs) |
|
||||||
| 113 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
|
| [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐⭐☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
|
||||||
| 114 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) |
|
| [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐⭐⭐☆ | 2.5 | 4.0 | [Josh Colclough](https://github.com/joshcol9232) |
|
||||||
| 115 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) |
|
| [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐⭐⭐☆ | 2.5 | 4.0 | [ProfJski](https://github.com/ProfJski) |
|
||||||
| 116 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
| [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
|
||||||
| 117 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
| [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐⭐☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
|
||||||
| 118 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐⭐⭐☆ | 3.0 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 119 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) |
|
| [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐⭐⭐⭐️ | 3.7 | 4.2 | [seanpringle](https://github.com/seanpringle) |
|
||||||
| 120 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐⭐☆☆ | 3.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 121 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
| [shaders_normal_map](shaders/shaders_normal_map.c) | <img src="shaders/shaders_normal_map.png" alt="shaders_normal_map" width="80"> | ⭐⭐⭐⭐️ | 5.6 | 5.6 | [Jeremy Montgomery](https://github.com/Sir_Irk) |
|
||||||
| 122 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | <img src="shaders/shaders_deferred_render.png" alt="shaders_deferred_render" width="80"> | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) |
|
| [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐⭐☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/chriscamacho) |
|
||||||
|
| [shaders_deferred_render](shaders/shaders_deferred_render.c) | <img src="shaders/shaders_deferred_render.png" alt="shaders_deferred_render" width="80"> | ⭐⭐⭐⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) |
|
||||||
|
| [shaders_hybrid_render](shaders/shaders_hybrid_render.c) | <img src="shaders/shaders_hybrid_render.png" alt="shaders_hybrid_render" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 4.2 | [Buğra Alptekin Sarı](https://github.com/BugraAlptekinSari) |
|
||||||
|
| [shaders_texture_tiling](shaders/shaders_texture_tiling.c) | <img src="shaders/shaders_texture_tiling.png" alt="shaders_texture_tiling" width="80"> | ⭐⭐☆☆ | 4.5 | 4.5 | [Luis Almeida](https://github.com/luis605) |
|
||||||
|
| [shaders_shadowmap](shaders/shaders_shadowmap.c) | <img src="shaders/shaders_shadowmap.png" alt="shaders_shadowmap" width="80"> | ⭐⭐⭐⭐️ | 5.0 | 5.0 | [TheManTheMythTheGameDev](https://github.com/TheManTheMythTheGameDev) |
|
||||||
|
| [shaders_vertex_displacement](shaders/shaders_vertex_displacement.c) | <img src="shaders/shaders_vertex_displacement.png" alt="shaders_vertex_displacement" width="80"> | ⭐⭐⭐☆ | 5.0 | 4.5 | [Alex ZH](https://github.com/ZzzhHe) |
|
||||||
|
| [shaders_write_depth](shaders/shaders_write_depth.c) | <img src="shaders/shaders_write_depth.png" alt="shaders_write_depth" width="80"> | ⭐⭐☆☆ | 4.2 | 4.2 | [Buğra Alptekin Sarı](https://github.com/BugraAlptekinSari) |
|
||||||
|
| [shaders_basic_pbr](shaders/shaders_basic_pbr.c) | <img src="shaders/shaders_basic_pbr.png" alt="shaders_basic_pbr" width="80"> | ⭐⭐⭐⭐️ | 5.0 | 5.1 | [Afan OLOVCIC](https://github.com/_DevDad) |
|
||||||
|
| [shaders_lightmap](shaders/shaders_lightmap.c) | <img src="shaders/shaders_lightmap.png" alt="shaders_lightmap" width="80"> | ⭐⭐⭐☆ | 4.5 | 4.5 | [Jussi Viitala](https://github.com/nullstare) |
|
||||||
|
| [shaders_rounded_rectangle](shaders/shaders_rounded_rectangle.c) | <img src="shaders/shaders_rounded_rectangle.png" alt="shaders_rounded_rectangle" width="80"> | ⭐⭐⭐☆ | 5.5 | 5.5 | [Anstro Pleuton](https://github.com/anstropleuton) |
|
||||||
|
| [shaders_view_depth](shaders/shaders_view_depth.c) | <img src="shaders/shaders_view_depth.png" alt="shaders_view_depth" width="80"> | ⭐⭐⭐☆ | 5.6 | 5.6 | [Luís Almeida](https://github.com/luis605) |
|
||||||
|
|
||||||
### category: audio
|
### category: audio [8]
|
||||||
|
|
||||||
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib, check [raudio_standalone](others/raudio_standalone.c) example.
|
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 123 | [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="80"> | ⭐️☆☆☆ | 1.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="80"> | ⭐☆☆☆ | 1.5 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 124 | [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="80"> | ⭐️☆☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="80"> | ⭐☆☆☆ | 1.3 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 125 | [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | **4.2** | [Ray](https://github.com/raysan5) |
|
| [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="80"> | ⭐⭐⭐☆ | 1.6 | 4.2 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 126 | [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) |
|
| [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐☆☆☆ | 1.1 | 3.5 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [audio_mixed_processor](audio/audio_mixed_processor.c) | <img src="audio/audio_mixed_processor.png" alt="audio_mixed_processor" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 4.2 | [hkc](https://github.com/hatkidchan) |
|
||||||
|
| [audio_stream_effects](audio/audio_stream_effects.c) | <img src="audio/audio_stream_effects.png" alt="audio_stream_effects" width="80"> | ⭐⭐⭐⭐️ | 4.2 | 5.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
|
| [audio_sound_multi](audio/audio_sound_multi.c) | <img src="audio/audio_sound_multi.png" alt="audio_sound_multi" width="80"> | ⭐⭐☆☆ | 4.6 | 4.6 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||||
|
| [audio_sound_positioning](audio/audio_sound_positioning.c) | <img src="audio/audio_sound_positioning.png" alt="audio_sound_positioning" width="80"> | ⭐⭐☆☆ | 5.5 | 5.5 | [Le Juez Victor](https://github.com/Bigfoot71) |
|
||||||
|
|
||||||
### category: others
|
### category: others [6]
|
||||||
|
|
||||||
Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
|
Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
|
||||||
|
|
||||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
| example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
|-----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||||
| 127 | [rlgl_standalone](others/rlgl_standalone.c) | <img src="others/rlgl_standalone.png" alt="rlgl_standalone" width="80"> | ⭐️⭐️⭐️⭐️ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) |
|
| [rlgl_standalone](others/rlgl_standalone.c) | <img src="others/rlgl_standalone.png" alt="rlgl_standalone" width="80"> | ⭐⭐⭐⭐️ | 1.6 | 4.0 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
| 128 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | <img src="others/rlgl_compute_shader.png" alt="rlgl_compute_shader" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) |
|
| [rlgl_compute_shader](others/rlgl_compute_shader.c) | <img src="others/rlgl_compute_shader.png" alt="rlgl_compute_shader" width="80"> | ⭐⭐⭐⭐️ | 4.0 | 4.0 | [Teddy Astie](https://github.com/tsnake41) |
|
||||||
| 129 | [easings_testbed](others/easings_testbed.c) | <img src="others/easings_testbed.png" alt="easings_testbed" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) |
|
| [easings_testbed](others/easings_testbed.c) | <img src="others/easings_testbed.png" alt="easings_testbed" width="80"> | ⭐⭐⭐☆ | 2.5 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) |
|
||||||
| 130 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | <img src="others/raylib_opengl_interop.png" alt="raylib_opengl_interop" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) |
|
| [raylib_opengl_interop](others/raylib_opengl_interop.c) | <img src="others/raylib_opengl_interop.png" alt="raylib_opengl_interop" width="80"> | ⭐⭐⭐⭐️ | 3.8 | 4.0 | [Stephan Soller](https://github.com/arkanis) |
|
||||||
| 131 | [embedded_files_loading](others/embedded_files_loading.c) | <img src="others/embedded_files_loading.png" alt="embedded_files_loading" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) |
|
| [embedded_files_loading](others/embedded_files_loading.c) | <img src="others/embedded_files_loading.png" alt="embedded_files_loading" width="80"> | ⭐⭐☆☆ | 3.0 | 3.5 | [Kristian Holmgren](https://github.com/defutura) |
|
||||||
|
| [raymath_vector_angle](others/raymath_vector_angle.c) | <img src="others/raymath_vector_angle.png" alt="raymath_vector_angle" width="80"> | ⭐⭐☆☆ | 1.0 | 4.6 | [Ramon Santamaria](https://github.com/raysan5) |
|
||||||
As always contributions are welcome, feel free to send new examples! Here is an [examples template](examples_template.c) to start with!
|
|
||||||
|
|
||||||
|
Some example missing? As always, contributions are welcome, feel free to send new examples!
|
||||||
|
Here is an[examples template](examples_template.c) with instructions to start with!
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [audio] example - Mixed audio processing
|
* raylib [audio] example - mixed audio processing
|
||||||
|
*
|
||||||
|
* Example complexity rating: [★★★★] 4/4
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
*
|
*
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 hkc (@hatkidchan)
|
* Copyright (c) 2023-2025 hkc (@hatkidchan)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Module playing (streaming)
|
* raylib [audio] example - Module playing (streaming)
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.5, last time updated with raylib 3.5
|
* Example originally created with raylib 1.5, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Music playing (streaming)
|
* raylib [audio] example - Music playing (streaming)
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Raw audio streaming
|
* raylib [audio] example - Raw audio streaming
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.6, last time updated with raylib 4.2
|
* Example originally created with raylib 1.6, last time updated with raylib 4.2
|
||||||
*
|
*
|
||||||
* Example created by Ramon Santamaria (@raysan5) and reviewed by James Hofmann (@triplefox)
|
* Example created by Ramon Santamaria (@raysan5) and reviewed by James Hofmann (@triplefox)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -106,8 +108,6 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Sample mouse input.
|
|
||||||
mousePosition = GetMousePosition();
|
mousePosition = GetMousePosition();
|
||||||
|
|
||||||
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT))
|
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT))
|
||||||
@ -123,7 +123,7 @@ int main(void)
|
|||||||
// Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc.
|
// Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc.
|
||||||
if (frequency != oldFrequency)
|
if (frequency != oldFrequency)
|
||||||
{
|
{
|
||||||
// Compute wavelength. Limit size in both directions.
|
// Compute wavelength. Limit size in both directions
|
||||||
//int oldWavelength = waveLength;
|
//int oldWavelength = waveLength;
|
||||||
waveLength = (int)(22050/frequency);
|
waveLength = (int)(22050/frequency);
|
||||||
if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2;
|
if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2;
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Sound loading and playing
|
* raylib [audio] example - Sound loading and playing
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.1, last time updated with raylib 3.5
|
* Example originally created with raylib 1.1, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,17 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [audio] example - Playing sound multiple times
|
* raylib [audio] example - sound alias
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 4.6
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 4.6, last time updated with raylib 4.6
|
||||||
|
*
|
||||||
|
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 Jeffery Myers (@JeffM2501)
|
* Copyright (c) 2023-2025 Jeffery Myers (@JeffM2501)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -27,18 +31,18 @@ int main(void)
|
|||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [audio] example - playing sound multiple times");
|
InitWindow(screenWidth, screenHeight, "raylib [audio] example - sound alias");
|
||||||
|
|
||||||
InitAudioDevice(); // Initialize audio device
|
InitAudioDevice(); // Initialize audio device
|
||||||
|
|
||||||
// load the sound list
|
// Load audio file into the first slot as the 'source' sound,
|
||||||
soundArray[0] = LoadSound("resources/sound.wav"); // Load WAV audio file into the first slot as the 'source' sound
|
// this sound owns the sample data
|
||||||
// this sound owns the sample data
|
soundArray[0] = LoadSound("resources/sound.wav");
|
||||||
for (int i = 1; i < MAX_SOUNDS; i++)
|
|
||||||
{
|
// Load an alias of the sound into slots 1-9. These do not own the sound data, but can be played
|
||||||
soundArray[i] = LoadSoundAlias(soundArray[0]); // Load an alias of the sound into slots 1-9. These do not own the sound data, but can be played
|
for (int i = 1; i < MAX_SOUNDS; i++) soundArray[i] = LoadSoundAlias(soundArray[0]);
|
||||||
}
|
|
||||||
currentSound = 0; // set the sound list to the start
|
currentSound = 0; // Set the sound list to the start
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@ -50,14 +54,15 @@ int main(void)
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
if (IsKeyPressed(KEY_SPACE))
|
if (IsKeyPressed(KEY_SPACE))
|
||||||
{
|
{
|
||||||
PlaySound(soundArray[currentSound]); // play the next open sound slot
|
PlaySound(soundArray[currentSound]); // Play the next open sound slot
|
||||||
currentSound++; // increment the sound slot
|
currentSound++; // Increment the sound slot
|
||||||
if (currentSound >= MAX_SOUNDS) // if the sound slot is out of bounds, go back to 0
|
|
||||||
currentSound = 0;
|
|
||||||
|
|
||||||
// Note: a better way would be to look at the list for the first sound that is not playing and use that slot
|
// If the sound slot is out of bounds, go back to 0
|
||||||
|
if (currentSound >= MAX_SOUNDS) currentSound = 0;
|
||||||
|
|
||||||
|
// NOTE: Another approach would be to look at the list for the first sound
|
||||||
|
// that is not playing and use that slot
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@ -74,9 +79,8 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
for (int i = 1; i < MAX_SOUNDS; i++)
|
for (int i = 1; i < MAX_SOUNDS; i++) UnloadSoundAlias(soundArray[i]); // Unload sound aliases
|
||||||
UnloadSoundAlias(soundArray[i]); // Unload sound aliases
|
UnloadSound(soundArray[0]); // Unload source sound data
|
||||||
UnloadSound(soundArray[0]); // Unload source sound data
|
|
||||||
|
|
||||||
CloseAudioDevice(); // Close audio device
|
CloseAudioDevice(); // Close audio device
|
||||||
|
|
||||||
|
|||||||
123
examples/audio/audio_sound_positioning.c
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [audio] example - spatialized 3D sound
|
||||||
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 5.5, last time updated with raylib 5.5
|
||||||
|
*
|
||||||
|
* Example contributed by Le Juez Victor (@Bigfoot71) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2025 Le Juez Victor (@Bigfoot71)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include "raymath.h"
|
||||||
|
|
||||||
|
// Sound positioning function
|
||||||
|
static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [audio] example - spatialized 3D sound");
|
||||||
|
|
||||||
|
InitAudioDevice();
|
||||||
|
|
||||||
|
Sound sound = LoadSound("resources/coin.wav");
|
||||||
|
|
||||||
|
Camera camera = {
|
||||||
|
.position = (Vector3) { 0, 5, 5 },
|
||||||
|
.target = (Vector3) { 0, 0, 0 },
|
||||||
|
.up = (Vector3) { 0, 1, 0 },
|
||||||
|
.fovy = 60,
|
||||||
|
.projection = CAMERA_PERSPECTIVE
|
||||||
|
};
|
||||||
|
|
||||||
|
DisableCursor();
|
||||||
|
|
||||||
|
SetTargetFPS(60);
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose())
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
UpdateCamera(&camera, CAMERA_FREE);
|
||||||
|
|
||||||
|
float th = GetTime();
|
||||||
|
|
||||||
|
Vector3 spherePos = {
|
||||||
|
.x = 5.0f*cosf(th),
|
||||||
|
.y = 0.0f,
|
||||||
|
.z = 5.0f*sinf(th)
|
||||||
|
};
|
||||||
|
|
||||||
|
SetSoundPosition(camera, sound, spherePos, 20.0f);
|
||||||
|
if (!IsSoundPlaying(sound)) PlaySound(sound);
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
BeginMode3D(camera);
|
||||||
|
DrawGrid(10, 2);
|
||||||
|
DrawSphere(spherePos, 0.5f, RED);
|
||||||
|
EndMode3D();
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadSound(sound);
|
||||||
|
CloseAudioDevice(); // Close audio device
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sound positioning function
|
||||||
|
static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist)
|
||||||
|
{
|
||||||
|
// Calculate direction vector and distance between listener and sound source
|
||||||
|
Vector3 direction = Vector3Subtract(position, listener.position);
|
||||||
|
float distance = Vector3Length(direction);
|
||||||
|
|
||||||
|
// Apply logarithmic distance attenuation and clamp between 0-1
|
||||||
|
float attenuation = 1.0f/(1.0f + (distance/maxDist));
|
||||||
|
attenuation = Clamp(attenuation, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
// Calculate normalized vectors for spatial positioning
|
||||||
|
Vector3 normalizedDirection = Vector3Normalize(direction);
|
||||||
|
Vector3 forward = Vector3Normalize(Vector3Subtract(listener.target, listener.position));
|
||||||
|
Vector3 right = Vector3Normalize(Vector3CrossProduct(listener.up, forward));
|
||||||
|
|
||||||
|
// Reduce volume for sounds behind the listener
|
||||||
|
float dotProduct = Vector3DotProduct(forward, normalizedDirection);
|
||||||
|
if (dotProduct < 0.0f) attenuation *= (1.0f + dotProduct*0.5f);
|
||||||
|
|
||||||
|
// Set stereo panning based on sound position relative to listener
|
||||||
|
float pan = 0.5f + 0.5f*Vector3DotProduct(normalizedDirection, right);
|
||||||
|
|
||||||
|
// Apply final sound properties
|
||||||
|
SetSoundVolume(sound, attenuation);
|
||||||
|
SetSoundPan(sound, pan);
|
||||||
|
}
|
||||||
BIN
examples/audio/audio_sound_positioning.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [audio] example - Music stream processing effects
|
* raylib [audio] example - Music stream processing effects
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★★] 4/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 4.2, last time updated with raylib 5.0
|
* Example originally created with raylib 4.2, last time updated with raylib 5.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2022-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2022-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -1,110 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
const builtin = @import("builtin");
|
|
||||||
|
|
||||||
// This has been tested to work with zig 0.12.0
|
|
||||||
fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) !*std.Build.Step {
|
|
||||||
if (target.result.os.tag == .emscripten) {
|
|
||||||
@panic("Emscripten building via Zig unsupported");
|
|
||||||
}
|
|
||||||
|
|
||||||
const all = b.step(module, "All " ++ module ++ " examples");
|
|
||||||
var dir = try std.fs.cwd().openDir(module, .{ .iterate = true });
|
|
||||||
defer if (comptime builtin.zig_version.minor >= 12) dir.close();
|
|
||||||
|
|
||||||
var iter = dir.iterate();
|
|
||||||
while (try iter.next()) |entry| {
|
|
||||||
if (entry.kind != .file) continue;
|
|
||||||
const extension_idx = std.mem.lastIndexOf(u8, entry.name, ".c") orelse continue;
|
|
||||||
const name = entry.name[0..extension_idx];
|
|
||||||
const path = try std.fs.path.join(b.allocator, &.{ module, entry.name });
|
|
||||||
|
|
||||||
// zig's mingw headers do not include pthread.h
|
|
||||||
if (std.mem.eql(u8, "core_loading_thread", name) and target.result.os.tag == .windows) continue;
|
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
|
||||||
.name = name,
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
});
|
|
||||||
exe.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
|
|
||||||
exe.linkLibC();
|
|
||||||
exe.addObjectFile(switch (target.result.os.tag) {
|
|
||||||
.windows => b.path("../zig-out/lib/raylib.lib"),
|
|
||||||
.linux => b.path("../zig-out/lib/libraylib.a"),
|
|
||||||
.macos => b.path("../zig-out/lib/libraylib.a"),
|
|
||||||
.emscripten => b.path("../zig-out/lib/libraylib.a"),
|
|
||||||
else => @panic("Unsupported OS"),
|
|
||||||
});
|
|
||||||
|
|
||||||
exe.addIncludePath(b.path("../src"));
|
|
||||||
exe.addIncludePath(b.path("../src/external"));
|
|
||||||
exe.addIncludePath(b.path("../src/external/glfw/include"));
|
|
||||||
|
|
||||||
switch (target.result.os.tag) {
|
|
||||||
.windows => {
|
|
||||||
exe.linkSystemLibrary("winmm");
|
|
||||||
exe.linkSystemLibrary("gdi32");
|
|
||||||
exe.linkSystemLibrary("opengl32");
|
|
||||||
|
|
||||||
exe.defineCMacro("PLATFORM_DESKTOP", null);
|
|
||||||
},
|
|
||||||
.linux => {
|
|
||||||
exe.linkSystemLibrary("GL");
|
|
||||||
exe.linkSystemLibrary("rt");
|
|
||||||
exe.linkSystemLibrary("dl");
|
|
||||||
exe.linkSystemLibrary("m");
|
|
||||||
exe.linkSystemLibrary("X11");
|
|
||||||
|
|
||||||
exe.defineCMacro("PLATFORM_DESKTOP", null);
|
|
||||||
},
|
|
||||||
.macos => {
|
|
||||||
exe.linkFramework("Foundation");
|
|
||||||
exe.linkFramework("Cocoa");
|
|
||||||
exe.linkFramework("OpenGL");
|
|
||||||
exe.linkFramework("CoreAudio");
|
|
||||||
exe.linkFramework("CoreVideo");
|
|
||||||
exe.linkFramework("IOKit");
|
|
||||||
|
|
||||||
exe.defineCMacro("PLATFORM_DESKTOP", null);
|
|
||||||
},
|
|
||||||
else => {
|
|
||||||
@panic("Unsupported OS");
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const install_cmd = b.addInstallArtifact(exe, .{});
|
|
||||||
|
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
|
||||||
run_cmd.cwd = b.path(module);
|
|
||||||
run_cmd.step.dependOn(&install_cmd.step);
|
|
||||||
|
|
||||||
const run_step = b.step(name, name);
|
|
||||||
run_step.dependOn(&run_cmd.step);
|
|
||||||
|
|
||||||
all.dependOn(&install_cmd.step);
|
|
||||||
}
|
|
||||||
return all;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
|
||||||
// Standard target options allows the person running `zig build` to choose
|
|
||||||
// what target to build for. Here we do not override the defaults, which
|
|
||||||
// means any target is allowed, and the default is native. Other options
|
|
||||||
// for restricting supported target set are available.
|
|
||||||
const target = b.standardTargetOptions(.{});
|
|
||||||
// Standard optimization options allow the person running `zig build` to select
|
|
||||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
|
|
||||||
// set a preferred release mode, allowing the user to decide how to optimize.
|
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
|
||||||
|
|
||||||
const all = b.getInstallStep();
|
|
||||||
|
|
||||||
all.dependOn(try add_module("audio", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("core", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("models", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("others", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("shaders", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("shapes", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("text", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("textures", b, target, optimize));
|
|
||||||
}
|
|
||||||
44
examples/build_example_web.bat
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
::@echo off
|
||||||
|
:: .
|
||||||
|
:: Compile your examples for web using: build_example_web.bat <example_category>/<example_name>
|
||||||
|
:: .
|
||||||
|
SET "INPUT_FILE=%1"
|
||||||
|
:: Change delimiter for the FOR loop
|
||||||
|
FOR /f "tokens=1-10 delims=/" %%a IN ("%INPUT_FILE%") DO (
|
||||||
|
SET CATEGORY=%%a
|
||||||
|
SET FILENAME=%%b
|
||||||
|
)
|
||||||
|
:: > SETup required Environment
|
||||||
|
:: -------------------------------------
|
||||||
|
SET RAYLIB_PATH=C:\GitHub\raylib
|
||||||
|
SET EMSDK_PATH=C:\raylib\emsdk
|
||||||
|
SET COMPILER_PATH=C:\raylib\w64devkit\bin
|
||||||
|
ENV_SET PATH=%COMPILER_PATH%
|
||||||
|
SET MAKE=mingw32-make
|
||||||
|
echo
|
||||||
|
:: Set required web compilation options
|
||||||
|
:: -------------------------------------
|
||||||
|
::SET CC=%EMSDK_PATH%\upstream\emscripten\emcc
|
||||||
|
::SET CFLAGS=-Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -O3 -I. -Iexternal -I%RAYLIB_PATH%\src -I%RAYLIB_PATH%\external -DPLATFORM_WEB
|
||||||
|
::SET LDFLAGS=-L. -L$(RAYLIB_PATH)\src -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall -sASYNCIFY --shell-file %RAYLIB_PATH%\src\shell.html
|
||||||
|
::SET LDLIBS=%RAYLIB_PATH%\src\libraylib.web.a
|
||||||
|
echo
|
||||||
|
:: Clean latest build
|
||||||
|
:: ------------------------
|
||||||
|
cmd /c if exist %FILENAME%.html del /F %FILENAME%.html
|
||||||
|
cmd /c if exist %FILENAME%.wasm del /F %FILENAME%.wasm
|
||||||
|
cmd /c if exist %FILENAME%.js del /F %FILENAME%.js
|
||||||
|
cmd /c if exist %FILENAME%.data del /F %FILENAME%.data
|
||||||
|
echo
|
||||||
|
:: Setup emsdk environment
|
||||||
|
:: --------------------------
|
||||||
|
call %EMSDK_PATH%\emsdk_env.bat
|
||||||
|
echo on
|
||||||
|
:: Compile program
|
||||||
|
:: -----------------------
|
||||||
|
C:
|
||||||
|
cd %RAYLIB_PATH%\examples
|
||||||
|
%MAKE% -f Makefile.Web %CATEGORY%/%FILENAME% PLATFORM=PLATFORM_WEB -B
|
||||||
|
::%CC% -o %FILENAME%.html %FILENAME%.c %CFLAGS% %LDFLAGS% %LDLIBS% %RESOURCES%
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
@ -2,16 +2,19 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 2D Camera system
|
* raylib [core] example - 2D Camera system
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.5, last time updated with raylib 3.0
|
* Example originally created with raylib 1.5, last time updated with raylib 3.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#define MAX_BUILDINGS 100
|
#define MAX_BUILDINGS 100
|
||||||
|
|
||||||
@ -42,7 +45,11 @@ int main(void)
|
|||||||
|
|
||||||
spacing += (int)buildings[i].width;
|
spacing += (int)buildings[i].width;
|
||||||
|
|
||||||
buildColors[i] = (Color){ GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255 };
|
buildColors[i] = (Color){
|
||||||
|
(unsigned char)GetRandomValue(200, 240),
|
||||||
|
(unsigned char)GetRandomValue(200, 240),
|
||||||
|
(unsigned char)GetRandomValue(200, 250),
|
||||||
|
255};
|
||||||
}
|
}
|
||||||
|
|
||||||
Camera2D camera = { 0 };
|
Camera2D camera = { 0 };
|
||||||
@ -75,7 +82,8 @@ int main(void)
|
|||||||
else if (camera.rotation < -40) camera.rotation = -40;
|
else if (camera.rotation < -40) camera.rotation = -40;
|
||||||
|
|
||||||
// Camera zoom controls
|
// Camera zoom controls
|
||||||
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
|
// Uses log scaling to provide consistent zoom speed
|
||||||
|
camera.zoom = expf(logf(camera.zoom) + ((float)GetMouseWheelMove()*0.1f));
|
||||||
|
|
||||||
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
||||||
else if (camera.zoom < 0.1f) camera.zoom = 0.1f;
|
else if (camera.zoom < 0.1f) camera.zoom = 0.1f;
|
||||||
|
|||||||
@ -2,12 +2,16 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 2d camera mouse zoom
|
* raylib [core] example - 2d camera mouse zoom
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
*
|
*
|
||||||
|
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2022-2024 Jeffery Myers (@JeffM2501)
|
* Copyright (c) 2022-2025 Jeffery Myers (@JeffM2501)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -69,9 +73,9 @@ int main ()
|
|||||||
camera.target = mouseWorldPos;
|
camera.target = mouseWorldPos;
|
||||||
|
|
||||||
// Zoom increment
|
// Zoom increment
|
||||||
float scaleFactor = 1.0f + (0.25f*fabsf(wheel));
|
// Uses log scaling to provide consistent zoom speed
|
||||||
if (wheel < 0) scaleFactor = 1.0f/scaleFactor;
|
float scale = 0.2f*wheel;
|
||||||
camera.zoom = Clamp(camera.zoom*scaleFactor, 0.125f, 64.0f);
|
camera.zoom = Clamp(expf(logf(camera.zoom)+scale), 0.125f, 64.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -92,10 +96,10 @@ int main ()
|
|||||||
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
||||||
{
|
{
|
||||||
// Zoom increment
|
// Zoom increment
|
||||||
|
// Uses log scaling to provide consistent zoom speed
|
||||||
float deltaX = GetMouseDelta().x;
|
float deltaX = GetMouseDelta().x;
|
||||||
float scaleFactor = 1.0f + (0.01f*fabsf(deltaX));
|
float scale = 0.005f*deltaX;
|
||||||
if (deltaX < 0) scaleFactor = 1.0f/scaleFactor;
|
camera.zoom = Clamp(expf(logf(camera.zoom)+scale), 0.125f, 64.0f);
|
||||||
camera.zoom = Clamp(camera.zoom*scaleFactor, 0.125f, 64.0f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 2D Camera platformer
|
* raylib [core] example - 2D Camera platformer
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
||||||
*
|
*
|
||||||
* Example contributed by arvyy (@arvyy) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by arvyy (@arvyy) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 arvyy (@arvyy)
|
* Copyright (c) 2019-2025 arvyy (@arvyy)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 2d camera split screen
|
* raylib [core] example - 2d camera split screen
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★★] 4/4
|
||||||
|
*
|
||||||
* Addapted from the core_3d_camera_split_screen example:
|
* Addapted from the core_3d_camera_split_screen example:
|
||||||
* https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_split_screen.c
|
* https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_camera_split_screen.c
|
||||||
*
|
*
|
||||||
@ -12,7 +14,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 Gabriel dos Santos Sanches (@gabrielssanches)
|
* Copyright (c) 2023-2025 Gabriel dos Santos Sanches (@gabrielssanches)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 3d camera first person
|
* raylib [core] example - 3d camera first person
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -115,7 +117,7 @@ int main(void)
|
|||||||
|
|
||||||
// Update camera computes movement internally depending on the camera mode
|
// Update camera computes movement internally depending on the camera mode
|
||||||
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
|
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
|
||||||
// For advance camera controls, it's reecommended to compute camera movement manually
|
// For advanced camera controls, it's recommended to compute camera movement manually
|
||||||
UpdateCamera(&camera, cameraMode); // Update camera
|
UpdateCamera(&camera, cameraMode); // Update camera
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Initialize 3d camera free
|
* raylib [core] example - Initialize 3d camera free
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
* Example originally created with raylib 1.3, last time updated with raylib 1.3
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Initialize 3d camera mode
|
* raylib [core] example - Initialize 3d camera mode
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - 3d cmaera split screen
|
* raylib [core] example - 3d cmaera split screen
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 3.7, last time updated with raylib 4.0
|
* Example originally created with raylib 3.7, last time updated with raylib 4.0
|
||||||
*
|
*
|
||||||
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021-2024 Jeffery Myers (@JeffM2501)
|
* Copyright (c) 2021-2025 Jeffery Myers (@JeffM2501)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ int main(void)
|
|||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// If anyone moves this frame, how far will they move based on the time since the last frame
|
// If anyone moves this frame, how far will they move based on the time since the last frame
|
||||||
// this moves thigns at 10 world units per second, regardless of the actual FPS
|
// this moves things at 10 world units per second, regardless of the actual FPS
|
||||||
float offsetThisFrame = 10.0f*GetFrameTime();
|
float offsetThisFrame = 10.0f*GetFrameTime();
|
||||||
|
|
||||||
// Move Player1 forward and backwards (no turning)
|
// Move Player1 forward and backwards (no turning)
|
||||||
|
|||||||
330
examples/core/core_3d_fps_controller.c
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - 3d first-person camera controller
|
||||||
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 5.5, last time updated with raylib 5.5
|
||||||
|
*
|
||||||
|
* Example contributed by Agnis Aldins (@nezvers) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2025-2025 Agnis Aldins (@nezvers)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#include "raymath.h"
|
||||||
|
#include "rcamera.h"
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Defines and Macros
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Movement constants
|
||||||
|
#define GRAVITY 32.0f
|
||||||
|
#define MAX_SPEED 20.0f
|
||||||
|
#define CROUCH_SPEED 5.0f
|
||||||
|
#define JUMP_FORCE 12.0f
|
||||||
|
#define MAX_ACCEL 150.0f
|
||||||
|
// Grounded drag
|
||||||
|
#define FRICTION 0.86f
|
||||||
|
// Increasing air drag, increases strafing speed
|
||||||
|
#define AIR_DRAG 0.98f
|
||||||
|
// Responsiveness for turning movement direction to looked direction
|
||||||
|
#define CONTROL 15.0f
|
||||||
|
#define CROUCH_HEIGHT 0.0f
|
||||||
|
#define STAND_HEIGHT 1.0f
|
||||||
|
#define BOTTOM_HEIGHT 0.5f
|
||||||
|
|
||||||
|
#define NORMALIZE_INPUT 0
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Types and Structures Definition
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Body structure
|
||||||
|
typedef struct {
|
||||||
|
Vector3 position;
|
||||||
|
Vector3 velocity;
|
||||||
|
Vector3 dir;
|
||||||
|
bool isGrounded;
|
||||||
|
} Body;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Global Variables Definition
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
static Vector2 sensitivity = { 0.001f, 0.001f };
|
||||||
|
|
||||||
|
static Body player = { 0 };
|
||||||
|
static Vector2 lookRotation = { 0 };
|
||||||
|
static float headTimer = 0.0f;
|
||||||
|
static float walkLerp = 0.0f;
|
||||||
|
static float headLerp = STAND_HEIGHT;
|
||||||
|
static Vector2 lean = { 0 };
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Module functions declaration
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
static void DrawLevel(void);
|
||||||
|
static void UpdateCameraAngle(Camera *camera);
|
||||||
|
static void UpdateBody(Body *body, float rot, char side, char forward, bool jumpPressed, bool crouchHold);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d first-person camera controller");
|
||||||
|
|
||||||
|
// Initialize camera variables
|
||||||
|
// NOTE: UpdateCameraAngle() takes care of the rest
|
||||||
|
Camera camera = { 0 };
|
||||||
|
camera.fovy = 60.0f;
|
||||||
|
camera.projection = CAMERA_PERSPECTIVE;
|
||||||
|
camera.position = (Vector3){
|
||||||
|
player.position.x,
|
||||||
|
player.position.y + (BOTTOM_HEIGHT + headLerp),
|
||||||
|
player.position.z,
|
||||||
|
};
|
||||||
|
|
||||||
|
UpdateCameraAngle(&camera); // Update camera parameters
|
||||||
|
|
||||||
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
Vector2 mouseDelta = GetMouseDelta();
|
||||||
|
lookRotation.x -= mouseDelta.x*sensitivity.x;
|
||||||
|
lookRotation.y += mouseDelta.y*sensitivity.y;
|
||||||
|
|
||||||
|
char sideway = (IsKeyDown(KEY_D) - IsKeyDown(KEY_A));
|
||||||
|
char forward = (IsKeyDown(KEY_W) - IsKeyDown(KEY_S));
|
||||||
|
bool crouching = IsKeyDown(KEY_LEFT_CONTROL);
|
||||||
|
UpdateBody(&player, lookRotation.x, sideway, forward, IsKeyPressed(KEY_SPACE), crouching);
|
||||||
|
|
||||||
|
float delta = GetFrameTime();
|
||||||
|
headLerp = Lerp(headLerp, (crouching ? CROUCH_HEIGHT : STAND_HEIGHT), 20.0f*delta);
|
||||||
|
camera.position = (Vector3){
|
||||||
|
player.position.x,
|
||||||
|
player.position.y + (BOTTOM_HEIGHT + headLerp),
|
||||||
|
player.position.z,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (player.isGrounded && ((forward != 0) || (sideway != 0)))
|
||||||
|
{
|
||||||
|
headTimer += delta*3.0f;
|
||||||
|
walkLerp = Lerp(walkLerp, 1.0f, 10.0f*delta);
|
||||||
|
camera.fovy = Lerp(camera.fovy, 55.0f, 5.0f*delta);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
walkLerp = Lerp(walkLerp, 0.0f, 10.0f*delta);
|
||||||
|
camera.fovy = Lerp(camera.fovy, 60.0f, 5.0f*delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
lean.x = Lerp(lean.x, sideway*0.02f, 10.0f*delta);
|
||||||
|
lean.y = Lerp(lean.y, forward*0.015f, 10.0f*delta);
|
||||||
|
|
||||||
|
UpdateCameraAngle(&camera);
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
BeginMode3D(camera);
|
||||||
|
DrawLevel();
|
||||||
|
EndMode3D();
|
||||||
|
|
||||||
|
// Draw info box
|
||||||
|
DrawRectangle(5, 5, 330, 75, Fade(SKYBLUE, 0.5f));
|
||||||
|
DrawRectangleLines(5, 5, 330, 75, BLUE);
|
||||||
|
|
||||||
|
DrawText("Camera controls:", 15, 15, 10, BLACK);
|
||||||
|
DrawText("- Move keys: W, A, S, D, Space, Left-Ctrl", 15, 30, 10, BLACK);
|
||||||
|
DrawText("- Look around: arrow keys or mouse", 15, 45, 10, BLACK);
|
||||||
|
DrawText(TextFormat("- Velocity Len: (%06.3f)", Vector2Length((Vector2){ player.velocity.x, player.velocity.z })), 15, 60, 10, BLACK);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Module functions definition
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
void UpdateBody(Body* body, float rot, char side, char forward, bool jumpPressed, bool crouchHold)
|
||||||
|
{
|
||||||
|
Vector2 input = (Vector2){ (float)side, (float)-forward };
|
||||||
|
|
||||||
|
#if defined(NORMALIZE_INPUT)
|
||||||
|
// Slow down diagonal movement
|
||||||
|
if ((side != 0) && (forward != 0)) input = Vector2Normalize(input);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
float delta = GetFrameTime();
|
||||||
|
|
||||||
|
if (!body->isGrounded) body->velocity.y -= GRAVITY*delta;
|
||||||
|
|
||||||
|
if (body->isGrounded && jumpPressed)
|
||||||
|
{
|
||||||
|
body->velocity.y = JUMP_FORCE;
|
||||||
|
body->isGrounded = false;
|
||||||
|
|
||||||
|
// Sound can be played at this moment
|
||||||
|
//SetSoundPitch(fxJump, 1.0f + (GetRandomValue(-100, 100)*0.001));
|
||||||
|
//PlaySound(fxJump);
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector3 front = (Vector3){ sin(rot), 0.f, cos(rot) };
|
||||||
|
Vector3 right = (Vector3){ cos(-rot), 0.f, sin(-rot) };
|
||||||
|
|
||||||
|
Vector3 desiredDir = (Vector3){ input.x*right.x + input.y*front.x, 0.0f, input.x*right.z + input.y*front.z, };
|
||||||
|
body->dir = Vector3Lerp(body->dir, desiredDir, CONTROL*delta);
|
||||||
|
|
||||||
|
float decel = (body->isGrounded ? FRICTION : AIR_DRAG);
|
||||||
|
Vector3 hvel = (Vector3){ body->velocity.x*decel, 0.0f, body->velocity.z*decel };
|
||||||
|
|
||||||
|
float hvelLength = Vector3Length(hvel); // Magnitude
|
||||||
|
if (hvelLength < (MAX_SPEED*0.01f)) hvel = (Vector3){ 0 };
|
||||||
|
|
||||||
|
// This is what creates strafing
|
||||||
|
float speed = Vector3DotProduct(hvel, body->dir);
|
||||||
|
|
||||||
|
// Whenever the amount of acceleration to add is clamped by the maximum acceleration constant,
|
||||||
|
// a Player can make the speed faster by bringing the direction closer to horizontal velocity angle
|
||||||
|
// More info here: https://youtu.be/v3zT3Z5apaM?t=165
|
||||||
|
float maxSpeed = (crouchHold? CROUCH_SPEED : MAX_SPEED);
|
||||||
|
float accel = Clamp(maxSpeed - speed, 0.f, MAX_ACCEL*delta);
|
||||||
|
hvel.x += body->dir.x*accel;
|
||||||
|
hvel.z += body->dir.z*accel;
|
||||||
|
|
||||||
|
body->velocity.x = hvel.x;
|
||||||
|
body->velocity.z = hvel.z;
|
||||||
|
|
||||||
|
body->position.x += body->velocity.x*delta;
|
||||||
|
body->position.y += body->velocity.y*delta;
|
||||||
|
body->position.z += body->velocity.z*delta;
|
||||||
|
|
||||||
|
// Fancy collision system against the floor
|
||||||
|
if (body->position.y <= 0.0f)
|
||||||
|
{
|
||||||
|
body->position.y = 0.0f;
|
||||||
|
body->velocity.y = 0.0f;
|
||||||
|
body->isGrounded = true; // Enable jumping
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update camera
|
||||||
|
static void UpdateCameraAngle(Camera *camera)
|
||||||
|
{
|
||||||
|
const Vector3 up = (Vector3){ 0.0f, 1.0f, 0.0f };
|
||||||
|
const Vector3 targetOffset = (Vector3){ 0.0f, 0.0f, -1.0f };
|
||||||
|
|
||||||
|
// Left and right
|
||||||
|
Vector3 yaw = Vector3RotateByAxisAngle(targetOffset, up, lookRotation.x);
|
||||||
|
|
||||||
|
// Clamp view up
|
||||||
|
float maxAngleUp = Vector3Angle(up, yaw);
|
||||||
|
maxAngleUp -= 0.001f; // Avoid numerical errors
|
||||||
|
if ( -(lookRotation.y) > maxAngleUp) { lookRotation.y = -maxAngleUp; }
|
||||||
|
|
||||||
|
// Clamp view down
|
||||||
|
float maxAngleDown = Vector3Angle(Vector3Negate(up), yaw);
|
||||||
|
maxAngleDown *= -1.0f; // Downwards angle is negative
|
||||||
|
maxAngleDown += 0.001f; // Avoid numerical errors
|
||||||
|
if ( -(lookRotation.y) < maxAngleDown) { lookRotation.y = -maxAngleDown; }
|
||||||
|
|
||||||
|
// Up and down
|
||||||
|
Vector3 right = Vector3Normalize(Vector3CrossProduct(yaw, up));
|
||||||
|
|
||||||
|
// Rotate view vector around right axis
|
||||||
|
float pitchAngle = -lookRotation.y -
|
||||||
|
lean.y;
|
||||||
|
pitchAngle = Clamp(pitchAngle, -PI / 2 + 0.0001f, PI / 2 - 0.0001f); // Clamp angle so it doesn't go past straight up or straight down
|
||||||
|
Vector3 pitch = Vector3RotateByAxisAngle(yaw, right, pitchAngle);
|
||||||
|
|
||||||
|
// Head animation
|
||||||
|
// Rotate up direction around forward axis
|
||||||
|
float headSin = sin(headTimer*PI);
|
||||||
|
float headCos = cos(headTimer*PI);
|
||||||
|
const float stepRotation = 0.01f;
|
||||||
|
camera->up = Vector3RotateByAxisAngle(up, pitch, headSin*stepRotation + lean.x);
|
||||||
|
|
||||||
|
// Camera BOB
|
||||||
|
const float bobSide = 0.1f;
|
||||||
|
const float bobUp = 0.15f;
|
||||||
|
Vector3 bobbing = Vector3Scale(right, headSin*bobSide);
|
||||||
|
bobbing.y = fabsf(headCos*bobUp);
|
||||||
|
|
||||||
|
camera->position = Vector3Add(camera->position, Vector3Scale(bobbing, walkLerp));
|
||||||
|
camera->target = Vector3Add(camera->position, pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw game level
|
||||||
|
static void DrawLevel(void)
|
||||||
|
{
|
||||||
|
const int floorExtent = 25;
|
||||||
|
const float tileSize = 5.0f;
|
||||||
|
const Color tileColor1 = (Color){ 150, 200, 200, 255 };
|
||||||
|
|
||||||
|
// Floor tiles
|
||||||
|
for (int y = -floorExtent; y < floorExtent; y++)
|
||||||
|
{
|
||||||
|
for (int x = -floorExtent; x < floorExtent; x++)
|
||||||
|
{
|
||||||
|
if ((y & 1) && (x & 1))
|
||||||
|
{
|
||||||
|
DrawPlane((Vector3){ x*tileSize, 0.0f, y*tileSize}, (Vector2){ tileSize, tileSize }, tileColor1);
|
||||||
|
}
|
||||||
|
else if (!(y & 1) && !(x & 1))
|
||||||
|
{
|
||||||
|
DrawPlane((Vector3){ x*tileSize, 0.0f, y*tileSize}, (Vector2){ tileSize, tileSize }, LIGHTGRAY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const Vector3 towerSize = (Vector3){ 16.0f, 32.0f, 16.0f };
|
||||||
|
const Color towerColor = (Color){ 150, 200, 200, 255 };
|
||||||
|
|
||||||
|
Vector3 towerPos = (Vector3){ 16.0f, 16.0f, 16.0f };
|
||||||
|
DrawCubeV(towerPos, towerSize, towerColor);
|
||||||
|
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
|
||||||
|
|
||||||
|
towerPos.x *= -1;
|
||||||
|
DrawCubeV(towerPos, towerSize, towerColor);
|
||||||
|
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
|
||||||
|
|
||||||
|
towerPos.z *= -1;
|
||||||
|
DrawCubeV(towerPos, towerSize, towerColor);
|
||||||
|
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
|
||||||
|
|
||||||
|
towerPos.x *= -1;
|
||||||
|
DrawCubeV(towerPos, towerSize, towerColor);
|
||||||
|
DrawCubeWiresV(towerPos, towerSize, DARKBLUE);
|
||||||
|
|
||||||
|
// Red sun
|
||||||
|
DrawSphere((Vector3){ 300.0f, 300.0f, 0.0f }, 100.0f, (Color){ 255, 0, 0, 255 });
|
||||||
|
}
|
||||||
BIN
examples/core/core_3d_fps_controller.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Picking in 3d mode
|
* raylib [core] example - Picking in 3d mode
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - automation events
|
* raylib [core] example - automation events
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
||||||
*
|
*
|
||||||
* Example based on 2d_camera_platformer example by arvyy (@arvyy)
|
* Example based on 2d_camera_platformer example by arvyy (@arvyy)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2023-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] examples - basic screen manager
|
* raylib [core] examples - basic screen manager
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* NOTE: This example illustrates a very simple screen manager based on a states machines
|
* NOTE: This example illustrates a very simple screen manager based on a states machines
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 4.0, last time updated with raylib 4.0
|
* Example originally created with raylib 4.0, last time updated with raylib 4.0
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -46,7 +48,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
switch(currentScreen)
|
switch (currentScreen)
|
||||||
{
|
{
|
||||||
case LOGO:
|
case LOGO:
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Basic window
|
* raylib [core] example - Basic window
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Welcome to raylib!
|
* Welcome to raylib!
|
||||||
*
|
*
|
||||||
* To test examples, just press F6 and execute 'raylib_compile_execute' script
|
* To test examples, just press F6 and execute 'raylib_compile_execute' script
|
||||||
@ -20,7 +22,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Basic window (adapted for HTML5 platform)
|
* raylib [core] example - Basic window (adapted for HTML5 platform)
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* NOTE: This example is prepared to compile for PLATFORM_WEB, and PLATFORM_DESKTOP
|
* NOTE: This example is prepared to compile for PLATFORM_WEB, and PLATFORM_DESKTOP
|
||||||
* As you will notice, code structure is slightly diferent to the other examples...
|
* As you will notice, code structure is slightly diferent to the other examples...
|
||||||
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
|
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
|
||||||
@ -11,7 +13,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
BIN
examples/core/core_basic_window_web.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - custom frame control
|
* raylib [core] example - custom frame control
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★★] 4/4
|
||||||
|
*
|
||||||
* NOTE: WARNING: This is an example for advanced users willing to have full control over
|
* NOTE: WARNING: This is an example for advanced users willing to have full control over
|
||||||
* the frame processes. By default, EndDrawing() calls the following processes:
|
* the frame processes. By default, EndDrawing() calls the following processes:
|
||||||
* 1. Draw remaining batch data: rlDrawRenderBatchActive()
|
* 1. Draw remaining batch data: rlDrawRenderBatchActive()
|
||||||
@ -10,7 +12,7 @@
|
|||||||
* 4. PollInputEvents()
|
* 4. PollInputEvents()
|
||||||
*
|
*
|
||||||
* To avoid steps 2, 3 and 4, flag SUPPORT_CUSTOM_FRAME_CONTROL can be enabled in
|
* To avoid steps 2, 3 and 4, flag SUPPORT_CUSTOM_FRAME_CONTROL can be enabled in
|
||||||
* config.h (it requires recompiling raylib). This way those steps are up to the user.
|
* config.h (it requires recompiling raylib). This way those steps are up to the user
|
||||||
*
|
*
|
||||||
* Note that enabling this flag invalidates some functions:
|
* Note that enabling this flag invalidates some functions:
|
||||||
* - GetFrameTime()
|
* - GetFrameTime()
|
||||||
@ -22,7 +24,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2021-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -59,7 +61,9 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
|
#ifndef PLATFORM_WEB // NOTE: On non web platforms the PollInputEvents just works before the inputs checks
|
||||||
|
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
|
||||||
|
#endif
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
|
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
|
||||||
|
|
||||||
@ -74,6 +78,10 @@ int main(void)
|
|||||||
if (position >= GetScreenWidth()) position = 0;
|
if (position >= GetScreenWidth()) position = 0;
|
||||||
timeCounter += deltaTime; // We count time (seconds)
|
timeCounter += deltaTime; // We count time (seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PLATFORM_WEB // NOTE: On web platform for some reason the PollInputEvents only works after the inputs check, so just call it after check all your inputs (on web)
|
||||||
|
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
|
||||||
|
#endif
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@ -93,7 +101,10 @@ int main(void)
|
|||||||
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
|
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
|
||||||
DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY);
|
DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY);
|
||||||
DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME);
|
DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME);
|
||||||
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
|
if (deltaTime != 0)
|
||||||
|
{
|
||||||
|
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
|
||||||
|
}
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Custom logging
|
* raylib [core] example - Custom logging
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 2.5
|
* Example originally created with raylib 2.5, last time updated with raylib 2.5
|
||||||
*
|
*
|
||||||
* Example contributed by Pablo Marcos Oltra (@pamarcos) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Pablo Marcos Oltra (@pamarcos) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018-2024 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
|
* Copyright (c) 2018-2025 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Windows drop files
|
* raylib [core] example - Windows drop files
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
|
* NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 4.2
|
* Example originally created with raylib 1.3, last time updated with raylib 4.2
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
130
examples/core/core_high_dpi.c
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - HighDPI
|
||||||
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] e/4
|
||||||
|
*
|
||||||
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Module functions declaration
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Program main entry point
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
SetConfigFlags(FLAG_WINDOW_HIGHDPI | FLAG_WINDOW_RESIZABLE);
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - highdpi");
|
||||||
|
SetWindowMinSize(450, 450);
|
||||||
|
|
||||||
|
int logicalGridDescY = 120;
|
||||||
|
int logicalGridLabelY = logicalGridDescY + 30;
|
||||||
|
int logicalGridTop = logicalGridLabelY + 30;
|
||||||
|
int logicalGridBottom = logicalGridTop + 80;
|
||||||
|
int pixelGridTop = logicalGridBottom - 20;
|
||||||
|
int pixelGridBottom = pixelGridTop + 80;
|
||||||
|
int pixelGridLabelY = pixelGridBottom + 30;
|
||||||
|
int pixelGridDescY = pixelGridLabelY + 30;
|
||||||
|
int cellSize = 50;
|
||||||
|
float cellSizePx = (float)cellSize;
|
||||||
|
|
||||||
|
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
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
int monitorCount = GetMonitorCount();
|
||||||
|
|
||||||
|
if ((monitorCount > 1) && IsKeyPressed(KEY_N))
|
||||||
|
{
|
||||||
|
SetWindowMonitor((GetCurrentMonitor() + 1)%monitorCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
int currentMonitor = GetCurrentMonitor();
|
||||||
|
Vector2 dpiScale = GetWindowScaleDPI();
|
||||||
|
cellSizePx = ((float)cellSize)/dpiScale.x;
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
int windowCenter = GetScreenWidth()/2;
|
||||||
|
DrawTextCenter(TextFormat("Dpi Scale: %f", dpiScale.x), windowCenter, 30, 40, DARKGRAY);
|
||||||
|
DrawTextCenter(TextFormat("Monitor: %d/%d ([N] next monitor)", currentMonitor+1, monitorCount), windowCenter, 70, 20, LIGHTGRAY);
|
||||||
|
DrawTextCenter(TextFormat("Window is %d \"logical points\" wide", GetScreenWidth()), windowCenter, logicalGridDescY, 20, ORANGE);
|
||||||
|
|
||||||
|
bool odd = true;
|
||||||
|
for (int i = cellSize; i < GetScreenWidth(); i += cellSize, odd = !odd)
|
||||||
|
{
|
||||||
|
if (odd) DrawRectangle(i, logicalGridTop, cellSize, logicalGridBottom-logicalGridTop, ORANGE);
|
||||||
|
|
||||||
|
DrawTextCenter(TextFormat("%d", i), i, logicalGridLabelY, 10, LIGHTGRAY);
|
||||||
|
DrawLine(i, logicalGridLabelY + 10, i, logicalGridBottom, GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
odd = true;
|
||||||
|
const int minTextSpace = 30;
|
||||||
|
int lastTextX = -minTextSpace;
|
||||||
|
for (int i = cellSize; i < GetRenderWidth(); i += cellSize, odd = !odd)
|
||||||
|
{
|
||||||
|
int x = (int)(((float)i)/dpiScale.x);
|
||||||
|
if (odd) DrawRectangle(x, pixelGridTop, (int)cellSizePx, pixelGridBottom - pixelGridTop, CLITERAL(Color){ 0, 121, 241, 100 });
|
||||||
|
|
||||||
|
DrawLine(x, pixelGridTop, (int)(((float)i) / dpiScale.x), pixelGridLabelY - 10, GRAY);
|
||||||
|
|
||||||
|
if ((x - lastTextX) >= minTextSpace)
|
||||||
|
{
|
||||||
|
DrawTextCenter(TextFormat("%d", i), x, pixelGridLabelY, 10, LIGHTGRAY);
|
||||||
|
lastTextX = x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawTextCenter(TextFormat("Window is %d \"physical pixels\" wide", GetRenderWidth()), windowCenter, pixelGridDescY, 20, BLUE);
|
||||||
|
|
||||||
|
const char *text = "Can you see this?";
|
||||||
|
Vector2 size = MeasureTextEx(GetFontDefault(), text, 20, 3);
|
||||||
|
Vector2 pos = (Vector2){ GetScreenWidth() - size.x - 5, GetScreenHeight() - size.y - 5 };
|
||||||
|
DrawTextEx(GetFontDefault(), text, pos, 20, 3, LIGHTGRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Module functions definition
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color)
|
||||||
|
{
|
||||||
|
Vector2 size = MeasureTextEx(GetFontDefault(), text, (float)fontSize, 3);
|
||||||
|
Vector2 pos = (Vector2){ x - size.x/2, y - size.y/2 };
|
||||||
|
DrawTextEx(GetFontDefault(), text, pos, (float)fontSize, 3, color);
|
||||||
|
}
|
||||||
BIN
examples/core/core_high_dpi.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Gamepad input
|
* raylib [core] example - Gamepad input
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* NOTE: This example requires a Gamepad connected to the system
|
* NOTE: This example requires a Gamepad connected to the system
|
||||||
* raylib is configured to work with the following gamepads:
|
* raylib is configured to work with the following gamepads:
|
||||||
* - Xbox 360 Controller (Xbox 360, Xbox One)
|
* - Xbox 360 Controller (Xbox 360, Xbox One)
|
||||||
@ -13,7 +15,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -254,11 +256,11 @@ int main(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(0)), 10, 50, 10, MAROON);
|
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(gamepad)), 10, 50, 10, MAROON);
|
||||||
|
|
||||||
for (int i = 0; i < GetGamepadAxisCount(0); i++)
|
for (int i = 0; i < GetGamepadAxisCount(gamepad); i++)
|
||||||
{
|
{
|
||||||
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(0, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(gamepad, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGamepadButtonPressed() != GAMEPAD_BUTTON_UNKNOWN) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
if (GetGamepadButtonPressed() != GAMEPAD_BUTTON_UNKNOWN) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
||||||
|
|||||||
@ -1,83 +0,0 @@
|
|||||||
/*******************************************************************************************
|
|
||||||
*
|
|
||||||
* raylib [core] example - Gamepad information
|
|
||||||
*
|
|
||||||
* NOTE: This example requires a Gamepad connected to the system
|
|
||||||
* Check raylib.h for buttons configuration
|
|
||||||
*
|
|
||||||
* Example originally created with raylib 4.6, last time updated with raylib 4.6
|
|
||||||
*
|
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
||||||
* BSD-like license that allows static linking with closed source software
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
|
||||||
*
|
|
||||||
********************************************************************************************/
|
|
||||||
|
|
||||||
#include "raylib.h"
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
// Program main entry point
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
// Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
const int screenWidth = 800;
|
|
||||||
const int screenHeight = 450;
|
|
||||||
|
|
||||||
SetConfigFlags(FLAG_MSAA_4X_HINT); // Set MSAA 4X hint before windows creation
|
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad information");
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Main game loop
|
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
|
||||||
{
|
|
||||||
// Update
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
// TODO: Update your variables here
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
BeginDrawing();
|
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
|
||||||
|
|
||||||
for (int i = 0, y = 5; i < 4; i++) // MAX_GAMEPADS = 4
|
|
||||||
{
|
|
||||||
if (IsGamepadAvailable(i))
|
|
||||||
{
|
|
||||||
DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 10, BLACK);
|
|
||||||
y += 11;
|
|
||||||
DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 10, BLACK);
|
|
||||||
y += 11;
|
|
||||||
|
|
||||||
for (int axis = 0; axis < GetGamepadAxisCount(i); axis++)
|
|
||||||
{
|
|
||||||
DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 10, BLACK);
|
|
||||||
y += 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int button = 0; button < 32; button++)
|
|
||||||
{
|
|
||||||
DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 10, BLACK);
|
|
||||||
y += 11;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DrawFPS(GetScreenWidth() - 100, 100);
|
|
||||||
|
|
||||||
EndDrawing();
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
|
|
||||||
// De-Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Input Gestures Detection
|
* raylib [core] example - Input Gestures Detection
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.4, last time updated with raylib 4.2
|
* Example originally created with raylib 1.4, last time updated with raylib 4.2
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2016-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Input Gestures for Web
|
* raylib [core] example - Input Gestures for Web
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 4.6-dev, last time updated with raylib 4.6-dev
|
* Example originally created with raylib 4.6-dev, last time updated with raylib 4.6-dev
|
||||||
*
|
*
|
||||||
* Example contributed by ubkp (@ubkp) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by ubkp (@ubkp) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 ubkp (@ubkp)
|
* Copyright (c) 2023-2025 ubkp (@ubkp)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Keyboard input
|
* raylib [core] example - Keyboard input
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Mouse input
|
* raylib [core] example - Mouse input
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 1.0, last time updated with raylib 4.0
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
|
* Example originally created with raylib 1.0, last time updated with raylib 5.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -36,6 +38,18 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
if (IsKeyPressed(KEY_H))
|
||||||
|
{
|
||||||
|
if (IsCursorHidden())
|
||||||
|
{
|
||||||
|
ShowCursor();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HideCursor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ballPosition = GetMousePosition();
|
ballPosition = GetMousePosition();
|
||||||
|
|
||||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) ballColor = MAROON;
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) ballColor = MAROON;
|
||||||
@ -56,6 +70,10 @@ int main(void)
|
|||||||
DrawCircleV(ballPosition, 40, ballColor);
|
DrawCircleV(ballPosition, 40, ballColor);
|
||||||
|
|
||||||
DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY);
|
DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY);
|
||||||
|
DrawText("Press 'H' to toggle cursor visibility", 10, 30, 20, DARKGRAY);
|
||||||
|
|
||||||
|
if (!IsCursorHidden()) DrawText("CURSOR HIDDEN", 20, 60, 20, RED);
|
||||||
|
else DrawText("CURSOR VISIBLE", 20, 60, 20, LIME);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] examples - Mouse wheel input
|
* raylib [core] examples - Mouse wheel input
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.1, last time updated with raylib 1.3
|
* Example originally created with raylib 1.1, last time updated with raylib 1.3
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Input multitouch
|
* raylib [core] example - Input multitouch
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.1, last time updated with raylib 2.5
|
* Example originally created with raylib 2.1, last time updated with raylib 2.5
|
||||||
*
|
*
|
||||||
* Example contributed by Berni (@Berni8k) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Berni (@Berni8k) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
|
* Copyright (c) 2019-2025 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -42,7 +44,7 @@ int main(void)
|
|||||||
// Get the touch point count ( how many fingers are touching the screen )
|
// Get the touch point count ( how many fingers are touching the screen )
|
||||||
int tCount = GetTouchPointCount();
|
int tCount = GetTouchPointCount();
|
||||||
// Clamp touch points available ( set the maximum touch points allowed )
|
// Clamp touch points available ( set the maximum touch points allowed )
|
||||||
if(tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
|
if (tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
|
||||||
// Get touch points positions
|
// Get touch points positions
|
||||||
for (int i = 0; i < tCount; ++i) touchPositions[i] = GetTouchPosition(i);
|
for (int i = 0; i < tCount; ++i) touchPositions[i] = GetTouchPosition(i);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -2,21 +2,34 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - input virtual controls
|
* raylib [core] example - input virtual controls
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
||||||
*
|
*
|
||||||
* Example create by GreenSnakeLinux (@GreenSnakeLinux),
|
* Example create by GreenSnakeLinux (@GreenSnakeLinux),
|
||||||
* lighter by oblerion (@oblerion) and
|
* lighter by oblerion (@oblerion) and
|
||||||
* reviewed by Ramon Santamaria (@raysan5)
|
* reviewed by Ramon Santamaria (@raysan5) and
|
||||||
|
* improved by danilwhale (@danilwhale)
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2024-2025 oblerion (@oblerion) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
BUTTON_NONE = -1,
|
||||||
|
BUTTON_UP,
|
||||||
|
BUTTON_LEFT,
|
||||||
|
BUTTON_RIGHT,
|
||||||
|
BUTTON_DOWN,
|
||||||
|
BUTTON_MAX
|
||||||
|
} PadButton;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Program main entry point
|
// Program main entry point
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
@ -29,24 +42,38 @@ int main(void)
|
|||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - input virtual controls");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - input virtual controls");
|
||||||
|
|
||||||
const float dpadX = 90;
|
Vector2 padPosition = { 100, 350 };
|
||||||
const float dpadY = 300;
|
float buttonRadius = 30;
|
||||||
const float dpadRad = 25.0f;//radius of each pad
|
|
||||||
Color dpadColor = BLUE;
|
|
||||||
int dpadKeydown = -1;//-1 if not down, else 0,1,2,3
|
|
||||||
|
|
||||||
|
Vector2 buttonPositions[BUTTON_MAX] =
|
||||||
const float dpadCollider[4][2]= // collider array with x,y position
|
|
||||||
{
|
{
|
||||||
{dpadX,dpadY-dpadRad*1.5f},//up
|
{ padPosition.x,padPosition.y - buttonRadius*1.5f }, // Up
|
||||||
{dpadX-dpadRad*1.5f,dpadY},//left
|
{ padPosition.x - buttonRadius*1.5f, padPosition.y }, // Left
|
||||||
{dpadX+dpadRad*1.5f,dpadY},//right
|
{ padPosition.x + buttonRadius*1.5f, padPosition.y }, // Right
|
||||||
{dpadX,dpadY+dpadRad*1.5f}//down
|
{ padPosition.x, padPosition.y + buttonRadius*1.5f } // Down
|
||||||
};
|
};
|
||||||
const char dpadLabel[4]="XYBA";//label of Dpad
|
|
||||||
|
|
||||||
float playerX=100;
|
const char *buttonLabels[BUTTON_MAX] =
|
||||||
float playerY=100;
|
{
|
||||||
|
"Y", // Up
|
||||||
|
"X", // Left
|
||||||
|
"B", // Right
|
||||||
|
"A" // Down
|
||||||
|
};
|
||||||
|
|
||||||
|
Color buttonLabelColors[BUTTON_MAX] =
|
||||||
|
{
|
||||||
|
YELLOW, // Up
|
||||||
|
BLUE, // Left
|
||||||
|
RED, // Right
|
||||||
|
GREEN // Down
|
||||||
|
};
|
||||||
|
|
||||||
|
int pressedButton = BUTTON_NONE;
|
||||||
|
Vector2 inputPosition = { 0, 0 };
|
||||||
|
|
||||||
|
Vector2 playerPosition = { (float)screenWidth/2, (float)screenHeight/2 };
|
||||||
|
float playerSpeed = 75;
|
||||||
|
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@ -54,63 +81,73 @@ int main(void)
|
|||||||
// Main game loop
|
// Main game loop
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
dpadKeydown = -1; //reset
|
if ((GetTouchPointCount() > 0))
|
||||||
int inputX = 0;
|
{
|
||||||
int inputY = 0;
|
// Use touch position
|
||||||
if(GetTouchPointCount()>0)
|
inputPosition = GetTouchPosition(0);
|
||||||
{//use touch pos
|
|
||||||
inputX = GetTouchX();
|
|
||||||
inputY = GetTouchY();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//use mouse pos
|
|
||||||
inputX = GetMouseX();
|
|
||||||
inputY = GetMouseY();
|
|
||||||
}
|
|
||||||
for(int i=0;i<4;i++)
|
|
||||||
{
|
{
|
||||||
//test distance each collider and input < radius
|
// Use mouse position
|
||||||
if( fabsf(dpadCollider[i][1]-inputY) + fabsf(dpadCollider[i][0]-inputX) < dpadRad)
|
inputPosition = GetMousePosition();
|
||||||
{
|
|
||||||
dpadKeydown = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// move player
|
|
||||||
switch(dpadKeydown){
|
// Reset pressed button to none
|
||||||
case 0: playerY -= 50*GetFrameTime();
|
pressedButton = BUTTON_NONE;
|
||||||
break;
|
|
||||||
case 1: playerX -= 50*GetFrameTime();
|
// Make sure user is pressing left mouse button if they're from desktop
|
||||||
break;
|
if ((GetTouchPointCount() > 0) || ((GetTouchPointCount() == 0) && IsMouseButtonDown(MOUSE_BUTTON_LEFT)))
|
||||||
case 2: playerX += 50*GetFrameTime();
|
{
|
||||||
break;
|
// Find nearest D-Pad button to the input position
|
||||||
case 3: playerY += 50*GetFrameTime();
|
for (int i = 0; i < BUTTON_MAX; i++)
|
||||||
default:;
|
|
||||||
};
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
// Draw
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
BeginDrawing();
|
|
||||||
ClearBackground(RAYWHITE);
|
|
||||||
for(int i=0;i<4;i++)
|
|
||||||
{
|
{
|
||||||
//draw all pad
|
float distX = fabsf(buttonPositions[i].x - inputPosition.x);
|
||||||
DrawCircleV((Vector2) { dpadCollider[i][0], dpadCollider[i][1] }, dpadRad, dpadColor);
|
float distY = fabsf(buttonPositions[i].y - inputPosition.y);
|
||||||
if(i!=dpadKeydown)
|
|
||||||
|
if ((distX + distY < buttonRadius))
|
||||||
{
|
{
|
||||||
//draw label
|
pressedButton = i;
|
||||||
DrawText(TextSubtext(dpadLabel,i,1),
|
break;
|
||||||
(int)dpadCollider[i][0]-7,
|
|
||||||
(int)dpadCollider[i][1]-8,20,BLACK);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move player according to pressed button
|
||||||
|
switch (pressedButton)
|
||||||
|
{
|
||||||
|
case BUTTON_UP: playerPosition.y -= playerSpeed*GetFrameTime(); break;
|
||||||
|
case BUTTON_LEFT: playerPosition.x -= playerSpeed*GetFrameTime(); break;
|
||||||
|
case BUTTON_RIGHT: playerPosition.x += playerSpeed*GetFrameTime(); break;
|
||||||
|
case BUTTON_DOWN: playerPosition.y += playerSpeed*GetFrameTime(); break;
|
||||||
|
default: break;
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Draw
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
// Draw world
|
||||||
|
DrawCircleV(playerPosition, 50, MAROON);
|
||||||
|
|
||||||
|
// Draw GUI
|
||||||
|
for (int i = 0; i < BUTTON_MAX; i++)
|
||||||
|
{
|
||||||
|
DrawCircleV(buttonPositions[i], buttonRadius, (i == pressedButton)? DARKGRAY : BLACK);
|
||||||
|
|
||||||
|
DrawText(buttonLabels[i],
|
||||||
|
(int)buttonPositions[i].x - 7, (int)buttonPositions[i].y - 8,
|
||||||
|
20, buttonLabelColors[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawText("move the player with D-Pad buttons", 10, 10, 20, DARKGRAY);
|
||||||
|
|
||||||
DrawRectangleRec((Rectangle) { playerX - 4, playerY - 4, 75, 28 }, RED);
|
|
||||||
DrawText("Player", (int)playerX, (int)playerY, 20, WHITE);
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 1.8 KiB |
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - loading thread
|
* raylib [core] example - loading thread
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* NOTE: This example requires linking with pthreads library on MinGW,
|
* NOTE: This example requires linking with pthreads library on MinGW,
|
||||||
* it can be accomplished passing -static parameter to compiler
|
* it can be accomplished passing -static parameter to compiler
|
||||||
*
|
*
|
||||||
@ -9,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [core] example - Generates a random sequence
|
* raylib [core] example - generate random sequence
|
||||||
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
||||||
*
|
*
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 Dalton Overmyer (@REDl3east)
|
* Copyright (c) 2023-2025 Dalton Overmyer (@REDl3east)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -18,159 +20,168 @@
|
|||||||
|
|
||||||
#include <stdlib.h> // Required for: malloc() and free()
|
#include <stdlib.h> // Required for: malloc() and free()
|
||||||
|
|
||||||
typedef struct ColorRect{
|
typedef struct ColorRect {
|
||||||
Color c;
|
Color c;
|
||||||
Rectangle r;
|
Rectangle r;
|
||||||
} ColorRect;
|
} ColorRect;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Module functions declaration
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
static Color GenerateRandomColor();
|
static Color GenerateRandomColor();
|
||||||
static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight);
|
static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight);
|
||||||
static void ShuffleColorRectSequence(ColorRect* rectangles, int rectCount);
|
static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount);
|
||||||
static void DrawTextCenterKeyHelp(const char* key, const char* text, int posX, int posY, int fontSize, Color color);
|
static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, int posY, int fontSize, Color color);
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Program main entry point
|
// Program main entry point
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
int main(void) {
|
int main(void)
|
||||||
// Initialization
|
{
|
||||||
//--------------------------------------------------------------------------------------
|
// Initialization
|
||||||
const int screenWidth = 800;
|
//--------------------------------------------------------------------------------------
|
||||||
const int screenHeight = 450;
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - Generates a random sequence");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - generate random sequence");
|
||||||
|
|
||||||
int rectCount = 20;
|
int rectCount = 20;
|
||||||
float rectSize = (float)screenWidth/rectCount;
|
float rectSize = (float)screenWidth/rectCount;
|
||||||
ColorRect* rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight);
|
ColorRect *rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
|
||||||
|
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
{
|
|
||||||
// Update
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if(IsKeyPressed(KEY_SPACE))
|
|
||||||
{
|
{
|
||||||
ShuffleColorRectSequence(rectangles, rectCount);
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
if (IsKeyPressed(KEY_SPACE)) ShuffleColorRectSequence(rectangles, rectCount);
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_UP))
|
||||||
|
{
|
||||||
|
rectCount++;
|
||||||
|
rectSize = (float)screenWidth/rectCount;
|
||||||
|
free(rectangles);
|
||||||
|
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_DOWN))
|
||||||
|
{
|
||||||
|
if (rectCount >= 4)
|
||||||
|
{
|
||||||
|
rectCount--;
|
||||||
|
rectSize = (float)screenWidth/rectCount;
|
||||||
|
free(rectangles);
|
||||||
|
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
int fontSize = 20;
|
||||||
|
for (int i = 0; i < rectCount; i++)
|
||||||
|
{
|
||||||
|
DrawRectangleRec(rectangles[i].r, rectangles[i].c);
|
||||||
|
DrawTextCenterKeyHelp("SPACE", "to shuffle the sequence.", 10, screenHeight - 96, fontSize, BLACK);
|
||||||
|
DrawTextCenterKeyHelp("UP", "to add a rectangle and generate a new sequence.", 10, screenHeight - 64, fontSize, BLACK);
|
||||||
|
DrawTextCenterKeyHelp("DOWN", "to remove a rectangle and generate a new sequence.", 10, screenHeight - 32, fontSize, BLACK);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *rectCountText = TextFormat("%d rectangles", rectCount);
|
||||||
|
int rectCountTextSize = MeasureText(rectCountText, fontSize);
|
||||||
|
DrawText(rectCountText, screenWidth - rectCountTextSize - 10, 10, fontSize, BLACK);
|
||||||
|
|
||||||
|
DrawFPS(10, 10);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsKeyPressed(KEY_UP))
|
// De-Initialization
|
||||||
{
|
//--------------------------------------------------------------------------------------
|
||||||
rectCount++;
|
free(rectangles);
|
||||||
rectSize = (float)screenWidth/rectCount;
|
CloseWindow(); // Close window and OpenGL context
|
||||||
free(rectangles);
|
//--------------------------------------------------------------------------------------
|
||||||
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(IsKeyPressed(KEY_DOWN))
|
return 0;
|
||||||
{
|
|
||||||
if(rectCount >= 4){
|
|
||||||
rectCount--;
|
|
||||||
rectSize = (float)screenWidth/rectCount;
|
|
||||||
free(rectangles);
|
|
||||||
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
BeginDrawing();
|
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
|
||||||
|
|
||||||
int fontSize = 20;
|
|
||||||
for(int x=0;x<rectCount;x++)
|
|
||||||
{
|
|
||||||
DrawRectangleRec(rectangles[x].r, rectangles[x].c);
|
|
||||||
DrawTextCenterKeyHelp("SPACE", "to shuffle the sequence.", 10, screenHeight - 96, fontSize, BLACK);
|
|
||||||
DrawTextCenterKeyHelp("UP", "to add a rectangle and generate a new sequence.", 10, screenHeight - 64, fontSize, BLACK);
|
|
||||||
DrawTextCenterKeyHelp("DOWN", "to remove a rectangle and generate a new sequence.", 10, screenHeight - 32, fontSize, BLACK);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* rectCountText = TextFormat("%d rectangles", rectCount);
|
|
||||||
int rectCountTextSize = MeasureText(rectCountText, fontSize);
|
|
||||||
DrawText(rectCountText, screenWidth - rectCountTextSize - 10, 10, fontSize, BLACK);
|
|
||||||
|
|
||||||
DrawFPS(10, 10);
|
|
||||||
|
|
||||||
EndDrawing();
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
|
|
||||||
// De-Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
free(rectangles);
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Module functions definition
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
static Color GenerateRandomColor()
|
static Color GenerateRandomColor()
|
||||||
{
|
{
|
||||||
return CLITERAL(Color){
|
Color color = {
|
||||||
GetRandomValue(0, 255),
|
GetRandomValue(0, 255),
|
||||||
GetRandomValue(0, 255),
|
GetRandomValue(0, 255),
|
||||||
GetRandomValue(0, 255),
|
GetRandomValue(0, 255),
|
||||||
255,
|
255
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight){
|
|
||||||
int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount-1);
|
|
||||||
ColorRect* rectangles = (ColorRect *)malloc((int)rectCount*sizeof(ColorRect));
|
|
||||||
|
|
||||||
float rectSeqWidth = rectCount * rectWidth;
|
|
||||||
float startX = (screenWidth - rectSeqWidth) * 0.5f;
|
|
||||||
|
|
||||||
for(int x=0;x<rectCount;x++){
|
|
||||||
int rectHeight = (int)Remap((float)seq[x], 0, rectCount-1, 0, screenHeight);
|
|
||||||
rectangles[x].c = GenerateRandomColor();
|
|
||||||
rectangles[x].r = CLITERAL(Rectangle){
|
|
||||||
startX + x * rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
UnloadRandomSequence(seq);
|
return color;
|
||||||
return rectangles;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShuffleColorRectSequence(ColorRect* rectangles, int rectCount)
|
static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight)
|
||||||
{
|
{
|
||||||
int *seq = LoadRandomSequence(rectCount, 0, rectCount-1);
|
ColorRect *rectangles = (ColorRect *)malloc((int)rectCount*sizeof(ColorRect));
|
||||||
for(int i1=0;i1<rectCount;i1++){
|
int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount - 1);
|
||||||
ColorRect* r1 = &rectangles[i1];
|
float rectSeqWidth = rectCount*rectWidth;
|
||||||
ColorRect* r2 = &rectangles[seq[i1]];
|
float startX = (screenWidth - rectSeqWidth)*0.5f;
|
||||||
|
|
||||||
// swap only the color and height
|
for (int i = 0; i < rectCount; i++)
|
||||||
ColorRect tmp = *r1;
|
{
|
||||||
r1->c = r2->c;
|
int rectHeight = (int)Remap((float)seq[i], 0, rectCount - 1, 0, screenHeight);
|
||||||
r1->r.height = r2->r.height;
|
|
||||||
r1->r.y = r2->r.y;
|
|
||||||
r2->c = tmp.c;
|
|
||||||
r2->r.height = tmp.r.height;
|
|
||||||
r2->r.y = tmp.r.y;
|
|
||||||
|
|
||||||
}
|
rectangles[i].c = GenerateRandomColor();
|
||||||
UnloadRandomSequence(seq);
|
rectangles[i].r = CLITERAL(Rectangle){ startX + i*rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight };
|
||||||
|
}
|
||||||
|
|
||||||
|
UnloadRandomSequence(seq);
|
||||||
|
|
||||||
|
return rectangles;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DrawTextCenterKeyHelp(const char* key, const char* text, int posX, int posY, int fontSize, Color color)
|
static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount)
|
||||||
{
|
{
|
||||||
int spaceSize = MeasureText(" ", fontSize);
|
int *seq = LoadRandomSequence(rectCount, 0, rectCount - 1);
|
||||||
int pressSize = MeasureText("Press", fontSize);
|
|
||||||
int keySize = MeasureText(key, fontSize);
|
|
||||||
int textSize = MeasureText(text, fontSize);
|
|
||||||
int totalSize = pressSize + 2 * spaceSize + keySize + 2 * spaceSize + textSize;
|
|
||||||
int textSizeCurrent = 0;
|
|
||||||
|
|
||||||
DrawText("Press", posX, posY, fontSize, color);
|
for (int i1 = 0; i1 < rectCount; i1++)
|
||||||
textSizeCurrent += pressSize + 2 * spaceSize;
|
{
|
||||||
DrawText(key, posX + textSizeCurrent, posY, fontSize, RED);
|
ColorRect *r1 = &rectangles[i1];
|
||||||
DrawRectangle(posX + textSizeCurrent, posY + fontSize, keySize, 3, RED);
|
ColorRect *r2 = &rectangles[seq[i1]];
|
||||||
textSizeCurrent += keySize + 2 * spaceSize;
|
|
||||||
DrawText(text, posX + textSizeCurrent, posY, fontSize, color);
|
// Swap only the color and height
|
||||||
|
ColorRect tmp = *r1;
|
||||||
|
r1->c = r2->c;
|
||||||
|
r1->r.height = r2->r.height;
|
||||||
|
r1->r.y = r2->r.y;
|
||||||
|
r2->c = tmp.c;
|
||||||
|
r2->r.height = tmp.r.height;
|
||||||
|
r2->r.y = tmp.r.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
UnloadRandomSequence(seq);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, int posY, int fontSize, Color color)
|
||||||
|
{
|
||||||
|
int spaceSize = MeasureText(" ", fontSize);
|
||||||
|
int pressSize = MeasureText("Press", fontSize);
|
||||||
|
int keySize = MeasureText(key, fontSize);
|
||||||
|
int textSize = MeasureText(text, fontSize);
|
||||||
|
int textSizeCurrent = 0;
|
||||||
|
|
||||||
|
DrawText("Press", posX, posY, fontSize, color);
|
||||||
|
textSizeCurrent += pressSize + 2*spaceSize;
|
||||||
|
DrawText(key, posX + textSizeCurrent, posY, fontSize, RED);
|
||||||
|
DrawRectangle(posX + textSizeCurrent, posY + fontSize, keySize, 3, RED);
|
||||||
|
textSizeCurrent += keySize + 2*spaceSize;
|
||||||
|
DrawText(text, posX + textSizeCurrent, posY, fontSize, color);
|
||||||
}
|
}
|
||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Generate random values
|
* raylib [core] example - Generate random values
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.1, last time updated with raylib 1.1
|
* Example originally created with raylib 1.1, last time updated with raylib 1.1
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Scissor test
|
* raylib [core] example - Scissor test
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
* Example originally created with raylib 2.5, last time updated with raylib 3.0
|
||||||
*
|
*
|
||||||
* Example contributed by Chris Dill (@MysteriousSpace) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Chris Dill (@MysteriousSpace) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 Chris Dill (@MysteriousSpace)
|
* Copyright (c) 2019-2025 Chris Dill (@MysteriousSpace)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Smooth Pixel-perfect camera
|
* raylib [core] example - Smooth Pixel-perfect camera
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 3.7, last time updated with raylib 4.0
|
* Example originally created with raylib 3.7, last time updated with raylib 4.0
|
||||||
*
|
*
|
||||||
* Example contributed by Giancamillo Alessandroni (@NotManyIdeasDev) and
|
* Example contributed by Giancamillo Alessandroni (@NotManyIdeasDev) and
|
||||||
@ -10,7 +12,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021-2024 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5)
|
* Copyright (c) 2021-2025 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -41,7 +43,8 @@ int main(void)
|
|||||||
Camera2D screenSpaceCamera = { 0 }; // Smoothing camera
|
Camera2D screenSpaceCamera = { 0 }; // Smoothing camera
|
||||||
screenSpaceCamera.zoom = 1.0f;
|
screenSpaceCamera.zoom = 1.0f;
|
||||||
|
|
||||||
RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight); // This is where we'll draw all our objects.
|
// Load render texture to draw all our objects
|
||||||
|
RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight);
|
||||||
|
|
||||||
Rectangle rec01 = { 70.0f, 35.0f, 20.0f, 20.0f };
|
Rectangle rec01 = { 70.0f, 35.0f, 20.0f, 20.0f };
|
||||||
Rectangle rec02 = { 90.0f, 55.0f, 30.0f, 10.0f };
|
Rectangle rec02 = { 90.0f, 55.0f, 30.0f, 10.0f };
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Storage save/load values
|
* raylib [core] example - Storage save/load values
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.4, last time updated with raylib 4.2
|
* Example originally created with raylib 1.4, last time updated with raylib 4.2
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
|
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2017-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -59,7 +61,7 @@ int main(void)
|
|||||||
VrStereoConfig config = LoadVrStereoConfig(device);
|
VrStereoConfig config = LoadVrStereoConfig(device);
|
||||||
|
|
||||||
// Distortion shader (uses device lens distortion and chroma)
|
// Distortion shader (uses device lens distortion and chroma)
|
||||||
Shader distortion = LoadShader(0, TextFormat("resources/distortion%i.fs", GLSL_VERSION));
|
Shader distortion = LoadShader(0, TextFormat("resources/shaders/glsl%i/distortion.fs", GLSL_VERSION));
|
||||||
|
|
||||||
// Update distortion shader with lens and distortion-scale parameters
|
// Update distortion shader with lens and distortion-scale parameters
|
||||||
SetShaderValue(distortion, GetShaderLocation(distortion, "leftLensCenter"),
|
SetShaderValue(distortion, GetShaderLocation(distortion, "leftLensCenter"),
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - window flags
|
* raylib [core] example - window flags
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 3.5, last time updated with raylib 3.5
|
* Example originally created with raylib 3.5, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2020-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -50,7 +52,7 @@ int main(void)
|
|||||||
|
|
||||||
int framesCounter = 0;
|
int framesCounter = 0;
|
||||||
|
|
||||||
//SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
@ -95,7 +97,10 @@ int main(void)
|
|||||||
if (IsWindowState(FLAG_WINDOW_MINIMIZED))
|
if (IsWindowState(FLAG_WINDOW_MINIMIZED))
|
||||||
{
|
{
|
||||||
framesCounter++;
|
framesCounter++;
|
||||||
if (framesCounter >= 240) RestoreWindow(); // Restore window after 3 seconds
|
if (framesCounter >= 240) {
|
||||||
|
RestoreWindow(); // Restore window after 3 seconds
|
||||||
|
framesCounter = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_M))
|
if (IsKeyPressed(KEY_M))
|
||||||
@ -129,6 +134,9 @@ int main(void)
|
|||||||
else SetWindowState(FLAG_VSYNC_HINT);
|
else SetWindowState(FLAG_VSYNC_HINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_B)) ToggleBorderlessWindowed();
|
||||||
|
|
||||||
|
|
||||||
// Bouncing ball logic
|
// Bouncing ball logic
|
||||||
ballPosition.x += ballSpeed.x;
|
ballPosition.x += ballSpeed.x;
|
||||||
ballPosition.y += ballSpeed.y;
|
ballPosition.y += ballSpeed.y;
|
||||||
@ -161,9 +169,9 @@ int main(void)
|
|||||||
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) DrawText("[D] FLAG_WINDOW_UNDECORATED: on", 10, 120, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) DrawText("[D] FLAG_WINDOW_UNDECORATED: on", 10, 120, 10, LIME);
|
||||||
else DrawText("[D] FLAG_WINDOW_UNDECORATED: off", 10, 120, 10, MAROON);
|
else DrawText("[D] FLAG_WINDOW_UNDECORATED: off", 10, 120, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_HIDDEN)) DrawText("[H] FLAG_WINDOW_HIDDEN: on", 10, 140, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_HIDDEN)) DrawText("[H] FLAG_WINDOW_HIDDEN: on", 10, 140, 10, LIME);
|
||||||
else DrawText("[H] FLAG_WINDOW_HIDDEN: off", 10, 140, 10, MAROON);
|
else DrawText("[H] FLAG_WINDOW_HIDDEN: off (hides for 3 seconds)", 10, 140, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_MINIMIZED)) DrawText("[N] FLAG_WINDOW_MINIMIZED: on", 10, 160, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_MINIMIZED)) DrawText("[N] FLAG_WINDOW_MINIMIZED: on", 10, 160, 10, LIME);
|
||||||
else DrawText("[N] FLAG_WINDOW_MINIMIZED: off", 10, 160, 10, MAROON);
|
else DrawText("[N] FLAG_WINDOW_MINIMIZED: off (restores after 3 seconds)", 10, 160, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) DrawText("[M] FLAG_WINDOW_MAXIMIZED: on", 10, 180, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) DrawText("[M] FLAG_WINDOW_MAXIMIZED: on", 10, 180, 10, LIME);
|
||||||
else DrawText("[M] FLAG_WINDOW_MAXIMIZED: off", 10, 180, 10, MAROON);
|
else DrawText("[M] FLAG_WINDOW_MAXIMIZED: off", 10, 180, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
|
||||||
@ -174,14 +182,16 @@ int main(void)
|
|||||||
else DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: off", 10, 240, 10, MAROON);
|
else DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: off", 10, 240, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_VSYNC_HINT)) DrawText("[V] FLAG_VSYNC_HINT: on", 10, 260, 10, LIME);
|
if (IsWindowState(FLAG_VSYNC_HINT)) DrawText("[V] FLAG_VSYNC_HINT: on", 10, 260, 10, LIME);
|
||||||
else DrawText("[V] FLAG_VSYNC_HINT: off", 10, 260, 10, MAROON);
|
else DrawText("[V] FLAG_VSYNC_HINT: off", 10, 260, 10, MAROON);
|
||||||
|
if (IsWindowState(FLAG_BORDERLESS_WINDOWED_MODE)) DrawText("[B] FLAG_BORDERLESS_WINDOWED_MODE: on", 10, 280, 10, LIME);
|
||||||
|
else DrawText("[B] FLAG_BORDERLESS_WINDOWED_MODE: off", 10, 280, 10, MAROON);
|
||||||
|
|
||||||
DrawText("Following flags can only be set before window creation:", 10, 300, 10, GRAY);
|
DrawText("Following flags can only be set before window creation:", 10, 320, 10, GRAY);
|
||||||
if (IsWindowState(FLAG_WINDOW_HIGHDPI)) DrawText("FLAG_WINDOW_HIGHDPI: on", 10, 320, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_HIGHDPI)) DrawText("FLAG_WINDOW_HIGHDPI: on", 10, 340, 10, LIME);
|
||||||
else DrawText("FLAG_WINDOW_HIGHDPI: off", 10, 320, 10, MAROON);
|
else DrawText("FLAG_WINDOW_HIGHDPI: off", 10, 340, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) DrawText("FLAG_WINDOW_TRANSPARENT: on", 10, 340, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) DrawText("FLAG_WINDOW_TRANSPARENT: on", 10, 360, 10, LIME);
|
||||||
else DrawText("FLAG_WINDOW_TRANSPARENT: off", 10, 340, 10, MAROON);
|
else DrawText("FLAG_WINDOW_TRANSPARENT: off", 10, 360, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_MSAA_4X_HINT)) DrawText("FLAG_MSAA_4X_HINT: on", 10, 360, 10, LIME);
|
if (IsWindowState(FLAG_MSAA_4X_HINT)) DrawText("FLAG_MSAA_4X_HINT: on", 10, 380, 10, LIME);
|
||||||
else DrawText("FLAG_MSAA_4X_HINT: off", 10, 360, 10, MAROON);
|
else DrawText("FLAG_MSAA_4X_HINT: off", 10, 380, 10, MAROON);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - window scale letterbox (and virtual mouse)
|
* raylib [core] example - window scale letterbox (and virtual mouse)
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
* Example originally created with raylib 2.5, last time updated with raylib 4.0
|
||||||
*
|
*
|
||||||
* Example contributed by Anata (@anatagawa) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Anata (@anatagawa) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 Anata (@anatagawa) and Ramon Santamaria (@raysan5)
|
* Copyright (c) 2019-2025 Anata (@anatagawa) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Window should close
|
* raylib [core] example - Window should close
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
* Example originally created with raylib 4.2, last time updated with raylib 4.2
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - World to screen
|
* raylib [core] example - World to screen
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 1.4
|
* Example originally created with raylib 1.3, last time updated with raylib 1.4
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ varying vec4 fragColor;
|
|||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 colDiffuse;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// NOTE: Add here your custom variables
|
// NOTE: Add your custom variables here
|
||||||
uniform vec2 leftLensCenter;
|
uniform vec2 leftLensCenter;
|
||||||
uniform vec2 rightLensCenter;
|
uniform vec2 rightLensCenter;
|
||||||
uniform vec2 leftScreenCenter;
|
uniform vec2 leftScreenCenter;
|
||||||
50
examples/core/resources/shaders/glsl120/distortion.fs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
// Input vertex attributes (from vertex shader)
|
||||||
|
varying vec2 fragTexCoord;
|
||||||
|
varying vec4 fragColor;
|
||||||
|
|
||||||
|
// Input uniform values
|
||||||
|
uniform sampler2D texture0;
|
||||||
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
|
// NOTE: Add your custom variables here
|
||||||
|
uniform vec2 leftLensCenter;
|
||||||
|
uniform vec2 rightLensCenter;
|
||||||
|
uniform vec2 leftScreenCenter;
|
||||||
|
uniform vec2 rightScreenCenter;
|
||||||
|
uniform vec2 scale;
|
||||||
|
uniform vec2 scaleIn;
|
||||||
|
uniform vec4 deviceWarpParam;
|
||||||
|
uniform vec4 chromaAbParam;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
// Compute lens distortion
|
||||||
|
vec2 lensCenter = fragTexCoord.x < 0.5? leftLensCenter : rightLensCenter;
|
||||||
|
vec2 screenCenter = fragTexCoord.x < 0.5? leftScreenCenter : rightScreenCenter;
|
||||||
|
vec2 theta = (fragTexCoord - lensCenter)*scaleIn;
|
||||||
|
float rSq = theta.x*theta.x + theta.y*theta.y;
|
||||||
|
vec2 theta1 = theta*(deviceWarpParam.x + deviceWarpParam.y*rSq + deviceWarpParam.z*rSq*rSq + deviceWarpParam.w*rSq*rSq*rSq);
|
||||||
|
vec2 thetaBlue = theta1*(chromaAbParam.z + chromaAbParam.w*rSq);
|
||||||
|
vec2 tcBlue = lensCenter + scale*thetaBlue;
|
||||||
|
|
||||||
|
if (any(bvec2(clamp(tcBlue, screenCenter - vec2(0.25, 0.5), screenCenter + vec2(0.25, 0.5)) - tcBlue)))
|
||||||
|
{
|
||||||
|
// Set black fragment for everything outside the lens border
|
||||||
|
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Compute color chroma aberration
|
||||||
|
float blue = texture2D(texture0, tcBlue).b;
|
||||||
|
vec2 tcGreen = lensCenter + scale*theta1;
|
||||||
|
float green = texture2D(texture0, tcGreen).g;
|
||||||
|
|
||||||
|
vec2 thetaRed = theta1*(chromaAbParam.x + chromaAbParam.y*rSq);
|
||||||
|
vec2 tcRed = lensCenter + scale*thetaRed;
|
||||||
|
|
||||||
|
float red = texture2D(texture0, tcRed).r;
|
||||||
|
gl_FragColor = vec4(red, green, blue, 1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,7 @@ uniform vec4 colDiffuse;
|
|||||||
// Output fragment color
|
// Output fragment color
|
||||||
out vec4 finalColor;
|
out vec4 finalColor;
|
||||||
|
|
||||||
// NOTE: Add here your custom variables
|
// NOTE: Add your custom variables here
|
||||||
uniform vec2 leftLensCenter = vec2(0.288, 0.5);
|
uniform vec2 leftLensCenter = vec2(0.288, 0.5);
|
||||||
uniform vec2 rightLensCenter = vec2(0.712, 0.5);
|
uniform vec2 rightLensCenter = vec2(0.712, 0.5);
|
||||||
uniform vec2 leftScreenCenter = vec2(0.25, 0.5);
|
uniform vec2 leftScreenCenter = vec2(0.25, 0.5);
|
||||||
@ -1,27 +1,27 @@
|
|||||||
GLFW_ICON ICON "raylib.ico"
|
GLFW_ICON ICON "raylib.ico"
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION 1,0,0,0
|
FILEVERSION 5,5,0,0
|
||||||
PRODUCTVERSION 1,0,0,0
|
PRODUCTVERSION 5,5,0,0
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
//BLOCK "080904E4" // English UK
|
//BLOCK "080904E4" // English UK
|
||||||
BLOCK "040904E4" // English US
|
BLOCK "040904E4" // English US
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "raylib technologies"
|
VALUE "CompanyName", "raylib technologies"
|
||||||
VALUE "FileDescription", "raylib example"
|
VALUE "FileDescription", "raylib application (www.raylib.com)"
|
||||||
VALUE "FileVersion", "1.0"
|
VALUE "FileVersion", "5.5.0"
|
||||||
VALUE "InternalName", "raylib-example"
|
VALUE "InternalName", "raylib-example"
|
||||||
VALUE "LegalCopyright", "(c) 2024 raylib technologies (@raylibtech)"
|
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
|
||||||
//VALUE "OriginalFilename", "raylib_app.exe"
|
VALUE "OriginalFilename", "raylib-example"
|
||||||
VALUE "ProductName", "raylib-example"
|
VALUE "ProductName", "raylib-example"
|
||||||
VALUE "ProductVersion", "1.0"
|
VALUE "ProductVersion", "5.5.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
//VALUE "Translation", 0x809, 1252 // English UK
|
//VALUE "Translation", 0x809, 1252 // English UK
|
||||||
VALUE "Translation", 0x409, 1252 // English US
|
VALUE "Translation", 0x409, 1252 // English US
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|||||||
171
examples/examples_list.txt
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
#
|
||||||
|
# raylib examples list used to generate/update collection
|
||||||
|
# examples must be provided as: <example_category>;<example_name>;<example_stars>;<raylib_created_version>;<raylib_last_update_version>;"<example_author_name>";<author_github_user>
|
||||||
|
#
|
||||||
|
# This list is used as the main reference by [rexm] tool for examples collection validation and management
|
||||||
|
# New examples must be added to this list and any possible rename must be made on this list first
|
||||||
|
#
|
||||||
|
# WARNING: List is not ordered by example name but by the display order on web
|
||||||
|
#
|
||||||
|
core;core_basic_window;⭐️☆☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_keys;⭐️☆☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_mouse;⭐️☆☆☆;1.0;5.5;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_mouse_wheel;⭐️☆☆☆;1.1;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_gamepad;⭐️☆☆☆;1.1;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_multitouch;⭐️☆☆☆;2.1;2.5;"Berni";@Berni8k
|
||||||
|
core;core_input_gestures;⭐️⭐️☆☆;1.4;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_virtual_controls;⭐️⭐️☆☆;5.0;5.0;"oblerion";@oblerion
|
||||||
|
core;core_2d_camera;⭐️⭐️☆☆;1.5;3.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_2d_camera_mouse_zoom;⭐️⭐️☆☆;4.2;4.2;"Jeffery Myers";@JeffM2501
|
||||||
|
core;core_2d_camera_platformer;⭐️⭐️⭐️☆;2.5;3.0;"arvyy";@arvyy
|
||||||
|
core;core_2d_camera_split_screen;⭐️⭐️⭐️⭐️;4.5;4.5;"Gabriel dos Santos Sanches";@gabrielssanches
|
||||||
|
core;core_3d_camera_mode;⭐️☆☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_3d_camera_free;⭐️☆☆☆;1.3;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_3d_camera_first_person;⭐️⭐️☆☆;1.3;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_3d_camera_split_screen;⭐️⭐️⭐️☆;3.7;4.0;"Jeffery Myers";@JeffM2501
|
||||||
|
core;core_3d_fps_controller;⭐️⭐️⭐️☆;5.5;5.5;"Agnis Aldins";@nezvers
|
||||||
|
core;core_3d_picking;⭐️⭐️☆☆;1.3;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_world_screen;⭐️⭐️☆☆;1.3;1.4;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_custom_logging;⭐️⭐️⭐️☆;2.5;2.5;"Pablo Marcos Oltra";@pamarcos
|
||||||
|
core;core_window_flags;⭐️⭐️⭐️☆;3.5;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_window_letterbox;⭐️⭐️☆☆;2.5;4.0;"Anata";@anatagawa
|
||||||
|
core;core_window_should_close;⭐️☆☆☆;4.2;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_drop_files;⭐️⭐️☆☆;1.3;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_random_values;⭐️☆☆☆;1.1;1.1;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_storage_values;⭐️⭐️☆☆;1.4;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_vr_simulator;⭐️⭐️⭐️☆;2.5;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_loading_thread;⭐️⭐️⭐️☆;2.5;3.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_scissor_test;⭐️☆☆☆;2.5;3.0;"Chris Dill";@MysteriousSpace
|
||||||
|
core;core_basic_screen_manager;⭐️☆☆☆;4.0;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_custom_frame_control;⭐️⭐️⭐️⭐️;4.0;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_smooth_pixelperfect;⭐️⭐️⭐️☆;3.7;4.0;"Giancamillo Alessandroni";@NotManyIdeasDev
|
||||||
|
core;core_random_sequence;⭐️☆☆☆;5.0;5.0;"Dalton Overmyer";@REDl3east
|
||||||
|
core;core_basic_window_web;⭐️☆☆☆;1.3;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_input_gestures_web;⭐️⭐️☆☆;4.6-dev;4.6-dev;"ubkp";@ubkp
|
||||||
|
core;core_automation_events;⭐️⭐️⭐️☆;5.0;5.0;"Ramon Santamaria";@raysan5
|
||||||
|
core;core_high_dpi;⭐️☆☆☆;5.0;5.0;"Jonathan Marler";@marler8997
|
||||||
|
shapes;shapes_basic_shapes;⭐️☆☆☆;1.0;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_bouncing_ball;⭐️☆☆☆;2.5;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_colors_palette;⭐️⭐️☆☆;1.0;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_logo_raylib;⭐️☆☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_logo_raylib_anim;⭐️⭐️☆☆;2.5;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_rectangle_scaling;⭐️⭐️☆☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||||
|
shapes;shapes_lines_bezier;⭐️☆☆☆;1.7;1.7;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_collision_area;⭐️⭐️☆☆;2.5;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_following_eyes;⭐️⭐️☆☆;2.5;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_easings_ball_anim;⭐️⭐️☆☆;2.5;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_easings_box_anim;⭐️⭐️☆☆;2.5;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_easings_rectangle_array;⭐️⭐️⭐️☆;2.0;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_draw_ring;⭐️⭐️⭐️☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||||
|
shapes;shapes_draw_circle_sector;⭐️⭐️⭐️☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||||
|
shapes;shapes_draw_rectangle_rounded;⭐️⭐️⭐️☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||||
|
shapes;shapes_top_down_lights;⭐️⭐️⭐️⭐️;4.2;4.2;"Jeffery Myers";@JeffM2501
|
||||||
|
shapes;shapes_rectangle_advanced;⭐️⭐️⭐️⭐️;5.5;5.5;"Everton Jr.";@evertonse
|
||||||
|
shapes;shapes_splines_drawing;⭐️⭐️⭐️☆;5.0;5.0;"Ramon Santamaria";@raysan5
|
||||||
|
shapes;shapes_digital_clock;⭐️⭐️☆☆;5.5;5.5;"Hamza RAHAL";@rhmz-rhl
|
||||||
|
shapes;shapes_double_pendulum;⭐️⭐️☆☆;5.5;5.5;"JoeCheong";@Joecheong2006
|
||||||
|
textures;textures_logo_raylib;⭐️☆☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_srcrec_dstrec;⭐️⭐️⭐️☆;1.3;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_image_drawing;⭐️⭐️☆☆;1.4;1.4;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_image_generation;⭐️⭐️☆☆;1.8;1.8;"Wilhem Barbier";@nounoursheureux
|
||||||
|
textures;textures_image_loading;⭐️☆☆☆;1.3;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_image_processing;⭐️⭐️⭐️☆;1.4;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_image_text;⭐️⭐️☆☆;1.8;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_to_image;⭐️☆☆☆;1.3;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_raw_data;⭐️⭐️⭐️☆;1.3;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_particles_blending;⭐️☆☆☆;1.7;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_npatch_drawing;⭐️⭐️⭐️☆;2.0;2.5;"Jorge A. Gomes";@overdev
|
||||||
|
textures;textures_background_scrolling;⭐️☆☆☆;2.0;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_sprite_anim;⭐️⭐️☆☆;1.3;1.3;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_sprite_button;⭐️⭐️☆☆;2.5;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_sprite_explosion;⭐️⭐️☆☆;2.5;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_bunnymark;⭐️⭐️⭐️☆;1.6;2.5;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_mouse_painting;⭐️⭐️⭐️☆;3.0;3.0;"Chris Dill";@MysteriousSpace
|
||||||
|
textures;textures_blend_modes;⭐️☆☆☆;3.5;3.5;"Karlo Licudine";@accidentalrebel
|
||||||
|
textures;textures_draw_tiled;⭐️⭐️⭐️☆;3.0;4.2;"Vlad Adrian";@demizdor
|
||||||
|
textures;textures_polygon;⭐️☆☆☆;3.7;3.7;"Chris Camacho";@chriscamacho
|
||||||
|
textures;textures_fog_of_war;⭐️⭐️⭐️☆;4.2;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_gif_player;⭐️⭐️⭐️☆;4.2;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_image_kernel;⭐️⭐️⭐️⭐️;1.3;1.3;"Karim Salem";@kimo-s
|
||||||
|
textures;textures_image_channel;⭐️⭐️☆☆;5.1-dev;5.1-dev;"Bruno Cabral";@brccabral
|
||||||
|
textures;textures_image_rotate;⭐️⭐️☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
textures;textures_textured_curve;⭐️⭐️⭐️☆;4.5;4.5;"Jeffery Myers";@JeffM2501
|
||||||
|
text;text_raylib_fonts;⭐️☆☆☆;1.7;3.7;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_font_spritefont;⭐️☆☆☆;1.0;1.0;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_font_filters;⭐️⭐️☆☆;1.3;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_font_loading;⭐️☆☆☆;1.4;3.0;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_font_sdf;⭐️⭐️⭐️☆;1.3;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_format_text;⭐️☆☆☆;1.1;3.0;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_input_box;⭐️⭐️☆☆;1.7;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_writing_anim;⭐️⭐️☆☆;1.4;1.4;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_rectangle_bounds;⭐️⭐️⭐️⭐️;2.5;4.0;"Vlad Adrian";@demizdor
|
||||||
|
text;text_unicode;⭐️⭐️⭐️⭐️;2.5;4.0;"Vlad Adrian";@demizdor
|
||||||
|
text;text_draw_3d;⭐️⭐️⭐️⭐️;3.5;4.0;"Vlad Adrian";@demizdor
|
||||||
|
text;text_codepoints_loading;⭐️⭐️⭐️☆;4.2;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_animation;⭐️⭐️☆☆;2.5;3.5;"Culacant";@culacant
|
||||||
|
models;models_billboard;⭐️⭐️⭐️☆;1.3;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_box_collisions;⭐️☆☆☆;1.3;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_cubicmap;⭐️⭐️☆☆;1.8;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_first_person_maze;⭐️⭐️☆☆;2.5;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_geometric_shapes;⭐️☆☆☆;1.0;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_mesh_generation;⭐️⭐️☆☆;1.8;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_mesh_picking;⭐️⭐️⭐️☆;1.7;4.0;"Joel Davis";@joeld42
|
||||||
|
models;models_loading;⭐️☆☆☆;2.0;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_loading_gltf;⭐️☆☆☆;3.7;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_loading_vox;⭐️☆☆☆;4.0;4.0;"Johann Nadalutti";@procfxgen
|
||||||
|
models;models_loading_m3d;⭐️⭐️☆☆;4.5;4.5;"bzt";@model3d
|
||||||
|
models;models_orthographic_projection;⭐️☆☆☆;2.0;3.7;"Max Danielsson";@autious
|
||||||
|
models;models_point_rendering;⭐️⭐️⭐️☆;5.0;5.0;"Reese Gallagher";@satchelfrost
|
||||||
|
models;models_rlgl_solar_system;⭐️⭐️⭐️⭐️;2.5;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_yaw_pitch_roll;⭐️⭐️☆☆;1.8;4.0;"Berni";@Berni8k
|
||||||
|
models;models_waving_cubes;⭐️⭐️⭐️☆;2.5;3.7;"Codecat";@codecat
|
||||||
|
models;models_heightmap;⭐️☆☆☆;1.8;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_skybox;⭐️⭐️☆☆;1.8;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_draw_cube_texture;⭐️⭐️☆☆;4.5;4.5;"Ramon Santamaria";@raysan5
|
||||||
|
models;models_gpu_skinning;⭐️⭐️⭐️☆;4.5;4.5;"Daniel Holden";@orangeduck
|
||||||
|
models;models_bone_socket;⭐️⭐️⭐️⭐️;4.5;4.5;"iP";@ipzaur
|
||||||
|
models;models_tesseract_view;⭐️⭐️☆☆;5.6-dev;5.6-dev;"Timothy van der Valk";@arceryz
|
||||||
|
shaders;shaders_basic_lighting;⭐️⭐️⭐️⭐️;3.0;4.2;"Chris Camacho";@chriscamacho
|
||||||
|
shaders;shaders_model_shader;⭐️⭐️☆☆;1.3;3.7;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_shapes_textures;⭐️⭐️☆☆;1.7;3.7;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_custom_uniform;⭐️⭐️☆☆;1.3;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_postprocessing;⭐️⭐️⭐️☆;1.3;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_palette_switch;⭐️⭐️⭐️☆;2.5;3.7;"Marco Lizza";@MarcoLizza
|
||||||
|
shaders;shaders_raymarching;⭐️⭐️⭐️⭐️;2.0;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_texture_drawing;⭐️⭐️☆☆;2.0;3.7;"Michał Ciesielski";@ciessielski
|
||||||
|
shaders;shaders_texture_outline;⭐️⭐️⭐️☆;4.0;4.0;"Samuel Skiff";@GoldenThumbs
|
||||||
|
shaders;shaders_texture_waves;⭐️⭐️☆☆;2.5;3.7;"Anata";@anatagawa
|
||||||
|
shaders;shaders_julia_set;⭐️⭐️⭐️☆;2.5;4.0;"Josh Colclough";@joshcol9232
|
||||||
|
shaders;shaders_eratosthenes;⭐️⭐️⭐️☆;2.5;4.0;"ProfJski";@ProfJski
|
||||||
|
shaders;shaders_fog;⭐️⭐️⭐️☆;2.5;3.7;"Chris Camacho";@chriscamacho
|
||||||
|
shaders;shaders_simple_mask;⭐️⭐️☆☆;2.5;3.7;"Chris Camacho";@chriscamacho
|
||||||
|
shaders;shaders_hot_reloading;⭐️⭐️⭐️☆;3.0;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_mesh_instancing;⭐️⭐️⭐️⭐️;3.7;4.2;"seanpringle";@seanpringle
|
||||||
|
shaders;shaders_multi_sample2d;⭐️⭐️☆☆;3.5;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
shaders;shaders_normal_map;⭐️⭐️⭐️⭐️;5.6;5.6;"Jeremy Montgomery";@Sir_Irk
|
||||||
|
shaders;shaders_spotlight;⭐️⭐️☆☆;2.5;3.7;"Chris Camacho";@chriscamacho
|
||||||
|
shaders;shaders_deferred_render;⭐️⭐️⭐️⭐️;4.5;4.5;"Justin Andreas Lacoste";@27justin
|
||||||
|
shaders;shaders_hybrid_render;⭐️⭐️⭐️⭐️;4.2;4.2;"Buğra Alptekin Sarı";@BugraAlptekinSari
|
||||||
|
shaders;shaders_texture_tiling;⭐️⭐️☆☆;4.5;4.5;"Luis Almeida";@luis605
|
||||||
|
shaders;shaders_shadowmap;⭐️⭐️⭐️⭐️;5.0;5.0;"TheManTheMythTheGameDev";@TheManTheMythTheGameDev
|
||||||
|
shaders;shaders_vertex_displacement;⭐️⭐️⭐️☆;5.0;4.5;"Alex ZH";@ZzzhHe
|
||||||
|
shaders;shaders_write_depth;⭐️⭐️☆☆;4.2;4.2;"Buğra Alptekin Sarı";@BugraAlptekinSari
|
||||||
|
shaders;shaders_basic_pbr;⭐️⭐️⭐️⭐️;5.0;5.1-dev;"Afan OLOVCIC";@_DevDad
|
||||||
|
shaders;shaders_lightmap;⭐️⭐️⭐️☆;4.5;4.5;"Jussi Viitala";@nullstare
|
||||||
|
shaders;shaders_rounded_rectangle;⭐️⭐️⭐️☆;5.5;5.5;"Anstro Pleuton";@anstropleuton
|
||||||
|
shaders;shaders_view_depth;⭐️⭐️⭐️☆;5.6-dev;5.6-dev;"Luís Almeida";@luis605
|
||||||
|
audio;audio_module_playing;⭐️☆☆☆;1.5;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
audio;audio_music_stream;⭐️☆☆☆;1.3;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
audio;audio_raw_stream;⭐️⭐️⭐️☆;1.6;4.2;"Ramon Santamaria";@raysan5
|
||||||
|
audio;audio_sound_loading;⭐️☆☆☆;1.1;3.5;"Ramon Santamaria";@raysan5
|
||||||
|
audio;audio_mixed_processor;⭐️⭐️⭐️⭐️;4.2;4.2;"hkc";@hatkidchan
|
||||||
|
audio;audio_stream_effects;⭐️⭐️⭐️⭐️;4.2;5.0;"Ramon Santamaria";@raysan5
|
||||||
|
audio;audio_sound_multi;⭐️⭐️☆☆;4.6;4.6;"Jeffery Myers";@JeffM2501
|
||||||
|
audio;audio_sound_positioning;⭐️⭐️☆☆;5.5;5.5;"Le Juez Victor";@Bigfoot71
|
||||||
|
others;rlgl_standalone;⭐️⭐️⭐️⭐️;1.6;4.0;"Ramon Santamaria";@raysan5
|
||||||
|
others;rlgl_compute_shader;⭐️⭐️⭐️⭐️;4.0;4.0;"Teddy Astie";@tsnake41
|
||||||
|
others;easings_testbed;⭐️⭐️⭐️☆;2.5;3.0;"Juan Miguel López";@flashback-fx
|
||||||
|
others;raylib_opengl_interop;⭐️⭐️⭐️⭐️;3.8;4.0;"Stephan Soller";@arkanis
|
||||||
|
others;embedded_files_loading;⭐️⭐️☆☆;3.0;3.5;"Kristian Holmgren";@defutura
|
||||||
|
others;raymath_vector_angle;⭐️⭐️☆☆;1.0;4.6;"Ramon Santamaria";@raysan5
|
||||||
|
text;text_unicode_ranges;⭐⭐⭐⭐️;2.5;4.0;"Vlad Adrian";@demizdor
|
||||||
@ -6,30 +6,30 @@
|
|||||||
|
|
||||||
1. File naming: <module>_<description> - Lower case filename, words separated by underscore,
|
1. File naming: <module>_<description> - Lower case filename, words separated by underscore,
|
||||||
no more than 3-4 words in total to describe the example. <module> referes to the primary
|
no more than 3-4 words in total to describe the example. <module> referes to the primary
|
||||||
raylib module the example is more related with (code, shapes, textures, models, shaders, raudio).
|
raylib module the example is more related with (code, shapes, textures, models, shaders, raudio)
|
||||||
i.e: core_input_multitouch, shapes_lines_bezier, shaders_palette_switch
|
i.e: core_input_multitouch, shapes_lines_bezier, shaders_palette_switch
|
||||||
|
|
||||||
2. Follow below template structure, example info should list the module, the short description
|
2. Follow below template structure, example info should list the module, the short description
|
||||||
and the author of the example, twitter or github info could be also provided for the author.
|
and the author of the example, twitter or github info could be also provided for the author
|
||||||
Short description should also be used on the title of the window.
|
Short description should also be used on the title of the window
|
||||||
|
|
||||||
3. Code should be organized by sections:[Initialization]- [Update] - [Draw] - [De-Initialization]
|
3. Code should be organized by sections:[Initialization]- [Update] - [Draw] - [De-Initialization]
|
||||||
Place your code between the dotted lines for every section, please don't mix update logic with drawing
|
Place your code between the dotted lines for every section, please don't mix update logic with drawing
|
||||||
and remember to unload all loaded resources.
|
and remember to unload all loaded resources
|
||||||
|
|
||||||
4. Code should follow raylib conventions: https://github.com/raysan5/raylib/wiki/raylib-coding-conventions
|
4. Code should follow raylib conventions: https://github.com/raysan5/raylib/wiki/raylib-coding-conventions
|
||||||
Try to be very organized, using line-breaks appropiately.
|
Try to be very organized, using line-breaks appropiately
|
||||||
|
|
||||||
5. Add comments to the specific parts of code the example is focus on.
|
5. Add comments to the specific parts of code the example is focus on
|
||||||
Don't abuse with comments, try to be clear and impersonal on the comments.
|
Don't abuse with comments, try to be clear and impersonal on the comments
|
||||||
|
|
||||||
6. Try to keep the example simple, under 300 code lines if possible. Try to avoid external dependencies.
|
6. Try to keep the example simple, under 300 code lines if possible. Try to avoid external dependencies
|
||||||
Try to avoid defining functions outside the main(). Example should be as self-contained as possible.
|
Try to avoid defining functions outside the main(). Example should be as self-contained as possible
|
||||||
|
|
||||||
7. About external resources, they should be placed in a [resources] folder and those resources
|
7. About external resources, they should be placed in a [resources] folder and those resources
|
||||||
should be open and free for use and distribution. Avoid propietary content.
|
should be open and free for use and distribution. Avoid propietary content
|
||||||
|
|
||||||
8. Try to keep the example simple but with a creative touch.
|
8. Try to keep the example simple but with a creative touch
|
||||||
Simple but beautiful examples are more appealing to users!
|
Simple but beautiful examples are more appealing to users!
|
||||||
|
|
||||||
9. In case of additional information is required, just come to raylib Discord channel: example-contributions
|
9. In case of additional information is required, just come to raylib Discord channel: example-contributions
|
||||||
@ -37,11 +37,11 @@
|
|||||||
10. Have fun!
|
10. Have fun!
|
||||||
|
|
||||||
The following files should be updated when adding a new example, it's planned to create some
|
The following files should be updated when adding a new example, it's planned to create some
|
||||||
script to automatize this process but not available yet.
|
script to automatize this process but not available yet
|
||||||
|
|
||||||
- raylib/examples/<category>/<category>_example_name.c
|
- raylib/examples/<category>/<category>_example_name.c
|
||||||
- raylib/examples/<category>/<category>_example_name.png
|
- raylib/examples/<category>/<category>_example_name.png
|
||||||
- raylib/examples/<category>/resources/*.*
|
- raylib/examples/<category>/resources/..
|
||||||
- raylib/examples/Makefile
|
- raylib/examples/Makefile
|
||||||
- raylib/examples/Makefile.Web
|
- raylib/examples/Makefile.Web
|
||||||
- raylib/examples/README.md
|
- raylib/examples/README.md
|
||||||
@ -56,16 +56,18 @@
|
|||||||
|
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [core] example - Basic window
|
* raylib [<module>] example - <name/short description>
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
*
|
*
|
||||||
* Example contributed by <user_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
|
* Example originally created with raylib 5.5, last time updated with raylib 5.6
|
||||||
|
*
|
||||||
|
* Example contributed by <author_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 <user_name> (@<user_github>)
|
* Copyright (c) <year_created>-<year_updated> <author_name> (@<user_github>)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -81,7 +83,7 @@ int main(void)
|
|||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
InitWindow(screenWidth, screenHeight, "raylib [<module>] example - <name>");
|
||||||
|
|
||||||
// TODO: Load resources / Initialize variables at this point
|
// TODO: Load resources / Initialize variables at this point
|
||||||
|
|
||||||
@ -102,9 +104,11 @@ int main(void)
|
|||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
// TODO: Draw everything that requires to be drawn at this point:
|
// TODO: Draw everything that requires to be drawn at this point
|
||||||
|
|
||||||
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); // Example
|
DrawLineEx((Vector2){ 0, 0 }, (Vector2){ screenWidth, screenHeight }, 2.0f, RED);
|
||||||
|
DrawLineEx((Vector2){ 0, screenHeight }, (Vector2){ screenWidth, 0 }, 2.0f, RED);
|
||||||
|
DrawText("example base code template", 260, 400, 20, LIGHTGRAY);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|||||||
BIN
examples/examples_template.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Load 3d model with animations and play them
|
* raylib [models] example - Load 3d model with animations and play them
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 3.5
|
* Example originally created with raylib 2.5, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example contributed by Culacant (@culacant) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Culacant (@culacant) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,13 +11,13 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 Culacant (@culacant) and Ramon Santamaria (@raysan5)
|
* Copyright (c) 2019-2025 Culacant (@culacant) and Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************
|
********************************************************************************************
|
||||||
*
|
*
|
||||||
* NOTE: To export a model from blender, make sure it is not posed, the vertices need to be
|
* NOTE: To export a model from blender, make sure it is not posed, the vertices need to be
|
||||||
* in the same position as they would be in edit mode and the scale of your models is
|
* in the same position as they would be in edit mode and the scale of your models is
|
||||||
* set to 0. Scaling can be done from the export menu.
|
* set to 0. Scaling can be done from the export menu
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Drawing billboards
|
* raylib [models] example - Drawing billboards
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★☆] 3/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 3.5
|
* Example originally created with raylib 1.3, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
@ -38,7 +40,7 @@ int main(void)
|
|||||||
Vector3 billPositionStatic = { 0.0f, 2.0f, 0.0f }; // Position of static billboard
|
Vector3 billPositionStatic = { 0.0f, 2.0f, 0.0f }; // Position of static billboard
|
||||||
Vector3 billPositionRotating = { 1.0f, 2.0f, 1.0f }; // Position of rotating billboard
|
Vector3 billPositionRotating = { 1.0f, 2.0f, 1.0f }; // Position of rotating billboard
|
||||||
|
|
||||||
// Entire billboard texture, source is used to take a segment from a larger texture.
|
// Entire billboard texture, source is used to take a segment from a larger texture
|
||||||
Rectangle source = { 0.0f, 0.0f, (float)bill.width, (float)bill.height };
|
Rectangle source = { 0.0f, 0.0f, (float)bill.width, (float)bill.height };
|
||||||
|
|
||||||
// NOTE: Billboard locked on axis-Y
|
// NOTE: Billboard locked on axis-Y
|
||||||
@ -52,7 +54,7 @@ int main(void)
|
|||||||
Vector2 origin = Vector2Scale(size, 0.5f);
|
Vector2 origin = Vector2Scale(size, 0.5f);
|
||||||
|
|
||||||
// Distance is needed for the correct billboard draw order
|
// Distance is needed for the correct billboard draw order
|
||||||
// Larger distance (further away from the camera) should be drawn prior to smaller distance.
|
// Larger distance (further away from the camera) should be drawn prior to smaller distance
|
||||||
float distanceStatic;
|
float distanceStatic;
|
||||||
float distanceRotating;
|
float distanceRotating;
|
||||||
float rotation = 0.0f;
|
float rotation = 0.0f;
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
*
|
*
|
||||||
* raylib [core] example - Using bones as socket for calculating the positioning of something
|
* raylib [core] example - Using bones as socket for calculating the positioning of something
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★★★] 4/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
||||||
*
|
*
|
||||||
* Example contributed by iP (@ipzaur) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by iP (@ipzaur) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
@ -9,7 +11,7 @@
|
|||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024 iP (@ipzaur)
|
* Copyright (c) 2024-2025 iP (@ipzaur)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Detect basic 3d collisions (box vs sphere vs box)
|
* raylib [models] example - Detect basic 3d collisions (box vs sphere vs box)
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.3, last time updated with raylib 3.5
|
* Example originally created with raylib 1.3, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Cubicmap loading and drawing
|
* raylib [models] example - Cubicmap loading and drawing
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 1.8, last time updated with raylib 3.5
|
* Example originally created with raylib 1.8, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - Draw textured cube
|
* raylib [models] example - Draw textured cube
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2022-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2022-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
*
|
*
|
||||||
* raylib [models] example - first person maze
|
* raylib [models] example - first person maze
|
||||||
*
|
*
|
||||||
|
* Example complexity rating: [★★☆☆] 2/4
|
||||||
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 3.5
|
* Example originally created with raylib 2.5, last time updated with raylib 3.5
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2019-2025 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|||||||