3263 Commits
2.5.0 ... 4.5.0

Author SHA1 Message Date
ashn
fec96137e8 Update Makefile comment to indicate arm64 as a supported Linux desktop platform (#2965) 2023-03-18 17:37:04 +01:00
Ray
18a36b3e06 Update raylib.sln 2023-03-18 17:35:14 +01:00
Ray
40d01162b9 Merge branch 'master' of https://github.com/raysan5/raylib 2023-03-17 00:05:51 +01:00
Ray
e8a5d7b85c Update CHANGELOG 2023-03-17 00:05:40 +01:00
Brian E
e06047419c Added my BQN Library to the list (#2962)
I'm the only maintainer and have been working hard recently to get my library to be as nice to use as possible. I found out about this language list, and getting a new language on it didn't seem so bad. A bonus for my efforts.
2023-03-16 22:45:42 +01:00
Ray
03516b1c68 Update npes_saved_w64devkit.txt 2023-03-15 19:09:30 +01:00
Ray
7ab24b94ee Delete c_raylib.xml 2023-03-15 19:09:27 +01:00
Ray
bf3e527dab Update config.h 2023-03-15 17:51:23 +01:00
Ray
b31c836456 Update CHANGELOG 2023-03-15 17:51:03 +01:00
ashn
1aacefd6fa Add raylib-sunder to BINDINGS.md (#2958) 2023-03-15 14:56:24 +01:00
Ray
3b4f9faebc UPDATED: Notepad++ instellisense data 2023-03-15 13:17:14 +01:00
Ray
159e6b6f24 UPDATED: raylib-parser output files (TXT, XML, JSON, LUA) 2023-03-15 13:13:48 +01:00
Ray
ad2067340f REVIEWED: TraceLog(), avoid possible buffer overflow 2023-03-15 13:03:55 +01:00
veins1
cf04425bc2 Spelling (#2957) 2023-03-14 19:23:17 +01:00
Ray
796d96408b Update HISTORY.md 2023-03-14 14:06:37 +01:00
Ray
54ccb18e87 Update write_depth.fs 2023-03-14 13:39:33 +01:00
Ray
3d64598e11 Update Makefile 2023-03-14 13:14:19 +01:00
Ray
7ac2b4a226 Update HISTORY.md 2023-03-14 13:07:24 +01:00
Ray
2b9ef7d15c Update ROADMAP.md 2023-03-14 13:06:22 +01:00
Ray
975c70d2b7 Update rlgl.h 2023-03-14 13:06:17 +01:00
Ray
a6300d828a Update CHANGELOG 2023-03-14 13:05:58 +01:00
Ray
1a361fdfe2 Update Makefile.Web 2023-03-13 23:24:30 +01:00
Ray
5a2c49b954 Updated Makefiles to include all missing new examples 2023-03-13 23:13:02 +01:00
Ray
90ec0d52e0 Reviewed filename 2023-03-13 23:12:23 +01:00
Ray
a7f81b06b9 Remove trailing spaces 2023-03-13 12:08:23 +01:00
Ray
393b0d1a80 Delete rcamera.old.h 2023-03-13 12:06:54 +01:00
Ray
9a115106b4 Update miniaudio.h 2023-03-13 11:48:34 +01:00
Ray
a3b7bd0891 Update webassembly.yml 2023-03-13 11:44:49 +01:00
Ray
dad0e64aa8 Update HISTORY.md 2023-03-13 11:44:02 +01:00
Ray
90e36d1883 Update ROADMAP.md 2023-03-13 10:54:06 +01:00
Ray
8873aca268 Update CHANGELOG 2023-03-12 21:09:50 +01:00
Ray
ce28dfbdeb Update CHANGELOG 2023-03-12 21:03:21 +01:00
Ray
e4bc2c643e Update README.md 2023-03-12 20:52:24 +01:00
Ray
54f01e151c Update CHANGELOG 2023-03-12 20:50:19 +01:00
Ray
11e9a0d41c Update CHANGELOG 2023-03-12 20:48:49 +01:00
Ray
4f38830058 Some tweaks 2023-03-12 20:14:32 +01:00
Ray
520ea94de8 Update version to raylib 4.5 2023-03-12 19:52:24 +01:00
Ray
8ca3212701 REVIEWED: UpdateCameraPro() to use Vector3 2023-03-12 19:40:43 +01:00
Ray
f9c4cc2040 ADDED: UpdateCameraPro() -Experimental-
REVIEWED: rcamera module formating
REVIEWED: `core_3d_camera_example`
2023-03-12 19:28:42 +01:00
Ray
b436c8d7e5 ADDED: Security check for emscripten_run_script() #2954 2023-03-12 13:48:11 +01:00
Ray
ee3e40c663 Update rcore.c 2023-03-12 13:47:02 +01:00
Ray
4fd1e04e70 Update CHANGELOG 2023-03-07 21:03:44 +01:00
Ray
4f7b5ff59f WARNING: REMOVED: UnloadModelKeepMeshes() 2023-03-07 20:40:45 +01:00
Ray
ab1e246367 REVIEWED: Data types validation 2023-03-07 20:33:45 +01:00
Ray
15716e59dc Update CHANGELOG 2023-03-07 20:07:54 +01:00
Ray
aa3c7f4614 Merge branch 'master' of https://github.com/raysan5/raylib 2023-03-07 19:55:02 +01:00
Ray
ae53600d31 WARNING: REMOVED: Multichannel audio support API 2023-03-07 19:54:53 +01:00
Ray
57f0015a08 Update CHANGELOG 2023-03-07 19:51:17 +01:00
Ray
1b873b028f WARNING: REMOVED: Multichannel audio support API
It was quite restrictive and hacky implementation, just load multiple types same sound to play multiple instances.
2023-03-07 19:48:47 +01:00
Ray
3a332d241c Update CHANGELOG 2023-03-07 11:32:37 +01:00
Sid K
0b18882a94 fix(build): Fix DLL build on Windows (#2951)
Changes the DLL export condition to apply to platform WIN32 instead of
compiler MSVC
2023-03-06 21:10:18 +01:00
Ray
8f7e2cd179 Replace TABS by 4 spaces 2023-03-06 15:05:57 +01:00
Ray
614e0518a7 Remove trailing spaces 2023-03-06 14:58:58 +01:00
Ray
cf1ebada0e Tweak WindowDropCallback() #2943 2023-03-06 13:15:13 +01:00
Ray
aae7ab64c7 Update raudio.c 2023-03-06 13:00:30 +01:00
Ray
68ee0bb8dd ADDED: QOA music streaming (with auxiliar lib)
Some format tweaks
2023-03-06 12:33:49 +01:00
Ray
d3f5bc4043 REVIEWED: GetWindowHandle() #2950 2023-03-05 20:06:45 +01:00
Ray
f4f6e25340 Support QOA audio file format by default 2023-03-05 14:07:02 +01:00
Ray
9614d3353b REVIEWED: QOA audio file export 2023-03-05 13:49:18 +01:00
Ray
ab14ad5d75 Close issue #2949 2023-03-05 11:26:37 +01:00
Ray
0eeb499288 Update qoa.h 2023-03-05 11:17:47 +01:00
Ray
5492f52adc Change default threading model for COM objects
It shouldn't matter much but it could avoid some conflicts with other libraries in the future (like `tinyfiledialogs`).
2023-03-05 00:09:56 +01:00
Ray
1611cd54e7 REVIEWED: GetWindowHandle() #2938 2023-03-04 18:56:04 +01:00
Ray
6897b43599 REVIEWED: core_drop_files #2943 2023-03-03 20:13:35 +01:00
Antonis Geralis
394b31faff Add GL_MIN GL_MAX blending equations (#2945) 2023-02-26 12:01:42 +01:00
Ray
73c9f72c52 Update rtextures.c 2023-02-25 22:32:50 +01:00
Ray
7fd2bf1a32 Minimal tweak 2023-02-25 01:07:52 +01:00
Ray
215eb967e8 Update rcore.c 2023-02-24 18:31:16 +01:00
Ray
cb2ba3675c REVIEWED: rlUnloadFramebuffer() #2937 2023-02-24 16:19:25 +01:00
Ray
ca98a84d68 Update rtext.c 2023-02-24 15:27:25 +01:00
fubark
110eab56a7 Add Cyber to BINDINGS.md (#2939) 2023-02-24 00:48:28 +01:00
Ray
d5a31168ce REVIEWED: Data validation 2023-02-23 18:08:15 +01:00
Ray
d652b95fbf ADDED: Security checks 2023-02-22 17:28:25 +01:00
Ray
153470d605 REVIEWED: GenMeshTangents(), avoid crash on missing texcoords data #2927 2023-02-21 23:55:55 +01:00
Ray
b4d824d6fc REVIEWED: GetMonitorWidth() and GetMonitorHeight() #2934 2023-02-21 23:10:03 +01:00
Ray
8169d0eab2 REVIEWED: IsWindowFocused() to consider Android App state #2935 2023-02-21 23:01:23 +01:00
Ray
b2926b2d28 Update rtextures.c 2023-02-21 13:20:52 +01:00
Ray
3cade2a1a0 REVIEWED: IsImageReady() and IsTexureReady()
Reordered some functions to avoid config.h issues when disabling some features.
2023-02-21 13:20:04 +01:00
Ray
bcae065c88 REVIEWED: IsShaderReady() 2023-02-21 13:15:11 +01:00
Ray
1347a15539 ADDED: SetWindowIcons() to set multiple icon image sizes 2023-02-21 13:14:51 +01:00
hkc
d26a56d4e1 Added mixed audio processor (#2929)
* Use RL_QUADS/RL_TRIANGLES for single-pixel drawing

Addresses problem mentioned in
https://github.com/raysan5/raylib/issues/2744#issuecomment-1273568263
(in short: when drawing pixels using DrawPixel{,V} in camera mode,
upscaled pixel becomes a line instead of bigger pixel)

* [rtextures] Fixed scaling down in ImageTextEx

Closes #2755

* Added global audio processor

* Renamed struct member to follow naming conventions

* Added example for AttachAudioMixedProcessor
2023-02-20 11:13:24 +01:00
Ray
47dd842e81 Minor format tweaks 2023-02-15 18:11:46 +01:00
Ray
f594f14510 Reviewed typo and formating 2023-02-15 18:01:42 +01:00
Ray
2766835ed4 REPLACE: TABS by 4 spaces 2023-02-15 17:36:31 +01:00
Jeffery Myers
9eaed07b77 Make the oribital camera work like it used to (it is not just a copy of third person) (#2926) 2023-02-15 17:17:00 +01:00
Ray
beb44f1dac Avoid centering mouse when program launches 2023-02-15 13:11:26 +01:00
Ray
903d85e323 Make sure window position always inits in the middle of the current monitor 2023-02-15 12:53:41 +01:00
Ray
5dedb27ce0 REVIEWED: Issue with camera jump on first frame 2023-02-14 22:51:34 +01:00
veins1
ec95aa2e04 Move camera after rotation (#2923)
Moving camera after rotation is set to avoid 1 frame delay in movement direction
2023-02-14 22:29:32 +01:00
Ray
1cfb484100 ADDED: Example project to VS 2023-02-14 20:31:42 +01:00
Ray
e843be7ea5 ADDED: rcamera dependencies details 2023-02-14 20:13:13 +01:00
Ray
547819766f ADDED: Example project to VS2022 solution 2023-02-14 20:12:53 +01:00
Ray
50d17393a5 Create models_loading_m3d.vcxproj 2023-02-14 20:00:56 +01:00
Ray
ea590c44a9 REVIEWED: Camera redesign PR 2023-02-14 20:00:51 +01:00
Crydsch Cube
73989a4981 WIP rcamera redesign vector (#2563)
* core functionality CAMERA_FREE

* fix example

* add remaining camera modes

* add view bobbing

* view bobbing

* catch curser in SetCameraMode

* adjust examples

* fix compilation on linux

* fix example text_draw_3d

* actually fix text_draw_3d

* Updated camera API

* Improve Vector3RotateByAxisAngle() function

* remove camera.mode dependency from low-level functions

* remove camera.mode from struct

* fixes after rebase

* adjust examples for new UpdateCamera function

* adjust example models_loading_m3d

---------

Co-authored-by: Ray <raysan5@gmail.com>
2023-02-14 17:47:21 +01:00
Ray
f1bcabcc37 Update CHANGELOG 2023-02-12 13:48:11 +01:00
Ray
a9c28d7583 Update CHANGELOG 2023-02-12 13:46:26 +01:00
Ray
22287a78c5 Update qoa.h 2023-02-12 13:29:39 +01:00
Ray
96a9b4e1f2 REVIEWED: config.h format and inconsistencies 2023-02-12 13:28:35 +01:00
Ray
21961a786d REVIEWED: Vertex colors support on M3D loading #2878 2023-02-12 12:10:01 +01:00
Ray
4647441ad8 Update rl_gputex.h 2023-02-12 01:10:54 +01:00
BugraAlptekinSari
4ae0a416f4 Added raymarch example and thumbnail for write depth (#2919) 2023-02-11 13:37:50 +01:00
Julio C. Galindo
6ae21d6581 Fixed some grammar mistakes and typos. (#2914)
* Fixed some grammar mistakes.

* Fixed some typos.
2023-02-09 13:17:47 +01:00
Sasquatch ヽ(´ー` )┌
5c6a756014 Update raylib-hx bindings to 4.2 in BINDINGS.md (#2916) 2023-02-08 13:45:34 +01:00
Nikolas
f784961b9c Enable GetWindowHandle() on macOS (#2915) 2023-02-07 22:18:14 +01:00
Ray
e187b693ea Update raudio.c 2023-02-06 11:02:46 +01:00
star-tek-mb
04ab76b889 zig build: do not use deprecated functions (#2913) 2023-02-06 10:28:24 +01:00
Ray
1fea266472 Clean trailing spaces 2023-02-05 16:30:23 +01:00
Ray
c91190fc6e Review QOA sound loading -WIP- 2023-02-05 16:28:04 +01:00
star-tek-mb
ff70a04bf5 update zig build to latest master (#2910)
also, adds package manager support
2023-02-05 13:03:03 +01:00
Ray
60d0ab418a some typos review 2023-02-05 11:44:12 +01:00
HKrogstie
8c50da167d fix DrawMesh using SHADER_LOC_COLOR_SPECULAR as a material map (#2908) (#2909) 2023-02-05 11:04:30 +01:00
Ray
589892af07 Support QOA audio format on ExportWave() -WIP- 2023-02-04 20:27:47 +01:00
Ray
901c4553d2 ADDED: QOA audio format support -WIP- 2023-02-04 20:20:21 +01:00
Ray
43e45cbb81 Replace TABS by 4 spaces 2023-02-04 20:19:51 +01:00
Ray
7914332c40 Update qoi.h 2023-02-03 14:54:28 +01:00
Ian McFarlane
b9e49cdca6 rcamera: move y clamp to before 3d projection (#2905) 2023-02-03 14:52:15 +01:00
Antonis Geralis
212f331583 Update core_input_gamepad.c (#2903) 2023-02-01 15:13:25 +01:00
Ray
d827a65e59 Update external libraries
Switch to official `stb_vorbis.c` instead of using an outdated fork
2023-02-01 11:45:42 +01:00
Ray
a151cbd37a ADDED: Vector2LineAngle() #2887
REVIEWED: `Vector2Angle()`
2023-02-01 11:18:55 +01:00
Nikolas
89171a2608 Add WASM support for Zig build (#2901)
* Add WASM support for Zig build

* Improve Web example building

* Remove emscript example building with Zig again

* Readd windows emscripten variables
2023-02-01 11:09:03 +01:00
Ray
c94c666d04 Review formatting for M3D loading vertex colors 2023-01-30 17:05:12 +01:00
Uneven Prankster
929a46cbab [models] Fix M3D vertex color import. (#2878)
* Fix vertex color import for .m3d

* Only load vertex colors when color map and/or materials are present

* Only execute when color array is present

---------

Co-authored-by: Uneven Prankster <unevenprankster@pm.me>
2023-01-30 17:00:39 +01:00
Dor Shapira
df5a736c00 fix typo (#2899)
patrix=>matrix
2023-01-28 19:26:41 +01:00
Rob Loach
7fff1ba0b0 ADDED: IsModelReady(), IsMaterialReady(), IsTextureReady(), IsRenderTextureReady() (#2895) 2023-01-28 12:13:09 +01:00
Antonis Geralis
0b42da4085 Raylib.h has exceeded 512 functions! (#2896) 2023-01-27 23:33:15 +01:00
Rob Loach
83ff7b2466 ADDED: IsShaderReady(), IsImageReady(), IsFontReady(), IsWaveReady(), IsSoundReady(), IsMusicReady() (#2892)
These IsReady() functions provide a method in order to verify whether or not the object was loaded successfully. They're useful to make sure the assets are there prior to using them.
2023-01-27 19:24:03 +01:00
Jeffery Myers
81ca2f0bf3 Fix warnings and bad project settings for 4.5 release (#2894) 2023-01-27 19:20:42 +01:00
Ray
af66e751db Update CHANGELOG 2023-01-26 23:20:14 +01:00
Ray
000cb5a47d Update CHANGELOG 2023-01-26 23:18:06 +01:00
Kenta
f088548261 Update BINDINGS.md (#2889)
Update Kaylib license to Zlib
2023-01-26 10:52:59 +01:00
Ray
0125790801 Update rmodels.c 2023-01-25 23:13:17 +01:00
Jeffery Myers
63da7cdec6 add include guards on config.h (#2888) 2023-01-25 22:26:03 +01:00
Antonis Geralis
4adba0d3c3 Add wayland support (#2883) 2023-01-25 22:25:25 +01:00
Dor Shapira
7cdffcec52 fixed typo (#2886)
pilepine=>pipeline
chosing=>choosing
additioanlly=>additionally
attachmment=>attachment
initialize=>inititialize
Binded=>Bound
lattest=>latest

hi @raysan5, I ran rlgl.h into some "typo checking" program(basically a JetBrains IDE), and here are all the things that the program was able to spot and fix. as my English isn't really well I would like it if you could check that I didn't make any mistakes in the typo fixing...
2023-01-24 23:43:09 +01:00
Ray
f68bb8c707 REVIEWED: rlGenTextureMipmaps(), GPU generation only 2023-01-24 17:17:25 +01:00
Ray
5149da5719 Merge branch 'master' of https://github.com/raysan5/raylib 2023-01-24 17:16:44 +01:00
Ray
5b3c5e1a16 REVIEWED: ProcessMaterialsOBJ() available when required 2023-01-24 17:16:35 +01:00
PencilAmazing
542ef8904a [models] Load bone names from IQM file if available (#2882)
* Load bone names from IQM file if available

* Formatting and default bone name
2023-01-23 19:55:02 +01:00
Ray
393a03a46e Removed twitter badge, twitter API seems to be limited 2023-01-23 15:28:45 +01:00
Rob Loach
4706891cae Add RAYLIB_VERSION numbers to raylib.h (#2856)
Ran into an issue in raylib-cpp where a user was using raylib 4.5-dev, even though the library currently only targets 4.2. With having RAYLIB_VERSION_MAJOR and RAYLIB_VERSION_MINOR, we will be able to target different versions of raylib in different ways, via C preprocessor conditionals.

For example:
``` c
newColor = ColorTint(BLUE, RED);
TraceLog(LOG_INFO, "The color should be tinted, but this isn't supported in ryalib <= 4.2");
```
2023-01-22 15:29:29 +01:00
Rob Loach
d8af76f67c Fix to use TRACELOG() instead of TraceLog() for internal modules (#2881)
There were a few raylib modules that continued to use TraceLog() instead of the TRACELOG() macro. This change ensures that all the internal raylib modules use the TRACELOG() pattern consistently.
2023-01-22 11:10:38 +01:00
Ray
78ae3b38a6 minor format tweak 2023-01-21 19:31:47 +01:00
Antonis Geralis
e539aad118 Fix android sound issue #2118 (#2875) 2023-01-21 18:52:31 +01:00
Uneven Prankster
19715546b3 Stub out rlCubemapParameters if under GL 1.1. (#2876)
Co-authored-by: Uneven Prankster <unevenprankster@pm.me>
2023-01-21 18:51:33 +01:00
KOLANICH
342b18da03 Add packaging for distros with deb- and rpm-based packages. (#2877) 2023-01-21 18:50:38 +01:00
Jeffery Myers
c649bec26c Have LoadMaterials call the same code that OBJ loader does so that we can read MTL files (#2872) 2023-01-20 16:13:19 +01:00
Masoud Naservand
e64606a82f Correct the set paths in bat files in examples/ (#2870)
Co-authored-by: Masoud Naservand <masoud.naservand@gmail.com>
2023-01-20 16:07:43 +01:00
Jeffery Myers
edaca16d7c Fix warnings in raylib project from MSVC (#2871) 2023-01-20 16:05:19 +01:00
Jeffery Myers
116603e61c don't try to free a void* buffer as if it's a cgltf_data structure (#2867) 2023-01-19 21:21:05 +01:00
Uneven Prankster
76468bb8d8 Add rlCubemapParameters to rlgl.h (#2862)
Co-authored-by: Uneven Prankster <unevenprankster@pm.me>
2023-01-19 20:53:30 +01:00
Ghost
2a2f2b20b8 Fixed bug : touches become sticky (#2857)
Touches became sticky and didn't disappear after using more than 2 fingers, fixed by getting the touch count of how many fingers are on the screen, and only looping through the available/pressed down touch points instead of looping through the maximum touch points.
Tested with more than 10 touch points, and with different MAX points value, working perfectly.
2023-01-14 19:41:42 +01:00
Kenta
aed131a8f0 Update BINDINGS.md (#2858)
* Update BINDINGS.md

Add Kaylib - Kotlin/Native binding for 4.5-dev (proper binding).
Add Raylib-Nelua - Nelua binding for 4.5-dev with working wasm export.

* Update BINDINGS.md
2023-01-14 19:40:48 +01:00
Tobias Mock
d224414eb1 Update raylib-ocaml to 4.2.0 (#2853) 2023-01-11 18:07:35 +01:00
Daijiro Fukuda
c6376acfc4 Set initial window position for display-sized fullscreen (#2742) 2023-01-10 12:45:53 +01:00
Ray
3028bffd4c Minor tweaks 2023-01-10 12:38:21 +01:00
Go Watanabe
f549f67be9 OpenGLES 2.0 support on PLATFORM_DESKTOP (#2840)
* OpenGLES 2.0 support on PLATFORM_DESKTOP

* exmples raylib_opengl_interop desktop GLES2 support

* rename gles2.h -> glad_gles2.h
2023-01-10 12:34:06 +01:00
Ray
6dd1d2d931 ADDED: Required define on Linux #2729 2023-01-10 12:20:45 +01:00
Ray
bba6ae5622 RENAME: type to projection #2851 2023-01-10 12:16:42 +01:00
Ray
ce8000ee7e REVIEWED: GetClipboardText() on PLATFORM_WEB 2023-01-04 20:13:44 +01:00
Ray
89755e52bf REVIEWED: rLoadTextureDepth() fixed issue 2023-01-04 17:35:51 +01:00
Ray
73234d2a28 Avoid trying to setup uniform for invalid locations 2023-01-03 17:44:06 +01:00
Ray
39f9045703 Update models_loading_gltf.c 2023-01-02 20:59:25 +01:00
Ray
b854909803 Update models_loading_gltf.c 2023-01-02 20:48:02 +01:00
Ray
d3c1a04983 REVIEWED: GLTF animations support #2844 2023-01-02 20:46:33 +01:00
Charles
f2e3d6eca7 [models] Add GLTF animation support (#2844)
* add GLTF animation support

* use correct index when allocating animVertices and animNormals

* early exit LoadModelAnimationsGLTF if the gtlf file fails to parse

* update models/models_loading_gltf.c to play gltf animation

Updated the .blend file to use weights rather than bone parents so it
fits into the framework. Exported with weights to the .glb file.

* fix order of operations for bone scale in UpdateModelAnimation

* minor doc cleanup and improvements

* fix formatting

* fix float formatting

* fix brace alignment and replace asserts with log messages
2023-01-02 20:23:48 +01:00
Ray
fabedf7636 Merge branch 'master' of https://github.com/raysan5/raylib 2023-01-02 17:06:55 +01:00
Ray
62f63f9e48 REVIEWED: Avoid possible gamepad index as -1 #2839
WARNING: It could require further review of `GamepadThread()` function where `js_event gamepadEvent.number` detecting current pressed button could generate a missmatch with index 0 (reserved for button unknow). Or maybe `0` could just be `GAMEPAD_BUTTON_NONE`? In that case, consistency with other inputs should be carefully considered...
2023-01-02 17:06:52 +01:00
Antonis Geralis
1dbcce8b56 Use explicit atomics (#2849)
* Use explicit atomics

* missed one

* use relaced ordering
2023-01-02 16:48:53 +01:00
Ray
0ccc1d3686 Update year to 2023 2023-01-01 19:07:58 +01:00
Ray
5ba41e4f7f REVIEWED: shaders_write_depth example 2023-01-01 18:31:03 +01:00
BugraAlptekinSari
3cfb9a6e83 [example] Writing into the depth buffer (#2836)
* Add a depth buffer example.

* Fixed a typo
2023-01-01 18:17:28 +01:00
Ray
30b75702df Update year to 2023 2023-01-01 18:09:22 +01:00
Ray
e2a8066fca Update year to 2023 2023-01-01 16:07:51 +01:00
Ray
b59fab7ee6 Update year to 2023 2023-01-01 16:00:56 +01:00
Wytek01
713e26332f Update year to 2023 (#2846)
* Update year to 2023

* Update raylib.h year to 2023
2023-01-01 12:55:49 +01:00
Antonis Geralis
ba38fe5b97 core_loading_thread example join thread on completion (#2845)
* core_loading_thread example join thread on completion

* error checking
2022-12-31 19:25:35 +01:00
turborium
dbdbbea471 Add new Delphi/Lazarus bindings (#2838)
TurboRaylib - dynamic bindings of ray lib for Delphi/Lazarus
2022-12-28 11:04:55 +01:00
Ray
03cc540d5f Minor tweak 2022-12-18 18:00:21 +01:00
Ray
d7f7c94c4d REVIEWED: Vector2Angle() 2022-12-18 18:00:14 +01:00
Ray
72b9f3c5de Minor tweaks 2022-12-17 12:15:19 +01:00
Antonis Geralis
d1a104bba4 Fix vector2angle (#2832)
* Fix vector2angle

* Fix ;

* use acosf

* need a break

* add comments
2022-12-17 12:13:40 +01:00
Ray
c2b56c583a Merge branch 'master' of https://github.com/raysan5/raylib 2022-12-14 13:00:29 +01:00
Ray
619331f4a7 REVIEWED: Issue with depth textures on WebGL #2824 2022-12-14 12:57:39 +01:00
Alexander Heinrich
3419aef677 Fix Vector2Angle() (#2829)
With this fix the function still returns negative values, which is
wrong. But we keep this behaviour to maintain backwards compatibility.
2022-12-13 18:59:00 +01:00
Ray
445ce51e51 Update Makefile 2022-12-13 10:46:49 +01:00
simendsjo
884d30b85a Use GLVND also for old cmake versions (#2826)
Use GLVND also when legacy implementations exist for old cmake versions
<= 3.10. This is a breaking change for old cmake versions (prior to
around 2017-10-05) which will now use GLVND rather than defaulting to
libGL.

This fixes the following warning when building:

    CMake Warning (dev) at /gnu/store/qv13zgbmyx0vjav8iiqp772kp6rxvwnd-cmake-3.24.2/share/cmake-3.24/Modules/FindOpenGL.cmake:315 (message):
      Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
      available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      FindOpenGL found both a legacy GL library:

        OPENGL_gl_LIBRARY: /home/simendsjo/.guix-profile/lib/libGL.so

      and GLVND libraries for OpenGL and GLX:

        OPENGL_opengl_LIBRARY: /home/simendsjo/.guix-profile/lib/libOpenGL.so
        OPENGL_glx_LIBRARY: /home/simendsjo/.guix-profile/lib/libGLX.so

      OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
      compatibility with CMake 3.10 and below the legacy GL library will be used.
    Call Stack (most recent call first):
      cmake/LibraryConfigurations.cmake:21 (find_package)
      src/CMakeLists.txt:46 (include)
    This warning is for project developers.  Use -Wno-dev to suppress it.

See https://cmake.org/cmake/help/latest/policy/CMP0072.html

Closes #2825
2022-12-11 13:37:38 +01:00
Ray
c04c3668cb Update windows.yml 2022-12-10 13:09:05 +01:00
Ray
855a5f3701 Update windows.yml 2022-12-10 13:06:13 +01:00
Ray
6d59a21e99 Update windows.yml 2022-12-10 13:01:57 +01:00
Ray
935a306b29 Update windows.yml 2022-12-10 12:44:25 +01:00
Ray
2c9d116a5c ADDED: ColorTint(), ColorContrast() 2022-12-07 12:52:42 +01:00
Ray
f1368c36dd ADDED: ColorBrightness() 2022-12-05 00:24:55 +01:00
Ray
4de64f5750 Expose OpenGL blending mode factors and functions/equations 2022-12-04 13:22:37 +01:00
Ray
89698844a1 REVIEWED: Example: textures_textured_curve 2022-12-04 11:01:59 +01:00
Jeffery Myers
57dd345dc3 Add a textured curve example (#2821) 2022-12-03 22:55:05 +01:00
Ray
5b5dff3f9e format tweak 2022-12-02 11:59:54 +01:00
Ray
a4079ad565 Update Makefile 2022-12-02 11:59:43 +01:00
Hristo Iliev
387c060006 Fix an issue when compiling for web (#2820)
It would try to use the glfw on the system but we're cross-compiling for web where the implementation is provided by emscripten's team
2022-11-30 10:36:01 +01:00
Ray
0b6d4b376f REVIEWED: Image fileformat support: PIC, PNM 2022-11-29 17:28:23 +01:00
Ray
d241ee8516 ADDED: Optional support for PNM images (.ppm, .pgm) 2022-11-29 10:58:27 +01:00
Ray
2edf5a9584 REVIEWED: Issue with shader linkage 2022-11-29 10:45:10 +01:00
jtainer
50a716c0d9 Updated rcore.c, renamed 'time' to 'nanoSeconds' (#2816)
* Updated rcore.c, renamed 'time' to 'time_nsec'

When PLATFORM_ANDROID, PLATFORM_RPI or PLATFORM_DRM were defined, there is a compilation error to redefinition of the variable 'time', so the second instance of 'time' was changed to 'time_nsec' which both fixes the name collision and more accurately describes what that variable represents.

* Renamed 'time_nsec' to 'nanoSeconds'
2022-11-29 00:46:10 +01:00
Daijiro Fukuda
57bd84510f Fix wrong compile definition (#2815) 2022-11-28 22:36:22 +01:00
Daijiro Fukuda
66a2cdee40 Fix array out of range (#2814)
This breaks other values of the struct.
2022-11-28 22:35:44 +01:00
Ray
bbf9935828 Update github workflows 2022-11-28 21:03:21 +01:00
Ray
fc5894e734 REVIEWED: Some compilation warnings (for strict rules) 2022-11-28 14:16:59 +01:00
Antonis Geralis
2fd6d7e8c0 Use const for pointer float array (#2807)
* Use const for pointer float array

* missed a definition
2022-11-24 00:58:56 +01:00
Antonis Geralis
2c77b31e30 Correct types for rlBindImageTexture (#2808) 2022-11-24 00:58:31 +01:00
gtrxAC
c48de2d1af Rename lighting_instanced shader (glsl100) to lighting_instancing (#2805)
* JSON parser: Use array for function params (#2255)

* Parser: follow C convention of type before name

* Update file names in build scripts

* Rename lighting_instanced shader to instancing
2022-11-22 18:16:44 +01:00
Ray
c0010105c2 REVIEWED: UnloadDirectoryFiles() 2022-11-22 17:09:39 +01:00
Ray
f6558fe6e0 Minor tweaks 2022-11-22 01:02:54 +01:00
Alex Macafee
36bb57d1be Add raylib-vapi (#2804) 2022-11-21 13:14:20 +01:00
Ray
e6306e5e76 REVIEWED: rlCullFace() -> rlSetCullFace()
Reviewed formating to follow raylib coding conventions.
2022-11-15 12:34:01 +01:00
jtainer
2761aa40dd Added function rlCullFace (#2797)
rlCullFace sets the face culling mode to RL_FRONT or RL_BACK which correspond to GL_FRONT and GL_BACK respectively.
2022-11-15 12:30:32 +01:00
Pere001
c8fd93d356 Warning on GetRandomValue range limit (#2800)
Added a comment explaining the range limitations of GetRandomValue.
Added a run-time warning TRACELOG when GetRandomValue is called with an invalid range.
2022-11-15 12:29:19 +01:00
Ray
2604b9f72b Merge branch 'master' of https://github.com/raysan5/raylib 2022-11-15 12:26:30 +01:00
Ray
3c51d066f1 Avoid using DrawCubeTexture() 2022-11-15 12:26:22 +01:00
Ray
656f47b7cc Update cmake.yml 2022-11-15 12:23:24 +01:00
Ray
2a88dc9bb7 Update linux_examples.yml 2022-11-15 12:22:26 +01:00
Ray
fadc29d811 WARNING: REMOVED: DrawCubeTexture(), DrawCubeTextureRec()
Those two functions have been moved to a new example: `models_draw_cube_texture`. The reasons for this decision:
 - Function inflexibility: Many users with the need to draw a textured cube could need to customize the texture applied to every face, that function did not allow that kind of functionality.
 - rlgl functionality exposure: The implementation exposed will teach users how to implement custom textured triangles drawing.
2022-11-15 12:16:28 +01:00
Jorge A. Gomes
4bb71c8fa2 Raylib-py updated to 4.2, plus parallel project (#2798)
Now Raylib-py is a releases-only project.
For now on, code maintenance will happen in a parallel project created to automate the binding generation: RaylibpyCtbg
2022-11-12 18:56:54 +01:00
Scott Helvick
baabe22f7a Add Claylib (CL bindings + convenience layer) (#2796) 2022-11-11 17:23:02 +01:00
Ray
025db8f227 Merge branch 'master' of https://github.com/raysan5/raylib 2022-11-10 12:03:26 +01:00
Ray
31edd13a72 Minor formating tweaks 2022-11-10 12:03:17 +01:00
Julianiolo
82e0644195 Fix Makefile emscripten path (#2785) 2022-11-10 11:51:51 +01:00
Ray
3888299bf5 WARNING: REMOVED: DrawTextureTiled()
This function implementation has been moved to the related example. Current implementation can be probably customized depending on user needs.
2022-11-10 10:17:37 +01:00
Ray
7f68c65406 WARNING: REMOVED: DrawTextureQuad()
This function can be easely replicated using `DrawtexturePro()` and actually it was doing some assumptions not transparent to the user. Even the function name was confusing. No example was available for it and actually noone requested one example.
2022-11-10 10:11:28 +01:00
Ray
84a2a88572 WARNING: REMOVED: DrawTexturePoly()
Function moved to `examples/textures/textures_polygon.c`, so users can learn from the implementation and create custom variants as required.
2022-11-10 10:05:11 +01:00
red thing
fca58c8e2f dray is now 4.2.0 (#2792) 2022-11-09 07:42:58 +01:00
Martin Wickham
311a57f9fc Add frameworks needed on macos (#2793) 2022-11-09 07:40:59 +01:00
Dor Shapira
773c0d78d8 removing typo (#2790) 2022-11-08 21:47:05 +01:00
Ray
ca6f58eed1 Update rcore.c 2022-11-05 00:31:13 +01:00
RGDTAB
dbdfad7ace Fix ExportDataAsCode() data types (#2787) 2022-11-04 20:39:04 +01:00
Roman Akberov
1cb81e3f4c Fix examples/build.zig for the latest Zig version (#2786) 2022-11-02 18:41:21 +01:00
IsaacTCB
4c4a703841 Fix Android x86 Architecture name (#2783)
When building a x86 project, the folder inside lib is named i686. However Android x86 actually expects the folder to be called x86.
2022-10-30 12:18:12 +01:00
Angga Permana
d91f30958f Fix deprecation error on android api higher than 23 (#2778) 2022-10-27 11:38:25 +02:00
nobytesgiven
5113817507 Improved billboards example, highlighting rotation and draw order (#2779)
* Improved billboards example, highlighting rotation and draw order

* changes to conform to the raylib conventions

* NOW it conforms

Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-26 19:16:35 +02:00
Ray
28e8b2add3 REVIEWED: Issue with OpenURL() 2022-10-26 18:04:20 +02:00
Dor Shapira
bcb47255b9 fixing typo (#2781)
fixing typo
2022-10-26 17:14:52 +02:00
Dor Shapira
bc60812d68 added raylib-python-ctypes bindings (#2780) 2022-10-26 17:14:24 +02:00
Yunoinsky
df4199e2c1 Add ChezScheme support (#2776) 2022-10-26 09:12:14 +02:00
nobytesgiven
c4abf68351 fixed blur issue on opaque pictures & added example (#2775)
Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-26 09:11:14 +02:00
Ray
865f823835 Review -s 2022-10-25 21:03:33 +02:00
nobytesgiven
dbecb95024 Added Box and Gaussian blurring (#2770)
* Added Box and Gaussian blurring

* Removed dependence of gaussian blur to box blur & Fixed precision errors

Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-25 17:56:06 +02:00
Ian Rash
072e92615a Updated support for crystal (#2774)
All fresh and current.
2022-10-25 10:51:40 +02:00
nobytesgiven
e5d332dea2 Fix bezier line breaking #2735 (#2767)
* Fixed bezier line breaking #2735

* converted tabs to spaces

* typo

* Changed doubles to floats

* removed heap allocations\

Co-authored-by: nobytesgiven <nobytesgiven@users.noreply.github.com>
2022-10-24 16:35:47 +02:00
Ray
d5cd5ebd80 Update to latest miniaudio (dev) 2022-10-24 13:37:20 +02:00
Ray
d71505bdc6 Update Makefile 2022-10-24 13:37:08 +02:00
Ray
483f10397e review note 2022-10-20 20:09:54 +02:00
Ray
d9f434afb9 Added -s EXPORTED_RUNTIME_METHODS=ccall to examples web build #2739 2022-10-20 20:07:29 +02:00
InKryption
40cf84e7e5 build.zig: let user decide how to set build mode + fix linker warning (#2763)
* build.zig: let user decide how to set build mode

This should delegate the responsibility of calling `standardReleaseOptions` and setting the build mode of the `*LibExeObjStep` step to the caller, especially since this might not be the process by which one wants to determine the build mode.

Also changes hides `getSrcDir` to enforce usage of `srcdir`, and asserts that the file is in fact inside a directory.

* build.zig: set root_src param to `null`

Supplying the header file as the root source here appears to cause a linker warning of the form:
```
LLD Link... warning(link): unexpected LLD stderr:
ld.lld: warning: {build_root}/zig-cache/o/{hash}/libraylib.a: archive member '{build_root}/zig-cache/o/{hash}/raylib.o' is neither ET_REL nor LLVM bitcode
```
Passing `null` instead fixes it.
2022-10-20 18:33:12 +02:00
Peter0x44
b8e14a4f99 Review parser Makefile (#2765)
* parser: Fail gracefully if a nonexistent file is passed on the command line

Before, if a nonexistent file was passed to LoadFileText(), it would
return NULL, and the parser would happily dereference it.

* parser: Refactor Makefile and update the path to easings.h (now reasings.h)

Before, the `make all` target would simply segfault, see 0a679d79
Now, if a file in the `make all` target doesn't exist, make will write
an error.

Individual API files can be generated likeso, provided the header file
the target depends on exists:

FORMAT=JSON EXTENSION=json make raygui_api.json

In order for the `make all` target to succeed, raygui.h, physac.h and
rmem.h need to be added to the correct directory.
2022-10-20 17:29:03 +02:00
ianband
7e7939e1ad Add DrawCapsule(Wires) (#2761)
* Add DrawCapsule & DrawCapsuleWires

* Add DrawCapsule & DrawCapsuleWires to example

Co-authored-by: Ian Band <ian.r.band@gmail.com>
2022-10-17 11:36:53 +02:00
Rob Loach
c5e89241c5 BINDINGS: Add Umka bindings to BINDINGS.md (#2760)
[raylib-umka](https://github.com/robloach/raylib-umka) provides [Umka scripting language](https://github.com/vtereshkov/umka-lang) bindings to raylib.
2022-10-16 00:25:52 +02:00
hkc
0b69bc28c6 Fix ImageTextEx and ImageDrawTextEx scaling (#2756)
* Use RL_QUADS/RL_TRIANGLES for single-pixel drawing

Addresses problem mentioned in
https://github.com/raysan5/raylib/issues/2744#issuecomment-1273568263
(in short: when drawing pixels using DrawPixel{,V} in camera mode,
upscaled pixel becomes a line instead of bigger pixel)

* [rtextures] Fixed scaling down in ImageTextEx

Closes #2755
2022-10-14 17:43:12 +02:00
Ray
e61639f6fc ADDED: GenImageText()
Probably useless but interesting for education. It generated a grayscale image directly from text data.
2022-10-14 10:51:43 +02:00
Kenta
ccd4f8b5ae Add C3 binding to BINDINGS.md (#2757) 2022-10-13 23:00:53 +02:00
Anut-py
11fd883ee4 Add Haskell bindings to BINDINGS.md (#2753) 2022-10-12 22:04:11 +02:00
CrezyDud
aa67f7c39a Fix & Simplify .vox signature check (#2752)
and make version check be only 150 not over 150
2022-10-12 17:14:18 +02:00
hartmannathan
f080367a0c examples/core/core_custom_logging.c: Fix typo (#2751) 2022-10-12 17:12:28 +02:00
Ray
07bbfe86b9 Update core_basic_window.c 2022-10-11 22:28:40 +02:00
hkc
8ebe62b4dd Use RL_QUADS/RL_TRIANGLES for single-pixel drawing (#2750)
Addresses problem mentioned in
https://github.com/raysan5/raylib/issues/2744#issuecomment-1273568263
(in short: when drawing pixels using DrawPixel{,V} in camera mode,
upscaled pixel becomes a line instead of bigger pixel)
2022-10-11 18:45:34 +02:00
Szieberth Ádám
4cca234f46 avoid leading spaces in text_rectangle_bounds (#2746) 2022-10-11 12:14:40 +02:00
Dor Shapira
0d04ceafbf build raylib_api without the 'vectex' tyops (#2749) 2022-10-11 12:14:01 +02:00
Dor Shapira
8025b052b3 fixing typo (#2748) 2022-10-11 11:20:29 +02:00
JupiterRider
cb085a1b50 Update BINDINGS.md (#2745) 2022-10-07 19:03:08 +02:00
Ray
cee0fc5d78 Update README.md 2022-10-07 16:33:39 +02:00
Ray
38025362ee Update version to raylib 4.5-dev to avoid confusions with 4.2 2022-10-07 16:22:44 +02:00
Ray
7a15861d44 Update rlgl.h 2022-10-06 00:56:18 +02:00
Ray
26969c2c38 Added BLEND_CUSTOM_SEPARATE #2741 2022-10-05 13:57:38 +02:00
Ray
25d846aa9a Avoid early return calls 2022-10-05 13:34:19 +02:00
Ray
9017be3259 Reviewed latest PR formating and variables naming #2741 2022-10-05 13:29:34 +02:00
凌溢狐
2d88958d35 Add rlSetBlendFactorsSeparate and custom blend mode modification checks (#2741) 2022-10-05 13:05:44 +02:00
Ray
2e26cf48e8 Merge branch 'master' of https://github.com/raysan5/raylib 2022-10-03 00:07:34 +02:00
Ray
7459d906de Update rtext.c 2022-10-03 00:07:22 +02:00
_Tradam
62d228346b Update build.zig to work with last GLFW update (#2737) 2022-10-02 20:29:48 +02:00
veins1
2872b2fff5 Clear PCM buffer state when closing audio device (#2736)
Fix for #2714
2022-10-02 19:30:26 +02:00
Ray
33e7f7cc59 WARNING: DrawLineBezier() implementation needs review #2721 2022-10-02 11:11:13 +02:00
Rob Loach
0daaaddeef Fix Gestures to use GetTime() if it's available (#2733) 2022-10-02 10:47:17 +02:00
Random
03f5fce672 removed glfwSetWindowPos on InitWindow (#2732)
* removed glfwSetWindowPos on InitWindow

* removed execute permission from CMakeLists
2022-10-02 10:46:33 +02:00
Ray
178a356cb4 minor tweaks 2022-09-30 23:07:29 +02:00
Random
f14955512f fix issue #2728 (#2731)
* fix issue #2728

* updated gamecontrollerdb: fixes GLFW warning due to invalid entry
2022-09-30 10:09:49 +02:00
Ray
45da03df23 Reviewed monitor checking order 2022-09-29 12:00:20 +02:00
Ray
4fe6f885f7 Update gamepad mappings with latest gamecontrollerdb, fix #2725 2022-09-29 11:23:25 +02:00
Ray
357f782f4e Merge branch 'master' of https://github.com/raysan5/raylib 2022-09-29 11:08:02 +02:00
Ray
0ced04f0df Fix #2722 2022-09-29 11:08:00 +02:00
Dor Shapira
587e61def9 fixing new typoes (#2727) 2022-09-28 20:04:59 +02:00
Dor Shapira
5c404c79da Update raylib.h (#2726) 2022-09-28 20:04:41 +02:00
Michael Scherbakow
8f88c61bdf update build.zig (#2720)
zig `master` now enforces to use addIncludePath instead of addIncludeDir
2022-09-27 01:27:22 +02:00
bXi
e9ca38fafa Clarified working of ImageDrawCircle and ImageDrawCircleV (#2719) 2022-09-26 12:24:10 +02:00
Ray
7ab056b6ef REVIEWED: GeneshHeightmap(), fix #2716 2022-09-25 15:41:49 +02:00
Ray
2ef0b064e5 Fix isssue #2718 2022-09-25 14:09:28 +02:00
Ray
ea87491a82 ADDED: Support CAPS/NUM lock keys registering if locked 2022-09-25 00:14:59 +02:00
Ray
810a0330ab WARNING: Several changes on UTF-8/Codepoints API
- ADDED: `GetCodepointPrevious()`
 - RENAMED: `GetCodepoint()` -> `GetCodepointNext()`, actually, reimplemented
 - `GetCodepoint()` has been kept for the moment, for compatibility and also because implementation is different
 - RENAMED: `TextCodepointsToUTF8()` to `LoadUTF8()`, simpler name and more aligned with raylib conventions (functions loading memory start with Load*()), parameters should be descriptive of functionailty.
 - ADDED: `UnloadUTF8()`, aligned with `LoadUTF8()` to avoid allocators issues.
2022-09-22 20:35:55 +02:00
Ray
4b1d4b4f6b Update rcore.c 2022-09-22 20:30:02 +02:00
Ray
907e9e1fe2 Update text_codepoints_loading.c 2022-09-22 20:29:54 +02:00
Ray
4311ffc9e1 REVIEWED: New functions coding conventions 2022-09-19 18:47:16 +02:00
Rob Loach
2093fdcc53 Added: ImageDrawCircleLines, ImageDrawCircleLinesV (#2713)
This adds `ImageDrawCircleLines()` and `ImageDrawCircleLinesV()` to draw outlines of circles, and updates `ImageDrawCircle()` draw a filled circle to match the effect of `DrawCircle()` and `DrawCircleLines()`.
2022-09-19 18:41:17 +02:00
Ray
0e5cd442be REVIEWED: Renamed some shaders, fix #2707 2022-09-19 18:29:08 +02:00
Ray
5530a3ceb8 REVIEWED: ScanDirectoryFilesRecursively(), fix #2704 2022-09-19 18:20:36 +02:00
Ray
6e8f3b0f45 Update rlgl.h 2022-09-19 10:35:34 +02:00
Ray
12e8cef9cf REMOVED: Mipmaps software generation for OpenGL 1.1
As generation is done in software, it's up to the user to do it. `ImageMipmaps()` is already provided for reference.
2022-09-19 10:31:55 +02:00
Denis Pobedrya
27781a4767 Remove touch points on touch up events on Android (#2711)
Fixes #2683

Remove elements from touch point related arrays when touch up and
similar events are processed. This makes GetTouchPointCount() always
report the actual count of touch points, and all positions returned by
GetTouchPosition() correspond to positions of currently happening
touches.
2022-09-18 23:01:10 +02:00
Gunko Vadim
7e3a50b4ac Update BINDINGS.md (#2710) 2022-09-18 22:36:59 +02:00
Nikolas
42ecd72547 [rlgl] Check for extensions before enabling them (#2706)
* [rlgl] Check for extensions before enabling them

* Shift to glad on macOS

* #undef CORE_OPENGL_33

* Remove version hack and fix ASTC compression assumption

* Remove loader from glad

* Use GLAD_MALLOC/FREE instead of malloc/free

* More explicit extension checking
2022-09-18 21:08:51 +02:00
Denis Pobedrya
8f597b3cc3 Basic gamepad support for Android (#2709)
Currently assumes a single gamepad, has no code specific to gamepad
detection (gamepad is "detected" when an event related to gamepad
arrives). Also assumes that all gamepads look roughly like an xbox/ps
controller. Both assumptions are not strictly true, but an
implementation like that probably covers 85% of usecases.

Also it doesn't update previousButtonState so functions
IsGamepadButtonPressed() and IsGamepadButtonReleased() don't work, but
they didn't work previously on Android anyway, and they are flaky on
desktop as they are now, so the mechanism for these two functions
probably should be reworked anyway.

It's certainly an improvement compared to the previous android gamepad
handling code, which put gamepad events into touch related structs.
2022-09-18 19:58:52 +02:00
Denis Pobedrya
ff25402f68 Fix viewport scaling bug on android after context rebind (#2703)
On android after rebinding context (which happens when you minimize and
navigate back to an app, or when you turn a screen off and back on)
there's a bug that viewport has a wrong scale and part of it is off
screen.

The change fixes it on devices I tried, but the solution feels hacky to
me. However when I attempted instead to call SetupViewport() again which
feels like a more proper solution, it didn't fix it.
2022-09-18 11:28:55 +02:00
Denis Pobedrya
8e57c8ace3 Fix touchscreen input related functions on Android (#2702)
Fix display -> screen coordinate conversion for android platform and
move it to the platform event handling code, simplifying
GetTouchPosition() function implementation.

Co-authored-by: Denis Pobedrya <denis.pobedrya@gmail.com>
2022-09-17 23:15:11 +02:00
AQuantumPotato
494a581339 Update BINDINGS.md (#2701)
Updated the list of projects that support 4.2
2022-09-17 23:14:00 +02:00
Rob Loach
4c3d577ddb CMake: Project template fix to easily target raylib version (#2700) 2022-09-17 23:12:57 +02:00
Ray
c328f09efc Move compressed textures loading to a separate self-contained library 2022-09-17 19:26:23 +02:00
Ray
cb9b8f73c0 ADDED: GenImagePerlinNoise() 2022-09-17 13:39:49 +02:00
murilluhenrique
eaa0b9102b Fix typo (#2696) 2022-09-16 00:06:25 +02:00
Nikolas
a12ddacb7b Enable DXT compression on __APPLE__ targets (#2694) 2022-09-12 12:21:41 +02:00
Ray
853c66baed REVIEWED: CheckCollisionPointPoly() 2022-09-10 23:56:52 +02:00
Ray
cf76d23476 Minor format tweaks 2022-09-10 10:23:38 +02:00
Ray
cf24c021a3 WARNING: BREAKING: Reviewed SSBO usage to avoid long long
raylib library tries to avoid `long long` usage. Several SSBO functions have been reviewed (including some renames for consistency) to minimize `long long` type usage.
2022-09-09 00:26:47 +02:00
Ray
b478364914 REVIEWED: Removed comment, fixes #2691 2022-09-09 00:04:08 +02:00
hartmannathan
c1b4881e8a examples/core/core_custom_logging.c: Fix typo (#2692) 2022-09-08 16:10:15 +02:00
Ray
ac1ffbad1d REVIEWED: Data type to unsigned 2022-09-07 00:39:38 +02:00
Ray
b09725fa84 REPLACED: rlVertex2i() by rlVertex2f() 2022-09-05 18:45:33 +02:00
Ray
e59442bfab REMOVED: rlPushMatrix()/rlPopMatrix() from rshapes
This simplification will allow the usage of `rshapes` as STANDALONE mode in a future. Only a small set of `rlgl` functions are required and they can be "more" easely replaced if no `rlPushMatrix()`/`rlPopMatrix()` are involved.

More simplification planned for the future, maybe the textures dependencies.
2022-09-05 18:23:25 +02:00
Ray
9996e328cb WARNING: BREAKING: Removed rlCheckRenderBatchLimit() requirement
Updated version to `rlgl 4.2`
2022-09-05 13:20:09 +02:00
Ray
ad5ffd78d6 REVIEWED: rlgl enums and comments 2022-09-05 11:15:28 +02:00
Ray
0917290e95 REVIEWED: M3D model loading #2688 2022-09-04 18:49:54 +02:00
Ray
ac3420faac Update core_custom_frame_control.c 2022-09-04 12:32:40 +02:00
skylar
ee5a87826d Fixed a bug in the 2d camera platformer example (#2687)
canJump used to alternate between true and false when on ground
2022-09-04 11:48:33 +02:00
Ray
f4b4054de5 REVIEWED: CheckCollisionPointPoly() 2022-09-04 10:45:01 +02:00
Jacek
aff98d7f2a Check collision point polygon (#2685)
* Update raylib.h

* CheckCollisionPointPolygon()

* typo
2022-09-04 10:39:03 +02:00
Ray
082920eb80 WARNING: RENAMED exported symbol to raylib_version #2671 2022-09-02 21:35:08 +02:00
Ray
de968e3623 WARNING: RENAMED symbol raylibVersion to raylib_version
I want to note this is a special symbol exported
2022-09-02 21:32:58 +02:00
Ray
2a798d64a2 Export raylibVersion symbol. Fixes #2671 2022-09-02 21:28:19 +02:00
Stan
234576da71 Removed raylib_opengl_interop.c from PLATFORM=Web build (#2682) 2022-09-02 09:13:35 +02:00
Ray
fb1037a241 ADDED: Complete support for M3D animations! #2648 2022-09-01 20:46:06 +02:00
Ray
64cca24526 ADDED: RL_TEXTURE_MIPMAP_BIAS_RATIO support to rlTextureParameters() for OpenGL 3.3 #2674 2022-09-01 11:18:22 +02:00
Ray
a598754b5b Update windows.yml 2022-09-01 11:04:10 +02:00
Ray
bb4d9297b5 Update windows.yml 2022-09-01 10:52:03 +02:00
Ray
4938966e76 Update windows.yml 2022-09-01 10:45:30 +02:00
Ray
cabaa53302 Update windows.yml 2022-09-01 10:44:25 +02:00
Ray
bfab101ac2 Update windows.yml 2022-09-01 10:42:11 +02:00
Ray
23cc39a265 Implemented latest .M3D improvements #2648 2022-09-01 10:27:16 +02:00
Ray
0c7ba773ec Fixed issue with LoadIQM() #2676 2022-09-01 10:14:45 +02:00
Ray
4b76aa09dd ADDED: lighting.fs for GLSL120 Fix #2651 2022-08-29 14:36:07 +02:00
Ray
d66692149b Update README.md 2022-08-28 18:04:47 +02:00
Ray
7f5567eec0 Reviewed GLFW compilation requirements on Linux: _GNU_SOURCE
Reasons to NOT define `_GNU_SOURCE`:

 - access to lots of nonstandard GNU/Linux extension functions
 - access to traditional functions which were omitted from the POSIX standard (often for good reason, such as being replaced with better alternatives, or being tied to particular legacy implementations)
 - access to low-level functions that cannot be portable, but that you sometimes need for implementing system utilities like mount, ifconfig, etc.
 - broken behavior for lots of POSIX-specified functions, where the GNU folks disagreed with the standards committee on how the functions should behave and decided to do their own thing.
2022-08-28 15:48:12 +02:00
Ray
be2328f848 Update Makefile 2022-08-28 15:39:22 +02:00
Ray
568fe42cb1 Reviewed GLFW issue with ppoll() function 2022-08-28 15:37:09 +02:00
Ray
482dbfc52e Avoid error on implicit-function-declaration 2022-08-28 15:28:57 +02:00
Ray
10ae54379a Update posix_poll.c 2022-08-28 15:25:34 +02:00
Ray
2236197d49 Update rglfw.c 2022-08-28 15:20:16 +02:00
Ray
9e0e08cba4 WARNING: UPDATED GLFW to latest master branch!
WARNING: This could be a BREAKING CHANGE for some platforms! I'm afraid something could be wrong on `rglfw.c` module.

To be able to compile on Windows I had to modify `glfw/src/platform.c` line 74. I couldn't manage to compile without that change, help is welcome!
2022-08-28 14:16:51 +02:00
Dmitry Matveyev
8508ae3d15 Update NimraylibNow! bindings version (#2667) 2022-08-28 13:35:39 +02:00
Milan Nikolic
99948a86e1 Update raylib-go bindings (#2665) 2022-08-27 18:07:30 +02:00
Ray
f66b1a3136 REVIEWED: Support M3D file loading #2648 2022-08-26 10:04:38 +02:00
Ray
ae745e4fa8 ADDED: -latomic library on Linux (only required for ARM32)
This linkage is only required for arm 32bit but I don't know how to detect that specific architecture in the Makefile...
2022-08-22 11:25:35 +02:00
Ray
e92bc8ca4e REVIEWED: M3D implementation #2648 2022-08-22 11:11:05 +02:00
Rodrigo Escar
aa4111a3b2 Fix PATH for Web target (#2647) 2022-08-21 11:45:37 +02:00
Daijiro Fukuda
7bb8ffc29e Win32: resolve some symbols re-definition of windows.h in glfw3native.h (#2643)
* Win32: resolve some symbols re-definition of windows.h in glfw3native.h

This reflects GLFW's fix: https://github.com/glfw/glfw/issues/1348

This enables to build with a external GLFW containing the
following fix:

* 05f6c13d11

Currently, glfw3native.h of the internal GLFW is customized at
2feea87b61

This fix is compatible with the current customized glfw3native.h.

This fix enables us to update it to the latest and remove the
customization.

* Win32: remove unneeded typedef
2022-08-21 11:44:16 +02:00
Rob Loach
e835311d0d BINDINGS: raylib-cpp has support for raylib 4.2 (#2652)
https://github.com/robloach/raylib-cpp
2022-08-21 11:43:27 +02:00
Ray
4ee5fdf619 ADDED: Support M3D model file format (meshes and materials) #2648 2022-08-20 14:01:54 +02:00
Ray
35c777ef2c REVIEWED: Avoid crash on bad data provided 2022-08-18 15:11:23 +02:00
Ray
904c505125 minor tweak 2022-08-18 15:10:40 +02:00
irishgreencitrus
d8ed3fb31e Update raylib.jl and raylib.v to 4.2.0 (#2644) 2022-08-17 16:36:03 +02:00
Ray
2ad7967db8 REVIEW: Fix issue with external GLFW missing define #2638 2022-08-17 10:19:52 +02:00
Michael Scherbakow
95d3a6ac52 update raylib.zig to 4.2 (#2642) 2022-08-15 23:55:58 +02:00
moosey
f049f9dd3a Tiny documentation fix in reasings.h (#2640) 2022-08-15 09:15:43 +02:00
WIITD
67f8424eb0 raylib-freebasic updated to 4.2 (#2639) 2022-08-15 09:12:30 +02:00
Ray
7db6fe02fd Fixed issue with new output format 2022-08-14 12:56:55 +02:00
Ray
bf2ad9df5f P A I N 2022-08-13 22:42:38 +02:00
Ray
092b6f956e WARNING: REVIEWED: rlCheckRenderBatchLimit() 2022-08-13 22:30:11 +02:00
Ray
48c7f65b77 minor tweaks 2022-08-13 22:28:47 +02:00
HarriP
e0b487c641 Fix string lacking null termination in IsFileExtension (#2637)
When file extension is longer or equal length compared to buffer holding lowercased string, strncpy does not null terminate the string.
Increased buffer size by 1 to ensure it will always be null-terminated, so that following strcmp does not read out of buffer bounds.
2022-08-13 17:36:29 +02:00
Dan Bechard
56072a631d Fix Codepoint position truncation (#2636)
This truncation causes text that spans the zero coord boundary to round differently left or zero vs. right of zero, in turn causing letters to appear squished together. If you actually need the position to be an integer, you should instead `floorf()` the float, rather than doing an integer truncation, but I don't see any reason to convert it to an integer in the first place. Everything else in the equation is a float.
2022-08-13 11:18:57 +02:00
Gunko Vadim
f2fbdd1999 Update BINDINGS.md (#2631)
Update to ray4laz
2022-08-12 08:16:12 +02:00
Richard Smith
03bf7e81dd updating jaylib binding to 4.2 (#2630) 2022-08-12 00:42:07 +02:00
Richard Smith
14b1aef194 update raylib-python-cffi bindings to 4.2 (#2629) 2022-08-12 00:40:53 +02:00
Ray
d658e6772d Update android.yml 2022-08-11 20:26:45 +02:00
Ray
965057dbe2 Update android.yml 2022-08-11 20:25:58 +02:00
Ray
b38dceb2de Update android.yml 2022-08-11 20:22:42 +02:00
Ray
764254d93e Update android.yml 2022-08-11 20:16:48 +02:00
Ray
b55cb32d9b Update android.yml 2022-08-11 20:10:59 +02:00
Ray
931af3a242 Update windows.yml 2022-08-11 20:04:59 +02:00
Ray
372983c06e Update HISTORY.md 2022-08-11 19:16:37 +02:00
Ray
8b8b5ef70e Merge branch 'master' of https://github.com/raysan5/raylib 2022-08-11 19:16:32 +02:00
Ray
feb9c52374 Update CHANGELOG 2022-08-11 19:16:16 +02:00
SomeUnusualGames
71e43612d6 Fix typos and reworded a question in the FAQ (#2628) 2022-08-11 17:54:24 +02:00
Eliza Milburn
b24947c0d0 Improve the readability of the FAQ page (#2627) 2022-08-11 14:39:21 +02:00
Ray
60d9cbd754 Update CHANGELOG 2022-08-11 13:39:46 +02:00
Peter0x44
4c71f5f76e Reword FAQ page, and fix some typos (#2626) 2022-08-11 13:05:00 +02:00
Ray
75ece337ae Revert "Update core_3d_camera_mode.c"
This reverts commit 4f6fbaed41.
2022-08-11 12:28:21 +02:00
Ray
4f6fbaed41 Update core_3d_camera_mode.c 2022-08-11 12:27:51 +02:00
Ray
ddb8be3564 Merge branch 'master' of https://github.com/raysan5/raylib 2022-08-11 12:03:43 +02:00
Ray
b3ed01dbab Create FAQ.md 2022-08-11 12:03:35 +02:00
archie2x
e87caa2687 Fix #2621: Set CMP0054 policy to NEW and appropriately quote ${PLATFORM} (#2622) 2022-08-09 09:52:56 +02:00
Ray
b0f3a2c217 Update c_raylib.xml 2022-08-08 19:43:02 +02:00
Ray
d1a5d381d8 Updated Npp scripts 2022-08-08 19:20:02 +02:00
Jacob Dennis
621d6ae856 Updated to work with zig master branch (#2620)
Specifically, std.fs.OpenDirOptions struct no longer has the iterable
flag, now it's a standalone function call std.fs.openIterableDir
2022-08-08 17:36:22 +02:00
Ray
8127044748 Update CHANGELOG 2022-08-08 12:47:40 +02:00
Ray
2c0071c851 Reviewed issue with negative key #2619 2022-08-07 19:19:18 +02:00
Ray
63a23a6b74 REMOVED: VS2019 project 2022-08-06 19:31:01 +02:00
Ray
304c820a8e Merge branch 'master' of https://github.com/raysan5/raylib 2022-08-06 19:23:45 +02:00
Ray
86ac792d9a Review projects details for raylib 4.2 2022-08-06 19:23:36 +02:00
veins1
4b2357dc34 Can't alt-tab out of fullscreen window (#2618) 2022-08-06 18:42:52 +02:00
Ray
e47a3afbd8 Update BINDINGS.md 2022-08-06 18:41:50 +02:00
Ray
3ce5941106 Update BINDINGS.md 2022-08-06 18:41:03 +02:00
Anthony Walter
3edf43f1d6 Added new Free Pascal bindings (#2617) 2022-08-06 18:39:48 +02:00
Angga Permana
e06ed6c608 Fix 4coder project template (#2616) 2022-08-06 08:18:32 +02:00
Ray
ec8fabceeb Updated Notepad++ intellisense data 2022-08-05 20:02:36 +02:00
Ray
14990209ef Added comments 2022-08-05 20:01:35 +02:00
Ray
d1c53910b7 Update parser outputs for raylib 4.2 2022-08-05 20:01:25 +02:00
Ray
5940790379 Update raylib_parser.c 2022-08-05 20:00:58 +02:00
Ray
19d6f2a961 Update HISTORY.md 2022-08-05 19:59:59 +02:00
Ray
7faeaa757c Update CHANGELOG 2022-08-05 19:43:32 +02:00
veins1
d70e5cd26b Small simplifications (#2615) 2022-08-05 12:16:49 +02:00
veins1
82b76149da GetMusicTimePlayed bug fix (#2614)
GetMusicTimePlayed() was calculated using buffered frames, not played frames.
For example: calling LoadMusicStream->UpdateMusicStream->GetMusicTimePlayed would return non-zero value, even though no music was playing.
2022-08-05 08:36:59 +02:00
hartmannathan
b0b6381745 Fix typo in README: s/instrallation/installation/ (#2613) 2022-08-04 23:53:36 +02:00
Ramiro Magno
3e4a8bb640 Update bindings with raylibr (#2611)
Add R package raylibr as a new binding for the R language
2022-08-04 16:01:19 +02:00
TheManTheMythTheGameDev
090e47dca0 Fix rendering issue in audio_raw_stream.c example (#2608) 2022-08-03 08:36:23 +02:00
Ray
1a35f73d84 Review some warnings 2022-08-02 21:17:19 +02:00
Ray
50663f0890 Merge branch 'master' of https://github.com/raysan5/raylib 2022-08-02 21:17:07 +02:00
Ray
7c9d55f4d9 Move parser output to output 2022-08-02 21:17:03 +02:00
Ray
0739152057 Update README.md 2022-08-02 21:16:46 +02:00
Ray
66108c47d9 Update raylib_parser.c 2022-08-02 21:10:35 +02:00
Ray
75c8df348f Update README.md 2022-08-02 21:07:47 +02:00
Ray
273c780b67 Update raylib_parser.c 2022-08-02 21:05:31 +02:00
Ray
2ce0722fb8 Update README.md 2022-08-02 21:02:11 +02:00
Ray
72b2d1335a Update cgltf.h 2022-08-02 19:05:42 +02:00
Ray
b79df1c329 Updated easings examples 2022-08-02 18:55:49 +02:00
Ray
d791c1cf64 Update miniaudio.h 2022-08-02 18:50:12 +02:00
Ray
94165a40b9 REMOVED: rmem library from raylib sources
Moved to own repo: https://github.com/raylib-extras/rmem
2022-08-02 18:50:08 +02:00
Ray
dd455c626e Update rlgl.h 2022-08-02 18:33:00 +02:00
Ray
0ce8a8f360 Remove easings.h from raylib/src, moved to examples 2022-08-02 18:31:57 +02:00
Ray
b187d6ca16 Delete rlights.h 2022-08-02 18:30:54 +02:00
Ray
5840cd6e50 Remove unneeded comment 2022-08-02 18:12:57 +02:00
Ray
df5514088e REVIEWED: GetMouseWheelMove(), avoid move scaling on PLATFORM_WEB
Tested with latest emscripten 3.1.18
2022-08-02 18:07:44 +02:00
Ray
312fa64b88 Updated raylib resource data (32bit) 2022-08-02 18:06:00 +02:00
Ray
222997f951 Update HISTORY.md 2022-08-02 17:26:20 +02:00
Ray
2a2c9e4da8 minor tweaks 2022-08-02 17:25:24 +02:00
Ray
6ecb29f33f REMOVED: Sponsors doc
This file requires manual maintenance and continuous review, it also changes from day to day moving sponsors from present-to-past and sometimes the other way round.

GitHub already lists the sponsors on the user profile, in a better an more visual way.

I also have doubts this should be a document distributed with raylib sources...
2022-08-02 12:03:03 +02:00
Ray
ddbe8972bc REMOVE: Unmaintained and outdated contributors doc 2022-08-02 10:38:13 +02:00
Ray
9cbbf149d8 Update audio_music_stream.c 2022-08-02 10:23:54 +02:00
Ray
328d65b1b3 Update Makefile.Web 2022-08-02 10:22:22 +02:00
Ray
c457835938 Update audio_raw_stream.c 2022-08-02 10:22:17 +02:00
Ray
d68ddda766 Added note for multi-threading web compilation 2022-08-02 09:59:12 +02:00
Ray
24e6bf0565 Update shapes_draw_ring.c 2022-08-02 09:58:56 +02:00
Ray
4492e64cb5 Update version 2022-08-02 09:27:13 +02:00
Ray
191c340409 Update Makefile.Web 2022-08-02 09:26:46 +02:00
Ray
ed7548051b Update version to 4.2 2022-08-02 09:21:03 +02:00
Ray
eb8d14e5b2 Update version to raylib 4.2 2022-08-02 00:36:59 +02:00
Ray
fd191a32ea Remove trailing spaces 2022-08-02 00:36:31 +02:00
Ray
fe9e82b2e6 Remove line breaks 2022-08-02 00:30:57 +02:00
Ray
b20d416131 Added latest examples 2022-08-02 00:30:26 +02:00
Ray
dacd500ef0 Update CHANGELOG 2022-08-02 00:00:57 +02:00
Ray
a0b4b28427 Update Makefile.Web 2022-08-01 23:57:09 +02:00
Ray
f9b71e7bcd Update Makefile 2022-08-01 23:57:05 +02:00
Ray
0f47054ece Added example to VS2022 2022-08-01 23:45:14 +02:00
veins1
a6b3c8aa1e Music doesn't stop looping fix (#2605)
This PR fixes a bug when music.looping is set to false but the music continues looping.
Also using proper functions to seek to start of an audio file.
Removed old comment.
2022-08-01 20:07:32 +02:00
Ray
2e5fc3d0c2 Avoid cleaning the front buffer to a specific color!
ISSUE: Front buffer and backbuffer have different clear colors, if no `ClearBackground()` is called by user, there is screen flickering on buffers swap.

It's up to the user to call `ClearBackground()` if desired
2022-08-01 10:05:40 +02:00
Ray
f596815973 Merge branch 'master' of https://github.com/raysan5/raylib 2022-08-01 09:57:29 +02:00
Ray
7853155f99 REMOVED: Config option: SUPPORT_MOUSE_CURSOR_POINT 2022-08-01 09:57:11 +02:00
BlueStag
f31e4ebb3d Use American spelling of colourSpace (#2604) 2022-07-31 21:09:41 +02:00
sDos280
85bd13c41d removing typo, Colours->Colors (#2603) 2022-07-31 10:31:14 +02:00
sDos280
d59ea21405 removing typo in line 41 line, presssed -> pressed (#2602) 2022-07-31 01:51:25 +02:00
Ray
93b633b6e6 Create audio_stream_effects.png 2022-07-29 19:56:36 +02:00
Ray
bc8cecc6aa Update CHANGELOG 2022-07-29 19:56:27 +02:00
Ray
6c61f83d63 Update ROADMAP.md 2022-07-29 18:45:14 +02:00
veins1
0ef3e4c4d5 Audio looping fix (#2579)
* WAVs looping fix. But broke other formats looping

* Fix audio looping issue

* Follow raylib formatting

* Cast void* to char* to make MSVC compiler happy

Co-authored-by: Ray <raysan5@gmail.com>
2022-07-29 13:10:59 +02:00
Ray
b6f87023ad Update rlgl_standalone.c 2022-07-29 12:38:01 +02:00
Ray
fccdb68df8 Create audio_stream_effects.c 2022-07-29 12:36:56 +02:00
Ray
277dd2bb57 Update audio_music_stream.c 2022-07-29 12:36:51 +02:00
Ray
721e7914b1 Update audio_music_stream.c 2022-07-29 12:08:04 +02:00
Ray
e4229e1be7 Merge branch 'master' of https://github.com/raysan5/raylib 2022-07-29 12:01:26 +02:00
Ray
bb6b43b7cb REVIEWED: GenImageFontAtlas() #2556
Just reviewed font atlas size estimation, now it considers `fontSize` instead of `chars[i].image.height`, increasing considerably the atlas size estimation.
2022-07-29 12:01:18 +02:00
Nikolay Krasheninnikov
52345fd883 [raymath] Rotation functions returns clockwise rotation matrix, #2595 (#2599)
Co-authored-by: Nikolai Krasheninnikov <nikolai.krasheninnikov@kronshtadt.ru>
2022-07-29 11:54:37 +02:00
Ray
241d6526b0 Some camera improvements #2563
Reviewed some camera functionality:

 - Reviewed camera swinging (up-down movement)
 - Reviewed camera tilting (left-right movement)
 - Make movement independent of frame-rate
 - removed unneeded variables

NOTE: Camera rotation has some speed issues on first person when fixed 60 fps are used: it moves too fast. Independent framerate movement is not properly implemented.
2022-07-29 10:04:12 +02:00
Ray
7b05444af8 Review comments and parameter names 2022-07-29 09:45:19 +02:00
Piotr Wierciński
024a803665 rtextures: Improve numerical stability of float multiplication (#2596)
Dimensions of Rectangle should be casted to int before multiplication,
otherwise there is a risk for underallocation/overallocation of memory.
2022-07-27 17:31:52 +02:00
Piotr Wierciński
5a2f25cc7c rtextures: Fix ImageFromImage crash (#2594)
Height of the rectangle can be float, which
may lead to doing extra iteration of loop and
writing out of bounds.
2022-07-26 20:53:36 +02:00
MyUncle
6f3a633f2e add: cmake config include guard (#2592) 2022-07-26 14:28:26 +02:00
Crydsch
00c7509454 add Vector3RotateByAxisAngle (#2590) 2022-07-26 14:27:28 +02:00
hitomi kirigri
64710e6030 fix QuaternionFromMatrix & QuaternionEquals (#2591)
Co-authored-by: kirigiri hitomi <chenjw@hiscene.com>
2022-07-26 14:25:31 +02:00
Ray
d78177d246 Update year 2022-07-25 00:52:10 +02:00
Ray
39d9d1da42 Update config.h 2022-07-25 00:48:15 +02:00
/ˈɛvən/
4b0f28b782 add hare-raylib to BINDINGS.md (#2589) 2022-07-24 10:40:27 +02:00
Ray
65c3edf797 ADDED: Missing examples to VS2022 solution #2580 2022-07-23 12:48:15 +02:00
Julianiolo
6ed1ce0082 fixed build for cygwin (#2588) 2022-07-23 12:33:23 +02:00
Ray
0abba4dc18 Update README.md 2022-07-22 11:48:00 +02:00
Andrew
55c43fcd26 Update README.md (#2587)
* Update README.md

Simple change of
- "specially" -> "especially" when appropriate
- "fileformats" -> "file formats"

* Update README.md

Remove an unwanted change in the README file.
2022-07-22 11:33:54 +02:00
George Linkovsky
b40696eab6 Fix Vector3ClampValue and Vector2ClampValue (#2585)
Co-authored-by: Timofffee <timofffee@gmail.com>
2022-07-20 14:46:11 +02:00
Ray
4a9391ae83 REVIEWED: examples descriptions 2022-07-20 01:28:37 +02:00
Ray
4fced50fd1 Reviewed example formating 2022-07-19 22:06:18 +02:00
Ray
a3a6b3f24a Update core_2d_camera.c 2022-07-19 22:05:07 +02:00
Jeffery Myers
39ead974a4 add mouse zoom example (#2583) 2022-07-19 21:55:10 +02:00
Jeffery Myers
e9029d3d00 [CORE] Fix Warnings (#2582)
* Fix raymath warning with floor to floorf

* signed unsigned missmatches
2022-07-19 06:36:03 +02:00
Mike DX
0f7c4f762f Update BINDINGS.md (#2581)
Added Binding for VALA language
2022-07-19 00:47:43 +02:00
Ray
49a534b5d4 Removed raudio.h from public header 2022-07-15 19:11:42 +02:00
Ray
cccea34c6f Update raudio.c 2022-07-15 19:09:14 +02:00
Ray
8aa105fd5b WARNING: REMOVED: raudio_standalone example
Moved to raudio library repo: https://github.com/raysan5/raudio
2022-07-15 19:05:05 +02:00
Ray
6c2c176a99 Added note 2022-07-15 18:53:08 +02:00
Ray
3ebfee5dbc REVIEWED: UpdateMusicStream() #2228
Trying to implement proper looping, independently of frame rate.
2022-07-11 21:19:21 +02:00
Ray
0379b94b7a Minor tweaks 2022-07-11 21:18:31 +02:00
Ray
b92573e711 Update raudio.c 2022-07-10 23:00:09 +02:00
CastimierDev
0ac825b22a set the maintained bindings in alphabetical order (#2570)
reordered the maintained bindings into alphabetical order
2022-07-10 21:43:33 +02:00
Ray
2245500245 Added comment about buffer refill issue on looping #2228 2022-07-10 21:39:13 +02:00
Ray
066bd5be87 Reviewed formating 2022-07-10 21:38:33 +02:00
Ray
29a0f60778 REVIEWED: ImageResize() #2572 2022-07-10 21:12:34 +02:00
Ray
05dc300296 Remove unneded TABS 2022-07-09 19:36:33 +02:00
Audi Nugraha
d1aabb3957 Allow DLL creation using TCC (#2569)
* Fix Undefined Symbol `_ftelli64`

* Add files via upload

* Update raylib.h

* Update raylib.h
2022-07-09 19:33:18 +02:00
Ray
5842a6a399 Merge branch 'master' of https://github.com/raysan5/raylib 2022-07-09 00:13:27 +02:00
Ray
53e3375186 Create rlgl_standalone.png 2022-07-09 00:12:50 +02:00
Richard Smith
f7e1550eea Fix fat universal (arm64 + x86_64) macos Github Actions build (#2567)
* test if clang supports multiple targets

* didnt work, so trying lipo to join separate targets together

* add CUSTOM_LDFLAGS to try to fix arm64 mac dynamic build

* fix sym links

* try again to fix sym links

* auto extract raylib version numbers from makefile

* fix macos missing gnu grep

* dont use custom name for raylib dlls
2022-07-08 07:57:10 +02:00
Ray
41a19cd007 Merge branch 'master' of https://github.com/raysan5/raylib 2022-07-07 20:23:48 +02:00
Ray
5f9972dfd1 Update raylib.sln 2022-07-07 20:23:46 +02:00
Ray
1343f5f31f Update CHANGELOG 2022-07-07 19:58:14 +02:00
Ray
0295ab968c Update README.md 2022-07-07 19:14:08 +02:00
Ray
ab23e2f130 Merge branch 'master' of https://github.com/raysan5/raylib 2022-07-07 19:12:44 +02:00
Ray
61695c5315 Added some examples screenshots 2022-07-07 19:12:37 +02:00
Ray
4e763b4aa3 Update example reviews raylib versions 2022-07-07 19:07:09 +02:00
Ray
870b7fa05f Added new examples to Makefile 2022-07-07 18:29:06 +02:00
Ray
ff838b48fd UPDATED: examples: Assigned **DIFFICULTY LEVELS**! 2022-07-07 14:34:38 +02:00
Ray
8e229ada1d ADDED: example: textures_gif_player 2022-07-07 12:15:55 +02:00
Ray
e121058eb6 RENAMED: example: textures_rectangle -> textures_sprite_anim 2022-07-07 12:09:30 +02:00
Ray
e3ff5f3dc2 ADDED: example: textures_fog_of_war 2022-07-07 11:13:45 +02:00
Ray
9e97a2c4a1 ADDED: example: core_window_should_close 2022-07-07 11:07:41 +02:00
Ray
8f65cb1d94 ADDED: example: text_codepoints_loading 2022-07-07 01:00:57 +02:00
Ray
7fb7591e4f Update raylib.h 2022-07-05 13:27:07 +02:00
Ray
e722a8dbef WARNING: BREAKING: REMOVED: *StorageValue() functions
Those functions were platform dependent and user has no control over the file created. They have been removed from raylib and just moved to `core_storage_values` example.
2022-07-05 13:24:14 +02:00
Ray
e0f0a5f663 REMOVED: GenMeshBinormals(), actually, never implemented 2022-07-05 12:55:51 +02:00
Ray
d0f53db65f REMOVED: example: core_quat_conversion 2022-07-05 00:54:50 +02:00
Ray
cd53531050 Added some comments 2022-07-05 00:50:23 +02:00
Ray
bf07d17cec REMOVED: example: core_quat_conversion
This example requires a complete remake to be more clear. Also current quaternion maths could have issues.
2022-07-05 00:50:04 +02:00
Ray
5c5db2c016 Update rlgl_compute_shader.c 2022-07-04 18:34:38 +02:00
Ray
c6c71fe73c REVIEWED: DrawMesh() #2511
Disable color vertex attribute if not provided by mesh
2022-07-04 17:47:47 +02:00
Ray
850321cf2b Update ROADMAP.md 2022-07-03 13:37:17 +02:00
Ray
f579a3a708 REVIEWED: DecompressData() 2022-07-03 11:11:50 +02:00
Ray
061e828524 REVIEWED: example: gltf models loading -WIP- 2022-07-01 14:02:30 +02:00
Omer Kilinc
b84fc30284 Fixed various grammar mistakes (#2559)
* Fixed various grammar mistakes

* Fixed various grammar mistakes

* Update README.md
2022-07-01 13:47:50 +02:00
Ray
9be186624c REVIEWED: DrawBillboard*() 2022-06-29 21:56:19 +02:00
Ray
61e691d94f Remove unneeded rlPushMatrix() 2022-06-27 13:27:16 +02:00
Ray
e9fcc8a391 Update CHANGELOG 2022-06-26 19:46:13 +02:00
Ray
da5d04061e Updated PLATFORM_RPI info #2547 2022-06-25 12:10:28 +02:00
Ray
e4972f4cdd REMOVED: Physac projects #2551 2022-06-24 20:44:40 +02:00
Ray
1211047e1c Removed physac #2543 2022-06-24 11:09:12 +02:00
veclavtalica
63568721f9 fix: precision loss, discard unused (#2541) 2022-06-24 10:59:31 +02:00
Richard Smith
3c3f08c416 Fix CMake build on Raspberry Pi OS Bullseye (#2548) 2022-06-24 10:50:24 +02:00
Hanaxar
6f231ea9ac Fix signedness in rlBindImageTexture (#2539)
rlGetGlTextureFormats was expecting unsigned int, corrected variables according to that.
2022-06-23 12:23:14 +02:00
veclavtalica
b1fb469e0d fix: small things in CONVENTIONS.md (#2536) 2022-06-23 08:03:16 +02:00
Ray
d7a0b46006 Update rlights.h 2022-06-22 00:35:06 +02:00
Ray
77b9ca50e0 Update shaders_basic_lighting.c 2022-06-22 00:35:04 +02:00
Ray
3879decb9f REVIEWED: example: shaders_mesh_instancing
Simplified example
2022-06-21 21:06:03 +02:00
Ray
371aa0fe7f Update rlgl.h 2022-06-21 20:59:54 +02:00
Ray
5044ce9de3 Reviewed batch buffer overflow #2526 2022-06-21 20:28:50 +02:00
Ray
68c7cc0cc4 minor tweak 2022-06-21 19:53:28 +02:00
Ray
c1b01c0d5d Added new comment to examples 2022-06-21 19:53:18 +02:00
Dan Bechard
8bd3ecaa66 Share PCM streaming buffer to reduce dynamic allocations (#2532) 2022-06-21 19:26:21 +02:00
Ray
0afa79067b Revert "Update rlgl.h"
This reverts commit 8fe6bfabbf.
2022-06-18 20:47:49 +02:00
Ray
5426262ae6 REVIEWED: IsFileExtension() #2530
Max file extension size set to 16
2022-06-18 20:44:15 +02:00
Ray
8fe6bfabbf Update rlgl.h 2022-06-18 19:24:11 +02:00
Ray
6f3b2a7661 Update rlgl.h 2022-06-18 16:22:47 +02:00
Ray
c1d9489294 Update rcore.c 2022-06-18 16:22:42 +02:00
Ray
8d9c45a08a tweak 2022-06-17 21:24:59 +02:00
Ray
d4f60f8303 REVIEWED: LoadDroppedFiles(), fixed issues 2022-06-17 12:06:58 +02:00
The Tophat Demon
a6e31cadbd Changed ExportFontAsCode to use given font's padding. (#2525) 2022-06-17 00:12:21 +02:00
Roy Qu
0964353073 fix: round off error in ColorAlphaBlend (#2524) 2022-06-16 14:47:46 +02:00
Ray
309ad3e08b REVIEWED: rlTextureParameters(), reset anisotropy level 2022-06-16 13:07:38 +02:00
Ray
7ed3d870fe REVIEWED: rlGenTextureMipmaps(), removed filtering setup 2022-06-16 13:07:09 +02:00
Ray
2824aacd5d Update rcore.c 2022-06-16 13:06:18 +02:00
Pijus
c392f0c16b Add wrap (#2522)
* add wrap function

* fixed Wrap function wrapping wrong
2022-06-14 21:28:39 +02:00
Ray
377dcef9f4 Revert "add wrap function (#2521)"
This reverts commit 81157e4e72.
2022-06-14 20:53:35 +02:00
Pijus
81157e4e72 add wrap function (#2521) 2022-06-14 19:12:37 +02:00
Ray
d37a63fad7 Reviewed easings include 2022-06-12 23:01:48 +02:00
Ray
9998a86625 Update rcore.c 2022-06-12 22:56:24 +02:00
Ray
a2c56b5929 Update rmem.h 2022-06-12 21:22:01 +02:00
Ray
043fa4cba7 Removed extras directory 2022-06-12 21:13:46 +02:00
Ray
7743af853a Update easings.h 2022-06-12 21:13:27 +02:00
Ray
ad56a49da8 Reviewed latest PR 2022-06-12 20:51:31 +02:00
Steven Schveighoffer
e1e0bc4266 Add function to read both X and Y mouse scrolling from a trackpad (#2517)
(GetMouseWheelMoveV).
2022-06-12 17:30:07 +02:00
Ray
875601c4cc REVIEWED: FilePathList, consider maximum capacity 2022-06-12 11:32:10 +02:00
Ray
96292bc859 Update models_skybox.c 2022-06-12 01:00:13 +02:00
Ray
f9426912f6 Update text_font_filters.c 2022-06-12 00:52:15 +02:00
Ray
ad332f49ed Update core_drop_files.c 2022-06-12 00:04:25 +02:00
Ray
8c2019f5ad Update core_drop_files.c 2022-06-12 00:01:47 +02:00
Ray
b8f67c6285 WARNING: BREAKING: REDESIGNED: Filepath loading API
REDESIGNED: `LoadDirectoryFiles()`
ADDED: `LoadDirectoryFilesEx()`
REDESIGNED: `LoadDroppedFiles()`
ADDED: `IsPathFile()`

This BIG BREAKING change simplifies the functions and gives more control to the user:
 - A new `struct FilePathList` has been added to avoid exposing complex pointers.
 - User is responsible of memory loading/unloading
 - Filepaths loading support recursive directories and file extension filters
2022-06-11 23:24:13 +02:00
Ray
f7744404d6 Remove physics projects 2022-06-11 23:01:22 +02:00
Ray
b1c413237c Update config.h 2022-06-11 20:44:47 +02:00
Ray
b9f617aaee Update raylib.h 2022-06-11 18:13:15 +02:00
Ray
702f2bccfc REVIEWED: Issue with MOUSE_PASSTROUGH #2516 2022-06-11 18:12:39 +02:00
Ray
b549baa6b7 New feature: support MOUSE_PASSTHROUGH #2516 2022-06-11 12:08:16 +02:00
Ray
4a6e8bb90b Minor formattng tweak 2022-06-09 21:01:51 +02:00
gulrak
5e3ef42201 GetMonitorWidth()/GetMonitorHeight(): return current video resolution instead max available (#2514)
* GetMonitorWidth()/GetMonitorHeight(): current video resolution instead max available

* adapt header comment to reflect change
2022-06-09 21:00:04 +02:00
Ray
59a808516e Update README.md 2022-06-08 23:05:51 +02:00
Ray
484a61c1d4 Update CHANGELOG 2022-06-08 21:17:37 +02:00
Ray
3fc1bd0670 Update CHANGELOG 2022-06-08 21:15:33 +02:00
rc-05
70ec71a373 Update BINDINGS.md (#2513) 2022-06-08 13:57:02 +02:00
flashback-fx
8c55b40e9e Unify busy waiting behavior across conditional compilation branches (#2508)
* Unify busy waiting behavior across conditional compilation branches

* Inline busy waiting code instead of using static function
2022-06-07 21:01:29 +02:00
Ray
ae715ba0d8 Update CHANGELOG 2022-06-07 20:43:27 +02:00
Ray
b3187e1291 Update CHANGELOG 2022-06-07 19:06:23 +02:00
Ray
a7459043c6 Update CHANGELOG 2022-06-07 19:03:44 +02:00
Ray
b5191a03b2 Update CHANGELOG 2022-06-07 18:50:31 +02:00
Ray
a53411013a Update CHANGELOG 2022-06-07 18:48:20 +02:00
Ray
dca23cb3ff RENAMED: BLEND_ALPHA_PREMUL to BLEND_ALPHA_PREMULTIPLY 2022-06-07 18:46:14 +02:00
Ray
fc86b5c1b4 Added raylib 4.2 release CHANGELOG 2022-06-07 14:15:06 +02:00
Ray
9dd28feadf Added rea change 2022-06-07 14:14:04 +02:00
Ray
bf208decc0 REVIEWED: Compilation warnings 2022-06-07 10:04:24 +02:00
Daw-Ran Liou
06db2767fe Update cl-raylib binding (#2509)
Commit d57c8136426b7cc8a39e77f05097c8585d4bb1eb from longlene/cl-raylib now puts
the binding on track with raylib version 4.0.
2022-06-07 00:05:58 +02:00
Ray
9c676e599e Update android.yml 2022-06-06 20:53:48 +02:00
Ray
e6bc401c93 WARNING: RENAMED: GetDroppedFiles() to LoadDroppedFiles()
RENAMED: `ClearDroppedFiles()` to `UnloadDroppedFiles()`
2022-06-06 20:39:37 +02:00
Ray
ebbcc2ffce WARNING: RENAMED: GetDirectoryFiles() to LoadDirectoryFiles()
RENAMED: `ClearDirectoryFiles()` to `UnloadDirectoryFiles()`
2022-06-06 20:30:24 +02:00
Ray
461cdda71e Reviewed latest PR, variable name 2022-06-06 20:23:14 +02:00
flashback-fx
c11d30bafe Change WaitTime argument from milliseconds to seconds (#2506) 2022-06-06 20:18:37 +02:00
Ray
609d92003b WARNING: REMOVED raygui from raylib/src/extras 2022-06-06 11:11:39 +02:00
Ray
8da566d6e7 WARNING: Removed physac from raylib sources/examples
`physac` is available on its own repo
2022-06-06 11:00:06 +02:00
Ray
865a44adda REVIEWED: Mouse device support on PLATFORM_DRM #2381 2022-06-05 11:34:23 +02:00
flashback-fx
cda89ebb58 Fix regression that was causing video stuttering (#2503) 2022-06-05 11:14:26 +02:00
Ray
6fccfc57a4 Minor tweak 2022-06-02 19:22:42 +02:00
Ray
91af3a3152 Update text_draw_3d.c 2022-06-02 19:22:31 +02:00
Ray
99841b8fde Merge branch 'master' of https://github.com/raysan5/raylib 2022-05-31 23:25:33 +02:00
Ray
a28dfbae9f REVIEWED: Batch limits check #2489 2022-05-31 23:25:21 +02:00
Naveen
023eb3380d chore: Set permissions for GitHub actions (#2496)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-05-31 23:23:12 +02:00
Ray
d0318aac4a REVIEWED: DrawBillboardPro() #2494 2022-05-30 20:30:16 +02:00
Ray
8294e04749 Correct typo 2022-05-29 18:23:48 +02:00
Ray
fe28aa7c9b Review log messages 2022-05-29 17:39:10 +02:00
Ray
1f806b555d ADDED: -latomic linkage, required by miniaudio on ARM 32bit #2452 2022-05-20 17:45:36 +02:00
gulrak
789e504069 use GetWindowScaleDPI to calculate size for rlReadScreenPixels in screenshot/recording (#2446) 2022-05-20 17:25:47 +02:00
Patrick
76c3881944 Fixed Android CMake build error (#2486)
`android_native_app_glue.c` wasn't appended to the `raylib_sources` as other libraries were.

Co-authored-by: Patrick Martin <martinpatrick@google.com>
2022-05-20 17:21:45 +02:00
Jonathan Poncelet
5bdd8f134f Improved boolean definitions (#2485) 2022-05-19 21:21:09 +02:00
Ray
426e8252d4 Update raylib-jai binding 2022-05-19 17:33:30 +02:00
Angga Permana
d3caee0e72 generate compile_commands.json to be used by language server (#2481)
* cmake: Generate compile commands

* Update README.md

simplify build process
2022-05-19 13:18:12 +02:00
Ray
6259dc4121 Revert "UPDATE: DEFLATE algorithm"
This reverts commit d786af83fc.
2022-05-18 16:23:52 +02:00
Ray
d786af83fc UPDATE: DEFLATE algorithm 2022-05-18 13:39:07 +02:00
Ray
5ecc289201 REVIEWED: Support OpneBSD for timming functions 2022-05-16 19:24:16 +02:00
Crydsch
020e903193 Fix lgtm warnings (#2477)
* Comparison is always true because finalSample >= 1

* Comparison is always false because keyCount >= 0
2022-05-14 15:02:29 +02:00
Ray
db16833d8c ADDED: EnableEventWaiting() / DisableEventWaiting()
Events waiting can be enabled/disabled, it toggles event polling.
2022-05-12 16:51:46 +02:00
Ray
f3aac87422 Some minor tweaks 2022-05-12 16:35:28 +02:00
ptarabbia
ea598f7d77 Fix crash with delay demo. (#2472) 2022-05-12 15:26:36 +02:00
Rob Loach
c0275df820 Easings: Add function descriptions (#2471) 2022-05-12 14:48:51 +02:00
Crydsch
b2c2b5ee21 remove fps requirement for drm connector selection (#2468) 2022-05-09 17:12:38 +02:00
Ray
df3f64bfd2 Corrected typo 2022-05-07 18:04:34 +02:00
lazaray
aa318674e8 Add support for calculated defines to parser (#2463)
* Add support for calculated defines to parser

* Regenerate parser output
2022-05-06 20:23:07 +02:00
lazaray
bbc8d39185 Add support for truncating parser input (#2464)
* Add support for truncating parser input

* Remove RLAPI from implementations in rlgl.h
2022-05-06 20:18:39 +02:00
Daniel Nagy
19f88241ec Flush stdout after trace messages (#2465)
This immediately shows log messages when stdout is not connected to a
tty.
2022-05-06 20:15:13 +02:00
Capital-EX
7fc9662480 Update Note About Factor's Raylib Bindings (#2466)
Factor's bindings have been moved into the main repo. Additionally, they have been updated to 4.0.
2022-05-06 19:24:24 +02:00
Ray
ed29b4eedf Update utils.c 2022-05-06 00:46:43 +02:00
Ray
d9a30b8480 ADDED: ExportDataAsCode() 2022-05-06 00:14:28 +02:00
Ray
ed2ab55034 Remove line ending spaces 2022-05-05 20:39:14 +02:00
lazaray
4eb3d8857f Reorder parser (#2462)
* Reorder parser output

* Regenerate parser output

* Reorder parser line reading

* Reorder parser data parsing

* Reorder remaining parser stuff
2022-05-04 13:44:55 +02:00
lazaray
df6caea25d Parser improvements (#2461)
* Fix parser function description detection

Some functions in easings.h are defined on a single line and include a
division which was mistaken for the start of the description.

* Fix parser detection of macros including spaces

* Add support for self-referencing structs to parser

* Fix parser code style

* Fix parser handling of multiple fields on one line

* Increase parser MAX_STRUCT_FIELDS

For internal rlglData State struct (internal structs are still not
supported but this makes it less wrong).

* Add description helper to parser

* Regenerate parser output

* Add cakkbacks to parser

* Regenerate parser output

* Refactor funcLines to be an array of line numbers

It used to be an array of pointers into the text buffer but was changed
to be an array of pointers to the lines. Now it is an array of line
numbers like the others.

* Fix code style

* Move array size from name to type

* Regenerate parser output
2022-05-04 11:06:01 +02:00
Benedek Szilvasy
8cb03ef524 Add racket-raylib to BINDINGS.md (#2454) 2022-05-01 21:50:11 +02:00
lazaray
6f044c57ac Add aliases to parser (#2444)
* Fix parser indentation

* Fix  parser comments

* Add aliases to parser

* Regenerate parser output

* Fix parser handling of multiple fields on one line

* Regenerate parser output

* Fix parser code style
2022-05-01 12:34:15 +02:00
Ray
666aa44a84 Reviewed some comments 2022-05-01 11:14:28 +02:00
Ray
f169530d8f Update raylib.h 2022-04-29 17:52:22 +02:00
Ray
5c66cc1c9b Update rcore.c 2022-04-28 17:38:52 +02:00
Ratul Krisna
db6c677755 Update raylib haxe binding name (#2451)
As title says
2022-04-28 12:14:51 +02:00
Michael Scherbakow
28ac82aeb0 add raylib.zig bindings (#2449) 2022-04-28 10:59:16 +02:00
Leonardo Montagner
3580267479 Fix Issue #2441 (#2442)
Remove line that caused a memory leak
2022-04-26 12:25:39 +02:00
Ray
a7ce537d32 Check for mouse devices on PLATFORM_DRM 2022-04-26 09:30:20 +02:00
Ray
38a3523f59 REVIEWED: SwapScreenBuffers() for PLATFORM_DRM
Avoid calling `abort()`, `LOG_ERROR` already manages it. Code looks cleaner now.
2022-04-25 21:00:17 +02:00
Ray
bdfa256cea Update rlgl.h 2022-04-25 19:35:23 +02:00
Ray
6e722d416b Update rcore.c 2022-04-25 19:35:19 +02:00
Ray
e543922055 Review formatting 2022-04-24 17:58:51 +02:00
Juan Carlos González Amestoy
f2c7b0d3bf - Fix issue #2371 (#2437) 2022-04-24 17:05:45 +02:00
Ray
74ca81338e REDESIGNED: Set rlgl internal framebuffer #2420 2022-04-24 12:37:50 +02:00
Ray
dc553d1996 Update rlgl.h 2022-04-24 12:25:26 +02:00
Ray
f798ee2bc1 Update rlgl.h 2022-04-24 12:19:41 +02:00
Maiko Steeman
ccfac59c60 Fix for vr rendering not taking render target size into account (#2424) 2022-04-24 11:48:50 +02:00
Ray
e1ee4b1466 Reviewed MouseScrollCallback() #2371 2022-04-24 11:16:35 +02:00
Ray
d433de7efa Initialize (reset) input global state #2360 2022-04-24 11:02:50 +02:00
Ray
233cf3970c Removed bool type from raymath, it broke raylib 2022-04-24 00:38:11 +02:00
Ray
ff95f05386 Update rlgl.h 2022-04-24 00:29:15 +02:00
Ray
47d768c3d6 REVIEWED: ToggleFullscreen() 2022-04-23 23:40:56 +02:00
Ray
015a71fc40 Update raymath.h 2022-04-23 23:39:50 +02:00
Ray
be3ae71aec Review new functions formatting 2022-04-23 23:24:13 +02:00
saccharineboi
52befa0815 Augment raymath.h with useful functions (#2428)
* Augment raymath.h with useful functions

* Rename Vector2ClampMagnitude and Vector3ClampMagnitude to Vector2ClampValue and Vector3ClampValue

* Remove Vector3{Up,Down,Left,Right,Forward,Backward}
2022-04-23 23:13:33 +02:00
Anilforextra
a5daee3812 Optimize Some Image Functions. (#2429) 2022-04-23 10:51:47 +02:00
tuckie
559ffc6331 Update BINDINGS.md (#2431)
node-raylib is updated to 4.0!
2022-04-11 18:13:43 +02:00
Ray
f71cc53bc9 WARNING: RENAMED: some parameters from length to size
When referring to byte array SIZE, I find it more clear than length
2022-04-06 20:50:50 +02:00
GoldenThumbs
07240b96ad Fix OpenGL 4.3 graphics option in CMake (#2427) 2022-04-05 09:59:53 +02:00
Benedek Szilvasy
aa8af23f10 Fix string defines generating invalid XML (#2426) 2022-04-05 00:00:41 +02:00
Anilforextra
9c66e2f97e [Examples] Free Allocated Matrices. (#2425) 2022-04-04 10:32:46 +02:00
ZimonIsHim
c064eefe26 Update SPONSORS.md (#2423) 2022-04-01 17:03:35 +02:00
Ray
709ec1663d Update audio_music_stream.c 2022-03-30 20:25:46 +02:00
Ray
1612ba63ab ADDED: Audio stream processors support -WIP- #2212
This feature is still under consideration/testing and it doesn't work properly, at least the Delay Effect processor.
2022-03-30 20:13:02 +02:00
Ray
90fc7c0376 WARNING: BREAKING: REMOVED: GetRayCollisionModel() #2405 2022-03-30 20:11:22 +02:00
Satoshi Tanaka
5abb87a0d2 Fix QuaternionScale (#2419) 2022-03-30 19:53:44 +02:00
Ray
9c2d337e99 Update rtext.c 2022-03-29 18:11:33 +02:00
Ray
3bcb19e040 Merge branch 'master' of https://github.com/raysan5/raylib 2022-03-28 11:58:25 +02:00
Ray
cfe7823453 REMOVED: MatrixNormalize() #2412 2022-03-28 11:58:16 +02:00
Ray
c2c1c93041 Corrected typo 2022-03-26 10:42:46 +01:00
Ray
418a595b6f Corrected typo 2022-03-25 15:39:32 +01:00
Ray
45cc806a5c Update README.md 2022-03-25 11:24:03 +01:00
Ray
69ccf6d472 Update README.md 2022-03-25 11:12:49 +01:00
Ray
a2399bd2bc Update README.md 2022-03-25 11:00:09 +01:00
Ray
8e28872fe1 Rename audio callback 2022-03-25 10:19:40 +01:00
Ray
381236051f ADDED: Audio stream input callback #2212 -WIP-
WARNING: This addition is based on a PR and it's still under review, not sure if it will be maintained in the future. In general, raylib tries to avoid callbacks usage mechanisms.
2022-03-24 20:49:11 +01:00
Ray
bcd84cd36d Some code reviews -WIP- 2022-03-24 18:56:53 +01:00
Ray
22c17da4d7 Update to miniaudio 11.8 2022-03-24 18:22:09 +01:00
Ray
ca12ef48e9 Fixes #2408 2022-03-24 11:44:52 +01:00
Ray
65f28460a1 Update shaders_raymarching.c 2022-03-22 23:53:32 +01:00
Ray
3634adf8d4 Update textures_draw_tiled.c 2022-03-22 21:11:56 +01:00
Ray
bd95408b06 Update textures_draw_tiled.c 2022-03-22 21:10:51 +01:00
Ray
cb62cb675f Minor tweaks const 2022-03-22 18:45:41 +01:00
irishgreencitrus
40794da9e4 Add raylib.jl binding for Julia (#2403) 2022-03-22 14:45:26 +01:00
Ray
0da7830745 REVIEWED: Avoid some float -> double promotions 2022-03-20 12:15:51 +01:00
Jeffery Myers
c65efecf0a Verify there is enough space in the batch for the npatch geometry. (#2401) 2022-03-19 22:26:27 +01:00
João Távora
9ecbc465a9 Fix too many opening parens in src/rtextures.c (#2398)
This is a tiny change that makes code in src/rtextures.c "fold"
correctly in editors/IDE's by matching the number of opening
parenthesis to closing parenthesis.  One of those editors is Emacs ;-)
2022-03-18 12:32:00 +01:00
Rodrigo Escar
9723489ccc Implements OpenURL() for Android Platform (#2396) 2022-03-18 11:41:41 +01:00
Ethan Conneely
3d812f8d0c Fix inline enum (#2393) 2022-03-17 11:52:13 +01:00
Kristian Lein-Mathisen
4954778f68 Improve joystick visualisation in gamepad example again (#2391)
As prior commit, but complete fix for XBox controller and trigger
buttons too.

> The joystick range is a float from -1 through +1. Casting this to int
> yields only three possible values: -1, 0, and 1. This gives a
> misleading joystick placement in the demo.
>
> By casting to int after the multiplication to get pixel values, the
> demo reveals the analog feel of the joystick.
2022-03-14 17:16:09 +01:00
Kristian Lein-Mathisen
ec7250ca54 Improve joystick visualisation in gamepad example (#2390)
The joystick range is a float from -1 through +1. Casting this to int
yields only three possible values: -1, 0, and 1. This gives a
misleading joystick placement in the demo.

By casting to int after the multiplication, the demo reveals the
analog feel of the joystick.
2022-03-14 16:00:59 +01:00
Ray
d2119848ed REVIEWED: OpenURL() 2022-03-14 15:31:37 +01:00
Antonis Geralis
f3b0d7f2fe Add naylib (#2386)
* Add naylib

* Fix license
2022-03-13 22:16:18 +01:00
Guido Bartolucci
c3a7bd8c51 Updated Zig bindings to reflect updates to that library (#2385)
* Updated zig bindings info

* Updated raylib-zig license
2022-03-12 21:31:24 +01:00
tixvage
3f01b8a93f Fixed an issue in Makefile when using raygui and physac on unix systems (#2384)
* Fixed an issue when using raygui and physac on unix systems
hash "#" is single-line comment character in bash so echo ignores #include and #define

* tab fix
2022-03-12 21:30:54 +01:00
Ray
a5a098c97f Remove space 2022-03-12 21:27:24 +01:00
Komari Spaghetti
8065504aba Simplify build.zig to not require user to specify raylib path (#2383)
We can figure out the source file location based on the location of the
build.zig file. No need to require the library user to specify where
raylib is stored.
2022-03-11 19:04:24 +01:00
Anilforextra
cda1324e87 Vector2/Vector3: Add squared distance. (#2376) 2022-03-09 20:05:08 +01:00
Ethan Conneely
43dbe67431 Update parser (#2375)
* Add variable len args support

* Api Regen for 4.1dev
2022-03-08 20:00:09 +01:00
Michael Vetter
e9f97e1165 Add repology badge (#2367)
So we can see which distributions package raylib.
And in which version they are.
2022-03-08 19:02:39 +01:00
Marco G. Maia
c5d2cc8e66 Update raylib-config.cmake (#2374)
Updated cmake to windows users.
So they can `find_package(raylib [...])` with exported target as raylib instead of ${raylib_LIBRARIES}, etc
2022-03-08 18:58:27 +01:00
megagrump
7584ce6f48 Increase atlas size guesstimate; print warnings if atlas size is too small (#2365) 2022-03-01 11:26:48 +01:00
Chris Warren-Smith
7bbaba38e4 Update BINDINGS.md (#2366)
Update SmallBASIC to 4.1-dev
2022-02-28 14:38:04 +01:00
Ray
7fa75cb24e Removed memset() 2022-02-27 22:32:17 +01:00
Ray
ead8003044 Possible fix for #2360 2022-02-25 20:41:18 +01:00
Conifer Coniferoslav
296b57e1f5 Update Swift binding version (#2352)
3.7 -> 4.0
2022-02-22 10:28:30 +01:00
Ray
6e9ec253c8 Support clipboard copy/paste on web 2022-02-20 22:07:52 +01:00
raysan5
937e7b3dd9 REVIEWED: Some functions input parametes that should be const 2022-02-20 20:35:28 +01:00
Antonis Geralis
68bad6986d make const (#2348)
* make const

* make const
2022-02-20 20:12:55 +01:00
DavidLyhedDanielsson
761669272f Fix free camera panning in the wrong direction (#2347) 2022-02-20 19:52:13 +01:00
raysan5
d4382f4a52 Removed trailing spaces 2022-02-18 20:30:46 +01:00
Antonis Geralis
963de06d08 follow style guide (#2346)
* follow style guide

* Update rmodels.c
2022-02-17 00:54:21 +01:00
raysan5
4f2bfc5476 Reviewed bug on FindNearestConnectorMode() 2022-02-15 19:38:28 +01:00
Chris
4815065c47 Update Raylib-cs bindings version (#2343) 2022-02-15 19:35:17 +01:00
Jaedeok Kim
b54e9db764 Optimize Vector2Rotate() function (#2340) 2022-02-13 18:43:17 +01:00
megagrump
f40eed5adf add premultiplied alpha blend mode (#2342) 2022-02-13 18:42:24 +01:00
Ray
4bc6e0d7de Update rtext.c 2022-02-13 10:47:19 +01:00
Ray
9cf170e6e9 Reviewed makefile to use right shell on right platform 2022-02-13 10:47:09 +01:00
raysan5
8c9a0221a4 Update Makefile 2022-02-12 19:38:14 +01:00
raysan5
2f3fc41c33 Allow setting a custom PLATFORM_SHELL 2022-02-12 19:31:27 +01:00
raysan5
6ef6dbff2d REVIEWED: PLATFORM_OS for PLATFORM_WEB 2022-02-12 19:08:31 +01:00
raysan5
d0008ae8cd REVIEWED: Issue when compiling for PLATFORM_WEB 2022-02-12 18:06:21 +01:00
Peter0x44
dd15531e25 Properly fix make clean under windows (#2341)
* Properly fix make clean under sh.exe

* Ensure make clean works properly under Windows if RAYLIB_RELEASE_PATH is modified
2022-02-12 17:59:48 +01:00
raysan5
ddba8478c5 Revert "Reviewed Makefile clean target to use CMD shell on Windows"
This reverts commit ab47c6401e.
2022-02-12 17:58:38 +01:00
raysan5
ab47c6401e Reviewed Makefile clean target to use CMD shell on Windows
Tested on the following environments:
 - w64devkit.exe
 - Windows 10 cmd
 - Notepad++ NppExec console
2022-02-12 17:37:12 +01:00
Peter0x44
81cced4d83 Fix make clean target failing when shell is not cmd (#2338)
GNU make on Windows first tries to find sh.exe on the path,
and will execute build rules using it if it is present.
The make clean target uses the builtin cmd.exe command del, which
won't work under sh.exe

The reason this is not done for the entire Makefile is because it would
break cross-compilation of raylib.
2022-02-10 20:52:34 +01:00
gtrxAC
30797d3201 Update file names in build scripts (#2339)
* JSON parser: Use array for function params (#2255)

* Parser: follow C convention of type before name

* Update file names in build scripts
2022-02-10 20:51:46 +01:00
Scribe of the Ziggurat
96452637d9 Add BSD support for zig builds (#2332)
- Adds a new OS clause to build.zig for the BSDs
- Tested on my FreeBSD box using https://github.com/Not-Nik/raylib-zig
- All demos build and render just fine.  Nice !
2022-02-09 08:23:14 +01:00
locriacyber
1e436be51d Make audio examples compile with external glfw on Linux (#2329) 2022-02-05 13:33:05 +01:00
iskolbin
c895bed5e6 Added defines to parser (#2269)
* added defines to parser

* added value and description for defines in parser

* parser: fixed lua defines output, fixed makefile for raygui, added LONG type for defines

* parser defines: remove postfix for LONG/FLOAT, support for hexadecimal consts, convert hex ints to decimal for JSON output

* removed defines from raylib_apis
2022-02-03 14:56:00 +01:00
Audi Nugraha
a0895f1a3c Fix Undefined Symbol _ftelli64 (#2319) 2022-02-03 12:00:33 +01:00
megagrump
c54d9cd552 simplify QuaternionInvert (#2324) 2022-01-31 09:39:21 +01:00
Macoy Madson
680cc72d43 Add missing defines to CUSTOMIZE_BUILD block (#2318)
This fixes compilation and linking errors when CUSTOMIZE_BUILD is
ON. Any option wasn't actually applied if it wasn't in this list.

I also added a message which makes it a bit easier to confirm you have
successfully enabled an option.
2022-01-29 19:12:13 +01:00
Macoy Madson
6e9bb7e480 Add missing defines to CUSTOMIZE_BUILD block (#2318)
This fixes compilation and linking errors when CUSTOMIZE_BUILD is
ON. Any option wasn't actually applied if it wasn't in this list.

I also added a message which makes it a bit easier to confirm you have
successfully enabled an option.
2022-01-29 19:11:45 +01:00
raysan5
44d3cee5d1 Minor tweak 2022-01-28 21:25:40 +01:00
Ray
d38fe92c3f RENAMED: GetFileSize() to GetFileLength()
`GetFileSize()` conflicts with the infamous `windows.h`
2022-01-28 00:23:28 +01:00
raysan5
0f00c41aad ADDED: GetFileSize() 2022-01-27 14:07:05 +01:00
raysan5
524bf57b74 Update qoi.h 2022-01-26 16:33:38 +01:00
Siddharth Roy
e5ee69a0f5 Add DrawTextCodepoints (#2308)
* Add DrawTextCodepoints

* Fixed top comment
2022-01-26 12:55:34 +01:00
Ray
76b6efc827 Support export .jpeg files 2022-01-26 11:30:38 +01:00
raysan5
ebdc34a20e Update minshell.html 2022-01-25 14:04:55 +01:00
Tobias Mock
b4e0f7ab08 Update raylib-ocaml to 4.0 (#2305) 2022-01-23 12:22:25 +01:00
Ray
b422e407e8 Update rtextures.c 2022-01-22 18:42:44 +01:00
Nikolas
5b8b24c0c5 Fix GetApplicationDirectory on macOS (#2304)
Previously failed to build with an implicit declaration of `_NSGetExecutablePath`.
2022-01-22 17:25:53 +01:00
Roy Qu
45ef46c5e8 fix: material color won't be loaded if there's no texture for that material (#2298) 2022-01-21 12:52:07 +01:00
Philip Shenk
dfac74ffa7 updated VSCode project to work with latest raylib makefile and 'working for web' instructions (#2296) 2022-01-21 08:53:25 +01:00
Laurentino Luna
3c359ff4bc Review code conventions for specific defines for GetApplicationDirectory() (#2293)
Unless these imports require to have this format, the code has been adjusted to the conventions
2022-01-18 18:30:19 +01:00
Jeffery Myers
bec27a6ebc [CORE] Fixes for GetApplicationDirectory on 32 bit windows builds (#2290)
* Fix a signature error with the windows calls in GetApplicationDirectory for 32 bit builds.

* break is better than loop var to -1
2022-01-17 18:05:48 +01:00
raysan5
61d0c71b3c REVIEWED: example: shapes_top_down_lights 2022-01-16 18:07:11 +01:00
Jeffery Myers
4b998cfd05 [Examples] Top down lights example (#2199)
* Start 2d lights example.

* finish example

* update image.

* Cleanup render textures

* Fixes to handle shadows on edges that are near to the light better.

* tabs

* move to shapes

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2022-01-16 17:47:17 +01:00
raysan5
15b36e04b2 Review formating 2022-01-16 17:16:04 +01:00
ptarabbia
5ac07122bd Add panning to raudio and update audio_raw_stream example. (#2205)
* Add panning to raudio and update audio_raw_stream example.

* remove pan smoothing, code formatting changes following pull request comments

Co-authored-by: Ray <raysan5@gmail.com>
2022-01-16 12:49:58 +01:00
Ray
48a463cca8 REVIEWED: Vector2Transform(() 2022-01-15 22:19:48 +01:00
Ray
8ee0eb8f36 ADDED: Vector2Transform() 2022-01-15 22:12:58 +01:00
Jeffery Myers
f4dea6919a [CORE] Bug and formating fixes for GetApplicatonDir (#2285)
* Fix formating problems with GetApplicationDir.
Don't ever return an empty string

* always return a valid path even if it's ./

* remove the need for the dll and just use the normal GetModuleFileName function
2022-01-14 20:16:25 +01:00
raysan5
f57727995a REVIEWED: rlLoadShaderCode() 2022-01-13 19:05:45 +01:00
Matthew Owens
e621efe79f rlLoadShaderCode - set ShaderId variables to RLGL.State.default[VF]ShaderId if repesctive Code is NULL (#2281) 2022-01-13 18:42:44 +01:00
Ray
464026f15c Update rcore.c 2022-01-12 12:00:47 +01:00
Ray
a134b8bc6d Update Makefile 2022-01-11 15:39:08 +01:00
Ray
b61c9afd04 Update Makefile, simplified 2022-01-11 11:57:26 +01:00
Ray
0416d5ff7b Update Makefile 2022-01-11 11:26:45 +01:00
Ray
cabb5518e5 Improve Makefile organization 2022-01-11 11:20:04 +01:00
hartmannathan
aaf0175d07 Fix typo in comment: s/simluate/simulate/ (#2277) 2022-01-11 09:04:09 +01:00
Archie
7b7424802f Fixes an error in the spelling of "appearance" (#2276) 2022-01-10 23:55:21 +01:00
Ray
8db56cfc3b Added minimal web shell 2022-01-10 22:31:30 +01:00
Ray
8089ef0f2d Merge branch 'master' of https://github.com/raysan5/raylib 2022-01-10 13:55:04 +01:00
Ray
b4e0ed6007 Review formating 2022-01-10 13:54:51 +01:00
Rob Loach
c0da80c2b8 cmake: Update CMake project template with docs and web (#2274) 2022-01-10 08:55:32 +01:00
Nikolas
a6aa5a1e4c Make zig build functionality available to zig programs (#2271) 2022-01-08 22:13:44 +01:00
hero2002
9d6fcd1710 Fixed Compiling Raylib for android Using cmake (#2270)
* Fixed Compiling Raylib for android Using cmake

* improved the cmake config for android so it don't conflict

* improved the cmake config for android so it don't conflict
2022-01-08 20:14:10 +01:00
Ray
7a159664bc Improved shader loading code 2022-01-08 20:12:03 +01:00
Ray
612c4ad1dc Reviewed possible issue with shaders detaching 2022-01-08 19:55:14 +01:00
Jeffery Myers
fbf34f7c0d [CORE] Add a function to return the application directory. (#2256)
* Add a function to return the application directory.

* CI fixes
2022-01-08 19:47:52 +01:00
Ray
549ca669aa Added VS2022 project 2022-01-05 23:40:22 +01:00
Ray
f7ed804131 Review parameters description size (not used) 2022-01-05 21:35:01 +01:00
gtrxAC
2e3cfdcc2f JSON parser: Use array for function params (#2255) (#2264)
* JSON parser: Use array for function params (#2255)

* Parser: follow C convention of type before name
2022-01-04 14:06:10 +01:00
Ray
2116a98745 ADDED: ExportFontAsCode() 2022-01-03 20:45:56 +01:00
Ray
62858e11f7 Review tracelogs 2022-01-03 20:45:19 +01:00
Calvin Day
744bbd12a7 Update Raylib-J version/licence info (#2258) 2022-01-03 10:08:53 +01:00
Gerber Lóránt Viktor
ba1e91b4d7 Change comment about custom blend modes in rlgl.h (#2260) 2022-01-02 22:50:39 +01:00
Ray
7eb341ccaf WARNING: REVIEWED: A big bug with GetMouseWheelMove() 2022-01-01 17:49:07 +01:00
ArnautDaniel
f5a832e770 Update BINDINGS.md (#2257) 2022-01-01 17:18:29 +01:00
raysan5
a940f41b4b Update year to 2022 2021-12-31 20:06:22 +01:00
raysan5
bb875b1db7 Update rcore.c 2021-12-31 18:18:27 +01:00
raysan5
8f2d9838a3 Reviewed fullscreen switch on PLATFORM_WEB
The previous implementation somewhat break the expected behaviour for games and examples when pressing the `Fullscreen` button in the provided `shell.html`.

Just reverted for the moment for further investigation.
2021-12-31 17:46:31 +01:00
Ray
4bb894f171 tweaks 2021-12-31 11:01:43 +01:00
Tushar Singh
d91b9171fa [Feature] Added SetWindowOpacity(float opacity) (#2254)
* Added drawing text with shadow

* Added SetWindowOpacity()

* Edited Mis-spell

* Fixed conventions
2021-12-30 13:13:50 +01:00
raysan5
fef5be0bc7 Merge branch 'master' of https://github.com/raysan5/raylib 2021-12-29 19:06:56 +01:00
raysan5
c862c4bdf2 Support CUSTOM_CFLAGS 2021-12-29 19:06:43 +01:00
Ray
79992a8d50 Update linux.yml 2021-12-29 19:05:23 +01:00
Ray
be5f36444d Update macos.yml 2021-12-29 19:05:00 +01:00
Ray
b1607ad9e7 Update linux.yml 2021-12-29 19:01:20 +01:00
raysan5
e222209732 Reviewed CFLAGS 2021-12-29 18:22:31 +01:00
shivajiva101
0d064b7808 Added: missing / (#2253)
Specify root as the starting point for the linux compiler path
2021-12-29 01:07:30 +01:00
raysan5
c9db9e6bb7 Updated version number to avoid confusions with release 2021-12-28 15:40:26 +01:00
raysan5
803ce9f44b Detected some pixel-errors due to rounding issues on position 2021-12-28 15:39:57 +01:00
Ray
611e54e67e Reviewed makefiles 2021-12-27 19:01:07 +01:00
Ray
5f2bc20191 Update Makefile 2021-12-27 16:49:01 +01:00
Ray
8844ad6f0b Update Makefile 2021-12-27 16:38:11 +01:00
Ray
bf0fed8431 Update Makefile 2021-12-27 16:14:58 +01:00
Laurentino Luna
011aebe4b3 Update SPONSORS.md (#2248)
Add catmanl + fix broken redirects
2021-12-27 16:03:35 +01:00
raysan5
423fdb320a Update raudio.c 2021-12-24 19:57:32 +01:00
Antonis Geralis
dcc0791502 check not null before accessing by index (#2243) 2021-12-24 19:54:25 +01:00
salotz
f66ae2366f fix scopes binding URL (#2240) 2021-12-23 11:12:05 +01:00
Ray
4874c45ebf REVIEWED: ExportWaveAsCode() 2021-12-23 11:02:20 +01:00
Ray
31dd7b95bc Update Makefile.Web 2021-12-23 11:01:52 +01:00
salotz
bb014ee61b add the raylib-scopes binding (#2238) 2021-12-22 10:38:39 +01:00
Ray
9e5a9892be REVIEWED: PlaySoundMulti() #2231 2021-12-21 23:57:13 +01:00
raysan5
58f2bf4181 REVIEWED: Export format for float 32bit 2021-12-21 20:32:58 +01:00
raysan5
a7bc5196cc Update dr_wav.h 2021-12-21 20:21:00 +01:00
Damien Pitard
bb7b13ef3c fixed cross-compilation from x86-64 (debian buster) to Raspberry Pi (raspbian) (#2233) 2021-12-21 19:03:25 +01:00
Michał KM
87b9ee9183 updated license of raylib-freebasic bindings (#2235) 2021-12-21 14:44:12 +01:00
Uneven Prankster
588de4d095 Re-enable QOI support (#2236)
* Updated QOI to latest version.

* Enable back QOI support!

* Stray extra space! Should be good now.
2021-12-21 14:42:27 +01:00
raysan5
22d0baa896 Review makefiles debug flag 2021-12-21 12:24:03 +01:00
Laurentino Luna
dcb0e62095 Remove TODO on Makefile (#2232)
Justification: original comment said the following
"TODO: Add other platforms. Remove sudo requirement, i.e. add USER mode."

For the other platforms part, installing is included on unix-like
systems, so for example Windows doesn't have a path where to install
libraries.

Removing the requirement for sudo is also quite contradictory since
we're writing files to directories which require root. Not sure what the
original commiter meant by USER mode.
2021-12-20 17:04:36 +01:00
Ray
5499388a4c REVIEWED: GenMeshCylinder() #2225 2021-12-19 13:40:55 +01:00
Ray
278c9fa5bd REVIEWED: LoadTextureCubemap() #2224 2021-12-19 13:17:37 +01:00
Ray
76daf6e364 REVIEWED: LoadTextureCubemap() #2223 2021-12-19 13:10:43 +01:00
Ray
05428df667 ADDED NOTE: ImageDraw() does not support f32bit #2222
Added a note for a future improvement
2021-12-19 12:48:06 +01:00
Jeffery Myers
f5e951145a Add a comment to LoadFontEx to specify how to get the default character set. (#2221)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-12-18 19:33:19 +01:00
raysan5
ef5be632fe REVIEWED: ExportMesh() #2220 2021-12-17 20:55:38 +01:00
Tomas S
87fa23beee Fix build results path on Linux and RPi (#2218)
Built files should be put into src/ not into the project root
as it was now on these platforms
2021-12-16 17:10:13 +01:00
Benedek Szilvasy
51c929ef21 Parse struct descriptions (#2214)
* Update struct parser to parse from lines buffer

* Parse struct description

* Fix erroneous comment
2021-12-16 16:34:55 +01:00
Tomas S
60b1f29783 Fix RPi make install (#2217) 2021-12-16 16:29:09 +01:00
ptarabbia
2db44bc34a Turn on interpolation for XM playback (#2216) 2021-12-16 16:28:30 +01:00
ptarabbia
86611e6459 Fix issue #2092 (#2215) 2021-12-16 16:27:31 +01:00
Ray
55d310fcc3 REVIEWED: EscapeBackslashes() in raylib-parser 2021-12-16 14:59:40 +01:00
Benedek Szilvasy
fffd78e7c8 Parse enum descriptions and value descriptions (#2208)
* Parse enum descriptions and value descriptions

* Put braces on newline

* Properly escape strings

* Realise that XML doesn't actually need backslash escapes

* Replace FPrintfEscapes with EscapeBackslashes

* Remove #include <stdarg.h>

* Update EscapeBackslashes description
2021-12-16 14:49:17 +01:00
Ray
48918ca5c6 REVIEWED: DrawMesh*() issue #2211 2021-12-16 00:19:41 +01:00
Ray
1653fc5bb5 Update rcore.c 2021-12-16 00:19:09 +01:00
raysan5
0454acaacf REVIEWED: Clear SSBO buffers on loading #2185 2021-12-15 13:09:24 +01:00
Ray
20f4d8c147 Reviewed typo 2021-12-10 11:41:45 +01:00
Ray
7787102573 Remove hardcoded path #2200 2021-12-10 10:42:13 +01:00
Andrea Fontana
c0715c1225 Fixed functions Vector2Angle and Vector3Angle (#2203)
* Fixed functions Vector2Angle and Vector3Angle

* typo

* Unrolled everything.
2021-12-09 22:30:52 +01:00
Ray
fd0e3a4fdd REVIEWED: GetCodepoint() #2201 2021-12-09 20:13:53 +01:00
peter elliott
fe95d82890 Add raylib-guile to BINDINGS.md (#2202) 2021-12-09 20:08:58 +01:00
Ray
f09a916587 Update raudio.c 2021-12-08 14:02:54 +01:00
Ray
ed1e1f35df REVIEWED: GenImageCellular() #2178 2021-12-08 11:01:41 +01:00
raysan5
7d25480723 REVIEWED: DrawTextureTiled() #2173 2021-12-07 19:06:18 +01:00
raysan5
81240fe960 REVIEWED: vox_loader.h, 64bit issue #2186 2021-12-07 19:00:58 +01:00
Jaedeok Kim
72f3b00b00 Fix Vector2Angle() not working as expected (#2196) 2021-12-07 10:45:36 +01:00
Steven Schveighoffer
3d0b56045a Add raylib-d binding. Also fix some spelling/grammar (#2194) 2021-12-07 00:09:54 +01:00
Ray
ef6959ed54 ADDED: raylibVersion symbol #2190 2021-12-06 19:53:09 +01:00
Ray
e7f48eb16b Tweaks 2021-12-06 19:08:06 +01:00
HarriP
3cb4ef2599 Fix inverse length in Vector2Normalize (#2189)
Following the pattern in Vector3Normalize.
2021-12-06 19:07:05 +01:00
Steven Schveighoffer
fa7337e19c Vector2Angle returns degrees instead of radians, but all other raymath (#2193)
functions use radians, making this awkward to use.
2021-12-06 19:05:28 +01:00
Ray
93f05d851d Update webassembly.yml 2021-12-06 18:37:44 +01:00
Ray
c5eaaed873 Update Makefile 2021-12-06 12:09:44 +01:00
Ray
c4a62ca1e4 ADDED: Modules info at initialization 2021-12-06 12:02:57 +01:00
Novaleaf
895f5ddd98 raylib-cslo switches to MPL-2.0 (#2187)
from LGPL 2.1
2021-12-05 10:24:35 +01:00
Ray
e637ad9d2a Support custom modules inclusion
Allow to choose which modules are compiled with raylib, if some modules are excluded from compilation, required functionality is not available but smaller builds are possible.
2021-12-04 19:56:02 +01:00
Ray
48d4806e53 Update raylib_compile_execute.bat 2021-12-03 15:39:46 +01:00
Ray
930941e85e Added a couple of notes 2021-12-03 00:30:27 +01:00
raysan5
ba8c73a327 Added some reference code to load bones id and weight data for animations 2021-12-02 20:48:12 +01:00
Gunko Vadim
d6517f9cd9 Add License to Ray4Laz (#2182) 2021-12-02 19:22:13 +01:00
Ray
3aff6dd63e Update BINDINGS.md 2021-12-02 18:35:56 +01:00
raysan5
6a0d5f6335 Added Licenses to BINDINGS
Only added to updated ones
2021-12-02 18:30:41 +01:00
raysan5
59c4facd90 Disabled QOI image format 2021-12-01 20:56:39 +01:00
Tobias Berger
7c6adc5d97 Update LICENSE.md (#2179)
Fix typo in link
2021-12-01 15:12:56 +01:00
Richard Smith
65e07036a6 update to Jaylib 4.0 in BINDINGS.md (#2177) 2021-11-30 13:13:12 +01:00
Ray
d1b8d4f2c7 REVIEWED: Updated QOI to first official release 2021-11-28 01:22:56 +01:00
Anders Holmberg
71f2e2b1e4 Add macos support to zig build system (#2175) 2021-11-27 10:46:18 +01:00
Ray
2b2141902b ADDED: Support for QOI image format 2021-11-27 10:35:00 +01:00
red thing
49a5547386 dray has been updated to raylib v4.0! (#2171) 2021-11-25 09:11:40 +01:00
Ray
9088135b49 REVIEWED: Formating and comments 2021-11-25 01:07:54 +01:00
Arnaud Valensi
b248a00c90 Fix scissor on macos (#2170)
* Expose GetRenderWidth and GetRenderHeight functions

* Fix scissor on macos

* Fix typo
2021-11-25 01:03:20 +01:00
Novaleaf
e60aa8e935 add raylib-cslo to bindings.md (#2169) 2021-11-23 22:21:39 +01:00
Novaleaf
c5fc7c7640 allow physac to be built as a shared library (#2168)
if `BUILD_LIBTYPE_SHARED` is defined allow build as a shared dll
2021-11-23 22:21:01 +01:00
Dmitry Matveyev
460eba53c7 Update NimraylibNow!'s supported Raylib version (#2166) 2021-11-23 08:57:22 +01:00
めぐみ発動機 (isVowel / GreenWing)
924b1c7b0c fixed typo: aproximation to approximation (#2164) 2021-11-21 18:06:52 +01:00
めぐみ発動機 (isVowel / GreenWing)
478b70e53e fixed typo: aproximation to approximation (#2163) 2021-11-21 18:06:20 +01:00
Ratul Krisna
4d3c79f91f Updated hxRaylib to 4.0 (#2158) 2021-11-19 15:42:18 +01:00
Lorenzo
73bded3b0c Move raylib-v7 to list of unmaintained bindings (#2156)
raylib-v7 is no longer being maintained as per their README.
2021-11-18 21:22:14 +01:00
raysan5
7755cd0019 Tweak to minimize buffer overflow possibility 2021-11-18 10:25:28 +01:00
Jochum van der Ploeg
3a9f089018 Added dart-raylib to BINDINGS.md (#2149) 2021-11-17 22:13:39 +01:00
WilledgeR
e24443bbbc Fixes CC while compiling for ANDROID_ARCH x86 (#2148)
* Override CC while compiling for ANDROID_ARCH x86

* REfix Override CC while compiling
2021-11-17 20:45:07 +01:00
raysan5
03f55d8f9e Minor tweaks 2021-11-17 13:36:28 +01:00
Ray
be371ebf99 REVIEWED: LoadTextureFromImage()
Allow texture loading with no data transfer (in case image.data = NULL)
2021-11-15 11:41:05 +01:00
Ray
b7bf220598 REVIEWED: rlUpdateTexture() 2021-11-15 10:25:24 +01:00
Ray
ed125f27b0 Merge branch 'master' of https://github.com/raysan5/raylib 2021-11-15 10:14:03 +01:00
Ray
5a6aa52a7c REVIEWED: ExportMesh() #2138 2021-11-15 10:14:00 +01:00
Ronnie Holm
6342cf103a Fix memory leak in parser (#2136) 2021-11-13 18:40:35 +01:00
Milan Nikolic
864e3ee9f3 Update BINDINGS.md (#2131) 2021-11-11 19:37:11 +01:00
Ray
2c38dad214 Merge branch 'master' of https://github.com/raysan5/raylib 2021-11-11 18:26:28 +01:00
Ray
c8f029dba9 Expose MAX_KEYBOARD_KEYS and MAX_MOUSE_BUTTONS #2127 2021-11-11 18:26:25 +01:00
iskolbin
802a1a1529 added LUA output format for parser; added Makefile for raylib_parser; added raylib_api.lua parser result; added raylib_parser binary to gitignore (#2129) 2021-11-11 18:12:30 +01:00
Ian Rash
fc268129ef Update BINDINGS.md (#2130)
I just updated it to 4.0. :)
2021-11-11 18:09:50 +01:00
lib-omar
91135c8799 Fixed file/alloc limitation in GetDirectoryFiles() (#2126)
MAX_DIRECTORY_FILES macro removed.
ClearDirectoryFiles() tweaked to reflect changes.
2021-11-10 19:52:30 +01:00
Ray
da7e0ba9d9 ouch 2021-11-10 13:37:50 +01:00
Ray
c82390e3f1 Reviewed descriptions and notes 2021-11-10 13:31:42 +01:00
Ray
4853082a4f REVIEWED: DrawRectanglePro(), support TRIANGLES drawing 2021-11-10 13:28:43 +01:00
Ray
f6180efd35 REVIEWED: CheckCollision*() consistency 2021-11-10 13:28:05 +01:00
Ray
7158c80448 tweak 2021-11-10 13:26:50 +01:00
Laurentino Luna
15fffa12a6 Update parser files (#2125) 2021-11-10 00:30:21 +01:00
Uneven Prankster
35cbacc68b Allow GL4.3 capabilities to be shown (#2124)
Now that 4.3 was added this can be enabled with the compile flag.
2021-11-09 15:24:39 +01:00
Ray
44ba3a50ba Updated ODIN binding 2021-11-09 13:29:56 +01:00
Ray
14e4992d73 REVIEWED: rlGetCompressedFormatName() 2021-11-09 11:53:18 +01:00
Ray
21ec8c38ae Review variables initialization
- All variables are initialized on declaration, some arrays were not properly initialized
 - Static array buffers require memset() for re-initialization on every function call
2021-11-09 11:49:03 +01:00
Luke Krasnoff
8ec5b2dc2f Protect TextIsEqual from NULLs (#2121) 2021-11-09 11:37:55 +01:00
Calvin Day
3f595fda26 Update BINDINGS.md (#2119)
Raylib-J currently targets 3,7 and is still in active development
2021-11-08 18:43:33 +01:00
Ray
42f5903b91 Update BINDINGS.md 2021-11-07 20:24:48 +01:00
Michał KM
bb87d2ae82 Update BINDINGS.md (#2116) 2021-11-07 17:17:02 +01:00
Kai
43c8c8ec34 README.md: HTTP => HTTPS (#2114) 2021-11-07 16:42:45 +01:00
AKDev
9cb8934688 Updated the version of nelua-raylib to 4.0 (#2113) 2021-11-07 14:57:47 +01:00
Ray
f67947325b Update README.md 2021-11-07 12:56:34 +01:00
Ray
1bfdc468da Update BINDINGS.md 2021-11-07 11:53:03 +01:00
Ratul Krisna
f78b666c26 Changed hxRaylib version to 4.0-dev (#2112) 2021-11-07 11:51:39 +01:00
KonPet
34f9f51835 Fix Render Batch Limit not being checked in DrawRectangleGradientEx() (#2111) 2021-11-07 11:50:15 +01:00
Richard Smith
9e6133bb09 update BINDINGS.md (#2108) 2021-11-06 17:35:05 +01:00
irishgreencitrus
bf6dac5fa3 Updated the raylib.v binding to the latest version (#2103) 2021-11-05 21:01:54 +01:00
mandar1jn
2021f09db4 added the guide for working with raylib on Chrome OS to the readme (#2101) 2021-11-05 15:30:18 +01:00
Astie Teddy
6055e44518 Update BINDINGS.md (#2100)
https://github.com/TSnake41/raylib-lua/releases/tag/v4.0a
2021-11-05 14:38:08 +01:00
Gunko Vadim
db0cc3c036 Update BINDINGS.md (#2099) 2021-11-05 08:08:40 +01:00
Rob Loach
87a4ee52b9 BINDINGS: raylib-cpp now targets raylib 4.0.0 (#2098)
https://github.com/RobLoach/raylib-cpp/releases/tag/v4.0.0
2021-11-05 08:08:09 +01:00
o3o
7bf8d6bc98 Update BINDINGS.md (#2097) 2021-11-05 00:02:01 +01:00
Ray
a56b8cd2b7 Corrected typo 2021-11-04 20:44:47 +01:00
Ray
0851960397 Update android.yml 2021-11-04 20:08:45 +01:00
Ray
a31784759d Update linux.yml 2021-11-04 20:08:25 +01:00
Ray
453a5b49a0 Update webassembly.yml 2021-11-04 20:07:59 +01:00
Ray
e7f24ade0b Update macos.yml 2021-11-04 20:07:32 +01:00
Ray
e14c6441ce Add some extra libraries to release packages 2021-11-04 19:46:17 +01:00
Ray
d18f3fca30 Reviewed broken link 2021-11-03 14:12:48 +01:00
raysan5
7f4ae653f3 Review display output order 2021-11-03 13:24:56 +01:00
raysan5
703df42586 Avoid duplicate output info on PLATFORM_RPI 2021-11-03 12:55:46 +01:00
Ray
13376de059 Reviewed scripts 2021-11-02 20:58:15 +01:00
Ray
677f5b0795 Review Notepad++ scripts for the supported compilers 2021-11-02 20:40:33 +01:00
Ray
d32bbabe0e Update SPONSORS.md 2021-11-02 19:16:46 +01:00
Ray
c3d32c156c REMOVED: Network examples
They were not working
2021-11-02 18:59:52 +01:00
Ray
1aaa55c38e Update Makefile 2021-11-02 18:54:01 +01:00
Ray
de0fca51a8 Updated scripts 2021-11-02 18:49:53 +01:00
Ray
5e3db0aa83 Updated some scripts paths
NOTE: New raylib release installer uses `w64devkit`, smaller and more updated than regular `mingw64-w64` default project. Paths are updated properly.
2021-11-02 18:40:45 +01:00
Ray
fadef24b62 Update ROADMAP.md 2021-11-02 16:46:49 +01:00
Ray
689a534c66 Update ROADMAP.md 2021-11-02 16:45:21 +01:00
Ray
9d93ca6fc8 Update ROADMAP.md 2021-11-02 16:42:00 +01:00
Ray
86d3e68d55 Add proper license to raylib-parser 2021-11-02 12:03:42 +01:00
Ray
9e17134949 Update HISTORY.md 2021-11-02 12:01:08 +01:00
Ray
290d68c11e Update README.md 2021-11-02 12:00:23 +01:00
Ray
2c8bc8ad47 Updated for the upcoming release! 2021-11-02 11:52:04 +01:00
AKDev
de070ba25f added another odin binding (#2094)
You can change the name to whatever you want to because the binding doesn't have a name.
2021-11-02 11:25:14 +01:00
Ray
e930ad3102 Reviewed spelling mistake 2021-11-01 23:06:26 +01:00
Ray
2fe488a71c Update version in CMake 2021-11-01 23:05:23 +01:00
Ray
0af2c139e2 Update CHANGELOG 2021-11-01 21:02:47 +01:00
Ray
191e8cf02b Update HISTORY.md 2021-11-01 21:02:23 +01:00
Ray
8737d697dc Update HISTORY.md 2021-11-01 21:00:52 +01:00
Ray
765a31597a Update CHANGELOG 2021-11-01 20:20:12 +01:00
raysan5
70a2118c49 REMOVED: rnet.h
It was not working properly... recommended to use `nbnet` instead.
2021-11-01 20:08:14 +01:00
raysan5
b02e737074 Update raygui.h 2021-11-01 20:07:22 +01:00
Ray
fdb7cd0587 Update HISTORY.md 2021-11-01 19:45:05 +01:00
raysan5
bba035c20c Minor type tweak 2021-11-01 19:14:55 +01:00
Ray
be361ed3dc Update README.md 2021-11-01 11:52:15 +01:00
Ray
8c0f9c7f5a Update miniaudio.h 2021-11-01 11:37:47 +01:00
Ray
8abba960c7 Review comments 2021-11-01 11:26:13 +01:00
Ray
8649032428 Update comment 2021-11-01 01:08:55 +01:00
Ray
6e8387468f Update CHANGELOG 2021-10-31 23:56:15 +01:00
Ray
27987f3fe6 Update README.md 2021-10-31 22:59:34 +01:00
Ray
ef32377336 Updated Notepad++ raylib intellisense functions 2021-10-31 18:12:50 +01:00
AKDev
a2b69c0905 removed raylib-d (#2091)
Because the repository and the author's GitHub profile doesn't exist anymore
2021-10-31 18:09:53 +01:00
Ray
1fac09d0f4 REVIEWED: example: Compute shader Game-of-life 2021-10-31 12:28:04 +01:00
Astie Teddy
f090f5444c Add Conway's Game of Life compute shader example. (#2088)
* Add Conway's Game of Life compute shader example.

* Fix various shaders problems, and tune command buffer size.

* Various coding convention changes.
2021-10-31 11:46:38 +01:00
Peter0x44
2bb4d36c43 Add missing file extensions for drag-and-drop support (#2090) 2021-10-30 23:43:07 +02:00
Ray
b7240d6a36 Update raygui.h 2021-10-27 11:25:24 +02:00
Ray
65076464d5 REVIEWED: KeyCallback()
Register keys independently of the actions
2021-10-26 22:27:18 +02:00
Ray
72758de6ea Reviewed warnings 2021-10-26 22:26:28 +02:00
Ray
25642cff36 Update comments for OpenGL 4.3 2021-10-26 22:23:16 +02:00
Ray
cd61463d23 Update README.md 2021-10-26 09:19:17 +02:00
Ray
0171bdfb9c Update raylib.pc.in 2021-10-26 09:13:30 +02:00
Jeffery Myers
daeccd03ac Fix VC warnings for examples (#2085) 2021-10-25 10:21:16 +02:00
Jeffery Myers
086f76ba7a Fix warnings in raylib build (#2084) 2021-10-25 10:18:42 +02:00
mandar1jn
e5cdfab97d made it so the cmake workflow runs on cmake related changes (#2083) 2021-10-25 02:05:11 +02:00
mandar1jn
affb707dd9 fixing the library so the workflows compile (#2082) 2021-10-24 18:24:01 +02:00
mandar1jn
4c497779a2 Updated workflow files (#2079)
* Updated workflow files

* added the manual trigger to the android workflow
2021-10-24 17:33:21 +02:00
TheSergey496
08441e8b2d When one of the colliding lines is vertical or horizontal, not all collisions were correctly detected due to floating point error. (#2081) 2021-10-24 17:31:13 +02:00
Ray
d02310e8ce Update README.md 2021-10-23 20:23:16 +02:00
raysan5
62965aa6d7 Comments tweaks 2021-10-23 14:17:26 +02:00
raysan5
04a4efb591 Added some comments on LoadGLTF() 2021-10-23 14:00:05 +02:00
raysan5
c4f0e80895 REVIEWED: Size of bones id supported, max 255 bones per mesh 2021-10-23 13:59:20 +02:00
raysan5
ebee8ba3bb REVIEWED: LoadGLTF() #2075 2021-10-23 11:42:02 +02:00
mausimus
8f5bd3e185 web: clear resizedLastFrame (#2077) 2021-10-23 10:52:36 +02:00
Richard Smith
fcc6a61d9e replace hardcoded number of mouse buttons with MAX_MOUSE_BUTTONS (#2076) 2021-10-23 10:52:04 +02:00
Ray
ae13f438ba Update Makefile.Web 2021-10-22 23:08:42 +02:00
raysan5
18db2c4f01 REVIEWED: LoadGLTF()
Reorganized code and added some feature and listed restrictions. Some gltf models do not work yet.
2021-10-22 21:27:11 +02:00
raysan5
1fd8052527 Update raylib.vcxproj 2021-10-22 21:24:39 +02:00
raysan5
6ce38e599a Remove big asset 2021-10-22 21:24:26 +02:00
raysan5
83b6cd00c6 Reviewed VS2019 projects 2021-10-22 15:41:28 +02:00
raysan5
1883343944 Update core_input_gamepad.c 2021-10-22 15:04:31 +02:00
raysan5
ebad28d831 REVIEWED: gltf models loading, reverted to a previous version (with some tweaks) 2021-10-22 14:53:11 +02:00
raysan5
befdb5963e REMOVED: IsGamepadName()
This function is not required, users can check it with `GetGamepadName()`
2021-10-22 12:21:31 +02:00
raysan5
83cd22ee5a Minor tweaks 2021-10-22 12:20:42 +02:00
raysan5
dd6e006d78 Reviewed multitouch example #1988 2021-10-22 11:53:47 +02:00
Ray
cbeb29d9d1 Update webassembly.yml 2021-10-21 22:40:13 +02:00
Ray
317db34059 Reviewed to support raygui and physac on building 2021-10-21 21:17:25 +02:00
Ray
1d61be5804 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-21 21:09:49 +02:00
Ray
13bb656a91 Update Makefile 2021-10-21 21:09:40 +02:00
Ray
16f5a04983 Update webassembly.yml 2021-10-21 21:08:28 +02:00
Ray
9afda9359b Reviewed physac building 2021-10-21 21:04:28 +02:00
Ray
2d82788e42 Reviewed uniform name 2021-10-20 11:55:00 +02:00
Ray
5761bf7e19 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-20 11:40:59 +02:00
Ray
fba117478d Update Makefile.Web 2021-10-20 11:40:46 +02:00
Richard Smith
8e599908d9 Re-write Code::Blocks template to work on Linux and Macos (#2073)
* update code::blocks example to support linux

* add macos support

* update screenshot

* update templates readme
2021-10-19 19:50:21 +02:00
Raffaele
ae7127232d Add D bindings to Raylib (#2072)
* Added the bindings for Scheme48.

* Add D bindings to Raylib
2021-10-19 15:41:49 +02:00
raysan5
2e151408bb REVIEWED: models_yaw_pitch_roll 2021-10-19 14:58:04 +02:00
raysan5
fec0ce34c5 Remove trailing spaces 2021-10-19 14:57:12 +02:00
raysan5
719c1551cc Reviewed latest PR formatting and details 2021-10-19 13:30:23 +02:00
warzes
9f2ff3e4d6 Support create OpenGL debug context in OpenGL 4.3 (#2068)
* - support create OpenGL debug context in OpenGL 4.3

* - additional events in debug message
- fixed glEnable(GL_DEBUG_OUTPUT)

* Reviewed OpenGL Debug Context
2021-10-19 12:43:27 +02:00
procfxgen
963021d393 VS2019 solution update (#2071)
* new models_magicavoxel_loading example

* Portable header-only file "magicavoxel_loader.h" for MagicaVoxel loader example.

* models_magicavoxel_loading example added to CMakeLists.txt and Makefile

* fix models_magicavoxel_loading example for linux.

* * vox_loader into "src/external/vox_loader.h"
 * vox file support for "models.c"
 * updated example "models/models_magicavoxel_loading.c"

* * Fix Vox_FreeArrays (removed memory leak)

* * removed magicavoxel_loader.h

* * Revert vs2019 solution

* * vox_loader.h -> Support custom memory allocators
* vox_loader.h -> Reverse Y<>Z for left to right handed system
* models/models_magicavoxel_loading.c -> fix model center

* * vox_loader.h -> Removed Raylib dependencies

* * Changed Vox_LoadFileName to Vox_LoadFromMemory

* VS2019 models_mesh_magicavoxel_loading.vcxproj added

* vs2019 project rename models_loading_vox
2021-10-19 10:50:14 +02:00
Ray
7763ccd8ad Resync .obj models! gitignore was ignoring them! 2021-10-18 23:17:37 +02:00
Jarosław Jaros
d8e0b2e27c Allow to run any file (#2069) 2021-10-18 22:00:54 +02:00
raysan5
6ac3043e88 WARNING: REMOVED: glTF loading
Actually, it was broken and it that code has no maintainer.
2021-10-18 14:11:56 +02:00
raysan5
2ec8ce649a ADDED: EncodeDataBase64() and DecodeDataBase64() 2021-10-18 14:10:51 +02:00
raysan5
bc47d36e90 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-18 13:26:07 +02:00
raysan5
1c9093fd24 Avoid GRAPHICS_API_OPENGL_* defines
Those defines are only used inside `rlgl` module
2021-10-18 13:25:59 +02:00
Ray
0543f897a9 Update README.md 2021-10-18 13:24:44 +02:00
raysan5
b28e353626 Reviewed glDisableVertexAttribArray() issue #2068 2021-10-18 13:22:52 +02:00
raysan5
a3f9ba8704 Removed useless GL calls #2068 2021-10-18 13:16:07 +02:00
Ray
ccf4329792 Review comments 2021-10-18 00:23:26 +02:00
Uneven Prankster
a6fb2dafc6 Fix rlLoadComputeShaderProgram define (#2067)
Now uses correct version.
2021-10-17 23:11:42 +02:00
raysan5
7a16834124 UPDATE: Officially support OpenGL 4.3 2021-10-17 21:41:19 +02:00
raysan5
628e6e52f3 Update examples screenshots 2021-10-17 21:39:52 +02:00
raysan5
f437f7b405 Reviewed makefile and examples building 2021-10-17 21:00:52 +02:00
raysan5
cf12992b6a Remove trailing spaces 2021-10-17 21:00:20 +02:00
raysan5
67a1e84859 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-17 19:10:48 +02:00
raysan5
6243466770 Create Makefile.Web 2021-10-17 19:10:33 +02:00
raysan5
0f8caeb186 Added new examples to Makefile 2021-10-17 19:10:28 +02:00
raysan5
c20df9aa47 Reviewed examples 2021-10-17 19:10:09 +02:00
Ray
c41e0f0c45 Update CHANGELOG 2021-10-17 19:07:29 +02:00
Sage Hane
16d015d81e build.zig: Use addCSourceFiles (#2066) 2021-10-17 19:04:08 +02:00
warzes
d47d7c0001 Fixing the error of loading VOX models. (#2065)
* - Fixing the error of loading VOX models.

* - fixed spaces
2021-10-17 10:22:58 +02:00
michaelfiber
c87e91d27a Update SetupViewport so that it doesn't subtract offset from render dimensions when calling rlViewport (#2064)
Co-authored-by: Michael <michael@cubeofb.org>
2021-10-17 10:21:51 +02:00
Ray
99f6707e2c Support OpenGL 4.3
- Support Compute Shaders by rlgl API
 - Support SSBO by rlgl API
2021-10-16 23:49:31 +02:00
Ray
e36dc01b91 Support GRAPHICS_API_OPENGL_43 2021-10-16 23:39:21 +02:00
Ray
8523d13683 Update rlgl.h 2021-10-16 23:30:30 +02:00
Astie Teddy
dba29e4405 Compute shaders support (#2061)
* Add basic compute shader and ssbo support in rlgl.

* Add rlBindImageTexture (untested), now requires SUPPORT_COMPILE_SHADERS

* Delete glad.c

* Delete glad.h

* Delete khrplatform.h

* Revert to previous glad.h

* Remove "glad.c"

Co-authored-by: Ray <raysan5@gmail.com>
2021-10-16 23:26:25 +02:00
Ray
0aefe256d0 REVIEWED: rlLoadDrawQuad() description #2058 2021-10-16 22:39:22 +02:00
Ray
1b793e76dc Reviewed memory usage 2021-10-16 22:36:47 +02:00
Ray
226c0e362c Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-15 11:25:28 +02:00
Ray
84edd22612 Reviewed unsigned int issue (discussion #2054) 2021-10-15 11:25:17 +02:00
raysan5
2a6bd973bd Review some comments 2021-10-14 15:38:50 +02:00
raysan5
d7266ea8f3 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-14 13:41:55 +02:00
raysan5
ef858b0dbb Review examples 2021-10-14 13:37:22 +02:00
Ryan Roden-Corrent
588131c9d5 Add zig buildfile for examples. (#2051)
* Add zig buildfile for examples.

- `zig build` to compile all examples
- `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`)

You can use `-Dtarget=` to compile for a non-native platform, such as
`zig build -Dtarget=x86_64-windows-gnu` to compile from Linux to
Windows.

* Skip pthread example on Windows.

* Select appropriate lib file based on target.
2021-10-14 13:24:00 +02:00
Ray
52c1a4e7d0 Update SPONSORS.md 2021-10-14 12:45:41 +02:00
Ray
f9c8e31ed7 Update SPONSORS.md 2021-10-14 12:30:46 +02:00
Ray
9ac5a96408 Update rmodels.c 2021-10-14 10:52:24 +02:00
Ray
8a5bc933de Starting to review glTF loading -WIP- 2021-10-14 10:43:29 +02:00
Ray
3e604a8645 Remove trailing spaces 2021-10-14 00:11:37 +02:00
Ray
83b3478fe4 Reviewed some TODO 2021-10-13 23:45:57 +02:00
raysan5
51b147cd32 Update models_loading_vox.c 2021-10-13 21:08:58 +02:00
raysan5
4390d3a122 Avoid raylib dependency 2021-10-13 20:47:57 +02:00
raysan5
a77afd5c8f Reviewed some MSVC warnings 2021-10-13 20:47:42 +02:00
raysan5
32c9d411b2 REVIEWED LoadVOX() -WIP-
It seems vox loader is not working properly...
2021-10-13 20:28:58 +02:00
raysan5
1350361f58 Reviewed formatting 2021-10-13 19:34:37 +02:00
Horrowind
e545286369 Fix issue with empty cylinder (#2050)
* Add DrawCylinderEx and DrawCylinderWiresEx

* Modify examples/models/models_geometric_shapes.c to show the
usage of DrawCylinder(Wires)Ex

* Simplified DrawCylinder and DrawCylinderWires to use the -Ex versions.

* This reverts commits f49b2598dd and
4542b32e4e.

* Fixed formatting.
Renamed base_angle to baseAngle.
Remove most of the raymath.h calls.

* Added check for empty cylinder.

* Added check for empty cylinder.

* Fix bug.

Co-authored-by: Horrowind <you@example.com>
2021-10-13 19:32:30 +02:00
raysan5
942731cc22 REVIEWED: macOS does not require GLAD library #2052
It directly uses the libraries provided by the system
2021-10-13 19:29:29 +02:00
raysan5
4e88160e78 Update raylib.h 2021-10-13 19:22:47 +02:00
Ray
a1db0220a1 REVIEWED: LoadFontFromImage()
Avoid crash on wrong sprite font
2021-10-12 23:00:00 +02:00
raysan5
f9d4601057 Create LICENSE 2021-10-12 21:26:41 +02:00
raysan5
f1659d78d3 Reviewed models examples paths 2021-10-12 21:01:49 +02:00
raysan5
007e840be1 Remove VS2019 solution projects 2021-10-12 20:27:03 +02:00
raysan5
d92531b81d Rename examples for consistency 2021-10-12 20:23:59 +02:00
raysan5
670eab8b17 Review comments 2021-10-12 20:23:46 +02:00
raysan5
252bd22738 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-12 20:22:12 +02:00
raysan5
0b0711027a Remove unimplemented function 2021-10-12 20:21:56 +02:00
Ray
e168c6dd81 Update CHANGELOG 2021-10-12 19:50:51 +02:00
Horrowind
526e68afa8 Add DrawCylinder(Wires)Ex (#2049)
* Add DrawCylinderEx and DrawCylinderWiresEx

* Modify examples/models/models_geometric_shapes.c to show the
usage of DrawCylinder(Wires)Ex

* Simplified DrawCylinder and DrawCylinderWires to use the -Ex versions.

* This reverts commits f49b2598dd and
4542b32e4e.

* Fixed formatting.
Renamed base_angle to baseAngle.
Remove most of the raymath.h calls.

Co-authored-by: Horrowind <you@example.com>
2021-10-12 19:36:06 +02:00
raysan5
1b91ac0b0d REVIEWED: EXAMPLE: shaders_shapes_outline
Removed unneeded resources to use raylib ones.
2021-10-12 13:36:31 +02:00
raysan5
599d6e810f REVIEWED: models resources structure 2021-10-12 12:47:50 +02:00
raysan5
75b5cc0084 REMOVED: EXAMPLE: models_gltf_animation 2021-10-12 12:47:10 +02:00
raysan5
9a568654be REMOVED: EXAMPLE: models_material_pbr 2021-10-12 12:46:41 +02:00
raysan5
4a1bd12e2d REVIEWED: DrawCubeTextureRec() formatting 2021-10-12 12:08:12 +02:00
Ray
282ec9bb76 Formatting tweak 2021-10-10 23:48:16 +02:00
Ray
a91f61262e Review RLAPI to avoid warnings 2021-10-10 23:24:05 +02:00
Ray
f8719e7ec3 Reviewed latest PR formatting 2021-10-10 22:38:58 +02:00
Arnaud Valensi
7c36f3f6b8 Fix dpi issues (#1987) 2021-10-10 22:34:56 +02:00
Jeffery Myers
3d6d5558c9 Add CheckCollisionPointLine to the header, it appears to have been missed (#2042) 2021-10-10 17:06:15 +02:00
Raffaele
a39a44c12f Added the bindings for Scheme48. (#2043) 2021-10-10 17:05:26 +02:00
Jeffery Myers
60bedb4f87 [Documentation] Move older and abandoned bindings to new section at the end of the file (#2040)
* Move older and abandoned bindings to new section at the end of the file

* cleanup

* raylib forever is auto
2021-10-10 00:26:15 +02:00
Jeffery Myers
62554db48d Add missing #endif to windows API defines (#2038) 2021-10-08 19:12:21 +02:00
Ray
94650f0def Simplified RLAPI preprocessor branching 2021-10-08 17:22:58 +02:00
Jeffery Myers
33ed452439 Fix dll exports so that raylib builds in visual studio again. (#2037) 2021-10-07 20:17:45 +02:00
Ray
bb2763cc1f Update models_rlgl_solar_system.c 2021-10-07 16:08:39 +02:00
raysan5
3e71232a04 WARNING: BREAKING: REMOVED: GenImagePerlinNoise()
raylib was using `stb_perlin.h` library to generate perlin noise, it seems that recently this library has been flagged as it could be infringing some algorythm patent. For security, it has been removed from raylib.
2021-10-06 21:20:36 +02:00
raysan5
700d448d75 Updated external libraries 2021-10-06 21:13:17 +02:00
raysan5
8722ff7043 REVIEWED: RLGL.State.vertexCounter (See detailed comment)
`RLGL.State.vertexCounter` is a generic counter and it's reused for all `rlRenderBatch`, actually, once render batch is filled, required vertex count is provided through the draw calls, so, the total accumulated count of vertices is not directly registered inside the rlRenderBatch.

`RLGL.State.vertexCounter` keeps that count but one possible improvement(?) could be moving the `vertexCounter` inside `rlRenderBatch` to always keep a register of the total accumulated vertices in that batch (despite that info is provided by the accumulated `draws[i].vertexCount`.

Simplifying, `RLGL.State.vertexCounter = SUM(draws[i].vertexCount)`

The decision to move the counter out of `rlVertexBuffer` is to keep only the data that I think should belong to `rlVertexBuffer` and make it more generic, aligned with raylib `Mesh` structure.

The decision to not add it to `rlRenderBatch` is because it could contain multiple `rlVertexBuffer` and it would be confusing (because it would only register the count of the last filled one).
2021-10-06 11:44:57 +02:00
Ray
8d7f97ee04 Remove trailing spaces 2021-10-06 01:20:46 +02:00
Ray
9a4fb25285 REDESIGNED: Simplify vertex data recording
Instead of registering vertex texcoords and colors on every call, we keep the last defined value and we record everything on `glVertex*()`. Actually that behavior is aligned with OpenGL 1.1 standard.
2021-10-06 01:17:20 +02:00
raysan5
7439c7547b Review functions specifiers 2021-10-05 19:20:21 +02:00
raysan5
c8b16d72e2 Merge branch 'master' of https://github.com/raysan5/raylib 2021-10-05 18:33:53 +02:00
raysan5
b972b8d324 REVIEWED: API functions specifiers 2021-10-05 18:33:41 +02:00
AKDev
67de7c4483 added nelua-raylib and removed raylib-nelua (#2033)
removed raylib-nelua because it's the same as nelua-raylib but with some significant improvements 😸
2021-10-05 16:44:33 +02:00
Ray
9f4a839853 Update CHANGELOG 2021-10-04 10:44:32 +02:00
mausimus
6541895901 Revert "reset resizedLastFrame on web platform (#2020)" (#2032) 2021-10-04 09:47:41 +02:00
tomarigr
5d8c477d12 [rcore] fix rpi4 Failed to get DRM resources (#2031)
* [rcore] fix rpi4 Failed to get DRM resources

card1 is not always the the correct card to use on rpi4
rpi os finds the correct card and links it to /dev/dri/by-path/platform-gpu-card during boot.
this fix makes sure that we always point to the correct card on rpi4

* Update rcore.c
2021-10-04 01:59:59 +02:00
Ray
79f36799e7 REVIEWED: Avoid raymath dependency
Still, it depends on Matrix type... rcamera module should be completely reviewed...
2021-10-03 14:08:21 +02:00
Ray
369cb0a3c5 Format tweak 2021-10-03 13:51:53 +02:00
Ray
9b3d74db6b ADDED: GetImageColor() #2024 2021-10-03 12:55:52 +02:00
Ray
92417c4485 Update raylib.h 2021-10-03 12:33:40 +02:00
Ray
22345ff62a Minor format tweak 2021-10-03 12:17:15 +02:00
SAOMDVN
3fc4a4c974 Added DrawLineBezierCubic() (#2021)
Co-authored-by: SAOMDVN <saomdvn@users.noreply.github.com>
2021-10-03 12:15:56 +02:00
Ray
03a88678da Update core_basic_window.c 2021-10-03 12:14:31 +02:00
Dennis E. Hamilton
f60e0e6c94 Tidying the core_basic_window.c in projects/scripts (#2025)
* Match build-windows.bat changes

The location for manual setting of the vcvarsall.bat location moved to line 38 in the latest change.

* Update flags for clean x64/x86 building

std:c11 is required for initialization features used in raylib.  UTF-8 for consistency in contemporary systems.  /W3 gets rid of puzzling slack byte and linker in-lining warnings.  /sdl for some insecure library usages in the user code that beginners should learn about early.

* 2021-10-01 core_basic_windows.c adjustment

 1. The press F6 message and the placement of the compiled executable statement are incorrect for the scripts case.
 2. <raylib.h> because "raylib.h" is meaningful only when compiling inside raylib/src/ folder.
 3. main(void) to get rid of a novice-confusing warning.
2021-10-03 12:13:46 +02:00
Laurentino Luna
9fce26bb06 Supress most warnings on rmodels.c (#2029)
* Supress most warnings on rmodels.c

NOTE: unused symbols have been deleted and the following report will show in what location they were previously.

Unused symbols:
- ArrayInt - vox_loader.h: line 84
- initArrayInt - vox_loader.h: line 168
- insertArrayInt - vox_loader.h: line 175
- freeArrayInt - vox_loader.h: line 186
- offsetX, offsetY, offsetZ - vox_loader.h: line 610
- chunkTotalChildSize - vox_loader.h: line 623

Other warnings:
- initialization discards 'const' qualifier - vox_loader.h: line 572
- incompatible types for VoxVector3 and Vector3 - rmodels.c: line 5748
- incompatible types for VoxColor and Color - rmodels: line 5749

* Remove ToVector3 and ToColor functions and assign values directly
2021-10-03 12:11:20 +02:00
Ray
f869229b7f Minor format tweaks 2021-10-03 12:09:59 +02:00
Ray
239c37246a WARNING: REVIEWED: Follow a set of conventions
CONVENTIONS:
  - Functions are always self-contained, no function use another raymath function inside, required code is directly re-implemented inside
  - Functions input parameters are always received by value
  - Functions use always a "result" variable for return
  - Functions are always defined inline
  - Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience)
2021-10-03 11:44:59 +02:00
Chris
9882796df0 Rename BRDG typo to BDRF (#2028) 2021-10-02 14:07:42 +02:00
Dennis E. Hamilton
e34c0911f9 Cleanup x64/x86 options in scripts/build-windows.bat (#2023)
* Match build-windows.bat changes

The location for manual setting of the vcvarsall.bat location moved to line 38 in the latest change.

* Update flags for clean x64/x86 building

std:c11 is required for initialization features used in raylib.  UTF-8 for consistency in contemporary systems.  /W3 gets rid of puzzling slack byte and linker in-lining warnings.  /sdl for some insecure library usages in the user code that beginners should learn about early.
2021-09-30 22:29:35 +02:00
mausimus
93efa565f9 reset resizedLastFrame on web platform (#2020) 2021-09-29 23:27:10 +02:00
mausimus
dfbb134bfe RLGL: restore draw batch state after limit check (#2018) 2021-09-29 23:26:29 +02:00
Vadim Boev
92f6290dbb Build Android App with Visual Studio 2019 (#2013)
* Add support Android build for Visual Studio

* Delete projects/VS2019-Android/raylib_android/ARM64/Debug directory

* Delete projects/VS2019-Android/raylib_android/raylib_android/raylib_android.NativeActivity/ARM64/Debug directory

* Delete projects/VS2019-Android/raylib_android/raylib_android/raylib_android.Packaging/ARM64/Debug directory

* Delete projects/VS2019-Android/raylib_android/raylib_android/raylib_android.Packaging/ARM/Debug directory

* Delete projects/VS2019-Android directory

* Build Android App with Visual Studio 2019
2021-09-27 17:57:06 +02:00
Ray
2474d50dba Update raylib.h 2021-09-27 17:52:15 +02:00
Ray
e40ece55d5 Update raylib.h 2021-09-27 17:51:57 +02:00
raysan5
18c92b3104 ADDED: Vector3Angle() 2021-09-27 13:57:06 +02:00
raysan5
dd7d65a6b4 Remove tabs 2021-09-27 13:55:45 +02:00
Tommi Sinivuo
206e1def6f Add Zig build file (#2014)
The build file builds Raylib as a static library for either
Windows or Linux.
2021-09-25 19:24:48 +02:00
Tristan Schulz
b7063ab879 [models] Animation System Fix Part 1 (#2009)
* Fixed gltf missing transforms on load

mend

* extracted Matrix calculation in to static method and added skinning check

* fixed formatting

* Fixed write to access to nullptr when animation has no normals

* Refactored UpdateModelAnimation to only update changed vertices when needed (allows for multi animation playing)

* add check for models that were missed during BindGLTFPrimitiveToBones to not segfault the program

* fixed id mismatch between animation and model

* draft on fixing the mesh to skin mapping

* dont look at this

* removing debug info
2021-09-23 21:06:51 +02:00
raysan5
10d7718011 UPDATED: raylib resource files 2021-09-23 20:53:31 +02:00
raysan5
ddc1fdf6d5 REVIEWED: SeekMusicStream() formating 2021-09-23 18:11:24 +02:00
Uneven Prankster
7fa521fae4 Fix + Return if attempting to seek on a module format (#2008) 2021-09-23 17:38:37 +02:00
Ray
08ea5e419e REVIEWED: LoadImageAnim() #2005 2021-09-23 00:23:57 +02:00
Ray
00a763ea44 Reviewed some TODO comments 2021-09-23 00:18:47 +02:00
Laurentino Luna
dcd289d931 Modify TODO to NOTE on Makefile (#2007)
'# TODO: see 'install' target.' should be a note rather than something
to do.
2021-09-22 23:49:11 +02:00
Timon de Groot
025246620f Add function DrawCubeTextureRec (#2001)
* Add function DrawCubeTextureRec

* Add EOF newline

* Remove unneeded example
2021-09-22 21:56:38 +02:00
Uneven Prankster
19ef765382 SeekMusicStream initial implementation (#2006) 2021-09-22 21:55:13 +02:00
Ryan Roden-Corrent
9607ea5c0a Use unsigned int for animation count. (#2002)
LoadModelAnimations takes an `int` for the animation count parameter.
The animation count should never be negative, so it makes sense to
specify it as unsigned in the API. This matches the API for
UnloadModelAnimations, which expects an unsigned int. Both GLTF and IQMM
also store the animation count internally as unsigned, and we were
casting to a signed int for no reason.

GLTF actually uses `size_t` internally, so we're technically risking
overflow, but having 2^32 animations seems unlikely.
2021-09-22 13:04:10 +02:00
Ray
8a434b4fd4 Update rmodels.c 2021-09-22 13:02:44 +02:00
Ray
0e037555fe Update raylib.h 2021-09-22 12:59:40 +02:00
Ray
de173a93c8 Update rmodels.c 2021-09-22 12:19:25 +02:00
Ray
37c047eabc Update rmodels.c 2021-09-22 11:28:52 +02:00
Ray
c1432386a5 Update Makefile 2021-09-22 11:13:10 +02:00
Conifer
b5f281bacd Update BINDINGS.md (#2003)
Update the link to new and better Swift binding to Raylib by STREGAsGate
2021-09-22 10:11:44 +02:00
Ray
23b827b66c Update macos.yml 2021-09-22 00:57:42 +02:00
Ray
d851208413 Update linux.yml 2021-09-22 00:56:58 +02:00
Ray
3caa15e696 Update webassembly.yml 2021-09-22 00:55:46 +02:00
Ray
99ab4d6cb8 WARNING: MODULES RENAMING!!!
raylib modules have been slightly renamed to add some identity and note that they are independent modules that can be used as standalone separate parts of raylib if required.

The renamed modules are:
 - `core` -> `rcore`
 - `shapes` -> `rshapes`
 - `textures` -> `rtextures`
 - `text` -> `rtext`
 - `models` -> `rmodels`
 - `camera` -> `rcamera`
 - `gestures` -> `rgestures`
 - `core` -> `rcore`

All the build systems has been adapted to this change.
2021-09-22 00:15:06 +02:00
Ray
8b3d054408 Minor reviews 2021-09-21 23:49:42 +02:00
raysan5
7d995d95eb Merge branch 'master' of https://github.com/raysan5/raylib 2021-09-21 15:31:35 +02:00
raysan5
a09311a8fc Tweaks 2021-09-21 15:31:26 +02:00
Uneven Prankster
339fdf4c31 Add up argument to DrawBillboardPro (#1941)
* Add `up` argument to `DrawBillboardPro`

* Replace tab with proper spaces
2021-09-21 15:22:30 +02:00
raysan5
c96de3a23a ADDED: GetTouchPointId(index) #1972 2021-09-21 15:11:33 +02:00
raysan5
1627f34032 Reviewed some compilation issues #1997 2021-09-21 15:06:06 +02:00
Richard Smith
59cabc7d11 Update BINDINGS.md (#2000) 2021-09-21 14:54:52 +02:00
Chris
89f031673b Fix mappings.h issue from glfw update (#1995)
- Ran GenerateMappings.cmake to restore mapping changes
2021-09-19 20:33:18 +02:00
Tommi Sinivuo
3c55f067a8 Add SetRandomSeed(unsigned int seed) function (#1994)
Specifying a fixed seed for the random number generator is often
used in games for various reasons.

By adding an api function for seeding the random number generator
we solve two different problems regarding the seeding:

1) The underlying RNG implementation does not leak to client code
   (as would be the case if we called srand directly from the
   client code)
2) Seeding the RNG would be simple from other programming languages
   (especially in cases where calling libc functions is non-trivial)
2021-09-17 21:26:21 +02:00
MrSwedish
23fabb1d67 Prevent INVALID_SOCKET to be defined twice on linux (#1993)
i got an error because of this lol
2021-09-17 01:05:38 +02:00
Neil Barkhina
e9d3d4fa1f Implemented GetGamepadName() for emscripten (#1986)
* implemented GetGamepadName for emscripten

* updated gamepad to use existing name as arary

* removed unnecessary platform_web check
2021-09-12 18:02:54 +02:00
Hristo Stamenov
024adc2538 Add find opengl for widnows too. (#1985)
* Add find opengl for widnows too.

* Also fix set LIBS_PRIVATE to bi similar to linux and apple targets
2021-09-10 20:31:36 +02:00
raysan5
72983d4e20 Typo 2021-09-10 19:01:24 +02:00
raysan5
b63c2619e3 Update Makefile for web compilation
Some flags are only for the linker, not the compiler
2021-09-10 19:01:09 +02:00
Ray
40ec7a6236 Update core.c 2021-09-10 17:23:48 +02:00
Ray
352ea80a1f REVIEWED: Vox loader 2021-09-10 15:37:31 +02:00
procfxgen
a422d2fc8b Vox loaded (#1981)
* new models_magicavoxel_loading example

* Portable header-only file "magicavoxel_loader.h" for MagicaVoxel loader example.

* models_magicavoxel_loading example added to CMakeLists.txt and Makefile

* fix models_magicavoxel_loading example for linux.

* * vox_loader into "src/external/vox_loader.h"
 * vox file support for "models.c"
 * updated example "models/models_magicavoxel_loading.c"

* * Fix Vox_FreeArrays (removed memory leak)

* * removed magicavoxel_loader.h

* * Revert vs2019 solution

* * vox_loader.h -> Support custom memory allocators
* vox_loader.h -> Reverse Y<>Z for left to right handed system
* models/models_magicavoxel_loading.c -> fix model center

* * vox_loader.h -> Removed Raylib dependencies

* * Changed Vox_LoadFileName to Vox_LoadFromMemory
2021-09-10 15:24:01 +02:00
Ray
803094f41f REVIEWED: Touch input system #1975 #1960
- ADDED: `GetTouchPointCount()` to core module, removed from gestures module.
 - Support multiple touch points: `MAX_TOUCH_POINTS`.
2021-09-10 15:19:12 +02:00
Ray
2c13e43c32 Review font loading log info 2021-09-10 15:16:34 +02:00
Nikolay Krasheninnikov
18d73eef19 Fixes target direction for first person camera mode. (#1977)
Co-authored-by: Nikolai Krasheninnikov <nikolai.krasheninnikov@kronshtadt.ru>
2021-09-10 11:51:59 +02:00
Tristan Schulz
7bf31dd468 Fixed loading obj models with no materials (#1984) 2021-09-09 18:14:15 +02:00
Steven Schveighoffer
1a6adc5f74 Fix dynamic library issues on Macos (#1978) 2021-09-06 23:17:12 +02:00
raysan5
b15715ca80 Merge branch 'master' of https://github.com/raysan5/raylib 2021-09-05 21:49:49 +02:00
raysan5
8d3ff3fda8 Updated Makefile for latest Android NDK r32 LTS
It seems now it's required to use archiver `llvm-ar`
2021-09-05 21:49:47 +02:00
Tristan Schulz
24a38dbd3f [models] LoadGLTF fixed missing transformations and nonroot skinning problem (#1964)
* Fixed gltf missing transforms on load

mend

* extracted Matrix calculation in to static method and added skinning check

* fixed formatting
2021-09-05 21:15:40 +02:00
raysan5
4120f12375 REVIEWED: Vox loading, mostly formating 2021-09-05 20:39:34 +02:00
procfxgen
dfc465ca6d new models_magicavoxel_loading example (#1940)
* new models_magicavoxel_loading example

* Portable header-only file "magicavoxel_loader.h" for MagicaVoxel loader example.

* models_magicavoxel_loading example added to CMakeLists.txt and Makefile

* fix models_magicavoxel_loading example for linux.

* * vox_loader into "src/external/vox_loader.h"
 * vox file support for "models.c"
 * updated example "models/models_magicavoxel_loading.c"

* * Fix Vox_FreeArrays (removed memory leak)

* * removed magicavoxel_loader.h

* * Revert vs2019 solution
2021-09-04 19:55:09 +02:00
raysan5
93168304cd Update shell.html 2021-09-03 15:24:05 +02:00
Ray
9ff8ad853c Update raygui.h 2021-09-02 00:39:47 +02:00
Ray
59e7275464 REVIEWED: Glyphs 2021-09-02 00:35:55 +02:00
Ray
fa79ae8a3d Merge branch 'master' of https://github.com/raysan5/raylib 2021-09-01 23:41:00 +02:00
Ray
9362eaf9c6 REVIEWED: Naming: length vs size 2021-09-01 23:40:51 +02:00
atticus
dfadb3ee37 fix various memory leaks (#1969) 2021-09-01 23:15:32 +02:00
Ray
6e76baa6a9 WARNING: BREAKING: RENAMED: Font struct variables
RENAMED: GetCodepointsCount() -> GetCodepointCount()
RENAMED: GetTouchPointsCount() -> GetTouchPointCount()
2021-09-01 23:11:31 +02:00
Ray
a0f8682905 REVIEWED: <name>Count for consistency
Following english rules, it should be singular name before Count.
2021-09-01 23:09:30 +02:00
Tristan Schulz
e8fa7ceb79 [models] Fixed counting loop for face amount per material (#1967) 2021-09-01 21:29:20 +02:00
Ray
68bcfa1192 Minor tweak 2021-08-28 22:54:47 +02:00
raysan5
d98e61c6eb Minor format tweaks 2021-08-28 12:01:16 +02:00
Hussein Sarea
66c6ec4465 Add pyraylib (#1961) 2021-08-28 09:57:13 +02:00
Ray
936199d8de Review dates 2021-08-27 18:50:02 +02:00
Ray
18af18479f REVIEWED: ExportWaveAsCode() 2021-08-27 18:49:03 +02:00
Ray
b7ae0df3d9 REVIEWED: Decouple DrawMesh() and DrawMeshInstanced() #1958 2021-08-27 12:13:44 +02:00
Richard Smith
cac856119c Change GetColor to take unsigned int (#1954) 2021-08-26 17:31:01 +02:00
irishgreencitrus
1286bc076f Add raylib.v binding (#1955)
Added raylib.v binding for Vlang
2021-08-26 17:27:31 +02:00
Ray
3d33c559e7 REVIEWED: Examples compilation 2021-08-26 00:14:34 +02:00
Ray
14e443afba REVIEWED: OpenGL 1.1 compilation issue 2021-08-25 23:41:33 +02:00
Ray
7749a2805c UPDATED: raygui to latest version -WIP-
Note this new raygui version embeds ricons and `GuiTextBoxMulti()` is not working properly
2021-08-25 00:51:37 +02:00
Ray
a04dbe7ffd Update shaders_shapes_outline.c 2021-08-25 00:41:48 +02:00
Ray
913f185f82 Renamed some static functions for more consistent naming 2021-08-25 00:22:16 +02:00
Laurentino Luna
6575d31379 Fix tcc not finding emmintrin.h (#1947)
* Fix tcc not finding emmintrin.h

This allows to compile raylib with tcc with no errors.

* Remove __TINYC__ check from stb_image.h

This will be placed under textures.c

* Move tcc check to textures.c

Avoiding to change stb_image.h
2021-08-24 16:34:52 +02:00
raysan5
7c1889c282 REVIEWED: Support mouse wheel on x-axis #1948 2021-08-24 15:26:59 +02:00
Luiz Pestana
45fd75952d Revert "Ignore generated example binaries (#1884)" (#1946)
This reverts commit 4a01139c8d.
2021-08-23 20:05:34 +02:00
Ray
51fbde178f Update shaders_shapes_outline.c 2021-08-22 01:08:27 +02:00
Ray
b154bc33f5 Added note on GLFW custom allocators for the future 2021-08-22 01:08:11 +02:00
Ray
d98779abef Minor tweak to avoid false error logs 2021-08-22 01:07:37 +02:00
Ray
aefdb9f9cf REMOVED: Old function names defines
As far as next raylib version will be 4.0, no backward compatibility hacks will be maintained.
2021-08-21 23:57:41 +02:00
Ray
ff523d55ac Updated raygui #1939 2021-08-20 11:56:25 +02:00
atticus
6d20430ccc add NULL check (#1925) 2021-08-20 11:47:51 +02:00
Ray
a5beb940f8 Remove trailing spaces 2021-08-16 23:23:16 +02:00
Ray
f3385b6ad2 Update rlgl.h 2021-08-16 19:52:57 +02:00
Ray
ef8526ae36 Update rlgl.h 2021-08-16 19:26:10 +02:00
Ray
92a13878dc Add some comments 2021-08-16 19:23:06 +02:00
Ray
1b4c58b66f WARNING: BREAKING: Use frameCount on audio
This is a big change for optimization and a more professional understanding of audio. Instead of dealing with samples, now we deal with frames, like miniaudio does, so, avoiding continuous conversions from samples to frames.
2021-08-16 11:06:31 +02:00
Dennis E. Hamilton
e203fb58c6 Match build-windows.bat changes (#1923)
The location for manual setting of the vcvarsall.bat location moved to line 38 in the latest change.
2021-08-16 09:53:14 +02:00
raysan5
462e7aec52 Updated RAYLIB_VERSION to 4.0-dev
Several breaking changes have been done lately so I think it's better to mark raylib for next release as 4.0.
2021-08-15 13:25:14 +02:00
raysan5
aae60e1e44 REVIEWED: extern "C" definition position for consistency
Note that `extern "C"` calling convention only affects objects that need to be seen by the linker, in our case only functions... but it would also be required by global variables exposed, if any.
2021-08-15 13:02:53 +02:00
raysan5
848cdb267a Support C++ usage as standalone library 2021-08-15 12:58:34 +02:00
raysan5
760cfd361e REVIEWED: PHYSACDEF definition and C++ issues #1918 2021-08-15 12:52:12 +02:00
630Studios
092435d51c [Models] Fix for issue #1809 (#1917)
* GenMeshTangents Fix

* GenMeshTangents Fix - Comment Update

* GenMeshTangents Fix - Comment Update final

* Code Style Changes

* Code Style Changes Final

* Code Style Changes Final 2

* GenMeshTangents better handling for issue #1876

* GenMeshTangents better handling for issue #1876

* GenMeshTangents: Better fix for issue #1876

* vboId location fix

* rlUpdateVertexBuffer - bufferId is an unsigned int

* Fix for issue#1809 - Obj with more materials then mesh caused crash

* Fix for issue#1809 - Formatting Update
2021-08-12 21:01:40 +02:00
raysan5
1dff5814be ADDED: rlUpdateVertexBufferElements() #1915 2021-08-12 21:01:09 +02:00
raysan5
26db391576 ADDED: rlActiveDrawBuffers() #1911
- ADDED: rlEnableColorBlend()/rlDisableColorBlend()
2021-08-12 20:38:57 +02:00
630Studios
ce3214b82d [rlgl] rlUpdateVertexBuffer (#1914)
* GenMeshTangents Fix

* GenMeshTangents Fix - Comment Update

* GenMeshTangents Fix - Comment Update final

* Code Style Changes

* Code Style Changes Final

* Code Style Changes Final 2

* GenMeshTangents better handling for issue #1876

* GenMeshTangents better handling for issue #1876

* GenMeshTangents: Better fix for issue #1876

* vboId location fix

* rlUpdateVertexBuffer - bufferId is an unsigned int
2021-08-12 09:47:00 +02:00
raysan5
621a8766a8 WARNING: BREAKING: Renamed CharInfo to GlyphInfo and more...
This commit introduces some breaking changes for library consistency, hopefully not too dramatic... Here the full list:
 - RENAMED: struct `CharInfo` to `GlyphInfo`, actually that's the correct naming for the data contained. It contains the character glyph metrics and the glyph image; in the past it also contained rectangle within the font atlas but that data has been moved to `Font` struct directly, so, `GlyphInfo` is a more correct name.
 - RENAMED: `CodepointToUtf8()` to `CodepointToUTF8()`, capitalization of UTF-8 is the correct form, it would also require de hyphen but it can be omitted in this case.
 - RENAMED: `TextToUtf8()` to `TextCodepointsToUTF8` for consistency and more detail on the functionality.
 - ADDED: `GetGlyphInfo()` to get glyph info for a specific codepoint
 - ADDED: `GetGlyphAtlasRec()` to get glyph rectangle within the generated font atlas
 - Some additional tweaks for consistency
2021-08-11 21:16:39 +02:00
raysan5
b6541b7a55 REVIEWED: DrawTextPro()
WARNING: DrawTextPro() requires including `rlgl.h`, before it was only dependant on `textures` module.
2021-08-11 19:02:15 +02:00
raysan5
7e27c2ffa8 TODO: DrawTextPro() rotation not working? 2021-08-11 18:53:06 +02:00
raysan5
b55418effd ADDED: DrawTextPro() with text rotation support 2021-08-11 18:31:56 +02:00
raysan5
5a259fa10f WARNING: REMOVED: DrawTextRec() and DrawTextRecEx()
- DrawTextRec() and DrawTextRecEx() have been moved to example, those functions could be very specific depending on user needs so it's better to give the user the full source in case of special requirements instead of allowing a function with +10 input parameters.
2021-08-11 18:31:32 +02:00
Tommi Sinivuo
0ba49cce45 Add *.so.* to .gitignore to ignore build artifacts (#1912)
When building a shared Raylib library on Linux, the build process
produces 3 files: libraylib.so (symlink), libraylib.so.381 (symlink)
and libraylib.so.3.8.1 (the library).

Only the first one of these (.so) is currently ignored by Git.
Adding *.so.* to .gitinore makes Git ignore the rest of them as
well.
2021-08-11 11:56:05 +02:00
raysan5
b54422c970 Merge branch 'master' of https://github.com/raysan5/raylib 2021-08-10 21:32:29 +02:00
Ryan Roden-Corrent
ef9fdd0fa5 Document Get{Key,Char}Pressed return value. (#1909)
I think it is useful to know what the empty behavior is in cases where
you are enumerating key presses (e.g. implementing "press any key to
continue").
2021-08-10 18:38:32 +02:00
raysan5
e3f0a11053 Update CHANGELOG 2021-08-10 17:48:31 +02:00
raysan5
311fe8f35b Replaced TABS by spaces 2021-08-08 21:09:11 +02:00
raysan5
a135d9c25d REVIEWED: Avoid conflict with bool 2021-08-08 13:23:04 +02:00
raysan5
ee72497eef REVIEWED: Some warnings... 2021-08-08 13:02:51 +02:00
raysan5
5e63cd3c97 ADDED: GenMeshCone() #1903 2021-08-08 11:29:24 +02:00
Ryan Roden-Corrent
e6fe8169c2 Fix Makefile to build WASM examples. (#1906)
* Fix Makefile to build WASM examples.

- Add --preload-file flag before specifying the resource dir
- Add empty resource dir to `shapes/` (otherwise wasm-ld will fail)
- Add wasm outputs to .gitigore

* Delete .gitignore

Co-authored-by: Ray <raysan5@gmail.com>
2021-08-07 23:30:48 +02:00
raysan5
7ca9131fd4 Update rlgl_standalone.c 2021-08-07 11:58:39 +02:00
Ray
07e0b10515 Added rayex, elixir binding 2021-08-07 11:28:35 +02:00
raysan5
aa67903f96 Improve rlgl description 2021-07-31 19:58:30 +02:00
raysan5
5b6d83b533 REVIEWED: rlgl defines for consistency 2021-07-31 19:46:44 +02:00
raysan5
3e75a2109d REVIEWED: rlgl module header info 2021-07-31 19:08:13 +02:00
raysan5
7013e60926 Update models_rlgl_solar_system.c 2021-07-31 18:44:07 +02:00
raysan5
559f1919c6 REVIEWED: Improved font loading info 2021-07-31 18:41:44 +02:00
raysan5
73c8ddc8bf REVIEWED: raylib_opengl_interop 2021-07-31 18:36:06 +02:00
raysan5
b805754aa1 REVIEWED: Avoid bool type collisions 2021-07-31 18:10:26 +02:00
raysan5
0f8cfd6031 Update rlgl_standalone.c 2021-07-30 13:52:00 +02:00
raysan5
dffd1435e9 Revert "REVIEWED: Avoid UBSAN warnings #1891"
This reverts commit a8e9e1387f.
2021-07-30 13:50:33 +02:00
raysan5
a8e9e1387f REVIEWED: Avoid UBSAN warnings #1891 2021-07-30 13:47:21 +02:00
raysan5
1613057881 Update raudio.c 2021-07-30 13:45:01 +02:00
raysan5
b4fddf146b REVIEWED: Added new mechanism to avoid data types collision between modules that share same data types and can be used in standalone mode 2021-07-30 13:44:52 +02:00
raysan5
aeb1a0da84 REVERTED: Removed the need for rlMatrix
Now rlgl uses the `Matrix` type, just make sure it has been previously defined somewhere... I don't like this approach but it's probably the easier one for the users... still looking for a better solution... maybe using something like
`#define MATRIX_TYPE`, so it can be checked in other modules.
2021-07-30 12:54:54 +02:00
raysan5
71373ee524 Update Makefile 2021-07-30 12:48:09 +02:00
raysan5
1cc25d1a2d Review include path that was breaking the build 2021-07-30 12:14:31 +02:00
raysan5
bd70a22412 Review some issues 2021-07-30 11:56:14 +02:00
raysan5
8b7f43f89b WARNING: BREAKING CHANGE: rlgl complete decoupling from raylib -WIP-
rlgl has been redesigned to avoid any dependency to `raylib` or `raymath`, all functions using some of those libs have been reviewed.
 - REMOVED: `Texture2D`, `Shader` structs dependency
 - REMOVED: `Vector3`, `Matrix` structs dependency
 - REMOVED: raymath functions dependency, all required math is implemented in rlgl
 - ADDED: `rlMatrix` custom rlgl type
 - ADDED: `utils.c`: `rlMatrixFromMatrix()` and `rlMatrixToMatrix()` for a safe conversion between raylib<->rlgl matrix types
 - ADDED: `rl` prefix to all `rlgl` structs
 - Other small tweaks here and there
2021-07-29 21:57:50 +02:00
raysan5
58e9a0894f Reviewed some functions to avoid calling other functions 2021-07-29 21:50:50 +02:00
iskolbin
6ef3ab3d3a impoves raylib_parser: makes it generic, adds -d key for functions define (RLAPI for raylib.h), increases maxiumum number of fields in structs and values in enums, doubles max length of struct field names; split float3/float16 struct typedefs in raymath to allow parser to process the file (#1901) 2021-07-29 20:37:44 +02:00
raysan5
a9f6ff6fe3 Add external folder to build (just in case) 2021-07-29 20:32:30 +02:00
Ray
cd1464390c Update CONVENTIONS.md 2021-07-29 12:11:12 +02:00
Kyle Appelgate
d8ca13f4c6 fixed DisableCursor() on web by registering an empty mouse click event function in emscripten (#1900) 2021-07-28 21:38:31 +02:00
raysan5
8fecf45f4c REVIEWED: rnet include from extras 2021-07-28 19:48:20 +02:00
raysan5
96aadec503 REVIEWED: Info on image loading failure 2021-07-28 19:47:53 +02:00
raysan5
c219fc02cd Review includes to use extras libraries 2021-07-28 17:29:49 +02:00
raysan5
75d675ab4d Review physac.h path 2021-07-28 17:21:34 +02:00
raysan5
69a82c7a0d ADDED: raygui to extras libraries for convenience 2021-07-28 13:15:43 +02:00
raysan5
0c3902b543 ADDED: GetModelBoundingBox()
Reorganized models functionality, it still needs some review...
2021-07-28 13:15:10 +02:00
raysan5
7c7ee1cdc8 REVERTED: Mesh indices issue #1891 2021-07-28 13:12:16 +02:00
raysan5
0c17d1e14f Minor formatting tweak 2021-07-28 12:58:43 +02:00
raysan5
0352aa2094 Replace TABS by 4 spaces 2021-07-28 12:55:38 +02:00
raysan5
a9230a6c07 Update shapes_logo_raylib_anim.c 2021-07-28 12:50:18 +02:00
Jeffery Myers
c706b33b30 Don't normalize zero length vectors. (#1896) 2021-07-28 08:59:39 +02:00
raysan5
e9c7ab925f REVIEWED: rlDrawVertexArrayElements() #1891 2021-07-27 23:35:54 +02:00
raysan5
70ed52dd5d REVIEWED: QuaternionFromAxisAngle() #1892 2021-07-27 23:30:08 +02:00
Uneven Prankster
4e363b5479 Remove unused UWP defines (#1894)
* Unused UWP define removal

* Further removal of unusued UWP defines
2021-07-26 17:40:10 +02:00
AKDev
9839ea6667 Added another raylib binding for nelua (#1890) 2021-07-25 19:45:04 +02:00
Níckolas Daniel da Silva
87b542085b Update SPONSORS.md (#1886) 2021-07-24 19:55:21 +02:00
Ray
647b54a2dc Update BINDINGS.md 2021-07-23 23:38:44 +02:00
Jeffery Myers
548961aea1 State that raylib works with both C and C++ and move raylib-cpp to a wrapper section instead of a language binding, for less confusion. (#1885)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-07-23 23:33:32 +02:00
Ray
00911b0842 Reviewed ImageDrawLine() formating 2021-07-23 23:32:20 +02:00
Alexander Buhl
ff2b8d6db1 Fixes #1873 Implemented remaining 7/8 of ImageDrawLine (#1874)
* Implemented remaining 7/8 of ImageDrawLine

The existing code was correct for one octant, it now works for all 8
Added two internal functions, _ImageDrawLineHorizontal and _ImageDrawLineVertical, whithout which it would've been 4 times as much code.

* ImageDrawLine: Replaced 3 functions with 1

Removed both freshly added internal functions
Crammed it all into one

* ImageDrawLine shortened significantly using maths

Substituted X and Y, then wrote one abstract loop instead of 4 specific loops.
Lots of comments to explain what I'm doing for future maintainers.

* Now conforms with style conventions

Also reworded a comment to sound more... fomal.
2021-07-23 23:17:04 +02:00
Ray
0fa295c72d Review formating to follow raylib style conventions 2021-07-23 18:16:08 +02:00
Luiz Pestana
4a01139c8d Ignore generated example binaries (#1884) 2021-07-23 18:04:09 +02:00
GoldenThumbs
64e786fe28 Add example shaders_shapes_outline.c (#1883) 2021-07-18 23:45:13 +02:00
Luiz Pestana
5c76c33d7d Raspberry RPI/DRM keyboard fix (#1879)
Legacy keyboard support was blocking the render loop, also it was keeping the last key status until the next key.
2021-07-17 20:27:48 +02:00
630Studios
53bb87c8fb [Models] Better Fix for GenMeshTangents issue #1876 (#1878)
* GenMeshTangents Fix

* GenMeshTangents Fix - Comment Update

* GenMeshTangents Fix - Comment Update final

* Code Style Changes

* Code Style Changes Final

* Code Style Changes Final 2

* GenMeshTangents better handling for issue #1876

* GenMeshTangents better handling for issue #1876

* GenMeshTangents: Better fix for issue #1876

* vboId location fix
2021-07-17 01:33:49 +02:00
630Studios
9aaf7a8057 GenMeshTangents Fix (#1877)
* GenMeshTangents Fix

* GenMeshTangents Fix - Comment Update

* GenMeshTangents Fix - Comment Update final

* Code Style Changes

* Code Style Changes Final
2021-07-16 22:14:13 +02:00
raysan5
56cab4b6a9 REVIEWED: shaders_basic_lighting #1865
Simplified the example
2021-07-16 17:18:32 +02:00
raysan5
c4804c4c0c REVIEWED: Wrong normal matrix calculation #1870 2021-07-16 17:12:22 +02:00
raysan5
8809ae66c6 REVIEWED: Possible memory leak 2021-07-16 16:11:22 +02:00
raysan5
85dc2cc03a Minor format tweaks 2021-07-16 16:10:53 +02:00
raysan5
db4cfc9fbd Reviewed resources licenses 2021-07-16 16:10:35 +02:00
raysan5
7d2845a661 Improve assets license information 2021-07-16 14:29:20 +02:00
raysan5
30a3dae8a6 Update texel_checker.png 2021-07-16 14:27:56 +02:00
GoldenThumbs
59acb6dbea Updated models.c (#1871)
- fixed issue where vertex positions being passed in place of vertex normals.
2021-07-13 12:18:52 +02:00
Humberto Yeverino Jr
8277597bcf Fix Android multi-touch (#1869) 2021-07-13 12:17:47 +02:00
Daniel Nagy
8a46b5e6c0 Use 60 FPS for textures_image_loading example (#1867) 2021-07-11 18:47:31 +02:00
raysan5
ae230dae46 Update Makefile 2021-07-09 18:49:36 +02:00
raysan5
7062415aec WARNING on emscripten_set_fullscreenchange_callback() 2021-07-09 18:49:29 +02:00
raysan5
5ed814e950 Minor tweaks and comments 2021-07-09 17:36:20 +02:00
Tobias Mock
2156cd4a84 Update raylib-ocaml to 3.7 (#1864) 2021-07-09 00:00:53 +02:00
Ray
3a74534c39 Added a note 2021-07-07 21:41:45 +02:00
raysan5
4d438ed68d REVIEWED: RPI: Keyboard stdin input #1769 2021-07-06 18:25:00 +02:00
raysan5
bfff2c432c Minor tweaks on DRM system 2021-07-06 17:16:50 +02:00
raysan5
bcf3ad87e8 Update raylib.vcxproj 2021-07-05 20:00:53 +02:00
raysan5
a958cebdd9 Update audio_raw_stream.c 2021-07-05 19:47:50 +02:00
raysan5
e6aa713a37 REVIEWED: Need to set default buffer size for raw data #1770
This design should probably be changed...
2021-07-05 19:45:57 +02:00
Richard Smith
e18aad0653 Update BINDINGS.md (#1862) 2021-07-05 19:03:53 +02:00
raysan5
9aedfbec69 Review formatting 2021-07-05 18:45:17 +02:00
raysan5
c0ca8a74bc WARNING: BREAKING: REMOVED PLATFORM_UWP support
After lot of investigation, I'm afraid I'm removing official UWP support from raylib, I'll keep the current implementation in a separate branch (UWP), just in case. It seems Microsoft is trying to replace UWP in the long term, they announced lack of support for the new WinUI 3 and they seem to be moving to Windows App SDK.

Also, on current implementation, the code is divided between raylib and the example, requiring multiple callback hooks, making it difficult to follow and maintain.

And realistically speaking, raylib is probably not the best option for anyone willing to target UWP, neither Xbox consoles.
2021-07-05 12:34:23 +02:00
Ray
63b1860010 Update README.md 2021-07-05 11:52:50 +02:00
Ray
0c78b8d182 Update README.md 2021-07-05 11:52:31 +02:00
Ray
4e79e23a20 Update README.md 2021-07-05 11:52:13 +02:00
raysan5
dbb2bbf207 REMOVED: VS2017 project, outdated
This project has been superseded by VS2019 with a better configuration and more complete solution, including more examples
2021-07-04 20:58:18 +02:00
raysan5
64916ba232 REMOVED: Old VSCode project
It would be nice that TCC option was integrated in main VSCode project
2021-07-04 20:55:39 +02:00
Ray
8a7812f1f5 Update README.md 2021-07-04 20:51:57 +02:00
raysan5
d432d03aea REVIEWED: Infinite loop on closing #1861 2021-07-04 20:29:20 +02:00
raysan5
c15d08d6ec Review some comments 2021-07-03 21:48:35 +02:00
raysan5
f8753bda01 Update core.c 2021-07-03 21:31:52 +02:00
raysan5
652b17d68d Review variables initialization 2021-07-03 21:25:30 +02:00
raysan5
efba81442a Update link address for miniaudio 2021-07-03 21:25:05 +02:00
raysan5
1aec0a90bc Merge branch 'master' of https://github.com/raysan5/raylib 2021-07-01 21:43:24 +02:00
raysan5
f81dfce19f Minor tweaks 2021-07-01 21:43:13 +02:00
Calvin Day
2a70638e26 Added Raylib-J (#1860) 2021-07-01 20:30:22 +02:00
raysan5
1fe137db44 Create core_basic_screen_manager.png 2021-06-30 18:54:36 +02:00
raysan5
fe8dad48e2 ADDED: EXAMPLE: core_basic_screen_manager 2021-06-30 18:53:55 +02:00
raysan5
2cda1502a3 WARNING: REMOVED: Game templates
It's seems noone has ever used them
2021-06-30 18:38:39 +02:00
raysan5
a6728a2203 REVIEWED: emscripten versions 2021-06-30 17:12:58 +02:00
raysan5
9e7ca41f58 Remove trailing spaces 2021-06-30 16:39:07 +02:00
raysan5
0776f1e106 Merge branch 'master' of https://github.com/raysan5/raylib 2021-06-30 16:38:39 +02:00
raysan5
de4611ecf6 REVIEWED: Advance template 2021-06-30 16:38:23 +02:00
masterex1000
ee24d17895 Fix DecompressData() pointer issue (#1856) 2021-06-29 23:06:09 +02:00
raysan5
da8d76d826 Review issue with pointer #1854 2021-06-29 11:26:34 +02:00
raysan5
6f30a19dd7 Update uwp_events.h 2021-06-28 14:23:55 +02:00
raysan5
2911cf2a48 Reviewed comments 2021-06-28 14:23:45 +02:00
Ray
e5cf3f9555 WARNING: BREAKING: Functions renamed for consistency
RENAMED: GetTextureData() -> LoadImageFromTexture()
RENAMED: GetScreenData() -> LoadImageFromScreen()
2021-06-28 09:39:31 +02:00
raysan5
5f03201616 Minor tweaks 2021-06-26 22:43:20 +02:00
raysan5
8eb7cf1fee REVIEWED: Enum values descriptions 2021-06-26 22:13:45 +02:00
raysan5
0624af09fd Update raygui.h 2021-06-26 21:11:34 +02:00
raysan5
2f75657350 WARNING: REMOVED: Some deprecated function names mapping
Some functions/values have been deprecated for long time but some mapping was kept for convenience. Some of those mappings have been removed...
2021-06-26 21:07:00 +02:00
Ray
00c8795385 Minor tweaks to follow code conventions 2021-06-26 13:45:39 +02:00
Ray
89708edf7f REVIEWED: Latest PR to follow raylib code conventions 2021-06-26 13:45:15 +02:00
Hristo Stamenov
71700254b4 Major revamp gltf (#1849)
* Added my own model and license to Raylib exclusively created by me and provided for use in the examples (and other projects if anyone decides to)

* Use animation vertices on initial load if possible.

* Added girl model to model example

* Revamped GLTF model loading as it was wrong by default. Also updated some comments.

GLTF models were loaded only by mesh but they should be loaded recursively by hierarchical nodes because tehre are some static node transformations that are to be applied to the vertices. It also resulted in more meshes being included in some models.

It is the correct way of loading GLTF and what is suggested in the official examples.

Currenlty limiting to only one scene but more can be included later.

* Refactored the new names and structure of extracted functions.

* Safer and easier read value.

* Made reading easier for accessor->bufferView->buffer in GLTF.

Now there is no need to check for supported types or anything.

* Correct inclusion of limits.h in the cases of MSVC based compilers vs the world

* Removed weird example file
2021-06-26 13:22:00 +02:00
Ray
aa86e9d399 REVIEWED: Minor tweaks on log messages 2021-06-26 13:18:39 +02:00
Ray
4b6e6ce20e REVIEWED: Improved log info on image/textures laoding
ADDED: rlGetPixelFormatName()
2021-06-26 13:07:14 +02:00
Ray
7cbfca8bd1 REVIEWED: Simplified code to avoid extra functions calls 2021-06-26 13:06:22 +02:00
Ray
e0720a0a55 WARNING: REVIEWED: Default shader uniform names
When a shader is loaded, by default, several locations are tried to be set automatically.
2021-06-25 13:35:43 +02:00
Ray
d4c03b47ec REVIEWED: LoadShader() and default locations
Reviewed locations descriptions
2021-06-25 00:46:14 +02:00
Ray
a226e11aac Update CONVENTIONS.md 2021-06-24 19:03:05 +02:00
Ray
d3d362090c Update CONVENTIONS.md 2021-06-24 18:59:09 +02:00
Ruminant
f3eff740ce fix to LoadShaderFromMemory (#1851)
- the shader.locs now match the LoadShader function

Without this change, the lighting sample looks incorrect when
using LoadShaderFromMemory

Co-authored-by: Ruminant <psp5150+git@gmail.com>
2021-06-24 18:48:48 +02:00
Ray
f4c171aa45 Create CONVENTIONS.md 2021-06-24 18:48:08 +02:00
Ray
953882e86f REVIEWED: CORE.Storage.basePath
Simplified some code
2021-06-24 18:13:25 +02:00
Ray
46ad7b87e8 Update text.c 2021-06-24 18:11:48 +02:00
Ray
4e9afac2a5 REVIEWED: WaitTime() #1841
Avoid global variables dependency, now the function is self-contained.
2021-06-24 11:01:44 +02:00
Ray
2cce5a24c9 Merge branch 'master' of https://github.com/raysan5/raylib 2021-06-24 10:39:56 +02:00
Ray
43efe92e21 Update core_basic_window.c 2021-06-24 10:39:43 +02:00
Nikhilesh S
f7a6b94f46 Allow SetWindowSize() on web (#1847) 2021-06-23 10:02:18 +02:00
Ray
7203acdef9 Minor format tweaks 2021-06-23 09:59:11 +02:00
Ray
3db26f82ea WARNING: BREAKING: Functions renamed!
RENAMED: GetCodepoints() -> LoadCodepoints(), now codepoint array data is loaded dynamically instead of reusing a limited static buffer.
ADDED: UnloadCodepoints() to safely free loaded codepoints
RENAMED: GetNextCodepoint() -> GetCodepoint()
2021-06-23 09:58:49 +02:00
Ray
716e26aa37 Review BeginTextureMode() usage
Moved outside BeginDrawing()/EndDrawing() to illustrate drawing is happening to an external texture (not screen)
2021-06-23 01:25:09 +02:00
Ray
f989048bda Reviewed example 2021-06-23 01:16:21 +02:00
Ray
49d2897b24 Update core_custom_frame_control.c 2021-06-22 21:24:15 +02:00
Ray
6f60622619 ADDED: Example: core_custom_frame_control 2021-06-22 21:20:14 +02:00
Ray
429c5a9a9a Review and un-expose InitTimer()
Actually it's not required for SUPPORT_CUSTOM_FRAME_CONTROL
2021-06-22 20:26:59 +02:00
Ray
7f2a071c51 Formatting review 2021-06-22 20:14:44 +02:00
Ray
2efb50cc63 Update .gitignore 2021-06-22 20:01:57 +02:00
Sky
9095dd9e82 Add support for resizing Emscripten canvas (#1840) 2021-06-22 18:25:52 +02:00
Diesirae
30a0f6f292 Fix DrawTextRec (#1843)
* fix text wrapping

* fix indent

* fix indent

* fix indent

* fix DrawTextRec
2021-06-22 18:16:04 +02:00
Guillaume DEVOILLE
52f1c7df6d Fix missing fclose in tinyobj loader (#1842)
Missing fclose in tinyobj loader.
2021-06-22 18:12:42 +02:00
FSasquatch
906c7f591e Added hxRaylib (#1846) 2021-06-22 18:07:47 +02:00
Ray
115cc7dede Review GetFPS() 2021-06-21 00:46:30 +02:00
Adrian Guerrero Vera
96d5dd24aa core: added GetMouseDelta() (#1832)
* core: added `GetMouseDelta()`

Thanks to previousPosition added by raysan it is now possible to create the GetMouseDelta() function.

Returns a Vector2 with the difference between the current and previous position of the mouse in a frame.

Useful for creating camera scrolling, among others.

* Added changes noted by raysan
2021-06-21 00:11:27 +02:00
raysan5
28093c46a8 Disable SUPPORT_EVENTS_AUTOMATION by default 2021-06-19 19:54:36 +02:00
PtitLuca
c37f776e87 fix: change relevant occurences of MeshBoundingBox to GetMeshBoundingBox (#1836) 2021-06-18 13:11:10 +02:00
Ray
1dd9fbae94 Merge branch 'master' of https://github.com/raysan5/raylib 2021-06-17 18:18:26 +02:00
Ray
8be5ec2288 Avoid SUPPORT_MOUSE_CURSOR_POINT 2021-06-17 18:18:16 +02:00
Sirvoid
1a420b77e3 Fixed: Binding vertex position twice (#1835) 2021-06-17 15:42:37 +02:00
Ray
0e65e5877f Update rlgl_standalone.c 2021-06-17 12:54:05 +02:00
Ray
e07054d0d4 RENAMED: SwapBuffers() -> SwapScreenBuffer()
Avoid possible symbol collisions
2021-06-17 12:47:03 +02:00
Ray
b733e76c86 Update physac.h 2021-06-17 12:26:33 +02:00
Ray
19b71f5f13 WARNING: Exposed SUPPORT_CUSTOM_FRAME_CONTROL #1729 2021-06-17 12:17:50 +02:00
Ray
ab032919df RENAMED: Wait() -> WaitTime() 2021-06-17 11:47:05 +02:00
Ray
68e408474d Renamed SUPPORT_MOUSE_CURSOR_NATIVE -> SUPPORT_MOUSE_CURSOR_POINT 2021-06-17 11:17:39 +02:00
Ray
942657fc7c Remove Color struct requirement 2021-06-17 00:28:51 +02:00
Ray
4decbb2586 RENAMED: MeshTangents() -> GenMeshTangents()
RENAMED: MeshBinormals() -> GenMeshBinormals()
2021-06-17 00:04:24 +02:00
Ray
f3d38018cd Comment tweak 2021-06-17 00:03:24 +02:00
Ray
3ae40c35e6 Update examples_template.c 2021-06-16 14:09:28 +02:00
Ray
4b93feb172 Remove trail spaces 2021-06-13 17:08:30 +02:00
Ray
d875891a3c Improved raylib parser to export data as XML
- Improved command-line
 - Added XML support
 - Added sample outputs: DEFAULT, JSON, XML
 - Reviewed LoadFileText() bug
 - Removed trailing spaces
2021-06-13 16:34:51 +02:00
Ray
3e68059556 Merge branch 'master' of https://github.com/raysan5/raylib 2021-06-13 12:08:44 +02:00
Ray
213c990eda Reviewed issue 2021-06-13 12:08:32 +02:00
Tobias Mock
929fa5780d Add nullptr check before passing arg (#1825) 2021-06-13 11:52:24 +02:00
Richard Smith
7d03048f1d updating raylib python cffi version (#1826)
* Update BINDINGS.md

* Update BINDINGS.md
2021-06-12 23:46:21 +02:00
FSasquatch
ae9cea03f0 Changed windows-build to build-windows (#1822) 2021-06-12 18:23:56 +02:00
Ray
de7b8ad551 NEW CRAZY FEATURE: EVENTS AUTOMATION!
https://youtu.be/3dZenkpmRzM
2021-06-11 12:27:46 +02:00
Francisco Javier Andrés Casas Barrientos
4dd5643402 Added missing null terminator (#1820)
Added missing null terminator when adding characters to the string, otherwise garbage values are read (often zeros which are equal to '\0', but not every time).

This error results in random characters appearing in the text box every one in a while:
```
asdfg??? ll??
```
It is corrected with the proposed fix.

This problem was observed by my student, Gonzalo Rivera Lazo.
2021-06-10 20:24:08 +02:00
Ray
0b8e0f05a7 Register mouse previous position 2021-06-10 18:03:25 +02:00
Ray
b188008a1c Review code formatting 2021-06-10 18:00:44 +02:00
Ray
7bc2e922c9 Review some comments 2021-06-10 17:49:55 +02:00
Ray
b0dcdf688f Reviewed functions description
Replaced: Returns -> Get
2021-06-10 17:43:58 +02:00
Ray
d3387c952a Reviewed Input variables and comments 2021-06-10 17:11:31 +02:00
Ray
3643974949 Corrected bug on enum 2021-06-10 11:38:02 +02:00
Ray
8980bcfe4b Added some enum comments 2021-06-10 11:31:34 +02:00
Hristo Stamenov
e1babab3cc There no longer is a library glfw_objlib and now it is only glfw. (#1818) 2021-06-09 09:49:13 +02:00
Ray
97b074ac26 Update GLFW to latest version #1817 2021-06-08 21:02:24 +02:00
Ray
76a907bb79 Remove tabs 2021-06-08 21:01:17 +02:00
Deathbat2190
9681a072d0 Fix parsing multiple struct fields defined in one line (#1813) 2021-06-06 13:22:42 +02:00
Rob Loach
32f3f53718 parser: Add JSON support with --json (#1812) 2021-06-06 10:21:56 +02:00
raysan5
246798a0ba Update Makefile 2021-06-05 20:15:03 +02:00
Ray
88a8395b8e Added raylib_oding_bindings 2021-06-05 14:02:06 +02:00
raysan5
e95d8bc655 Minor format tweaks 2021-06-05 12:33:05 +02:00
raysan5
6445200a93 Removed GetAudioStreamBufferSizeDefault() 2021-06-05 12:32:52 +02:00
Ray
e00d2439b9 WARNING: BREAKING: Consistency renamings
RENAMED: InitAudioStream() -> LoadAudioStream()
RENAMED: CloseAudioStream() -> UnloadAudioStream()
2021-06-03 23:36:47 +02:00
Ray
7e68e733f5 Update models_material_pbr.c 2021-06-03 21:04:23 +02:00
Ray
0565fb9fb6 Update models_mesh_picking.c 2021-06-03 20:58:04 +02:00
Ray
121c689b78 Review code formatting 2021-06-03 20:25:28 +02:00
Crydsch
edeaff4bd4 Better collisions (#1803)
* review collisions ray-box and ray-sphere

* Applied raysan's refactor
Improved GetRayCollisionBox

* Replace GetRayCollisionGround with GetCollisionQuad

* Update example core_3d_picking

* Update example models_loading

* Fixed issues after merge

* remove debug stuff

Co-authored-by: Cry dsch <chris.obo@gmx.net>
2021-06-03 20:15:27 +02:00
Ray
2370af598e Reviewed example: core_split_screen 2021-06-03 19:35:36 +02:00
Jeffery Myers
deaa84d28d Add a split screen example showing render texture use and multiple cameras. (#1806)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-06-03 19:09:43 +02:00
Deathbat2190
2efb5a36ca Small parser bugfix (#1805) 2021-06-02 20:47:37 +02:00
isaac553876299
d1ac38171c Update raymath.h (#1802) 2021-06-01 17:00:40 +02:00
Marco G. Maia
1a7dace57e Update docs for supported blend modes (#1801) 2021-06-01 15:00:19 +02:00
Ray
0870295a7c RENAMED: enum Gestures -> Gesture
Consistency tweak
2021-05-31 20:40:27 +02:00
Ray
5e3cf28642 Update raudio.c 2021-05-31 19:32:48 +02:00
Ray
23398f0198 Update Makefile 2021-05-31 19:02:26 +02:00
Ray
e991fefb89 Update Makefile 2021-05-31 18:51:56 +02:00
Ray
d39d26f275 Update models_loading.c 2021-05-31 18:36:03 +02:00
Ray
9cc2cee936 Update text_draw_3d.c 2021-05-31 18:32:35 +02:00
Ray
b359a1575e Update core_3d_picking.c 2021-05-31 18:27:53 +02:00
Ray
8f4261e9d4 Remove unused declarations 2021-05-31 12:58:49 +02:00
Ray
565319184c Reviewed struct field name 2021-05-31 12:37:03 +02:00
Ray
2760304d66 Update CMakeLists.txt 2021-05-31 12:27:26 +02:00
Ray
9bd3d78374 WARNING: Moved some **extra** raylib libraries to /extras/ directory 2021-05-31 11:43:56 +02:00
Ray
1c5de9721a WARNING: BREAKING: RENAMED: RayHitInfo to RayCollision #1781
- RENAMED: RayHitInfo to RayCollision
- RENAMED/REDESIGNED: Multiple Ray collision functions to be more consistent and return RayCollision data -WIP-
2021-05-31 11:41:56 +02:00
Ray
7bcb2ad4f1 Update uwp_events.h 2021-05-31 11:39:20 +02:00
Ray
89e734de6b Review config flags #1784 2021-05-30 22:31:14 +02:00
Julianiolo
cc4de1d1f9 note (#1797) 2021-05-30 18:33:38 +02:00
Ray
71995d52b3 REVIEWED: exit() on LOG_FATAL instead of LOG_ERROR #1796 2021-05-30 18:02:06 +02:00
Ray
a178a2170b Structs tweaks for consistency 2021-05-30 13:34:02 +02:00
Ray
3c1c13b660 ADDED: raylib header parser 2021-05-30 11:51:15 +02:00
Ray
0369ec9adf Some code tweaks 2021-05-30 11:50:32 +02:00
Ray
c828e481fb Review code format 2021-05-29 13:56:08 +02:00
Ray
e3ba11bead Review some comments 2021-05-29 13:54:05 +02:00
Hristo Stamenov
beeac18eb1 Fix QuaternionToMatrix returning transposed result. (#1793) 2021-05-29 13:53:00 +02:00
Hristo Stamenov
470574517a Implement vertex color attribute for GLTF and IQM (#1790)
Added a simple cube with vertex colors for testing both.
2021-05-26 20:23:13 +02:00
Ray
c5ef96272f Merge branch 'master' of https://github.com/raysan5/raylib 2021-05-26 20:21:40 +02:00
Ray
1c7c8c682c REVIEWED: models_skybox #1792 #1778 2021-05-26 20:21:37 +02:00
Milan Nikolic
ded6754de4 Update raylib-go bindings (#1791) 2021-05-26 15:07:42 +02:00
Ray
05aff1e097 Merge branch 'master' of https://github.com/raysan5/raylib 2021-05-25 23:19:06 +02:00
Ray
7959d95db0 Review raylib structs comments 2021-05-25 23:19:03 +02:00
Ben Beshara
6fe0a229e2 Bumped minimum GLFW vers in cmake (#1788) 2021-05-25 12:19:36 +02:00
Ray
9f45fea31e Remove line break in DrawTextRecEx() 2021-05-25 11:59:34 +02:00
DanielG
e5e401c640 Fixed CMake linking on MacOS (#1783)
Added links to IOKit, Cocoa, and OpenGL to the CMake build file for MacOS platforms
2021-05-24 11:05:08 +02:00
Chris
6c874feb7b Update BINDINGS.md (#1782) 2021-05-23 17:52:17 +02:00
Ray
03710c9d8e Some code tweaks for consistency 2021-05-22 16:54:04 +02:00
Ray
cb698dd37d Update Makefile 2021-05-22 16:51:51 +02:00
Ray
b36422083e Remove headers from shaders 2021-05-22 16:09:34 +02:00
Ray
5765b7895c Minor comments tweaks 2021-05-22 14:35:10 +02:00
raysan5
4aa680d6d3 Merge branch 'master' of https://github.com/raysan5/raylib 2021-05-21 22:59:38 +02:00
raysan5
60ca8acd0a Update version to 3.8-dev to note breaking changes
Some breaking changes were introduced lately, it's better to note that current version is not 3.7 anymore...
2021-05-21 22:59:00 +02:00
Bxil
352db3a183 Removes debug information from release builds (#1780) 2021-05-21 21:59:21 +02:00
Ray
4a099c3658 Review ExportImage() to use SaveFileData() #1779 2021-05-20 20:37:46 +02:00
Ray
23a08a483e WARNING: RENAMED: IsMusicPlaying() -> IsMusicStreamPlaying() 2021-05-20 19:27:04 +02:00
Ray
f33cec64aa Use output->boneCount instead of nodes_count 2021-05-20 19:25:09 +02:00
Ray
e401d5c48e WARNING: RENAMED: MeshBoundingBox() -> GetMeshBoundingBox()
Renamed for consistency with other function in raylib.
2021-05-20 19:24:28 +02:00
Ray
9360e4e2c1 Comment minor tweak 2021-05-20 19:14:42 +02:00
Ray
7b6b87ec5b Update VS2019 project: rlgl_standalone 2021-05-20 19:14:20 +02:00
Guillaume DEVOILLE
b90ac7bd31 Fixed over-allocation of buffer (#1772)
output->framePoses[frame] is over-allocated.
framePoses is a 2D array:
- first dimension: frames (allocated l. 4717)
- second dimension: nodes (allocated l. 4731)
Second dimension should be allocated of nodes_count transformations only.
2021-05-15 00:41:33 +02:00
Gianni Alessandroni
a84e98ba6c Hotfix for smooth pixel-perfect camera example [core_2d_camera_smooth_pixelperfect.c] (#1771)
* Hotfix for glitchy camera

Super small fix that was causing the camera to glitch every x amount of seconds/pixels. Works much better now, 3/4 lines changed.

* fixed dumb visual studio formatting problems
2021-05-14 18:06:47 +02:00
Ray
232378ed2d Merge branch 'master' of https://github.com/raysan5/raylib 2021-05-14 14:01:51 +02:00
Ray
3baba7ffe8 Review some VS warnings and messages 2021-05-14 14:01:42 +02:00
Guillaume DEVOILLE
45b0dc63cd Fixed GLTF boneWeights uint32 loading (#1768)
boneWeights uint32 were loaded in normals instead of boneWeights.
2021-05-13 13:58:51 +02:00
Ray
fff06d24da Merge branch 'master' of https://github.com/raysan5/raylib 2021-05-12 19:51:39 +02:00
Ray
6c56fe2670 Update shell.html 2021-05-12 19:51:29 +02:00
Bxil
dbe1c9c6e6 Removes Whole Program Optimization (#1767) 2021-05-12 19:20:27 +02:00
Astie Teddy
d8e1a77da5 Update raylib-lua and raylib-wren binding versions (#1766) 2021-05-12 19:02:13 +02:00
Ray
6bd63de8d0 Reviewed latest PR
REMOVED: DrawBillboardEx()
2021-05-11 01:02:53 +02:00
nobytesgiven
ac204a11f7 Redesigned billboards - added rotation/pro functions (#1759)
* Redesigned billboards - added rotation/pro functions

* updated parameters

Co-authored-by: nobytesgiven <nobytesigiven@github.com>
2021-05-11 00:55:43 +02:00
Gianni Alessandroni
4ab28fffb4 Added smooth pixel-perfect camera example + Small typo fix in examples_template.c (#1760)
* Typo fix

Changed "bsasic" to "basic" in the comments.

* Added pixel-perfect camera example

Added pixel-perfect camera example, both the .c file and the cover .png image. The example works with any resolution you want, as long as the ratio stays the same
(ex. 16:9, 4:3) ecc.

* Fixed Typecasts

Fixed compiler errors (implicit conversions)

* Precomputed rectangles, time-based movement and whitespace fix

Moved the source and destination rectangles for the renderTexture into their own variables, modified the animation to be time-based instead of frame-based, fixed the bug with whitespaces.

* Fixed spacing and added more consistency with sinf() and cosf()

* Fixed *= operator spacing
2021-05-10 20:16:12 +02:00
Lambert Wang
e39e45824d Add RenderPolyLinesEx routine (#1758)
Co-authored-by: Lambert Wang <lambert.ww@gmail.com>
2021-05-10 20:08:58 +02:00
Dmitry Matveyev
5d831f3f18 Update NimraylibNow! - Nim language bindings version to 3.7 (#1764) 2021-05-10 19:43:17 +02:00
ProphesorIks
1d0767022d ~Updated project version (#1761)
Updated to fix versioning and linking issues.
Old version would cause examples to not be linked on fresh raylib install or linked with an old library version on updated raylib install.
2021-05-10 00:51:37 +02:00
Lambert Wang
2545f62565 Added support for additional mouse buttons (#1753)
* Added support for additional mouse buttons

* Renamed mouse button enum

Co-authored-by: Lambert Wang <lambert.ww@gmail.com>
2021-05-08 18:26:24 +02:00
Antonio Jose Ramos Marquez
2565c01158 check for vao extension (#1757) 2021-05-08 18:24:14 +02:00
Jeffery Myers
133e6f097d Convert the half sleep to a sleep that is a fraction of the target FPS (Default 95%) to reduce CPU use. (#1756)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-05-07 19:49:44 +02:00
Ray
b62c86572e REVIEWED: raudio_standalone #1752 2021-05-07 15:38:13 +02:00
Astie Teddy
c82d9cb89a Unset CORE.Window.ready on CloseWindow (#1749)
Window shouldn't be considered ready when CloseWindow has been called.
2021-05-05 19:08:15 +02:00
Rudolf Kemmler
1269ce8a6f modified Makefile.Android.linux in templates/simple_game (#1748)
switched out @echo for @printf to make it actually print newlines instead of literal \n's

Co-authored-by: Rudolf Kemmler <admin@rudolf-kemmler.de>
2021-05-04 22:53:59 +02:00
Ray
a41ed986bd Expose RAYLIB_VERSION in raylib.h #1747 2021-05-04 11:20:47 +02:00
Ray
c4eaf0076d Update raylib version 2021-05-04 11:19:28 +02:00
Ray
e5708a8f36 Comment tweak 2021-05-03 19:05:53 +02:00
Ray
2015828fc6 Security check in case of not valid font 2021-05-03 19:05:43 +02:00
Ray
4c1af4cc90 Update BINDINGS.md 2021-04-30 13:01:25 +02:00
Théo Cavignac
ecc00357b4 Update BINDINGS.md (#1744)
Bump version supported version by raylib-ocaml.
2021-04-29 12:13:28 +02:00
Ray
a3e7664dcf Fixed bug that overrides other flags
This issue prevented enabling MSAA on several platforms
2021-04-29 00:07:28 +02:00
Ray
ffadeeeb84 Decoupling rlgl from platform layer
Now rlgl only depends on OpenGL and it's completely decoupled from platform layer libraries (EGL)
2021-04-28 23:57:46 +02:00
Ray
f516f4099b Corrected issue #1742 2021-04-28 19:27:50 +02:00
Ray
d6708de7b0 Update README.md 2021-04-27 23:55:05 +02:00
Ray
a113d3326b Disable raylib code 2021-04-27 23:12:04 +02:00
Ray
fe607323aa Updated projects 2021-04-27 23:00:49 +02:00
Ray
131672f199 Updated linkage libraries #1732 2021-04-27 22:58:49 +02:00
Rabia Alhaffar
9b6a005819 Updated raylua and raylib-boo to raylib 3.7! (#1741) 2021-04-27 21:08:31 +02:00
Rabia Alhaffar
399894ac90 Fixed definition of UNCOMPRESSED_R8G8B8A8 (#1740) 2021-04-27 20:17:47 +02:00
Ray
89d5b3df44 ADDED: raylib-swift binding 2021-04-27 11:27:31 +02:00
Ray
6ebe76cba7 Minor tweaks 2021-04-27 11:05:05 +02:00
Ray
1aa8a4ff90 REVIEWED: rlLoadExtensions()
On PLATFORM_ANDROID, PLATFORM_RPI, PLATFORM_DRM and PLATFORM_UWP glfwGetProcAddress() is not defines, actually those platforms use egl platform windowing system.
2021-04-27 11:04:48 +02:00
Rob Loach
fcf3a04825 BINDINGS: raylib-cpp targets raylib 3.7.0 (#1739)
https://github.com/RobLoach/raylib-cpp/releases/tag/v3.7.0
2021-04-27 10:31:15 +02:00
Gunko Vadim
5751776a73 Update BINDINGS.md (#1738) 2021-04-26 21:59:34 +02:00
Ray
b6c8d343dc Update CHANGELOG 2021-04-26 18:00:33 +02:00
Jeffery Myers
b663724293 Generate a mesh in client code. (#1735) 2021-04-26 17:30:07 +02:00
Ray
bb33033389 Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-26 00:36:22 +02:00
Ray
a44815e939 REMOVED: GenMeshDefault() 2021-04-26 00:36:13 +02:00
Jeffery Myers
30db611e92 Disable projects that won't build by default from 2019 solution build configuration. (#1734) 2021-04-25 23:56:32 +02:00
Jeffery Myers
6c518008a5 Fixes for 64 bit typecast warnings (#1733) 2021-04-25 18:50:26 +02:00
raysan5
8719858655 Added opengl32.lib to the linker #1732 2021-04-25 13:51:17 +02:00
raysan5
0e2845ec26 Review OpenGL 1.1 building #1732
It works compiling with MinGW
2021-04-25 13:32:24 +02:00
raysan5
c4041043f5 Reviewed VS2019 projects 2021-04-24 19:58:24 +02:00
Ray
7ad17386f6 Update raylib.h 2021-04-23 17:24:25 +02:00
Ray
f4abc05d62 Update README.md 2021-04-23 13:21:57 +02:00
Ray
8a55c60e47 Update shaders_mesh_instancing.c 2021-04-23 09:09:34 +02:00
Ray
03815ec4fe RPI4: Improve DRM card check #1723 2021-04-22 21:01:48 +02:00
Ray
9a0accddb8 Update HISTORY.md 2021-04-22 18:56:42 +02:00
Ray
dcf52c132f Remove trail spaces 2021-04-22 18:55:24 +02:00
Ray
f92ee46d86 Update README.md 2021-04-22 18:52:41 +02:00
Ray
2a9ffcc0a1 Update README.md 2021-04-22 18:48:36 +02:00
Ray
b4e586f272 Update CHANGELOG 2021-04-22 18:41:51 +02:00
Ray
cf201e0794 Update CHANGELOG 2021-04-22 18:39:33 +02:00
Ray
1161df0ee4 Added screenshots 2021-04-22 18:34:33 +02:00
Ray
715a46277e Update README.md 2021-04-22 18:33:59 +02:00
Ray
5ef777219a Reviewed templates Makefiles 2021-04-21 21:23:04 +02:00
Ray
ac79d22a9b Reviewed file comments 2021-04-21 00:41:55 +02:00
Ray
0a6694708d Update README.md 2021-04-20 23:57:04 +02:00
Ray
52f91bc652 Update README.md 2021-04-20 12:31:12 +02:00
Ray
8812213c01 Update README.md 2021-04-20 12:30:31 +02:00
Ray
ca8329c330 Update raylib_logo_animation.gif 2021-04-20 12:29:54 +02:00
Ray
dec9f24673 Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-20 12:19:13 +02:00
Ray
1e65817d05 Update models.c 2021-04-20 12:19:04 +02:00
Ray
a599fd1095 Update CHANGELOG 2021-04-20 12:17:06 +02:00
Ray
3bf9ea1a4b Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-20 12:16:18 +02:00
Ray
bb743e8c6e ADDED: UpdateMeshBuffer() 2021-04-20 12:16:16 +02:00
Ray
d533183b7f Update README.md 2021-04-20 00:43:48 +02:00
Ray
f903686060 Update README.md 2021-04-19 23:51:19 +02:00
Ray
f21e520c9c Update README.md 2021-04-19 23:29:40 +02:00
Ray
1c5cf90a52 Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-19 22:40:13 +02:00
Ray
d1537bfd61 Update raylib_logo_animation.gif 2021-04-19 22:39:59 +02:00
Ray
9b0dd543e0 Update README.md 2021-04-19 22:36:33 +02:00
Ray
9011b936cf Create raylib_logo_animation.gif 2021-04-19 22:34:30 +02:00
Stephan Soller
93d3212914 [examples] Added an example for raylib OpenGL interop (#1726)
* Added an example for raylib OpenGL interop.

* Removed C99 variable-length array to fix MSVC errors

* Moved the opengl interop example from shaders to others.
2021-04-19 20:28:14 +02:00
Ray
63a1bf373c Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-19 19:41:41 +02:00
Ray
899afcbdca Minor tweaks 2021-04-19 19:41:32 +02:00
Stephan Soller
7f1068ef96 Added zoom independent sharp edges to the SDF text example. (#1727) 2021-04-19 19:40:34 +02:00
nathants
1c45a882f7 use bone weights for animation (#1728) 2021-04-19 18:26:40 +02:00
Ray
581bd0eb02 Remove trailing spaces 2021-04-18 23:50:32 +02:00
Ray
63432724c7 Update CHANGELOG 2021-04-18 21:18:53 +02:00
Ray
223091f44c Review extensions issue on macOS 2021-04-18 20:33:49 +02:00
Ray
d4ccca81db WARNING: REDESIGNED: rlLoadExtensions() #1295
Added config flag: SUPPORT_GL_DETAILS_INFO
2021-04-18 20:24:19 +02:00
Peter Arato
2ad3eb1d57 Update and fix android linux makefile template (#1725) 2021-04-17 17:58:25 +02:00
Ray
640fc4d0a0 Minor tweaks 2021-04-16 21:19:28 +02:00
Ray
657b527bc6 Update SPONSORS.md 2021-04-16 12:52:22 +02:00
Ray
74fc4b1a03 Update SPONSORS.md 2021-04-16 12:47:33 +02:00
Ray
e91eabdb09 Update SPONSORS.md 2021-04-16 12:45:01 +02:00
Ray
a3a9416b33 Update SPONSORS.md 2021-04-16 12:37:04 +02:00
Ray
815a064abe Update SPONSORS.md 2021-04-16 12:33:54 +02:00
Ray
929ff45568 Update ROADMAP.md 2021-04-16 11:57:33 +02:00
Ray
c96304c83f Update HISTORY.md 2021-04-16 11:23:19 +02:00
noloop
8453ff837b Fix old directories used and windows/linux portability (#1722)
* Fix olds directories used and windows/linux portability

* Fix windows/linux portability
2021-04-16 00:25:40 +02:00
Ray
4badff1c2f Update CONTRIBUTING.md 2021-04-15 12:31:55 +02:00
Ray
68f664afa4 Create CONTRIBUTORS.md 2021-04-14 21:18:54 +02:00
Ray
fbf1f32807 Update CONTRIBUTING.md 2021-04-14 21:16:04 +02:00
Ray
ac95a2e27c Update CMakeOptions.txt 2021-04-14 21:14:55 +02:00
Ray
45823a36eb Added some OpenGL extensions comments 2021-04-14 21:07:04 +02:00
Ray
37f523fdeb Update external libraries 2021-04-14 21:06:00 +02:00
Ray
646f1f06c4 Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-14 21:05:28 +02:00
Ray
d7b6505f64 Update Makefile 2021-04-14 21:05:23 +02:00
Ray
dc8a86557e Update README.md 2021-04-14 11:38:10 +02:00
Ray
d289085ce3 Reviewed DrawLine3D() limits #1721 2021-04-13 01:08:39 +02:00
Ray
06f16f199a REVIEWED: DrawLine3D() #1721
Increased batch limit check to compensate internal buffers alignment for lines drawing
2021-04-13 00:05:21 +02:00
Ray
afb254b985 Update rlgl.h 2021-04-11 00:58:04 +02:00
Ray
d2cb628a66 Some defines simplification 2021-04-11 00:55:45 +02:00
Ray
fcab72f915 Update history -WIP- 2021-04-10 01:16:15 +02:00
Ray
caa375412b Update CHANGELOG 2021-04-10 00:37:19 +02:00
Ray
88089f22f3 Update history for raylib 3.7 -WIP- 2021-04-10 00:34:54 +02:00
Ray
44f7f8a997 Update CHANGELOG 2021-04-10 00:28:08 +02:00
Jon
c74230a9ea Enable DRM platform cross compilation support (#1717)
* Log a warning if chdir failed, use agnostic CHDIR instead of chdir

* Only include libdrm directory explicitly when not cross compiling
2021-04-09 19:57:14 +02:00
Ray
d17c519f88 Update with more changes from commits... -WIP- 2021-04-09 13:01:17 +02:00
Jeffery Myers
f6f9a3d925 use xm streams in the same sample sample size as the output device (#1716) 2021-04-09 11:00:21 +02:00
Ray
09e6f42f2e Update Notepad++ Intellisense 2021-04-09 01:28:52 +02:00
Chris
3cdac3e11e Fix off by one bug with GetGamepadAxisCount on PLATFORM_DESKTOP (#1715)
- Found testing core_input_gamepad. The last axis was not drawn.
- GLFW_GAMEPAD_AXIS_LAST is defined to the last axis which is 5
not the total number which is 6.
2021-04-09 00:55:47 +02:00
Ray
8a8948780e REVIEWED: GetKeyPressed() #1712 2021-04-09 00:21:56 +02:00
Ray
49e17044c9 Update resource files 2021-04-09 00:20:43 +02:00
Ray
15ee280632 Update CHANGELOG -WIP- 2021-04-08 00:06:41 +02:00
Ray
45c964c1e6 Update core_vr_simulator.c 2021-04-07 12:30:45 +02:00
Ray
bafa13f207 Update core_vr_simulator.c 2021-04-07 12:27:11 +02:00
Ray
bdc5686e4c Update shaders_julia_set.c 2021-04-07 12:25:04 +02:00
Ray
ed96bc6441 Update core_vr_simulator.c 2021-04-07 12:24:43 +02:00
Ray
6719c3a1cd REVIEWED: OpenGL 2.1 compilation 2021-04-07 09:39:41 +02:00
Ergoold
85ef9d8f2e Fix ImageClearBackground (#1711)
- Dividing by height instead of width results in missing parts of the image.
2021-04-07 00:02:37 +02:00
Ray
b3f75b91ff REDESIGNED: Vr stereo mode 2021-04-06 23:23:03 +02:00
Ray
84d0d21f23 Reviewed Vr stereo 2021-04-06 23:06:03 +02:00
Ray
71b86bf4d0 REDESIGNED: Vr stereo rendering 2021-04-06 22:49:41 +02:00
Saikyun
fd663024ea added import in order for alloca to work on macos (#1710) 2021-04-06 21:42:00 +02:00
Ray
6d3c66a179 Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-06 21:40:05 +02:00
Ray
68124599e1 Corrected issue on RPI 2021-04-06 21:39:54 +02:00
frithrah
b2545e053a Minimum number of segments in circle sector functions changed from hard-coded to based on degree range. (#1707)
Co-authored-by: Simon <simon@frithrah.com>
2021-04-06 14:29:58 +02:00
Ray
109d00cb14 Reorganized shaders functions 2021-04-06 13:10:12 +02:00
Ray
551944e15b Minor comment tweaks 2021-04-06 13:04:15 +02:00
Ray
0a34a35403 Update miniaudio.h 2021-04-06 11:57:51 +02:00
Ray
802ca161d3 REVIEWED: Some rlgl cleaning on unused types 2021-04-06 00:43:38 +02:00
raysan5
a8dd4127f3 Added security check to avoid internal render batch overflow 2021-04-05 13:59:52 +02:00
raysan5
0e04ae561e Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-05 13:48:03 +02:00
raysan5
7b37caa96c REVIEWED: Model scale #1700 2021-04-05 13:47:52 +02:00
m4ntr0n1c
abf481023b Update to the xm player routine and support functionalities (#1701)
* Update jar_xm.h

Major bug fixes and refactoring

* Update jar_xm.h

update to version 0.31
2021-04-05 13:46:09 +02:00
raysan5
c2c141f941 Update version to raylib 3.7 2021-04-05 13:36:23 +02:00
raysan5
b52cd8f605 Reorganized functions by module 2021-04-05 13:35:59 +02:00
raysan5
5fd441969d REVIEWED: rlLoadShaderDefault()
Operate over global variable
2021-04-05 13:35:42 +02:00
raysan5
14aa29d18b Update rlgl.h 2021-04-04 15:10:39 +02:00
raysan5
4c9d2e719e Merge branch 'master' of https://github.com/raysan5/raylib 2021-04-04 14:59:29 +02:00
raysan5
66f3434571 REDESIGNED: Shapes texture/rec moved to shapes module 2021-04-04 14:59:17 +02:00
Rob Loach
d58b7b509e Make SaveFile* callbacks return a boolean (#1697) 2021-04-03 08:56:42 +02:00
raysan5
c21baf0d92 ADDED: GenMeshDefault() #1556 2021-04-02 15:56:35 +02:00
raysan5
46650b5fb1 Reviewed skybox and pbr examples 2021-04-02 15:41:44 +02:00
raysan5
51f3129c5d Reviewed examples 2021-04-02 15:34:32 +02:00
raysan5
ccdf7ff335 REDESIGN: Move GenTexture*() functions to PBR example #721
Removed functions from rlgl module.
2021-04-02 14:29:33 +02:00
raysan5
67dda62867 REVIEWED: GenTexture*() functions #721
Avoid RLGL data dependency to allow moving the functions somewhere else
2021-04-02 14:01:30 +02:00
raysan5
7e2531fe35 REVIEWED: ToggleFullscreen() on web #1241
After some investigation, I came to the conclusion it's impossible to get a solution that works for all situations. Fullscreen mode on web depends on the browser, the canvas and also the desired scaling strategy of the user. Just choose a solution that fits me needs for now and let the user manage the canvas on their webs (hopefully not requiring ToggleFullscreen() call).

Also removed several useless related callbacks.
2021-04-02 13:46:56 +02:00
raysan5
38df0760cc Review compress/decompress logs 2021-04-02 13:43:10 +02:00
raysan5
d64f27bad1 Remove old flag 2021-04-02 13:42:07 +02:00
raysan5
2b6e7c8632 Update Makefile 2021-04-02 13:41:54 +02:00
raysan5
b54d96205f Review libc dependency 2021-04-01 21:22:18 +02:00
Ray
1da0176cad Update README.md 2021-04-01 20:42:18 +02:00
raysan5
aed0fee2ca Remove trailing spaces 2021-04-01 20:24:33 +02:00
raysan5
b4975619ed Review comments 2021-04-01 20:23:05 +02:00
raysan5
736d5920c7 Update core_input_gamepad.c 2021-04-01 20:22:52 +02:00
raysan5
cdc3754449 ADDED: Support model normal matrix location #1691 2021-03-31 20:44:16 +02:00
raysan5
2488d361b6 Review formatting 2021-03-31 20:15:04 +02:00
raysan5
c772de702b REVIEWED: DrawMeshInstanced() matrix computations
Simplified some parts and reviewed for a correct computation of matrices, considering stereo render view/projection per eye transformations
2021-03-31 19:59:23 +02:00
raysan5
434a3a276d REVIEWED: Define instancing API entry points for RPI 2021-03-31 18:41:03 +02:00
raysan5
8e51e6d1df REVIEWED: CheckCollisionPointLine()
Use fabsf() instead of abs()
2021-03-31 18:40:33 +02:00
raysan5
fd3e2fda00 RENAMED: example: shaders_mesh_instancing
shaders_rlgl_mesh_instanced -> shaders_mesh_instancing
2021-03-31 18:40:04 +02:00
raysan5
8f1d81df0f Review code formatting 2021-03-31 17:55:46 +02:00
mkupiec1
3d1a05d588 [shapes] CheckCollisionPointTriangle (fix), CheckCollisionPointLine (new routine) (#1695)
* CheckCollisionPointTriangle

* New feature proposal to existing collision detection routines.
It checks if point [point] belongs to line created between two points [p1] and [p2] with defined margin in pixels[threshold].
1693
2021-03-31 16:50:05 +02:00
raysan5
98a2e16d4d REVIEWED: RPI instancing checks #1679 2021-03-31 16:44:14 +02:00
raysan5
b5aaf33058 Review matrix multiplication 2021-03-28 22:04:04 +02:00
raysan5
aaf0d8b839 REVIEWED: rlgl: Stereo render is working again
As a bonus, stereo render is compatible with mesh instancing now!
2021-03-28 21:35:58 +02:00
raysan5
00e71faed6 REVIEWED: text_draw_3d, code formatting 2021-03-28 21:09:34 +02:00
raysan5
6a24dd8945 REVIEWED: tinyobjloader #1568 2021-03-28 20:51:29 +02:00
raysan5
b8c3b8277c Reviewed UWP project #1681 2021-03-28 20:21:50 +02:00
raysan5
8f3e91ae83 REVIEWED: models_gltf_model #1684 2021-03-28 20:15:57 +02:00
raysan5
23a764190e ADDED: LoadShaderFromMemory() #1690 2021-03-28 20:12:48 +02:00
raysan5
bc6b16beb2 REVIEWED: DrawTexturePoly() 2021-03-28 20:07:59 +02:00
Vlad Adrian
668ba870e4 Added draw 3d text example (#1689) 2021-03-28 16:08:14 +02:00
Carlos Hernandez Barbera
7eaeffc8d9 GetCollisionRayMesh makes use of triangle count (#1688)
Co-authored-by: Carlos Hernandez Barbera <carloshdezbarbera@gmail.com>
2021-03-27 18:24:39 +01:00
Maksymilian Mika
f38ced15e7 Fixing pointer arithmetic to avoid error [-Werror=pointer-arith] (#1685) 2021-03-27 07:54:44 +01:00
Dan Bechard
b6ca524bdd Preserve floating point values in DrawRectangleLinesEx (#1683) 2021-03-26 20:15:19 +01:00
Ray
f9bab14fdb REVIEWED: DrawMeshInstanced() 2021-03-26 00:12:29 +01:00
Ray
c6828070dc Update models_yaw_pitch_roll.c 2021-03-26 00:11:48 +01:00
Ray
fb9a437f8a REVIEWED: OpenGL 1.1 working again 2021-03-25 20:35:48 +01:00
Ray
cba412cc31 WARNING: BREAKING: rlgl redesign -WIP-
rlgl module has been completely redesigned to move Mesh/Material structures to [models] module. Still some work to do, broken elements:
 - [models] OpenGL 1.1 mesh rendering: DrawMesh()
 - [models] Mesh Instancing: DrawMeshInstanced()
 - [models] Stereo rendering: DrawMesh()
 - [models] GL_FLOAT, GL_UNSIGNED_INT exposed
 - [models] GenMeshCustom()
 - [rlgl] GenTexture*() functions removal?
2021-03-25 14:28:12 +01:00
chriscamacho
9569d6a802 Add DrawTexturedPoly and example (#1677)
* adds DrawTexturedPoly with example

* the actual example ... ahem

* moved DrawTexturePoly to textures function and example
NB function name changed to fit with other DrawTextureXXX functions
(no "d" )

Co-authored-by: codifies <you@example.com>
2021-03-25 14:22:10 +01:00
Ray
dd59350485 REVIEW: instancing example formating 2021-03-25 13:41:32 +01:00
Max
7e58838895 added animation and keyboard controls to rlgl mesh Instancing example (#1678) 2021-03-25 11:12:59 +01:00
Jeffery Myers
13f97471a2 Change the color of the FPS display if the FPS is low (orange for <30, red for < 15). (#1676)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-03-24 17:59:05 +01:00
Ray
bb73a8089a Reviewed DrawFPS() comment 2021-03-24 17:06:32 +01:00
Ray
9bea64b5e4 REMOVED: DrawGizmo()
This is a very simple and specific implementation that should be better addressed by the users
2021-03-24 17:02:40 +01:00
Ray
9047025ab7 Update textures.c 2021-03-24 00:41:01 +01:00
Ray
c2bc3d22a1 REVIEWED: DrawRectangleRounded() performance #1523
Function analyzed using RenderDoc. It's a complex function and could require many triangles for the corners but it seems overall it's quite optimized!
2021-03-24 00:25:53 +01:00
Ray
60bfee4a7d Added security check for render batch #1670 2021-03-23 23:45:14 +01:00
Victor
c5b0a1f005 Fix activeTextureId to have MAX_BATCH_ACTIVE_TEXTURES elements instead of the hardcoded 4 (#1674) 2021-03-23 20:17:23 +01:00
Chris
2532c396ed Fix 90 degree bug with DrawTexturePro and DrawRectanglePro (#1673)
- The vertices did not map to where I expected causing rotation to be
off by 90 degrees. I reorganized the vertices making it easier to
reason about which fixes this.
- The order for drawing is now topLeft, bottomLeft, bottomRight,
topRight.
2021-03-23 14:40:26 +01:00
Ray
71fe0bff95 Update text_raylib_fonts.c 2021-03-23 12:20:28 +01:00
Ray
89278953ae Update text_raylib_fonts.c 2021-03-23 12:20:11 +01:00
Ray
3e6ee028e5 Update rlgl.h 2021-03-23 12:15:52 +01:00
Ray
6f5a4a9351 REVIEWED: rlgl_standalone usage 2021-03-23 11:51:09 +01:00
Dan Bechard
5325d8d2ba Don't call sqrtf when axis already normalized (#1672) 2021-03-23 11:32:25 +01:00
Davidson Francis
81738bfa98 Fix PATH for other PLATFORM_OS's (#1671)
The Raylib root Makefile for PLATFORM=PLATFORM_WEB is assumed to
run in Windows environments, which makes it incorrectly set the
PATH variable, so Linux (and possibly other) environments are not
able to find binaries from EMSDK_PATH.

Fix this by checking which PLATFORM_OS and configure PATH
accordingly.
2021-03-23 07:53:25 +01:00
Jeffery Myers
e48b9a6da1 [Examples] Warning fixes (pt 1) (#1668)
* Fix some warnings in examples.

* cleanups from review

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-03-23 07:51:52 +01:00
Jeffery Myers
c6dd41495b typecast warning fixes. (#1667)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-03-22 20:45:46 +01:00
Ray
2ce28f75ad WARNING: BREAKING: REDESIGNED: rlgl module
- Many functions renamed to follow rl*() convention
- Some internal functions exposed in the API
- Some functionality moved to other modules
- Reorganized all functions by categories
- Make sure it keeps working with OpenGL 1.1 and 2.1
2021-03-22 20:45:04 +01:00
Ray
24dae29a03 Review latest PR and some formatting 2021-03-22 20:41:33 +01:00
Jeffery Myers
2c0a533948 [AUDIO] Music Looping enhancements (#1665)
* Add loop functions for music files.
Tell xm tracker to loop tracker when loop state changes.
Don't let looped xm tracker streams restart, they are infinite
Use modulo to make time tracker for xm looped streams work correctly.

* Remove loop functions, set XM loop in update based on flag.
Formatting cleanups.

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-03-22 20:36:13 +01:00
Rabia Alhaffar
8e1e1ef970 Changed IsKeyPressed('R') to IsKeyPressed(KEY_R) for Physics examples! (#1666) 2021-03-22 16:44:12 +01:00
Jeffery Myers
b573ff3e7a [AUDIO] Use device native sample rates (#1660)
* Init MinAudio to a sample rate of 0 to let the device pick the rate.
Read the rate from the device after it starts up.
Convert AUDIO_DEVICE_SAMPLE_RATE from a #def into an int, that is set from the device's rate
Set all sample systems to use the AUDIO_DEVICE_SAMPLE_RATE as the target rate to minimize resampling.

* use device sample rate instead of separate var
let config define a device sample rate if it wants to, but let the default be 0 for native rate.

* Don't use fixed sample rates for tracker files.
Remove config default audio buffer size and replace with a function that computes one for a reasonable frame rate at the output sample rate.
2021-03-21 22:07:55 +01:00
Ray
c37f61d31f REVIEWED: rlgl module #1523 2021-03-21 20:31:35 +01:00
Ray
e0e68aad54 Update Makefile 2021-03-21 18:33:16 +01:00
Ray
2f943aaff0 Reverting align change #1658 2021-03-21 18:32:05 +01:00
Ray
ed4ca6a7f3 WARNING: BREAKING: rlgl module redesign -WIP-
- Some rlgl functions have been moved to core
 - Some functions have been made internal to rlgl
 - rlgl functions prefixed with rl*()
2021-03-21 01:29:31 +01:00
Ray
f4f6f665f7 Fixed possible issue with memory alignment #1658 2021-03-20 21:02:20 +01:00
Ray
dcde99bbb8 Corrected issue with HighDPI on macOS 2021-03-20 20:58:24 +01:00
Ray
364fbbd283 Review Discord link with Vanity URL 2021-03-20 20:22:44 +01:00
Ray
95f9a6171b Review HighDPI macOS support #1510 2021-03-20 20:06:38 +01:00
Sean Heber
f4d6bad607 Considering the window's scale when setting the viewport. (#1659)
This appears to fix the issue with macOS windows opening with the wrong scale.
2021-03-20 19:57:29 +01:00
Ray
a76fcaba3e BIG CHANGE: REDESIGNED: Vr device simulator #1582
Vr simulator has been moved to core module and completely redesigned. Now user is in charge of stereo-render fbo and also in full control of distortion shader. Code is a bit more complex but better aligned with other raylib examples.
2021-03-20 18:36:25 +01:00
Ray
4fba09794f Example considering HighDPI on RenderTexture draw #1086 2021-03-20 13:34:06 +01:00
Ray
5049137715 Added KEY_NULL #520 2021-03-20 13:08:13 +01:00
Ray
4fb6f4af75 Merge branch 'master' of https://github.com/raysan5/raylib 2021-03-20 13:02:53 +01:00
Ray
95282edaf9 REVIEWED: HighDPI support on macOS retina #1510 2021-03-20 13:02:44 +01:00
Rabia Alhaffar
96e5e0dfb2 Fixed funny typo mistake... (#1657) 2021-03-20 01:18:44 +01:00
Ray
75882f3254 Delete Avocado.glb 2021-03-20 00:02:28 +01:00
Ray
442abaab72 Updated example assets 2021-03-19 22:39:39 +01:00
Ray
5967c1ba1a REVIEWED: BeginMode3D() 2021-03-19 21:55:47 +01:00
Ray
be8d5a7ae2 RENAMED: camera.type -> camera.projection 2021-03-19 20:14:14 +01:00
Ray
9909068714 Removed trailing spaces 2021-03-19 19:43:44 +01:00
Ray
e28f754fbe Reviewed latest PR: formatting and some comments 2021-03-19 19:42:36 +01:00
Chris
45670fbf2d Optimize DrawTexturePro and DrawRectanglePro transformations (#1632)
* Optimize DrawTexturePro and DrawRectanglePro transformations
- Add check so rotation is only applied if rotation != 0.0f.
- Replace matrix usage by calculating the vertex data directly.

* Fix error with windows build and trim whitespace
2021-03-19 19:19:10 +01:00
frithrah
2f367a905e Changed DrawRing and DrawCircleSector angle params from int to float to allow greater accuracy. (#1656)
Co-authored-by: Simon <simon@frithrah.com>
2021-03-19 19:13:55 +01:00
Ray
7a566a07ea Update text_input_box.c 2021-03-19 19:12:08 +01:00
Ray
fe9181c1b4 REVIEWED: QuaternionFromEuler() #1651 2021-03-19 18:24:12 +01:00
Ray
3e25760950 REMOVED: GetMouseCursor()
This function could be confusing depending on the context, it's better to let the user track the current active cursor
2021-03-19 18:20:14 +01:00
Ray
8527dbc6e2 WARNING: REMOVED: GamepadNumber enum 2021-03-19 18:16:05 +01:00
Ray
07d82a91c5 WARNING: BREAKING: RENAMED: camera.type to camera.projection 2021-03-19 13:56:46 +01:00
Ray
d4e2c331b1 REVIEWED: BeginMode3D()
Simplified some code
2021-03-19 13:20:23 +01:00
Ray
a1d9987e7c WARNING: BREAKING: REVIEWED some enums naming
Now enum names are more consistent between them.
2021-03-19 13:19:54 +01:00
Ray
664fbb87f5 REVIEWED: Material params #1649
Just assigned a fixed memory size for custom Material parameters in case of being required, so we shouldn't worry about allocating/freeing them.
2021-03-18 13:57:53 +01:00
Ray
ca1f2f9078 REVIEWED: MatrixRotateZYX() #1642 2021-03-18 13:47:18 +01:00
Ray
8b0574a217 REVIEWED: DrawLine3D() #1643 2021-03-18 13:41:58 +01:00
Ray
0cbb3878c9 Merge branch 'master' of https://github.com/raysan5/raylib 2021-03-18 13:39:06 +01:00
Ray
2b9d81c9bc REVIEWED: QuaternionFromEuler() #1651 2021-03-18 13:38:56 +01:00
Joseph Montanez
45b1e3c72c raylib-php && raylib-phpcpp support 3.5 (#1654) 2021-03-18 13:22:39 +01:00
Ray
e5834210d3 Update models_skybox.c 2021-03-17 19:40:59 +01:00
Ray
1cc838cef4 Update textures.c 2021-03-17 19:37:03 +01:00
Ray
bae423be41 Create reload.fs 2021-03-17 19:18:31 +01:00
Ray
ff6d5c8ddb REVIEWED: shaders_multi_sample2d 2021-03-17 19:03:51 +01:00
Ray
aba69146f2 Support instancing in OpenGL ES 2.0 if available
Checking for extension and enabling it if available
2021-03-17 13:56:00 +01:00
Ray
3c76b5cc8e Update to latest emscripten 2021-03-17 13:53:31 +01:00
xdrie
811e241f22 Update dray bindings version to 3.5 (#1650)
I just updated dray to bind to the raylib 3.5 api.
2021-03-15 08:07:49 +01:00
Hristo Stamenov
bc9194690c Implement UnloadModelAnimations (#1648) 2021-03-14 19:30:18 +01:00
Ray
f7e48c95cd Added some comments on libc dependencies 2021-03-14 14:14:51 +01:00
Ray
1afd56dbf6 Use UnloadFileData() 2021-03-14 14:14:31 +01:00
Hristo Stamenov
f9b79403d1 Improve gltf support (#1647)
* Implement a load values from accessor function.
Added some more value types for the different GLTF attributes.
Fixed crash when loading animated triangle.

* Split GLTF model loading into separate functions for readability.

* Fixed the already working models that I broke when introducing GLTFReadValue.
Improved the example for gltf models to be able to switch between a few models.

* Removed license from screen. It is pu inside a license file anyway.

* Small improvements on the naming of functions
Removed (*model). and replaced it with model->
2021-03-14 12:09:31 +01:00
Ray
01e28263be WARNING: VERY BREAKING CHANGE: Renamed some enum values for consistency
Some enums values have been renamed to be more consistent and also provide a more detailed description:
 - ShaderLocationIndex:    LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION
 - ShaderUniformDataType:  UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2
 - MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO
 - PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
2021-03-14 11:05:51 +01:00
Ray
75038baf71 Reviewed UWP project config 2021-03-13 13:08:05 +01:00
Ray
fe3256be9f Renamed some functions to use latest raylib version 2021-03-12 18:00:36 +01:00
Ray
0872365938 Add config flag: SUPPORT_WINMM_HIGHRES_TIMER #1641
Useful to avoid WinMM requirement and useful to avoid possible performance issues.
2021-03-12 17:18:48 +01:00
Ray
755ed388b2 Minor tweak to avoid warning 2021-03-12 17:17:53 +01:00
Hristo Stamenov
5c2983f510 Gltf model and animations exploring problems (#1635)
* Added bone binding to whole mesh and not only set vertices.
+ Also added missed setting of the animation count.
+ Removed double ; on one line

* Added more of the gltf sample models

https://github.com/KhronosGroup/glTF-Sample-Models
We need to make it working for all of them.

* Binding to initial bind pose added.

* Fix cube disappearing bug because lerpPercent could be Inf.

* Fixed for rigged figure also
2021-03-09 00:11:08 +01:00
Ray
f0ab4723b9 Merge branch 'master' of https://github.com/raysan5/raylib 2021-03-09 00:07:19 +01:00
Ray
b7f2059dc3 Update miniaudio.h 2021-03-09 00:07:08 +01:00
Hristo Stamenov
ef9f67749a Fix fullscreen resolution (#1637)
* Always try to set vsync.
Use the internal monitor function to correctly get the display for windows.

* Modified how fullscreen gets toggled.

- Removed the unsetting and setting of the resize callback function. Instead of that I moved the fullscreen flag setting into a more correct place before setting the fullscreen so that this flag can be used in the callback.
- In the resize callback now window size is only set when it is not fullscreen resulting in preserving the window size.
- When going fullscreen the larges resolution is used so that there are no problems of the type when you minimize the window you cannot use anything else in your desktop because the resolution might be too low. If a low res effect is desired one should use render texture (this is the approach all game engines use).

* Set correct return to window in case of fail to get monitor.

* Set the refresh rate on the mode.

* Made changes based on review from @raysan5

Co-authored-by: Jeffery Myers <JeffM2501@gmail.com>
2021-03-08 22:51:10 +01:00
Kirottu
19651cfaad Added SUPPORT_STANDARD_FILEIO flag support for the CMake build system (#1638)
* Update CMakeOptions.txt

* Update config.h.in

* Added SUPPORT_STANDARD_FILEIO to CMakeOptions.txt

* Fixed typo

* Added SUPPORT_STANDARD_FILEIO to CompileDefinitions.cmake

Co-authored-by: KirottuM <kirottum@protonmail.com>
2021-03-08 22:12:27 +01:00
Ray
8dc3057fe5 Update windows_examples.yml 2021-03-08 19:21:24 +01:00
Ray
915b0780d6 Update core_3d_picking.c 2021-03-08 19:19:43 +01:00
Ray
55bf595cae Create windows_examples.yml 2021-03-08 19:17:42 +01:00
Ray
955d4d3d1a Create linux_examples.yml 2021-03-08 19:09:22 +01:00
Ray
8a30a2408c ADDED: Required callbacks
Removed memory allocation callbacks
2021-03-08 18:48:27 +01:00
Jeffery Myers
3e6f0d7372 Always try to set vsync. (#1636)
Use the internal monitor function to correctly get the display for windows.
2021-03-08 18:08:37 +01:00
Ray
0d096b43c2 Update some comments to warn users about callbacks 2021-03-04 20:44:22 +01:00
Ray
b084552808 ADDED: Config flag: SUPPORT_STANDARD_FILEIO
This new flag allows omitting stdio.h library in case of a custom implementation is used.
2021-03-04 20:36:04 +01:00
Ray
7ad1370193 Some naming tweaks 2021-03-04 20:22:58 +01:00
Ray
1ed72b7812 Minor struct organization tweak 2021-03-04 12:08:54 +01:00
Ray
c4a7c702b4 FEATURE: Several callbacks added -WIP- #1523 #1329
NOTE: This feature is still under consideration and not complete.
2021-03-04 12:06:28 +01:00
Ray
af3926af4b REVIEWED: Examples to new enum values 2021-03-04 11:51:54 +01:00
Ray
c8ed231eca Update text_font_filters.c 2021-03-03 23:05:52 +01:00
Ray
ca22a87949 REVIEWED: TextFormat() #1626 2021-03-03 19:55:09 +01:00
Ray
c938d71d15 Corrected issue with enums renamed 2021-03-03 19:51:23 +01:00
Ray
0b108c2087 Corrected bug 2021-03-03 19:49:10 +01:00
Ray
dfe797060a WARNING: BREAKING: RENAMED: enums values
RENAMED: TextureFilterMode values
RENAMED: TextureWrapMode values
2021-03-03 19:47:37 +01:00
Ray
408f5aedb8 WARNING: BREAKING: RENAMED enum values
RENAMED: CubemapLayoutType and NPatchType
2021-03-03 19:36:28 +01:00
hristo
81908f7960 Removing +1 on comparing extesnions because this way it checked the file extension without the . against the file extension with the . resulting in always false. (#1629) 2021-03-03 15:41:15 +01:00
waotzi
e09f5179e6 replace vraylib link (#1627)
the vraylib binding from  MajorHard doesn't seem to be getting any updates, so maybe replace it with the working fork?
2021-03-03 00:03:55 +01:00
Ray
ab36fbf24a Reviewed defines, try to avoid elif statements 2021-03-02 12:45:23 +01:00
Ray
2a5ce96047 REVIEWED: Wait() to support FreeBSD #1618 2021-03-02 12:44:53 +01:00
Ray
01b3c97c42 Some misc tweaks 2021-03-02 02:03:52 +01:00
Ray
8df56c5843 REVIEWED: rlUnloadMesh() 2021-03-02 01:41:30 +01:00
Ray
c514431e79 REVIEWED: rlUnloadMesh() 2021-03-02 01:35:30 +01:00
Ray
bcc4418ff0 REVIEWED: GetFileExtension() to include the dot #1523 2021-03-02 01:07:08 +01:00
Ray
2ff5fa73e9 REVIEWED: rlUnloadMesh() #1615 2021-03-02 00:34:10 +01:00
Ray
742206c1f2 Review formatting 2021-03-02 00:31:04 +01:00
masterex1000
4e6253b546 Add check to flip quaternion (#1624) 2021-03-02 00:29:48 +01:00
Ray
5902cc6d9b REVIEWED: GetScreen*() #1570
Now GetScreenWidth() and GetScreenHeight() return the current fbo width and height.
2021-03-01 23:51:32 +01:00
Ray
3f6a08535f REVIEWED: CheckCollisionLines() 2021-03-01 23:39:08 +01:00
Jeffery Myers
0f10c44578 Fixes gl state after HDR texture functions. (#1621)
Updates skybox demo to show how to do both HDR and non HDR skyboxes

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-28 23:31:25 +01:00
Rabia Alhaffar
b64fe4dfed Readded survived copy of Harbour bindings! (#1616) 2021-02-26 15:54:24 +01:00
Ray
58e4efbba8 Review bug on OpenGL 1.1 2021-02-26 13:40:43 +01:00
Rabia Alhaffar
4e1c7a9f46 Added raylib-v7 and done edit as comparing between JavaScript bindings... (#1614) 2021-02-25 18:26:29 +01:00
Agnis "NeZvērs" Aldiņš
ead339fa96 LoadMusicStreamFromMemory OGG support (#1613) 2021-02-25 11:55:08 +01:00
Agnis "NeZvērs" Aldiņš
24839c7cfb jar_xm_create_context_safe requesting const char* (#1611)
Fixing compiler warning for passing (unsigned char*) to (const char*)
2021-02-24 12:23:39 +01:00
Chris Sinclair
84ab4ce007 Patch up GLTF Skeleton loading (#1610)
* Add support for u8 bone indicies when loading glTF

* Fix segfault for glTF animations not keyframed at 0

When loading glTF animations we lerp between keyframes, and previously
assume that if the frame we are considering has a later keyframe, there
must be a previous keyframe. This is not true if the animation's first
keyframe is some time into the animation. In this case we now
effectively clamp to that first keyframe for any time prior to it.

* Respect parent bones tranform when loading glTF animations

We previously assumed that when loading glTF animations, the bones were
ordered with those higher up the skeleton tree (i.e. closer to the root)
came first in the list of nodes. This may not be true, so now we
repeatedly loop, preparing each level of the skeleton tree one after the
other, starting at the root level. This ensures that any parent
transforms are applied before transforming any child bones.

We also ensure that we have forced the loading of animation data before
attempting to interpolate to generate the animation frames for use
later, without this no animations are applied.

Finally we remove the check that assumed the first node in the nodes
list is the root, and use an invalid index value as the sentinal value
for when a node has no parent. Previously this was 0, which made
distinguishing between root nodes and children of the first node
impossible.
2021-02-24 09:25:20 +01:00
Agnis "NeZvērs" Aldiņš
0cb748f30b LoadMusicStreamFromMemory wav mp3 flac support (#1609) 2021-02-24 09:22:21 +01:00
Agnis "NeZvērs" Aldiņš
209445ccde LoadMusicStreamFromMemory (#1606)
* define SUPPORT_FILEFORMAT_MOD in config.h

* RLAPI LoadModuleFromData() definition in raylib.h

* LoadModuleFromData() definition in raudio.h

* LoadModuleFromData implementation in raudio.c

* Rename API to LoadMusicStreamFromMemory & default unload.

* raudio.c tabs to spaces

* Styling curly bracket and removing dev debugging TRACELOG

Co-authored-by: nezvers <agnis16@inbox.lv>
2021-02-22 19:45:52 +01:00
Ray
478f4de7ae Update models_material_pbr.c #1571 2021-02-21 12:31:50 +01:00
Ray
ef8318f5e3 [models] Move vboId ALLOC/FREE to rlgl module #1603
Actually, it seems more logical that rlgl takes care of OpenGL data than the models module...

Also, models module loaded vertex data is unloaded by models module.
2021-02-21 12:09:52 +01:00
Airbus5717
34f5532fad Update BINDINGS.md (#1605) 2021-02-21 10:45:18 +01:00
RedCubeDev
d84a015725 Added ReCT Binding (Relib) to the list (#1604)
hey!
Ive made a Raylib Binding for my Programming language ReCT! Its still a fairly small language (~30 users) but it would be really cool to be featured here, tho I'd completely understand if only relevant languages are allowed on the list
2021-02-21 10:44:41 +01:00
Jeffery Myers
48a7cd3c87 [Examples] Fix typecast warnings in examples. (#1601)
* Fixing typecast warnings generated by visual studio 2019 in examples.

* Changes to fixes based on feedback

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-20 23:37:32 +01:00
Paul Jurczak
82cdd88ffe Fixed DrawLineEx (#1598)
* Fixed DrawLineEx

Corrected the issue https://github.com/raysan5/raylib/issues/1596

* Removed raymath dependency for DrawLineEx
2021-02-20 23:35:43 +01:00
Jeffery Myers
0726491ef8 Fixes to make rnet and it's examples build on Windows in visual studio 2019. (#1602)
Mostly typecasts, and some int to unsigned short changes, and including the windsock 2 library in the examples.

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-20 21:13:20 +01:00
Jeffery Myers
eb47cc5e93 Fix warnings generated by Visual Studio 2019 in new model loading code. (#1600)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-20 19:42:32 +01:00
Ray
4604271c6a Code formatting tweaks 2021-02-20 11:22:32 +01:00
Redcamellia
0a8cb60eee fixed the right and left button not working (#1595) 2021-02-20 11:18:43 +01:00
Jeffery Myers
2375464213 [Physics] Fix typecast warnings generated by visual studio 2019 (#1599)
* More warning fixes for physics and math

* fix a crash introduced with the warning changed.

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-20 11:15:40 +01:00
Rabia Alhaffar
d96b422809 Fixed example doesn't show gamepad for Xbox 360 controllers with different drivers (#1597) 2021-02-18 21:52:39 +01:00
Jeffery Myers
0f5aab3a1c check to make sure parent bone is not null before trying to compute its offset from the root (#1594) 2021-02-16 10:29:00 +01:00
Rob Loach
b530b584b5 Rename raylib-js to raylib-duktape (#1591)
While it is JavaScript, I'd rather this be named raylib-duktape since there are different implementations of javascript available. Like QuickJS, V7, or Node.js.
2021-02-15 17:41:15 +01:00
Rabia Alhaffar
e300d268f9 Fixed problem related to IsKeyPressed function! (#1589) 2021-02-15 13:28:52 +01:00
Chris
ccb083af52 [raudio] Fix load and unload issues with Music (#1588)
* Add MUSIC_AUDIO_NONE to MusicContextType and format fixes
- Useful to check the context type to see if the format is recognized. Defaulting to wav causes issues where formats are assumed to
be wav.

* Fix memory issues with LoadMusicStream and UnloadMusicStream
- Set ctxType and ctxData even if the format fails to load.
- Set ctxData to NULL if it fails and check for null inside UnloadMusicStream.
- Change RL_MALLOC when loading formats to RL_CALLOC to prevent undefined behavior.
- Add NULL check when unloading xm file.
2021-02-14 17:37:34 +01:00
jpe230
c7476f0aa5 Fix support of touchscreens for RPI (#1586)
-Checks for absolute pressure in absolute events to simulate a touch or a left mouse click.
-Updates touch position on absolute events.
2021-02-14 17:36:24 +01:00
raysan5
f3df64210b Update physac.h 2021-02-14 16:47:47 +01:00
raysan5
7035435948 Update core.c 2021-02-14 16:47:19 +01:00
raysan5
0c63c7c907 Possible callbacks -WIP- 2021-02-14 16:47:08 +01:00
raysan5
2b1ec5d8d2 Review some comments 2021-02-14 16:46:33 +01:00
raysan5
a474511356 Update Makefile 2021-02-14 16:46:05 +01:00
raysan5
6037adcace Update raylib.rc 2021-02-11 16:32:07 +01:00
raysan5
83f0c771d5 ADDED: ALL examples projects to VS2019 solution 2021-02-11 16:02:17 +01:00
raysan5
44a6b86d68 Create raylib_144x144.png 2021-02-11 15:59:22 +01:00
Ray
02d6402f4f Update CMakeBuilds badge 2021-02-11 11:51:37 +01:00
Ray
ccdf2a3a9e Update cmake.yml 2021-02-11 11:50:55 +01:00
Ray
aaab355df7 Add CMake workflow badge 2021-02-11 11:49:58 +01:00
BrokenKeyboard
d93b8f6544 Fix spelling mistake (#1581)
Sorry if this is a bit of a useless pr
2021-02-09 22:29:01 +01:00
Ray
36e434099d Update android.yml 2021-02-09 15:54:12 +01:00
Ray
bf008234e2 Update linux.yml 2021-02-09 15:53:56 +01:00
Ray
16c0f92f18 Update macos.yml 2021-02-09 15:53:30 +01:00
Ray
a5af604b2d Update webassembly.yml 2021-02-09 15:52:07 +01:00
Ray
4f40b4a961 Update windows.yml 2021-02-09 15:51:34 +01:00
raysan5
043eb5882b Review Makefile to support PLATFORM_RPI #1580 2021-02-09 15:42:03 +01:00
raysan5
00a0461c7a REDESIGNED: VS2019 build paths
REMOVED: core_basic_window.cpp
2021-02-09 14:06:40 +01:00
raysan5
cdf8ea7e30 Update advance_game.c 2021-02-09 13:23:20 +01:00
raysan5
9619e5cbf8 Review some warnings and formatting 2021-02-09 13:23:06 +01:00
raysan5
4e68524871 REMOVED: GetGamepadButton() internal func 2021-02-09 12:14:50 +01:00
masterex1000
52d0e86cc6 Poll inputs after frame sleep (#1573) 2021-02-08 16:57:19 +01:00
Rob Loach
cdd35d4b09 BINDINGS: Remove Harbour (#1574)
It looks like the Harbour bindings disappeared? Did they exist at one point?
2021-02-08 13:15:40 +01:00
hristo
70965f20d5 Disabling WindowSizeCallback around fullscreen toggle. (#1480)
* Disabling WindowSizeCallback around fullscreen toggle.

#1294 fixed the issue that toggle fullscreen changes the screen size because of the WindowSizeCallback. The proposed edit by @raysan5 was to comment out WindowSizeCallback which I essentially simplified to disable the callback around the set window monitor functions.

The developers using the ToggleFullscreen function should be aware that they need to size the screen correctly on that same frame. Otherwise they should check if fullscreen and size properly using the GetMonitorWidth and GetMonitorHeight functions.

* Update core.c

Fix issue from merge
2021-02-07 20:55:27 +01:00
raysan5
67206a5415 Review latest PR formating 2021-02-07 20:52:11 +01:00
Gil Barbosa Reis
9081defd46 Fix initialize GLFW's Joystick subsystem before window is created on Desktop platforms (#1554) (#1572) 2021-02-07 20:49:37 +01:00
raysan5
090c790e50 Review formating for latest PR 2021-02-07 20:47:40 +01:00
hristo
6be1be4573 Fix wrong values shown for monitor width and height in pixels when fullscreen is toggled. (#1479)
This solves issue #1322 which in my opinion was prematurely closed. As the monitor resolution is expected to be the maximum that the monitor supports. My change is that as per GLFW documentation you can get all current video modes sorted by max resolution. When you toggle fullscreen the first video mode returned would be the current screen resolution setup but that doesn't help if you want to know the maximum supported.
2021-02-07 20:44:38 +01:00
raysan5
c49ce58f02 REVIEWED: Multichannel sound system #1548
I don't like this solution but I think it's valid in the meantime....
2021-02-07 19:20:30 +01:00
raysan5
b2215cf017 REVIEWED: Replace GetImageData() by LoadImageColors() 2021-02-06 13:29:22 +01:00
raysan5
b7b718a545 REVIEWED: example: Replaced GetImageData() 2021-02-06 13:15:23 +01:00
raysan5
0f309b9b16 REMOVED: MeshNormalsSmooth() #1421
Current implementation is probably wrong and it should be reimplemented from scratch, in the meantime, I prefer to remove the function.
2021-02-05 19:49:05 +01:00
raysan5
edb54c6cb1 REVIEWED: CloseAudioBufferPool(), uninit buffers properly #1548 2021-02-05 19:45:13 +01:00
raysan5
5663c81803 REVIEWED: raudio: Some LOG_ERROR -> LOG_WARNING #1562 2021-02-05 19:19:44 +01:00
raysan5
56ff944def Update miniaudio to v0.10.32 #1562 2021-02-05 19:18:44 +01:00
raysan5
62ccec0ac5 REMOVED: SetTraceLogExit()
I feel nobody has ever used this function...
2021-02-05 14:36:28 +01:00
raysan5
421e5d4829 REVIEWED: DecompressData() 2021-02-05 14:35:43 +01:00
kernelkinetic
e831bf02c5 removed redundant call to eglGetConfig (https://github.com/raysan5/raylib/issues/1550) (#1567) 2021-02-05 13:55:09 +01:00
raysan5
97a7875648 REVIEWED: Gamepad issues on Android 2021-02-05 13:52:25 +01:00
raysan5
4407533a41 REVIEWED: DecompressData(), memory reallocation 2021-02-05 13:52:01 +01:00
Ray
3431d58586 Designing some callbacks -WIP- 2021-02-05 10:17:21 +01:00
raysan5
005bc4c414 REVIEWED: LoadShaderProgram() #1563
Try to avoid a possible false-positive memory leak...
2021-02-02 12:33:01 +01:00
raysan5
ed9c10a3e6 Update raudio.c 2021-02-02 11:42:49 +01:00
hristo
c8e427ad23 Update loading of gltf animation. (#1561)
This is to account for GLTF info being more like instructions on how to build your animation instead of verbose description of each pose.
2021-02-02 10:49:42 +01:00
Jeffery Myers
2884b88101 out is a keyword in shaders and can't be used as a variable name. (#1558)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-01-31 21:37:27 +01:00
raysan5
aebcd9b551 Update models_first_person_maze.c 2021-01-31 16:22:24 +01:00
raysan5
96db787657 REVIEWED: Gamepad system, specially for RPI 2021-01-31 03:07:26 +01:00
Jeffery Myers
e818dc27cd Use local (") includes for GLFW since it is included with the source tree. (#1557)
This change helps some platforms produce fewer errors/warnings.

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-01-30 22:22:14 +01:00
raysan5
bc332018f6 REVIEWED: SetGamepadMappings()
return value for all platforms
2021-01-28 18:37:52 +01:00
hristo
731ab15d57 Gltf animation support (#1551)
* Added example for gltf animation and split some functions for loading model animations into IQM and GLTF similar to how models are being loaded.

* Removed wrongly duplicated function

* Bone loading for gltf model (not working at this point)

* Loading info about vertex to joint connection but animation is still not working

* Skeleton and pose is correctly loaded. Need to communicate about interpolation in GLTF

* The model almost looks like a real person on animation.

* Fixed model loading with bones.

Also updated license info on the model.

* Cleaned up some code and updated examples.

* Fix identation issues

* Fix identation issues

* Fix identation issues
2021-01-28 11:29:06 +01:00
hristo
88a6f16c9a Documentation cmake (#1549)
* Documenting the compiler flags

* Moved some android compiler flags and added documentation on them too.

* Some more restructuring.

Removed unnecessary comments that were self described by the code.
Added some more explanations around certain parts of CMake and especially around compiler flags.
2021-01-26 14:34:27 +01:00
raysan5
65b299c6cf Replace tabs by 4 spaces 2021-01-25 17:53:04 +01:00
hristo
f3ce3a6f74 Removing config.h.in file (#1546)
CMake relied on this file for configurations and also was interfering in the regular config.h by having a separate definition if building with CMake. This was not entirely correct so instead we will define compile time definitions separately through CMake (CompileDefinitions.cmake) and also will use the provided EXTERNAL_CONFIG_FLAGS that I found that will not use config.h in through the build process.

I also introduced a new compiler option (CUSTOMIZE_BUILD) that when OFF will use the default config.h and when ON will show other options for redefining your own options.

Fixed an error in rlgl.h where if you have both RLGL_STANDALONE and SUPPORT_VR_SIMULATOR you get a compile time error.
2021-01-25 10:47:53 +01:00
hristo
4bf7b00013 Removing test file. (#1545)
This test file is just testing compilation with the library works correctly but is no longer needed because:
- it is not cross platform
- it taps into the CTest system which is better suited for real unit/integration tests
- it can be incorporated into the pipeline of github actions instead in the future
2021-01-25 10:44:30 +01:00
hristo
1d23e15692 Added a windows and linux simple compile with cmake (#1543)
* Added a windows and linux simple compile with cmake

Will expand on the file but it will be nice to know if they are some extremely breaking changes in the future. cmake.yml will run two task one for linux build and one for windows build essentially checking that both are working. We can add all platforms later.

* Renaming the task to "CMake Builds" and removing the test step.

Commented out the test step as I don't yet know what the two bash files are doing but they are failing the build.
2021-01-24 21:09:01 +01:00
Nikolas
a0d2b64747 Fix issue when trying to build raylib statically (#1544) 2021-01-22 23:43:06 +01:00
Ray
f4f208c4ae ADDED: UploadMesh() #1529
Upload mesh data to GPU and get VAO/VBO identifiers
2021-01-22 12:16:19 +01:00
Ray
721768bdb0 Remove automatic pointer lock on mouse click #1513 2021-01-22 11:57:57 +01:00
Ray
f2c0981c57 Review typo 2021-01-22 11:57:18 +01:00
hristo
05dfbf3cd4 Remove STATIC and SHARED variables. (#1542)
As described in the official documentation https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html this flag is global by default and controls if the library will be built as a shared or a static library allowing us to define only one call to the add_library function (without specifying its type). It is also added as an option to be visible in CMake GUI applications.
2021-01-22 00:07:22 +01:00
Ray
18ab694f70 ADDED: SetGamepadMappings() #1506 2021-01-21 14:39:03 +01:00
Ray
677f420bf0 REVIEWED: physac module and examples #1525 2021-01-20 20:55:12 +01:00
Ray
b845f3886a Minor tweak to Makefile 2021-01-20 17:18:45 +01:00
Ray
d20efde49d Merge branch 'master' of https://github.com/raysan5/raylib 2021-01-20 17:07:06 +01:00
Ray
01b7509a39 Review screen capture / gif recording #1540 2021-01-20 17:06:53 +01:00
Ray
407c014eb4 Update Makefile 2021-01-20 17:06:30 +01:00
Ray
5e6eb0b847 Update raylib to v3.5 :P 2021-01-19 12:36:30 +01:00
Rob Loach
3e3e41eaba Update node-raylib to 3.5 (#1539)
[`node-raylib`](https://github.com/robloach/node-raylib) is now on raylib 3.5.0
2021-01-17 09:31:56 +01:00
Richard Smith
f21aa0352b Update BINDINGS.md (#1538) 2021-01-16 20:01:28 +01:00
hristo
6cc27e9797 Fix cmake build error dirent (#1536)
* Better ignore support for idea projects.

Added a wildcard at the end because different configurations would have a diffeerent build directory.

* Removed external from being a relative include directory for target raylib.

Fixes #1533
2021-01-16 14:04:01 +01:00
Gil Barbosa Reis
1866be0475 Fix absolute path handling in GetFileName and GetDirectoryPath (#1534) (#1535) 2021-01-16 10:33:13 +01:00
Ray
eb7820b2b0 Review comment 2021-01-15 00:20:35 +01:00
Ray
b7f275efb3 Review warning 2021-01-15 00:20:23 +01:00
Ray
186e52c4d8 REVIEWED: DecompressData()
Corrected bug!
2021-01-14 20:42:01 +01:00
Ray
a3c56d9052 go-raylib updated to 3.5 2021-01-14 19:53:58 +01:00
Dmitry Matveyev
8d3381b490 Add NimraylibNow! wrapper for Nim to bindings [ci skip] (#1532) 2021-01-14 17:09:34 +01:00
hristo
9821725c6b Big cmake changes (#1514)
* Delete emscripten.cmake

This file is not needed at this point. EMSDK provides a toolchain file that has a lot more things in it and is better supported. Project currently works fine with the documentation provided in Emscripten SDK on how to build projects.

* First pass file separation.

The main two files are cleaner now. Only important things can be seen. Major changes include:
- raylib_static is now the alias instead of raylib
- Repeating segments are removed and pulled into separate files into <root>/cmake
- File is reordered to make more sense
- Installs are better structured
- Library is build into an output directory "raylib" instead of "src"
- All public header files are now set as a public header file
- Source files need to be listed (it is a bad practice to capture them using wildcards and file globs)
- CMakeLists are better commented

* Second pass on the example dirs.

They are quite complex so I'm more hesitant to do major changes. Also it works pretty well. Noticed that I forgot one of the seperated files and added it into src/CMakeLists.txt.

* Returned the header copy as it was convenient to have the public headers copied.

* A better description to the variable RAYLIB_IS_MAIN

Co-authored-by: Rob Loach <robloach@gmail.com>

* Remove debug message

Co-authored-by: Rob Loach <robloach@gmail.com>

* Improvements based on review.

* Simplify the install condition to not be platform specific as it was before.

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>

* Remove some CMAKE variables as they don't affect the build in any way

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>

Co-authored-by: Rob Loach <robloach@gmail.com>
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
2021-01-13 23:10:02 +01:00
Davidson Francis
3d22709808 Fixes Android builds on Linux environments (#1530)
* simple_game: Configure Make and makefile for Linux environments

* simple_game: Fix build issues on Android plaform with Linux HOST

The Makefile.Android.linux file was out of date with the rest of the
project, so this commit updates the paths, as well as leaving some as
optional, if it is already configured as an environment variable.

In addition, it corrects the build error related to static raylib:
the makefile was trying to generate libmain.so using the path of the
NDK libraries, instead of using those of the Android system, which
resulted in crashes in the generated apk.
2021-01-13 23:07:34 +01:00
Ray
a0a840101c Update miniaudio to v0.10.30 #1518 2021-01-12 22:51:26 +01:00
Ray
5d1d590692 REDESIGN: Compresion API
Now it compresses/decompresses valid DEFLATE streams instead of zlib streams. It uses the minimal and efficient libraries: sdefl/sinfl.
2021-01-12 21:15:11 +01:00
Ray
dfa11e22cf Add comments 2021-01-12 20:25:09 +01:00
Ray
c256b26629 Reorder function 2021-01-12 20:24:58 +01:00
Ray
12e7be63f7 Merge branch 'master' of https://github.com/raysan5/raylib 2021-01-12 20:24:43 +01:00
Ray
477653a0d6 Update Makefile 2021-01-12 20:24:31 +01:00
Dmitry Matveyev
04a1bb1390 Reorder typedefs in physac.h to be in header part (#1528) 2021-01-12 20:12:14 +01:00
Ray
bbc09288bd rlOrtho() reverted change 2021-01-09 12:37:21 +01:00
Jeffery Myers
b76dc06297 It's top-bottom not bottom-top in GL space. (#1517) 2021-01-07 23:13:44 +01:00
Dan J
33ed142306 Add info to readme for conan dependency manager (#1516)
Co-authored-by: resttime <resttime@users.noreply.github.com>
2021-01-07 10:02:48 +01:00
badlydrawnrod
49f9bff260 Fix keyboard state change detection on RPI (#1488)
* Fix keyboard state change detection on RPI

* Rework RaspberryPi evdev keyboard input.

- Extract evdev keyboard handling into PollKeyboardEvents()
- Move keyboard polling to main thread
- Rename EventThreadSpawn() to ConfigureEvdevDevice() as it doesn't necessarily spawn threads
- Remove unused code (KeyEventFifo and lastKeyPressed)

* Replace tabs with 4 spaces.
2021-01-06 20:46:12 +01:00
Kirottu
22da9087b1 Include SUPPORT_DATA_STORAGE flag for building with CMake (#1515)
* Update CMakeOptions.txt

* Update config.h.in
2021-01-06 20:45:32 +01:00
Victor Gallet
a6cd6eedbe Remove unused condition in 'GenerateMipmaps' function for GRAPHICS_API_OPENGL_11 (#1496) 2021-01-06 13:27:32 +01:00
raysan5
7bd33e4406 Review rlOrtho() to avoid return in the middle of the function
I usually try to avoid any return in the middle of functions, I try to keep them always at the end of the functions.
2021-01-06 13:26:55 +01:00
Jeffery Myers
5d4aada526 Don't create an ortho matrix when the viewport is 0 in any axis. (#1504)
* Don't create an ortho matrix when the viewport is 0 in any axis.
Not all compilers divide by 0 and return inf, some segfault.
The matrix is not used by anything when minimized, so it just needs to not be called.

* Better fix that always ensures the rlgl matrix is always valid

* Better fix that always ensures the rlgl matrix is always valid
2021-01-06 13:21:58 +01:00
hristo
551597d579 Removed a repeating allocation of memory (#1507)
Resolves #1495
This line allocated some memory that was already allocated in the beginning of the function and was essentially creating a leak.
2021-01-03 22:43:09 +01:00
Tornike Goshadze
4bce0f27e6 Update Raylib-cs bindings version (#1508) 2021-01-03 22:20:02 +01:00
Chris
320732ae6b Update mappings.h in glfw using GenerateMappings.cmake (#1505) 2021-01-02 21:46:39 +01:00
raysan5
d7b4b9e485 Update year to 2021 2021-01-02 18:15:13 +01:00
ayshvab
f5815b781a Update project.4coder (#1503)
Fix run .cmd for win
2021-01-02 11:36:11 +01:00
ArnautDaniel
10b5e2e73a Update Gforth and Factor bindings (#1500) 2020-12-31 16:10:29 +01:00
Victor Gallet
57fef97433 Modify the check condition for the screen window height and width. It can't be less than zero because it's an unsigned int (#1497) 2020-12-31 13:29:35 +01:00
Victor Gallet
03278a74bf Avoid dereferencing a null pointer in the 'LoadMaterials' function in the models module (#1498) 2020-12-31 13:28:53 +01:00
Victor Gallet
9fe153ae29 Avoid dereferencing a null pointer in the 'LoadSounsFromWave' function if the audioBuffer is null (#1499) 2020-12-31 13:28:16 +01:00
Artur Mustafin
2f966531a7 added missing constants (#1493)
Co-authored-by: funcelot <artur.mustafin@gmail.com>
2020-12-30 21:05:55 +01:00
Jeffery Myers
4c8bebc0d7 Add a current monitor function for window mode windows. (#1492) 2020-12-30 17:29:39 +01:00
Jeffery Myers
24b6dcf29f lookup the returned monitor in the list of monitors to get an index. (#1490) 2020-12-30 00:08:56 +01:00
raysan5
22b179e66c Review rlights helper module #1489 2020-12-29 22:01:48 +01:00
raysan5
9ed29725a0 Review code formatting 2020-12-29 20:42:29 +01:00
Jeffery Myers
59bb759855 Faster version of ImageClearBackground and ImageDrawRectangleRec (#1487)
* Don't use DrawRect to clear an image, a pixel loop is an order of magnitude faster.

* Update ImageDrawRectangle to be faster too.
2020-12-29 20:39:53 +01:00
hristo
75c6fd047b Monitor utilites (#1485)
* Added a new utility function to get the current monitor.

Some of the other functions rely on passing on a monitor id but we only have a function for querying the count of monitors available.

* Updated the comment to correctly reflect the function action
2020-12-29 13:37:08 +01:00
hristo
d3db690c42 I noticed that toggle fullscreen always gets the primary monitor when its more intuitive to use the monitor that the window is currently in. (#1486)
This monitor should even probably be passed as an id instead to make it more consistent with the rest of the API but this would break existing applications so I am hesitant to change the function signature directly.
2020-12-29 13:35:47 +01:00
raysan5
abdd57db0b Review comments formating 2020-12-28 11:19:05 +01:00
Matheus Duarte
227496bea7 providing and example on how to apply the screen scale (as done in the virtual mouse) to the real mouse, to work with raygui (#1481) 2020-12-28 11:10:39 +01:00
Ray
068fc48fda Update HISTORY.md 2020-12-27 16:26:52 +01:00
Astie Teddy
af39344e99 TSnake41/raylib-lua updated to 3.5 (#1478)
[raylua v3.5a](https://github.com/TSnake41/raylib-lua/releases/tag/v3.5a) has been released
2020-12-27 01:25:22 +01:00
Rob Loach
92b7e63bb5 Update raylib-cpp to state that it targets 3.5 (#1477)
[raylib-cpp](https://github.com/robloach/raylib-cpp) now targets raylib 3.5.0 as of [raylib-cpp 3.5.0-alpha1](https://github.com/RobLoach/raylib-cpp/releases/tag/v3.5.0-alpha1).
2020-12-26 22:24:27 +01:00
Rabia Alhaffar
b74be185c2 Corrected raylib-mruby version + Updated raylua bindings! (#1476) 2020-12-26 20:42:54 +01:00
Rabia Alhaffar
ad8a46d261 Again, Renamed version... (#1475)
Sorry for that, At least i'm correct now ;)
2020-12-26 20:27:21 +01:00
Rabia Alhaffar
10626ad6f8 Edited version of raylib-mruby to comply with 2.5 (Renamed to 2.4-dev) (#1474) 2020-12-26 19:25:02 +01:00
Rabia Alhaffar
f5db106eb6 Detected versions of some libs... (#1473) 2020-12-26 15:44:01 +01:00
raysan5
521ed1cef0 Review DrawLineBezierQuad(), formating and aprameters order 2020-12-26 13:09:34 +01:00
Violet White
de13fca3b1 Add Quadratic Bezier drawing (#1468)
* Add quadratic bezier to shapes.c

* Add DrawLineBezierQuad to header
2020-12-26 13:04:38 +01:00
Ray
b59ca95a16 Update commits since last version 2020-12-26 13:04:05 +01:00
badlydrawnrod
6631fc4c6d Fix use of GuiSliderBar in examples. (#1470) 2020-12-26 13:02:42 +01:00
Gunko Vadim
23208357c1 Update BINDINGS.md (#1472) 2020-12-26 13:01:24 +01:00
Rabia Alhaffar
9f3351cf7b Boo bindings updated to 3.5 (#1471) 2020-12-25 23:29:13 +01:00
Ray
e25e380e80 Update webassembly.yml 2020-12-25 02:07:24 +01:00
Ray
1320d9e303 Update macos.yml 2020-12-25 02:06:50 +01:00
Ray
e4477472f3 Update android.yml 2020-12-25 02:05:39 +01:00
Ray
60ffc9f59b Update linux.yml 2020-12-25 02:04:18 +01:00
Ray
79435bf34e Update windows.yml 2020-12-25 02:03:33 +01:00
Ray
ef5667c078 Update HISTORY.md 2020-12-25 01:35:22 +01:00
Ray
b6557166f2 Update README.md 2020-12-25 01:31:15 +01:00
Ray
a7599b83a5 Update HISTORY.md 2020-12-25 01:25:40 +01:00
Ray
047747a4cc Update HISTORY.md 2020-12-25 01:22:58 +01:00
raysan5
e8ea105b3d Update HISTORY.md 2020-12-25 01:21:09 +01:00
raysan5
1caa31396e Update CHANGELOG 2020-12-25 01:20:19 +01:00
raysan5
b973c2f08e Update SPONSORS.md 2020-12-24 23:21:44 +01:00
raysan5
e0c1f25116 Update ROADMAP.md 2020-12-24 23:10:42 +01:00
raysan5
d38e01d186 Minor tweak 2020-12-24 23:10:29 +01:00
raysan5
ea0f6c7a26 Replace TABS by 4 spaces 2020-12-24 23:07:52 +01:00
Ray
b93c4b0c20 Update CHANGELOG 2020-12-24 19:33:52 +01:00
raysan5
ec3845fa9f Review some RPI4 tracelogs 2020-12-24 19:09:05 +01:00
raysan5
3e041a27b1 Update Makefile 2020-12-24 19:08:02 +01:00
raysan5
5ffce8f230 Review tracelog messages for DRM platform 2020-12-24 17:56:08 +01:00
raysan5
8073c5ec93 Update README.md 2020-12-24 15:51:46 +01:00
raysan5
13a288d13a Update README.md 2020-12-24 15:48:43 +01:00
Ray
5662403488 Update README.md 2020-12-24 15:32:15 +01:00
raysan5
b68e522ffc Updated several files while porting examples to web 2020-12-24 13:51:24 +01:00
raysan5
bab1b9c1c5 Review example formating 2020-12-23 20:59:14 +01:00
raysan5
d9a9bacb48 Review formatting 2020-12-23 20:30:00 +01:00
raysan5
10a57f297e Merge branch 'master' of https://github.com/raysan5/raylib 2020-12-23 17:50:08 +01:00
raysan5
60a3746a80 Remove dup example 2020-12-23 17:49:54 +01:00
Ray
002258aa57 Update CHANGELOG 2020-12-23 17:44:00 +01:00
Ray
c59ea67b97 Update CHANGELOG 2020-12-23 17:43:06 +01:00
raysan5
7e459dc38b Review Android Makefiles to required version 2020-12-23 17:05:51 +01:00
raysan5
f8a2903cec Review issues when compiling for Android 2020-12-23 17:05:07 +01:00
raysan5
ef46003270 Update raylib functions parser to generate XML intellisense file
Update Notepad++ functions intellisense
2020-12-23 16:35:39 +01:00
raysan5
1df89039ad Update Makefile(s) 2020-12-23 16:34:21 +01:00
raysan5
0a9e080998 Remove trailing spaces 2020-12-23 15:03:26 +01:00
raysan5
547960ca71 Update raylib version 2020-12-23 13:48:53 +01:00
raysan5
59949bf848 Update resource file 2020-12-23 13:48:43 +01:00
Ray
28b3571517 Update CHANGELOG 2020-12-23 13:26:31 +01:00
raysan5
aa38532cc3 Remove unused variable 2020-12-23 13:03:13 +01:00
raysan5
9216e96315 Corrected typo 2020-12-23 13:02:40 +01:00
raysan5
0da827d754 Corrected small issue 2020-12-23 12:54:57 +01:00
raysan5
871c3d87b4 REMOVED: Travis CI 2020-12-23 12:46:06 +01:00
raysan5
b78ee13791 ADDED: CheckCollisionLines()
Removed function from raymath
2020-12-23 12:45:53 +01:00
Ray
2bdb45f280 Remove Travis CI badge 2020-12-23 12:30:00 +01:00
Victor Gallet
668b3e4cfb [Math Feature]: Add two functions for Vector2 to know if two lines intersect and two segments intersect (#1466)
* Add a function to know if two lines intersect each other and if yes, get the intersection point

* Remove indents

* Rework the declaration of the 'Vector2LineIntersect' function, and add the 'Vector2SegmentIntersect' function

* Remove bad indents

* Fix compilation issues

* Fix compilation error

* Fix compilation error

* Replace keyword '_Bool' by 'bool'
2020-12-21 21:04:02 +01:00
Ray
51e75be9d1 Update CHANGELOG 2020-12-20 11:05:24 +01:00
Ray
976932e05e Set version for raylib 3.5 2020-12-19 20:38:49 +01:00
Ray
d82113ec34 Camera funcs, review params names
Just for a better consistency
2020-12-19 20:14:34 +01:00
Ray
9097d0b4ef REVIEW: CheckCollisionSpheres() params naming 2020-12-19 20:05:32 +01:00
Ray
f30354fc35 Minor tweak 2020-12-19 20:01:07 +01:00
Ray
d2d72b1dfb ADDED: MemAlloc() / MemFree() #1440
Exposing internal memory allocator/free, useful for advance users when required
2020-12-19 19:43:25 +01:00
Ray
cbf7369a3d Update raylib.h 2020-12-19 19:28:06 +01:00
Ray
2374281204 Avoid *Rec suffix in some variables
Pefixing/Suffixing some data type identifier in the variables is not a convention used in raylib, just reviewed it for consistency...

Still, I kept the *Rec suffix in some functions.
2020-12-19 19:27:31 +01:00
Ray
015e715278 Corrected DrawTextRecEx() bug 2020-12-19 19:12:51 +01:00
Ray
e404a18226 Support font chars padding on drawing #1432
Previous implementation did not consider any padding while drawing the characters on screen (despite being available on the font atlas), so, only minimum character area was drawn.

If some text effect shader was required (shadow, glow, outline...), there was no space in the drawn quad to draw that pixels effect.

This commit corrects that issue.
2020-12-19 12:16:23 +01:00
Ray
51e8f37688 Minimal tweak 2020-12-19 00:22:58 +01:00
Ray
c36a6f3d9f Update textures.c 2020-12-19 00:01:14 +01:00
Ray
e07bc372a1 WARNING: RENAMED several functions for consistency #1440
This is a BREAKING CHANGE!

To address the linked issue, several functions have been renamed and couterpart functions have been created to free loaded memory:
 - RENAMED: GetImageData() -> LoadImageColors()
 - RENAMED: GetImagePalette() -> LoadImagePalette()
 - RENAMED: GetWaveData() -> LoadWaveSamples()
 - ADDED: UnloadImageColors()
 - ADDED: UnloadImagePalette()
 - ADDED: UnloadWaveSamples()
2020-12-18 21:03:08 +01:00
Ray
5dd142beb6 Added some Web checks for missing GLFW functions 2020-12-18 19:32:52 +01:00
Ray
96542269d0 WARNING: GetKeyPressed() <-> GetCharPressed() #1336
Previous GetKeyPressed() method was actually returning unicode codepoints equivalent values instead of the key-code of the pressed key. So, it has been replaced by GetCharPressed(), returning unicode codepoints and GetKeyPressed() now returns key-codes.
2020-12-18 18:58:02 +01:00
Ray
893a64712e Support mouse input on example #1465 2020-12-18 18:36:04 +01:00
hristo
0987507ef5 Add headers to install cmake (#1462)
* Changed extension for web from .bc to .a

I did this to support vcpkg expectation. When using the library from vcpkg for web you would install it using vcpkg install raylib:wasm32-emscripten but also vcpkg expects the output lib to be with .a extension instead of .bc

Doesn't make a difference for standalone builds or when raylib is used as a subdirectory dependency.

* Added headers to install targets to fix vcpkg usage

Currently vcpkg works by installing the cmake target into its packages directory. The problem is that install only copies the public header at this point so we need to add the others to the install targets.
2020-12-16 19:11:21 +01:00
Andrea Fontana
ef0dcaabf9 Changing JPG compression (#1463)
Since I don't think the purpose of raylib is to save space compressing image, I think it could be a good idea to keep quality from 90 to 100.
2020-12-16 19:07:18 +01:00
Ray
f5b4656801 Added additional charsPadding initialization #1432 2020-12-14 23:51:55 +01:00
Ray
5f690819e7 REVIEWED: Font struct, added charsPadding #1432 -WIP-
Not implemented usage of this variable yet but already setup for the future... some functions require review to consider it on drawing...
2020-12-14 23:47:11 +01:00
Ray
e69f2f0c26 REVIEWED: DrawGrid(), issue with buffer limits check #1417 2020-12-14 23:39:12 +01:00
Ray
d360a49f36 ADDED: UnloadFileData() / UnloadFileText() #1440 2020-12-14 20:47:58 +01:00
Ray
cd3eb3d8bd Added some security checks on GenMesh*() #1454 2020-12-14 20:41:58 +01:00
Jeffery Myers
7a0e73331d Add mesh collision function so we can check meshes directly instead of having to put them in a model. (#1459)
Make model collision function call the mesh function.
2020-12-14 19:26:32 +01:00
hristo
a840d8a77d Changed extension for web from .bc to .a (#1461)
I did this to support vcpkg expectation. When using the library from vcpkg for web you would install it using vcpkg install raylib:wasm32-emscripten but also vcpkg expects the output lib to be with .a extension instead of .bc

Doesn't make a difference for standalone builds or when raylib is used as a subdirectory dependency.
2020-12-14 19:24:56 +01:00
hristo
3ec8ac52f8 Building examples by default only if raylib is standalone. (#1460)
This change only modifies the default value. In cmake you can have raylib as a subdirectory (dependency) and when you have it as dependency you wouldn't probably want to use the example by default. You can still use the option to enable them though.
2020-12-14 19:24:20 +01:00
hristo
6e79476650 Fixed the build for web using CMake. (#1452)
* Fixed the build for web using CMake.

I found that the build for me was failing and I added some if defined checks in the core.c file where the glfwSetWindowAttrib was used. (error: implicit declaration of function 'glfwSetWindowAttrib' is invalid in C99 [-Werror,-Wimplicit-function-declaration])

I also changed some values in the toolchain file so that it correctly uses the .bat files when on windows.

* Cleaned up the additional variables (they are not important)

* Added more improvements to cmakelists

Added the option to use the system provided Emscripten toolchain to be more uniform with other libraries.

Fixed and issue which prevented example being built from cmake and also building with html extensions properly.

* Fixed ENUM to STRING because of a missed warning
2020-12-13 20:29:47 +01:00
Jeffery Myers
11ebb54674 Don't put the obj and temp files for all the projects in the same place, it causes conflicts (#1458) 2020-12-13 16:08:22 +01:00
Alexander Buhl
a798fd401f Fixed #1455 (#1456)
* Fixed #1455

Fixed writing out of array bounds
Adjusted FPS comment to match value
Deleted unused function at the end, which has never been in use in the history of this file

* Fixed #1455

Readded the function
2020-12-13 16:06:55 +01:00
Jeffery Myers
342d4faf14 Add options to set line width and aliasing to rlGL layer. (#1457)
* Add options to set line width and aliasing to rlGL layer.

* Don't do line smoothing in OpenGLES
2020-12-13 10:58:24 +01:00
Ray
e6ae4879f6 Added security check to pitch change #1450 2020-12-12 13:07:46 +01:00
Ray
459c4754dc Reviewed SetAudioBufferPitch() #1450 2020-12-12 13:01:31 +01:00
Jeffery Myers
039503e7c2 Add functions to enable/disable depth writes to go with functions for depth tests. (#1451) 2020-12-05 21:53:19 +01:00
Jeffery Myers
03df593263 Add function to get the position of a monitor (and fix some comments) (#1449) 2020-12-05 21:51:20 +01:00
Ray
62406259d7 Corrected minor windows flags issues 2020-12-03 20:33:46 +01:00
Ray
dd45d0ed64 Update VS2019 project 2020-12-03 20:22:06 +01:00
Ray
c4aee2d09a Add VS2019 project 2020-12-03 20:19:54 +01:00
Ray
7955381fb3 Update core_basic_window.c 2020-12-03 20:19:32 +01:00
Ray
7e9028ae08 Update user name 2020-12-03 20:17:50 +01:00
Ray
1c9726fd8c Update core_window_flags.c 2020-12-03 20:17:21 +01:00
Ray
d1119816d7 Review comment 2020-12-03 20:16:46 +01:00
Ray
0540f0ad32 Review window flags 2020-12-03 20:16:35 +01:00
Ray
84ab00d52e Merge branch 'master' of https://github.com/raysan5/raylib 2020-12-02 08:29:14 +01:00
Ray
63d33d7a7a Update CMakeLists.txt 2020-12-02 08:27:43 +01:00
Jeffery Myers
679a26a195 Two small quality of life changes to projects. (#1448)
1) use the latest windows SDK not a specific one.
2) use the project dir as the root for the include dir for raylib, to help if the project is ever included in some other solution.
2020-12-02 07:35:48 +01:00
Ray
60928ec82c ADDED: UnloadModelKeepMeshes() #1441 2020-12-01 23:44:10 +01:00
Ray
0481053dad Review for issue #1446 2020-12-01 23:23:30 +01:00
Ray
59be7b9c29 Update CMakeLists.txt 2020-12-01 23:21:35 +01:00
Ray
83916bd3c2 Updated GLFW to latest 3.4 (github master - 16Nov2020)
WARNING: Some CMake files not changed
WARNING: glfw_native.h contains custom changes
2020-11-30 09:11:22 +01:00
Ray
23ed67cce0 Review some config options 2020-11-30 09:00:40 +01:00
Jeffery Myers
df249f5513 Fix typecast warnings in raylib code as reported by visual studio 2019 (#1443) 2020-11-30 08:14:11 +01:00
Seth Archambault
d43268b317 Added GLFW_OPENGL_FORWARD_COMPAT for Apple Support (#1445)
Without GLFW_OPENGL_FORWARD_COMPAT, running this as a standalone will yield the error:
```
NSGL: The targeted version of macOS only supports forward-compatible core profile contexts for OpenGL 3.2 and above
```
2020-11-29 10:15:51 +01:00
Random
0322fc28d4 optimized MatrixLookAt (#1442) 2020-11-29 10:08:22 +01:00
Seth Archambault
ed0fda2b40 Added Apple Compilation Instructions (#1444)
Stumbled on this example and I love this! Adding instructions that work for me on MacOS.. Note that glfw3 will need to be statically built locally and copied to this external/libs directory on mac. I can upload my static version, but it probably makes sense to do this only if there's some general naming convention for adding platform specific folders. Like "external_osx/lib" or "external/lib_osx". Then I'll drop my static libs in there.
2020-11-29 09:53:29 +01:00
raysan5
d6f4f3ee88 REMOVED: GetImageDataNormalized()
Let the advance users manage it as they want...
2020-11-28 19:11:31 +01:00
raysan5
14c1ee2681 ADDED: UnloadFontData() 2020-11-28 19:07:41 +01:00
Ray
28213c2a20 Update CHANGELOG 2020-11-25 00:24:51 +01:00
Ray
687dd34c38 Update CHANGELOG 2020-11-25 00:14:51 +01:00
Ray
3d1ae3500c REVIEWED: Window state flags -WIP-
WARNING: Several functions removed, replaced by SetWindowState() / ClearWindowState() equivalents, only for advance users.
ADDED: ClearWindowState() to reset window state
REMOVED: HideWindow() / UnhideWindow()
REMOVED: DecorateWindow() / UndecorateWindow()
2020-11-23 23:46:05 +01:00
Ray
468a0bedd8 REDESIGNED: Window state config #1367 -WIP-
Some flags not working properly yet...
2020-11-23 00:49:27 +01:00
Ray
a560fe9a1e Added some comments 2020-11-22 10:56:17 +01:00
Ray
11da1714d5 Added raylib Harbour binding 2020-11-22 09:34:42 +01:00
Ray
8e48268310 Update CHANGELOG 2020-11-22 00:16:26 +01:00
Ray
bb9d734f69 Exposing some file access results to user layer #1420 2020-11-22 00:10:16 +01:00
Ray
36dc302c25 Reverted to previous working version #1434 2020-11-21 14:14:25 +01:00
Ray
9bb4d84577 Update CHANGELOG 2020-11-20 23:23:26 +01:00
Ray
4eae76302f REPLACED: rgif.h by msf_gif.h
The improvement in performance is considerable!
2020-11-20 00:34:18 +01:00
Ray
4a7ab0ae24 Update windows.yml 2020-11-19 20:21:05 +01:00
Ray
7564097d5e Update webassembly.yml 2020-11-19 20:19:18 +01:00
Ray
7f6cd93d62 WARNING: Multiple funcs reviewed!
There were some problems about frameCount vs sampleCount that could cause some breaks.

raylib audio structs stores sampleCount = frameCount*channels.

Most libraries return framesCount instead of sampleCount.

stb_vorbis seems to refer to framesCount as samples.

All required functions have been reviewed.
2020-11-19 20:11:11 +01:00
Ray
72e51cd6de Review formating 2020-11-19 20:06:35 +01:00
Ray
700bff5fd8 Version tweak 2020-11-19 20:01:40 +01:00
Ray
9471794449 Update to latest tiniobjloader
WARNING: OBJ loading is broken at this point...
2020-11-17 00:30:12 +01:00
Ray
a54d9f734b rlUpdateTexture(): Corrected issue 2020-11-16 15:18:05 +01:00
Richard Smith
94dd2f81e9 Update BINDINGS.md for raylib-python-cffi 3.1-dev (#1433) 2020-11-16 15:17:03 +01:00
Ray
f448542dd2 Review issues with FLAC loading 2020-11-16 12:20:50 +01:00
raysan5
4d5ee7953c Updated tinyobjloader 2020-11-15 14:31:43 +01:00
raysan5
cb517d0050 Update tinyobj_loader_c.h 2020-11-15 14:19:55 +01:00
raysan5
a3d33d9222 Update tinyobj_loader_c.h 2020-11-15 14:18:59 +01:00
raysan5
82d61a5875 Updated stb_image v2.26 and stb_image_write v1.15 2020-11-15 14:11:36 +01:00
raysan5
66f9fbaa88 Update cgltf.h
v1.8
2020-11-15 14:06:39 +01:00
raysan5
321f55bce1 Update audio libraries #1423
miniaudio -> v0.10.25
dr_wav -> v0.12.14
dr_mp3 -> v0.6.19
dr_flac -> v0.12.22
2020-11-15 14:04:28 +01:00
raysan5
8ff2b387f9 Review code formating 2020-11-15 13:17:11 +01:00
Ilya3point999K
bd287efa4c Fixed zero-window upscaling (#1428)
There is no zero-check, so window upscales to nothing.
SetupFramebuffer() is kinda wrong, it uses not its params, but global variables. I won't touch it, maybe it has purpose
2020-11-15 13:13:21 +01:00
raysan5
9b2b660f91 Commented new feature 2020-11-15 13:10:12 +01:00
raysan5
55dc8171f8 [text] Consider characters padding -WIP- #1432 2020-11-15 12:39:59 +01:00
Ray
c222e231f0 Added SmallBASIC binding 2020-11-08 17:47:21 +01:00
Ray
3e1cd487df Remove trailing spaces 2020-11-03 23:47:33 +01:00
kernelkinetic
f46514b855 Fixed keyboard stuttering but for cmake only (#1422)
* fixed mouse movements are bound to the screen resolution (https://github.com/raysan5/raylib/issues/1392)

* fixed keyboard stuttering on PLATFORM_RPI and PLATFORM_DRM (https://github.com/raysan5/raylib/issues/1392)

* fixed keyboard stuttering on PLATFORM_RPI and PLATFORM_DRM (https://github.com/raysan5/raylib/issues/1392)
2020-11-03 23:39:56 +01:00
Ray
05ab39ed9f REVIEWED: SaveFileText() error checking 2020-11-01 19:42:50 +01:00
Ray
5ac9cb04c2 Reverted ChangeDirectory() redesign
It returns true on success again
2020-11-01 19:06:21 +01:00
Ray
01d9af12f7 REDESIGNED: ChangeDirectory()
Not returning error code (or success), just log if it fails
2020-11-01 18:14:55 +01:00
Ray
8e15dae5ed Review contributed examples 2020-11-01 13:39:48 +01:00
Ray
5f79ad9765 Update CHANGELOG 2020-11-01 13:38:42 +01:00
Dominus Iniquitatis
fc1fc250e7 A couple of little comment fixes (#1416) 2020-10-31 14:40:35 +01:00
Ray
8327857488 Update shaders_multi_sample2d.c 2020-10-31 11:49:19 +01:00
Ray
fbc51e822b REDESIGNED: Multiple sampler2D usage on batch system
New implementation allow enabling additional textures per batch only.
2020-10-31 11:48:44 +01:00
Ray
8a16348131 Support multiple sample2D on batch drawing #1333 2020-10-29 20:22:52 +01:00
Ray
60d874caf8 REVIEWED: GetWindowScaleDPI() #1086 2020-10-29 19:29:59 +01:00
Ray
37e2d993e7 Updated assets
Reduce size and better license CC0
2020-10-29 18:41:05 +01:00
Ray
2bcd3a6df5 Simplified example and resources sizes 2020-10-28 20:35:44 +01:00
Ray
d99ac093d4 Support additional texture units for default batch system #1333
This path requires some testing...
2020-10-26 20:13:08 +01:00
Ray
d9e591f235 Review some comments 2020-10-26 20:11:58 +01:00
raysan5
482b8a5e7e Some tweaks 2020-10-24 10:37:15 +02:00
Ray
88dbaae3be Update CHANGELOG 2020-10-21 23:32:24 +02:00
Ray
e820aae80b Added raylib 3.5 CHANGELOG -WIP- 2020-10-21 23:27:00 +02:00
Ray
f12db180cd Reviewed PR #1407 2020-10-21 11:08:37 +02:00
Chance Snow
9833fe45eb Added desktop cursor getter and setter functions (#1407)
* [core] Added desktop cursor getter and setter functions

* Example: Set mouse cursor in text input box

* Setup standard cursors _after_ GLFW window initialization

* Remove old `int GetMouseWheelMove` declaration
2020-10-21 10:55:52 +02:00
Rabia Alhaffar
eb3e9e4df5 Added version of raylib-cppsharp via used raylib license date! (#1413)
It's 2.5
@raysan5 Oh...There are 4 bindings has license date of 2016, But unsure if 1.6.0 or 1.5.0 or 1.4.0 :(

Co-authored-by: Ray <raysan5@gmail.com>
2020-10-21 00:13:39 +02:00
Rabia Alhaffar
5df08daa3f Added Boo bindings for raylib! (#1412) 2020-10-20 21:03:19 +02:00
kernelkinetic
3c9f7263e5 fixed mouse movements are bound to the screen resolution (https://github.com/raysan5/raylib/issues/1392) (#1410) 2020-10-13 22:26:40 +02:00
raysan5
fa357b8d5d Review undesired changes 2020-10-10 19:27:18 +02:00
raysan5
c62c4df749 Updated miniaudio #1402 2020-10-10 19:25:23 +02:00
chriscamacho
6ebf6b4e72 allow for multiple materials in obj files (#1408)
* allow for multiple materials in obj files also fix obj_loader hash map issues

* minor fix for warning

Co-authored-by: codifies <nospam@antispam.com>
2020-10-08 20:31:59 +02:00
Ray
41192c6d4a Replace 0.f by 0.0f 2020-10-05 20:19:18 +02:00
Doyle
b29311c7ca mouse: Return float movement for precise scrolling where possible (#1397) 2020-10-05 20:16:23 +02:00
Ray
a4ea9f872f Review "aggregate initializations" #1403 2020-10-05 20:04:33 +02:00
Daniel-Junior Dubé
a8685ee4fd Add Vector2Reflect to raymath.h (#1400)
Vector3Reflect exists but not Vector2Reflect. The code is pretty much the same.
I'm not sure what RMDEF does, but I added it to match other function definitions (haven't done much C programming, maybe I'm missing something). Can someone explain to me what it does?
2020-10-04 12:12:52 +02:00
Intasx
7e62d973f9 Add some bindings' versions (#1398)
Raylib-forever: 3.1-dev
It generates the c-to-nim bindings straight from the source.

nim-raylib: 3.1-dev
It uses Raylib-forever.

raylib-php: 3.0
Tested it using the provided binaries.

raylib-java: 2.0
Tested it using the provided binaries.
2020-10-02 08:01:21 +02:00
Tobias Jammer
0c29ca8166 Fix 1393 (#1395) 2020-09-29 17:57:28 +02:00
Ray
a850246030 Review Texture type
Texture type also maps to Texture2D and TextureCubemap
2020-09-28 00:40:32 +02:00
raysan5
446f9fff00 Added note 2020-09-27 11:14:49 +02:00
seanpringle
4bcddc3b15 [wip] rlDrawMeshInstanced (#1318)
* rlDrawMeshInstanced first attempt

* rlDrawMeshInstanced OpenGL 3.3 and VAO checks

* rlDrawMeshInstanced GetShaderAttribLocation; comments

* example instanced shader

* RLGL_STANDALONE RAYMATH_STANDALONE Vector4

* apply suggested naming changes; add instanced mesh example

* remove orphan variables
2020-09-27 10:29:05 +02:00
kernelkinetic
e90b4d8915 Platform DRM (#1388)
* updated README.md

* fixed CMakeLists.txt to allow building and debugging with Visual Studio Code and CMAKE Tools extension

* added PLATFORM_DRM
contains mouse pointer code from https://github.com/chriscamacho

* removed redundant cleanup in InitGraphicsDevice

* fixed DRM connector mode selection

* added choosen DRM connected mode to log output

* added respecting TargetFPS on DRM mode selection, default to 60

* added support for GetMonitorRefreshRate

* changed SUPPORT_MOUSE_CURSOR_RPI to SUPPORT_MOUSE_CURSOR_NATIVE

* changed avoidProgressive to allowInterlaced

* cleanup, function extraction and improved mode selection

* README reverted to original for PR

* line endings fixed for core.c

* removed old code

* mouse pointer reverted to small square

* replaced SetGraphicDeviceName() by DEFAULT_GRAPHIC_DEVICE_DRM

Co-authored-by: kernelkinetic <kernelkinetic@outlook.com>
2020-09-27 10:18:43 +02:00
raysan5
c2e56f2604 REVIEW: GenTextureCubemap(), avoid using models.c functions
- DrawCube() belongs to models.c -> rl*() alternative should be used
2020-09-26 11:51:42 +02:00
raysan5
b9053eebe7 Added new GIF recording library (not used yet) 2020-09-26 11:41:49 +02:00
raysan5
eef82b04ac REVIEW: Replace rlglDraw() calls by DrawRenderBatch() internal calls 2020-09-25 18:19:19 +02:00
raysan5
fe8bf2fa55 REVIEWED: GenTextureCubemap(), use rlgl functionality only
Function has been reviewed to avoid any direct OpenGL call and use rlgl functionality, also, GenDrawCube() has been replaced by the internal batch system with DrawCube().

WARNING: rlEnableTexture() call must be issued after enabling the current framebuffer when using batch mechanism because it includes a set of security checks to avoid batch overflow and push/pop matrix operations.
2020-09-25 18:14:46 +02:00
Adam Griffiths
b9ece86ffd Add join_paths and join prefix with include/lib dirs (#1383)
Fixes #1380: incorrect usage of CMake paths which causes issues
on some more complicated environments (NixOS especially).
2020-09-25 16:20:49 +02:00
raysan5
bd512764ff REVIEW: example: models_cubicmap_pbr #1384
It does not work properly yet but it compiles correctly
2020-09-23 14:19:10 +02:00
raysan5
4a97a5c63a Update models_skybox.c 2020-09-23 14:18:15 +02:00
raysan5
032b2db398 REVIEWED: GenTextureCubemap()
Added some tracelog messages
2020-09-21 13:18:53 +02:00
André L. Alvares
59bbba19a7 update raylib-nelua repository url (#1382)
The repository is not a mirror anymore.
2020-09-20 18:46:51 +02:00
coderoth
c05dbb4581 Updated joystick mappings with latest version of gamecontrollerdb (executed GenerateMappings.cmake), so that raylib can identify more joysticks (#1381) 2020-09-19 21:51:32 +02:00
raysan5
8d41683917 REVIEWED: models_skybox example
Now supports dynamic panoramic view, just drag and drop
2020-09-19 20:42:19 +02:00
raysan5
789c5fbdf9 Updated build script to generate .a on WebAssembly
This is the recommended way
2020-09-18 20:53:57 +02:00
raysan5
4a242c2889 Updated library build script for HTML5 (emscripten 2.0.4) 2020-09-18 20:48:25 +02:00
raysan5
b5d50ee51a EXAMPLE: models_skybox works on OpenGL ES 2.0 2020-09-18 20:47:39 +02:00
raysan5
79d63e6ca1 Review comment 2020-09-18 16:44:28 +02:00
raysan5
55204dae03 Review Makefile path 2020-09-18 16:43:48 +02:00
raysan5
152665ff48 REDESIGNED: GenTexture*() #721
Functions have been redesigned to use rlgl and allow to externalize them (aka removing them from rlgl because they use custom shaders...).
2020-09-18 13:50:51 +02:00
Ray
b7867fb10d Update raylib-pas binding version
Related to commit https://github.com/tazdij/raylib-pas/pull/15
2020-09-18 12:25:22 +02:00
raysan5
ccda320be4 REVIEWED: rlFramebufferAttach() to support texture layers
Required to attach multiple color textures and multiple cubemap faces
2020-09-18 11:37:57 +02:00
kernelkinetic
6038c8fdd5 fixed wrong error message for input device on RPI (#1379)
* fixed wrong error message for input device

* error message without errnofor input device on RPI
 to prevent from including additional header

Co-authored-by: kkl <klingenberger@bfmc.de>
2020-09-18 08:52:52 +02:00
raysan5
04406c0f1a Corrected minor framebuffer issue on OpenGL ES 2.0 2020-09-18 02:14:05 +02:00
raysan5
cdc8850e68 WARNING: REDESIGN of rlgl framebuffers API #721
This redesign allows more flexibility when creating RenderTexture and a simplification (and hopefully removal) of `GenTexture*()` functions, that should not belong to this model but the user code, due to the use of custom shaders.

Also, this new API opens the door for a possible GBuffers type and advance rendering possibilities...

Some functions of the API have been also simplified or even removed.

rlgl module can be used as an standalone library, so, a version for the library has been added: v3.1.0, matching current raylib version.
2020-09-18 02:11:49 +02:00
raysan5
fa2c114636 WARNING: struct RenderTexture2D: Removed depthTexture
Not required anymore, attachment type is queried when required
2020-09-17 13:44:03 +02:00
raysan5
6da3c1e7c3 Reverted previous change 2020-09-16 16:37:31 +02:00
raysan5
cbdb9bfe42 REVIEWED: UnloadShader() issue
Avoid unloading default shader, raylib will take care of it
2020-09-16 16:33:17 +02:00
raysan5
b870b9f828 Minor: remove tabs 2020-09-16 13:17:31 +02:00
raysan5
90befff4b8 Make sure to detach data before deleting
Before deleting certain objects, they must be detached from their parents. That's the case for shader objects after linkage to shader program and also for the texture/cubemaps/renderbuffers attached to framebuffers. If objects are deleted before detached, they are kept in memory to avoid accessing deleted data.
2020-09-16 13:17:16 +02:00
raysan5
11fbd49b73 Avoid GETCWD() warning #1371 2020-09-16 11:44:48 +02:00
raysan5
43d82c1f21 Add security checks when loading data from memory 2020-09-16 11:33:56 +02:00
raysan5
c5c156d65e Review GenDrawCube() and GenDrawQuad()
Better organized and commented
2020-09-15 13:44:04 +02:00
raysan5
2d96196d25 REVIEWED: SaveWAV() to use memory write insted of file 2020-09-15 13:17:10 +02:00
raysan5
405d3fac0c Corrected issue with floor() #1377 2020-09-15 11:40:51 +02:00
raysan5
0983d7b45c Solved issues when compiled for OpenGL 1.1 2020-09-15 11:30:20 +02:00
Ray
8cf0be4b6c Review memory loading functions signesness 2020-09-14 19:20:38 +02:00
raysan5
5073619962 REVIEWED: GetTextureData(), allow retrieving 32bit float data 2020-09-14 16:03:45 +02:00
raysan5
43b9113c0c Reverted some previous changes... 2020-09-14 15:55:31 +02:00
raysan5
d7853127db Reviewed some structs to reduce size and padding
Also updated raylib Wiki about struct sizes in 32bit and 64bit
2020-09-14 15:36:50 +02:00
ArnautDaniel
ddba31d423 Add Gforth bindings and update Factor bindings (#1375) 2020-09-13 21:37:55 +02:00
Ray
c196b09d33 Remove function declaration added by error 2020-09-13 16:43:19 +02:00
Ray
db652daf42 ADDED: LoadFontFromMemory() (TTF only) #1327 2020-09-13 16:42:31 +02:00
Ray
88c5deac87 WARNING: REDESIGNED: LoadFontData() 2020-09-13 16:41:52 +02:00
Ray
250a0e3592 Minor tweak 2020-09-13 16:40:34 +02:00
Ray
63b739bbfa Corrected issue on log 2020-09-13 16:01:51 +02:00
Ray
dace2172d1 Update cgltf library to v1.7 2020-09-13 15:55:48 +02:00
Ray
5b60a743bd ADDED: LoadWaveFromMemory() #1327 2020-09-13 15:38:57 +02:00
Ray
768b29dd74 ADDED: LoadImageFromMemory() #1327 2020-09-13 15:37:15 +02:00
Ray
cb8cbb038b WARNING: RENAMED: GetExtension() to GetFileExtension() 2020-09-13 14:07:08 +02:00
raysan5
f1ed8be5d7 REDESIGNED: ColorFromHSV()
Replaced Vector3 by direct values, easier to use and understand
2020-09-07 19:33:06 +02:00
raysan5
85d5744679 REVIEW: glfwSetWindowMaximizeCallback() not available on web 2020-09-07 15:34:21 +02:00
georgjz
311aa0ab58 Added Gambit Scheme to bindings (#1369) 2020-09-05 16:25:04 +02:00
Ray
6120ec9437 Added QuickJS-raylib version 2020-09-02 12:42:35 +02:00
Ray
4bc918fb9f Added some more versions to bindings 2020-09-02 11:27:59 +02:00
Rabia Alhaffar
17b01e3b7a Added more versions info! (#1366)
Co-authored-by: Ray <raysan5@gmail.com>
2020-09-02 11:03:54 +02:00
Rob Loach
900a28c165 Add versions for various bindings (#1365)
- raylib-cpp
- raylib-lua-sol
- node-raylib
- raylib-js
- raylib-chaiscript
- raylib-squirrel

Co-authored-by: Ray <raysan5@gmail.com>
2020-09-02 11:02:54 +02:00
Rabia Alhaffar
9781e1ca8f Update BINDINGS.md (#1364) 2020-09-02 00:02:50 +02:00
Ray
796f61d447 Added some versions... PLEASE HELP! 2020-09-01 23:31:12 +02:00
Ray
76ceb1daaa Added go-raylib binding and some versions 2020-09-01 23:27:27 +02:00
Ray
ed6d27f495 Add langauge links and version field (to be filled) 2020-09-01 23:17:46 +02:00
raysan5
1134024985 Update rlgl.h 2020-09-01 21:27:47 +02:00
raysan5
05cdaf7d01 MOVED: rlUnproject() [rlgl] -> Vector3Unproject() [raymath] 2020-09-01 21:08:45 +02:00
raysan5
a1422ba1c1 Review custom blend modes mechanism
rlBlendMode() has been added to rlgl to be used on BLEND_CUSTOM. This functionality is exposed to advance users.

In any case, new blending modes could be added if required.
2020-09-01 21:02:19 +02:00
cedemax
bfafb80cde Multiple blendmodes (#1324)
Co-authored-by: max <max.cedercreutz@cetopo.com>
2020-09-01 20:33:49 +02:00
Juan Medina
dcbe481a28 adding new windows functions (#1357) 2020-09-01 20:29:13 +02:00
Ray
e4d891fa37 Added some missing bindings 2020-08-31 18:54:04 +02:00
raysan5
ffe2364334 Update miniaudio to version 0.10.18 2020-08-30 20:01:38 +02:00
raysan5
8b5485f822 Remove unused variable 2020-08-30 20:00:56 +02:00
smaludzi
8d615a99f6 Added Never language to the list of bindings. (#1361) 2020-08-30 19:58:30 +02:00
Ray
103df6c408 Added raylib-ocaml 2020-08-29 18:42:40 +02:00
raysan5
945a02798b DrawTextEx(): Minor tweak 2020-08-29 13:57:59 +02:00
Ray
9da0656c2f Update CI badges links 2020-08-23 21:21:31 +02:00
raysan5
d0ebeb1713 Reorder some functions 2020-08-23 21:18:39 +02:00
raysan5
ea832628c4 Review last PR formatting to follow raylib standards 2020-08-23 21:10:59 +02:00
chriscamacho
d140dc81c0 work on quat and matrix math - deleted multiple copies of raymath.h causing issues (#1359)
Co-authored-by: codifies <nospam@antispam.com>
2020-08-23 21:01:26 +02:00
raysan5
816856eb75 Corrected compiling issue
When using USE_PTHREADS=1 on libraylib.bc compilation, program requires --shared-memory passed to the linker and despite it compiles, it fails on execution (at least for me).
2020-08-23 21:01:10 +02:00
Ray
c101f916fa Update README.md 2020-08-21 14:03:13 +02:00
Ray
94f32848b8 Update README.md 2020-08-21 14:02:27 +02:00
Ray
606a69ded7 Remove Android and HTML5 builds 2020-08-21 13:53:44 +02:00
Ray
f688ec6b51 Update webassembly.yml 2020-08-21 13:16:46 +02:00
Ray
89cf02ba56 Update macos.yml 2020-08-21 13:16:40 +02:00
Ray
b22a4ecdf9 Update windows.yml 2020-08-21 13:16:35 +02:00
Ray
a33111ae9d Update linux.yml 2020-08-21 13:16:32 +02:00
Ray
6b5f68af5e Update android.yml 2020-08-21 13:16:30 +02:00
Ray
336c6b7055 Update webassembly.yml 2020-08-21 13:03:15 +02:00
Ray
2d8e8a3b84 Update webassembly.yml 2020-08-21 12:53:04 +02:00
Ray
890ea77246 Update webassembly.yml 2020-08-21 12:48:59 +02:00
Ray
7bb92972d1 Update windows.yml 2020-08-20 20:53:32 +02:00
Ray
58ab0e462e Update windows.yml 2020-08-20 20:51:55 +02:00
raysan5
e785ca73b5 Review compilation parameter for objective C code on GLFW 2020-08-20 19:37:03 +02:00
raysan5
06ff1ce2aa Minor tweak for consistency 2020-08-20 19:31:54 +02:00
Ray
c1585dda02 Update linux.yml 2020-08-20 19:30:05 +02:00
Ray
b5f508c336 Update windows.yml 2020-08-20 19:23:42 +02:00
Ray
801e255a36 Update linux.yml 2020-08-20 19:21:51 +02:00
Ray
01563c2d48 Update windows.yml 2020-08-20 19:18:23 +02:00
Ray
58d452c78d Update linux.yml 2020-08-20 19:13:59 +02:00
Ray
c500b9c036 Update windows.yml 2020-08-20 19:10:38 +02:00
Ray
5ec0f68937 Update linux.yml 2020-08-20 19:05:17 +02:00
Ray
5c755d4afd Update windows.yml 2020-08-20 19:00:21 +02:00
Ray
74637ef884 Update linux.yml 2020-08-20 18:57:05 +02:00
Ray
3c85cea36e Remove AppVeyor badge 2020-08-20 18:54:51 +02:00
Ray
f5a6397a57 AppVeyor replaced by GitHub Actions 2020-08-20 18:51:41 +02:00
Ray
f6aa8f7c6d Update linux.yml 2020-08-20 18:50:23 +02:00
Ray
418e6f3e18 Update linux.yml 2020-08-20 18:44:21 +02:00
Ray
a55786c994 Update linux.yml 2020-08-20 18:37:38 +02:00
Ray
145803092b Update windows.yml 2020-08-20 18:34:22 +02:00
Ray
7d2243ea92 Update linux.yml 2020-08-20 18:31:16 +02:00
Ray
e54ed5fc58 Update windows.yml 2020-08-20 18:28:56 +02:00
Ray
00b7f08ca9 Update windows.yml 2020-08-20 18:23:37 +02:00
Ray
23ca58175e Update linux.yml 2020-08-20 18:22:43 +02:00
Ray
ed22e2f4a4 Update windows.yml 2020-08-20 18:17:14 +02:00
Ray
85aee79050 Update windows.yml 2020-08-20 18:12:50 +02:00
Ray
10c294a021 Update linux.yml 2020-08-20 18:11:44 +02:00
Ray
eedea1d2de Update windows.yml 2020-08-20 18:00:14 +02:00
Ray
784b24e35e Update linux.yml 2020-08-20 17:45:28 +02:00
Ray
7737085c1b Update windows.yml 2020-08-20 17:41:08 +02:00
raysan5
3490e0c1b4 Removed unneded PNG chunks 2020-08-20 17:40:28 +02:00
raysan5
45b28b9d3d Merge branch 'master' of https://github.com/raysan5/raylib 2020-08-20 17:37:20 +02:00
raysan5
b499b50154 Avoid architecture selection on gcc, use correct gcc version instead
Review raylib resource file for DLL compilation
2020-08-20 17:37:01 +02:00
Ray
c47fb0a463 Update windows.yml 2020-08-20 12:38:56 +02:00
Ray
d6a566da06 Update windows.yml 2020-08-20 12:34:10 +02:00
Ray
aa6c3c869d Update windows.yml 2020-08-20 12:28:32 +02:00
Ray
d43514a44d Update windows.yml 2020-08-20 12:21:38 +02:00
Ray
600d7b524d Update windows.yml 2020-08-20 12:16:03 +02:00
Ray
cb5e4f9b44 Update windows.yml 2020-08-20 12:09:43 +02:00
Ray
ec768bb83e Update windows.yml 2020-08-20 12:07:13 +02:00
Ray
9d74f27abd Update webassembly.yml 2020-08-20 12:03:07 +02:00
Ray
4f55d833d3 Update webassembly.yml 2020-08-20 00:23:55 +02:00
Ray
2d86705314 Update webassembly.yml 2020-08-20 00:13:15 +02:00
Ray
3352d54554 Update webassembly.yml 2020-08-20 00:10:52 +02:00
Ray
5876825bcd Update webassembly.yml 2020-08-20 00:05:23 +02:00
Ray
864ff48e11 Update linux.yml 2020-08-19 23:16:18 +02:00
Ray
9c00b1338c Update windows.yml 2020-08-19 23:13:48 +02:00
Ray
d64d017c1c Update android.yml 2020-08-19 20:06:34 +02:00
Ray
a91962b1de Update macos.yml 2020-08-19 19:55:11 +02:00
Ray
73d401b8d7 Update macos.yml 2020-08-19 19:50:47 +02:00
Ray
73c81455df Update macos.yml 2020-08-19 19:40:38 +02:00
Ray
2e50485a54 Update macos.yml 2020-08-19 19:30:35 +02:00
Ray
c577e7310c Update macos.yml 2020-08-19 19:27:16 +02:00
Ray
771ea1f9e0 Update macos.yml 2020-08-19 19:23:18 +02:00
Ray
18f98987be Update macos.yml 2020-08-19 19:12:17 +02:00
raysan5
249708dbb8 Support externally provided library name
It can be useful in some cases qhen compiling for multiple architectures
2020-08-19 19:11:18 +02:00
Ray
78f78e69ba Update android.yml 2020-08-19 18:48:44 +02:00
Ray
c119908c15 Update macos.yml 2020-08-19 18:48:16 +02:00
Ray
3178992889 Update linux.yml 2020-08-19 18:47:58 +02:00
Ray
f16b9267de Update webassembly.yml 2020-08-19 18:46:39 +02:00
Ray
c345a9a356 Update webassembly.yml 2020-08-19 18:08:09 +02:00
Ray
9d50f23f80 Update webassembly.yml 2020-08-19 18:04:03 +02:00
Ray
052c821102 Update webassembly.yml 2020-08-19 18:02:35 +02:00
Ray
59277566e3 Update webassembly.yml 2020-08-19 17:54:52 +02:00
Ray
14e12db675 Update android.yml 2020-08-19 17:39:43 +02:00
Ray
b0708c43bf Update README.md 2020-08-19 17:38:07 +02:00
Ray
7471eb11a7 Create webassembly.yml 2020-08-19 17:37:21 +02:00
Ray
f52c5cb9b5 Update windows.yml 2020-08-19 17:22:55 +02:00
Ray
1d6d58ef5b Update linux.yml 2020-08-19 17:22:15 +02:00
Ray
dfb1460236 Update macos.yml 2020-08-19 17:20:44 +02:00
Ray
33002a9e91 Update README.md 2020-08-19 17:07:29 +02:00
Ray
fdc875a579 Update android.yml 2020-08-19 16:52:11 +02:00
raysan5
1e9de0f9ff Review Android arch names to lowercase 2020-08-19 16:51:43 +02:00
Ray
ba547648df Update android.yml 2020-08-19 16:43:12 +02:00
raysan5
44dd1fc7f5 Trying to configure android_native_app_glue target compilation 2020-08-19 16:30:33 +02:00
raysan5
48f0dfa18e Update Makefile 2020-08-19 16:25:51 +02:00
raysan5
ac0362d30e Update Makefile 2020-08-19 16:17:27 +02:00
raysan5
687187b5cf Merge branch 'master' of https://github.com/raysan5/raylib 2020-08-19 16:13:28 +02:00
raysan5
34c8f4c39c Update Makefile 2020-08-19 16:13:16 +02:00
Ray
1bea69001c Update android.yml 2020-08-19 15:58:52 +02:00
Ray
4d627a29ad Update android.yml 2020-08-19 15:54:06 +02:00
Ray
467ef87a76 Update android.yml 2020-08-19 15:50:32 +02:00
Ray
2217b93f30 Update android.yml 2020-08-19 15:47:54 +02:00
raysan5
cc8626f6bb Update Makefile 2020-08-19 15:47:36 +02:00
Ray
0c76431efb Update android.yml 2020-08-19 15:37:49 +02:00
Ray
028a86cc53 Update android.yml 2020-08-19 15:34:19 +02:00
Ray
f7d37292a6 Update android.yml 2020-08-19 15:31:21 +02:00
Ray
97a40e6140 Update android.yml 2020-08-19 15:29:03 +02:00
Ray
5df73fe627 Update android.yml 2020-08-19 15:22:38 +02:00
raysan5
6760338eb0 Merge branch 'master' of https://github.com/raysan5/raylib 2020-08-19 15:21:34 +02:00
raysan5
1316183b3a Trying to automate Android building... 2020-08-19 15:21:20 +02:00
Ray
606f4ea47c Update android.yml 2020-08-19 15:14:22 +02:00
Ray
39e267c029 Create android.yml 2020-08-19 14:05:13 +02:00
raysan5
3416858d1c Update Makefile 2020-08-19 14:04:53 +02:00
raysan5
0d05004468 Added resource file for DLL compilation info 2020-08-19 11:59:50 +02:00
Ray
391a23ad84 Update README.md 2020-08-19 11:37:14 +02:00
raysan5
d98c471883 Add LDFLAGS when required 2020-08-19 11:25:13 +02:00
Ray
903b7b5213 Update README.md 2020-08-19 11:13:33 +02:00
Ray
71bd9f04fe Update macos.yml 2020-08-19 10:43:48 +02:00
Ray
5427e08c18 Update macos.yml 2020-08-19 10:39:57 +02:00
raysan5
05b3ca0a83 Update Makefile 2020-08-19 10:38:53 +02:00
Ray
721f015e07 Update linux.yml 2020-08-19 10:36:25 +02:00
Ray
d875ea4d24 Update macos.yml 2020-08-19 10:35:05 +02:00
Ray
0fc897e82f Update macos.yml 2020-08-19 10:32:56 +02:00
raysan5
d90767ad83 Delete ci_src_examples_win.yml.disabled 2020-08-19 10:04:17 +02:00
raysan5
861fd68bda Delete cd_src_release.yml.disabled 2020-08-19 10:03:00 +02:00
Ray
9436b63f5f Update macos.yml 2020-08-19 10:00:19 +02:00
Ray
f3091185ca Update linux.yml 2020-08-18 15:24:20 +02:00
Ray
279182ca14 Update linux.yml 2020-08-18 15:21:42 +02:00
Ray
db8927f6b1 Update linux.yml 2020-08-18 15:17:10 +02:00
Ray
0d0c3d2504 Update linux.yml 2020-08-18 15:05:32 +02:00
Ray
a142e7c3d0 Update linux.yml 2020-08-18 14:45:17 +02:00
Ray
96e4f369bd Update linux.yml 2020-08-18 14:17:11 +02:00
Ray
b6bd00ebff Update macos.yml 2020-08-18 14:12:55 +02:00
Ray
0f5b01eb73 Update windows.yml 2020-08-18 14:07:55 +02:00
Ray
6c9e6cb097 Update linux.yml 2020-08-18 14:03:05 +02:00
Ray
a29f0695ef Update linux.yml 2020-08-18 13:53:40 +02:00
Ray
3d24dbc7b4 Update windows.yml 2020-08-18 13:51:25 +02:00
Ray
2a198651de Update linux.yml 2020-08-18 13:40:11 +02:00
Ray
eb656a1982 Update windows.yml 2020-08-18 13:24:46 +02:00
Ray
53f3103a93 Update linux.yml 2020-08-18 13:20:48 +02:00
Ray
c1ee4c3e7e Update windows.yml 2020-08-18 13:11:32 +02:00
Ray
3fb0fa673a Update windows.yml 2020-08-18 13:00:59 +02:00
Ray
5552323553 Update windows.yml 2020-08-18 00:52:02 +02:00
Ray
122f86b4c5 Update windows.yml 2020-08-18 00:39:57 +02:00
Ray
45dad5d903 Update windows.yml 2020-08-18 00:37:19 +02:00
Ray
b6e0766d86 Update windows.yml 2020-08-18 00:35:29 +02:00
Ray
28917c0d14 Update windows.yml 2020-08-18 00:31:50 +02:00
Ray
0b366ec4b6 Update windows.yml 2020-08-18 00:24:53 +02:00
Ray
337068dad0 Update windows.yml 2020-08-18 00:23:40 +02:00
Ray
e41ba55036 Update windows.yml 2020-08-18 00:15:33 +02:00
Ray
84103ae936 Update windows.yml 2020-08-17 23:41:17 +02:00
Ray
9ef1ef93e7 Update windows.yml 2020-08-17 23:26:28 +02:00
raysan5
ab8ec9adad Support multiple build architectures (x86, x64) 2020-08-17 23:23:42 +02:00
Ray
8af787cabc Update windows.yml 2020-08-17 23:01:17 +02:00
Ray
d64f5ee02a Update windows.yml 2020-08-17 22:53:44 +02:00
Ray
6f98c0c9b6 Update windows.yml 2020-08-17 22:49:03 +02:00
Ray
eb8cf7e4d2 Update windows.yml 2020-08-17 22:48:12 +02:00
Ray
5f78b78489 Update windows.yml 2020-08-17 22:42:34 +02:00
raysan5
5c097b26d4 Merge branch 'master' of https://github.com/raysan5/raylib 2020-08-17 22:41:38 +02:00
raysan5
090490389e Improved Makefile clean on Windows 2020-08-17 22:41:26 +02:00
Ray
cd1b71b3f9 Update windows.yml 2020-08-17 22:27:44 +02:00
raysan5
921f0c02e2 Update Makefile 2020-08-17 22:27:22 +02:00
Ray
f618c41061 Update windows.yml 2020-08-17 21:54:39 +02:00
Ray
38d4768cdd Update windows.yml 2020-08-17 21:42:37 +02:00
Ray
f86126aaea Update windows.yml 2020-08-17 21:25:16 +02:00
Ray
e7f507c204 Update windows.yml 2020-08-17 21:20:02 +02:00
Ray
c6ddaaf953 Update windows.yml 2020-08-17 21:10:34 +02:00
Ray
ebeee7ebed Update windows.yml 2020-08-17 21:07:03 +02:00
Ray
6df0f2c535 Update linux.yml 2020-08-17 21:05:42 +02:00
Ray
1d9cdc1d83 Update macos.yml 2020-08-17 21:04:58 +02:00
Ray
be6e1e7c06 Update macos.yml 2020-08-17 21:04:20 +02:00
Ray
6f012d44d4 Update linux.yml 2020-08-17 21:03:58 +02:00
Ray
ceea5cb99b Update and rename ci_src_examples_linux.yml to linux.yml 2020-08-17 21:02:56 +02:00
Ray
62302b1f71 Update and rename ci_src_examples_macos.yml to macos.yml 2020-08-17 20:54:10 +02:00
Ray
18aef2f781 Rename ci_src_examples_win.yml to ci_src_examples_win.yml.disabled 2020-08-17 20:49:04 +02:00
Ray
4fd227527e Rename cd_src_release.yml to cd_src_release.yml.disabled 2020-08-17 20:48:44 +02:00
Ray
2dd4ab9535 Update windows.yml 2020-08-17 20:47:58 +02:00
Ray
a96b2b5b0d Update windows.yml 2020-08-17 20:46:25 +02:00
Ray
e3709a9754 Create windows.yml 2020-08-17 20:40:17 +02:00
raysan5
2d0811d94c Update Makefile 2020-08-17 20:38:06 +02:00
raysan5
c32ae480af RENAMED: FormatText() -> TextFormat()
This function was renamed for consistency in raylib 3.0, just unified all examples to use TextFormat() instead of FormatText()
2020-08-16 11:28:15 +02:00
raysan5
26f6a64a39 NEW EXAMPLE: shaders_hot_reloading #1198 2020-08-16 11:18:25 +02:00
raysan5
ebdeab7e25 Code reorganization on example 2020-08-16 11:17:33 +02:00
Ray
7b346dbbe1 Review issue with .fnt -> .png path #1351
When .fnt file is in the .exe path, image path was wrongly calculated
2020-08-15 11:32:23 +02:00
Ray
902a97f540 Update BINDINGS.md 2020-08-15 11:00:32 +02:00
Ray
53b17765f4 Added raylib-luajit 2020-08-13 10:53:09 +02:00
Gaëtan Blaise-Cazalet
810f51b3e7 Change raylib version for VSCode mingw project makefile (#1347) 2020-08-12 15:04:17 +02:00
raysan5
ad1b3330b7 Support mulstiple WAV sampleSize for MusicStream #1340
24bit per sample is not supported internally and automatically converted 16bit
2020-08-11 19:08:07 +02:00
Henrique de Lima
702341ae6e Making the windows build script a bit faster by verifying if the msvc environment was set up previously and only setting it up if it wasn't (#1346) 2020-08-10 21:08:51 +02:00
Ray
959d0d2591 Review Makefiles for WEB compilation 2020-08-08 14:08:56 +02:00
Ahmad Fatoum
1841a6bd3b CMake: allow spaces in CMAKE_INSTALL_PREFIX
We use @CMAKE_INSTALL_PREFIX@ in the pkg-config template, but the way we
use it breaks when used with a path containing a space. Use quote to fix
this. This now means, we probably can't have quotes, but that's of
lesser concern.
2020-08-08 01:11:45 +02:00
Ahmad Fatoum
6108ba89df CMake: don't use raylib_static name for MinGW on Windows
There are no *.lib files that could overwrite each other when building
both static and shared versions of raylib at once. So just use the
normal library name without _static suffix.
2020-08-08 01:11:45 +02:00
raysan5
2c7dc70878 Reset close status for next frame #1339 2020-08-06 11:47:46 +02:00
Ray
2d866d5118 Added raylib-jai 2020-08-05 12:19:13 +02:00
Rfaile313
9e75f870bb Update Makefile for web (#1332)
When you install emsdk out of the box, the directory is no longer `$(EMSDK_PATH)/python/33.7.4_64bit` but rather `$(EMSDK_PATH)/python/3.7.4-pywin32_64bit` noting the `3.7.4-pywin32_64bit` change on the last file.

Thus, without adjusting this in the raylib Makefile it will throw an error:

```
PS C:\raylib\raylib\src> make PLATFORM=PLATFORM_WEB -B                                                                  emcc -c core.c -Wall -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -std=gnu99 -Os -s USE_GLFW=3 -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2              '"python"' is not recognized as an internal or external command,                                                        operable program or batch file.  
```

However, changing this line in the Makefile compiles raylib for web as expected

`"raylib library generated (libraylib.bc)!"`
2020-08-02 20:21:59 +02:00
raysan5
168948d91d Update raudio_standalone.c 2020-07-31 12:31:40 +02:00
raysan5
7eb6cb470b Update raudio_standalone.c 2020-07-31 12:13:10 +02:00
raysan5
6e9e7bd6bc LoadSound(): Use memory loading (WAV, OGG, MP3, FLAC) #1312 2020-07-31 12:13:04 +02:00
Adrie
3c095f9d34 Fix color of ambient light (#1330) 2020-07-30 12:51:58 +02:00
seanpringle
1d895616f7 rlCheckErrors (#1321)
* rlglCheckErrors

* rlglCheckErrors LOG_WARNING

* rename to rlCheckErrors; improve messages; revert core.c
2020-07-30 12:50:20 +02:00
raysan5
9c2ff464b0 Support pthreads on PLATFORM_WEB compilation 2020-07-28 20:36:10 +02:00
raysan5
20301d1e5d Corrected issue with framebuffer size storage #1298 2020-07-28 11:44:45 +02:00
raysan5
488c60d139 Small shader fix on vec3 initialization #1298 2020-07-28 11:27:05 +02:00
Ray
b5eb104b08 Consider empty title for window #1323 2020-07-24 18:20:37 +02:00
Ray
14d37464ad DrawTriangleFan(): Add a comment about vertex order #1316 2020-07-22 11:12:04 +02:00
seanpringle
cebcdea80f [wip] MeshNormalsSmooth() (#1317)
* MeshSmoothNormals() by average

* wrong comment

* spelling

* use correct function naming convention
2020-07-20 11:05:18 +02:00
raysan5
6ec847a93f Find a better mechanism to avoid FBO on OpenGL 2.1 if required #1290 2020-07-17 19:41:38 +02:00
raysan5
feedf332a8 Issue with render size assignment on RPI/Android #1314 2020-07-17 18:39:31 +02:00
raysan5
642f42bb4f Reviewed comment in LoadIQM() #1315 2020-07-17 18:22:09 +02:00
seanpringle
bdd253a66a clamp ray hit y position to ground plane height (#1311) 2020-07-15 11:13:03 +02:00
Random
7760575d3f fix emcc warning (-Wparentheses-equality) (#1310) 2020-07-14 21:25:21 +02:00
raysan5
6fb5207694 Update resources LICENSE 2020-07-14 19:17:08 +02:00
raysan5
67acb0f840 Update audio resources LICENSE 2020-07-14 19:11:09 +02:00
raysan5
dd5f448f25 Update Makefile Android 2020-07-14 19:09:58 +02:00
raysan5
0b52c57a24 Update Makefile emsdk paths 2020-07-14 19:07:51 +02:00
raysan5
d2d50bc60f Update miniaudio to v0.10.14 2020-07-14 18:59:00 +02:00
seanpringle
a9d676a5fd scale perspective top calc for near culing plane (#1309) 2020-07-14 10:36:22 +02:00
raysan5
bf429a0058 Remove conditional __EMSCRIPTEN__
Not required anymore
2020-07-13 18:57:46 +02:00
Random
4de362b405 Updated miniaudio to v0.10.13, fixes emscripten compilation error (#1306) 2020-07-13 18:56:17 +02:00
raysan5
0db0e6acd8 WARNING: REMOVED: LoadImageEx()
Reason for removal: This function forces a specific Image data format, it copies data internally (it could be confusing and lead to memory leaks), it's redundant, there is a simpler alternative and raylib promotes using structures directly
2020-07-10 19:18:29 +02:00
raysan5
7199dd570f REVIEW: Pointer lock emscripten API does not work #1241
It seems some internals change recently due to web security reasons and some emscripten HTML5 funtionalities like pointerLock or fullscreen modes behave very weird or just don't work as expected
2020-07-10 18:23:17 +02:00
raysan5
3f4c6fee11 Correct issue when not supporting GIF format 2020-07-10 17:24:37 +02:00
raysan5
c57323f29c ADDED: LoadImageAnim() to load animated sequence of images 2020-07-10 13:59:01 +02:00
raysan5
fa7799143e Update miniaudio to v0.10.12, solves #1288 2020-07-10 13:29:42 +02:00
raysan5
57dc8a91dd Disable FBO support on OpenGL 2.1 #1290 2020-07-10 13:14:56 +02:00
Random
86a8f1d5d5 Chromium needs a larger audio buffer (#1300)
* Chromium needs a larger audio buffer: https://github.com/dr-soft/miniaudio/issues/150

* changed PLATFORM_WEB to __EMSCRIPTEN__
2020-07-10 12:34:35 +02:00
raysan5
b4ff6fdde3 Review skybox shaders 2020-07-10 12:20:57 +02:00
raysan5
956f61cf14 Merge branch 'master' of https://github.com/raysan5/raylib 2020-07-10 12:20:40 +02:00
raysan5
0877019fb6 Review comment 2020-07-10 12:15:52 +02:00
Daniel Jour
2d4956feeb Fix format-security error in rlgl_standalone.c (#1305)
See #1304
2020-07-10 11:17:46 +02:00
Terry Nguyen
871cd1a76a Free leaked allocations from render objects (#1302) 2020-07-09 20:42:20 +02:00
Doyle
00fda3be65 Fix incorrect color transform to 255 space (#1297) 2020-07-05 20:02:32 +02:00
Ray
6832da5aa7 Update SPONSORS.md 2020-07-04 11:49:54 +02:00
Ray
5986eee6ab Expose additional configuration options
Some internal defines have been exposed in config.h
2020-06-30 11:05:09 +02:00
Ray
00557df17f Update SPONSORS.md 2020-06-29 21:15:27 +02:00
Vlad Adrian
4d71e9b44f Added new function DrawTextureTiled() (#1291)
* Implemented DrawTextureTiled()

* Example added
2020-06-27 23:59:14 +02:00
Ray
eae6e6a828 Minor format tweak 2020-06-27 14:11:21 +02:00
Ray
5b294b7cff Corrected issue with OpenGL 1.1 support 2020-06-27 14:10:53 +02:00
Ray
03846342bb Update SPONSORS.md 2020-06-25 16:50:51 +02:00
Ray
ba39a1b304 ADDED: UpdateTextureRec() 2020-06-25 16:26:59 +02:00
Shylie
25fb24ba7d [add] GetMonitorRefreshRate(int monitor); (#1289) 2020-06-24 18:28:57 +02:00
Ray
be80708d41 REVIEWED: textures_raw_data #1286 2020-06-23 01:06:05 +02:00
Ray
38530ebf12 REVIEWED: ToggleFullscreen(), issue #1287 2020-06-23 00:39:06 +02:00
Ray
bd13d4a471 Add missing include 2020-06-23 00:33:51 +02:00
raysan5
e18c4c1158 REVIEWED: ColorAlphaBlend(), support tint color 2020-06-20 23:32:32 +02:00
Reece Mackie
6b94ce2204 [UWP] Fix time query precision (#1284) 2020-06-20 21:13:32 +02:00
raysan5
7ed7116e27 REVIEWED: ColorAlphaBlend(), integers-version, optimized #1218 2020-06-20 19:57:09 +02:00
raysan5
5a862bce29 REVIEWED: ImageDraw(), consider negative source offset properly #1283 2020-06-20 18:49:15 +02:00
raysan5
da582e2eec REVIEWED: ImageDraw() #1283 2020-06-20 18:10:21 +02:00
peppemas
0e26d514b8 Fix bug #1270 (#1282)
* Fix bug #1270

Added an argument to the shader in order to flip the texture

* Fix Bug #1270

* Fix bug #1270
2020-06-20 17:55:56 +02:00
Ray
c833644a0e Update SPONSORS.md 2020-06-19 13:42:23 +02:00
raysan5
c078640fa5 Commented Fade() macro 2020-06-16 10:37:31 +02:00
raysan5
afcc584fb6 RE-ADDED: Fade() function to avoid multiple breaking changes
Probably there is a better way to do this but this is a temporary solution for backward compatibility
2020-06-16 10:36:05 +02:00
raysan5
589d606000 REDESIGNED: ImageDraw(), optimized #1218
After multiple tests and lot of redesign, current implementation is the fastest one. It also considers several fast-paths for maximum speed!
2020-06-15 12:06:41 +02:00
raysan5
32c0a7a135 Small code optimization 2020-06-15 12:05:03 +02:00
raysan5
bfa6544030 REDESIGNED: ImageResize(), optimized #1218 2020-06-15 12:04:18 +02:00
raysan5
691c1f9391 REDESIGNED: ImageFromImage(), optimized #1218 2020-06-15 12:03:33 +02:00
raysan5
ad954dc7ab WARNING: BIG CHANGE: Move Color functions to texture module
WARNING: Some functions ADDED and some RENAMED:
- RENAMED: Fade() -> ColorAlpha() [Added #define for compatibility]
- ADDED: ColorAlphaBlend()
- ADDED: GetPixelColor()
- ADDED: SetPixelColor()
2020-06-15 12:02:50 +02:00
raysan5
ec09fea29a REDESIGNED: ImageDraw(), optimization #1218
Trying a new optimization approach, some additional functions added, they will be probably exposed soon.
2020-06-11 22:47:25 +02:00
raysan5
15bfe44e73 REVIEWED: ImageDraw(), optimizations test #1218
Despite all the effort put on function optimization, dealing with alpha blending is complex, considering src and dst could have different pixel format...
2020-06-11 12:47:47 +02:00
raysan5
a6e6a99cb6 REDESIGNED: ImageAlphaClear(), optimized #1218 2020-06-10 23:10:16 +02:00
raysan5
4745ebeed5 REVIEWED: ImageResizeCanvas(), optimization #1218
Optimized to avoid ImageCrop() calls, now we define the source image rectangle and we just copy that data over the new canvas.
2020-06-10 21:21:37 +02:00
raysan5
dea0279a74 REVIEWED: ExportImage(), optimized 2020-06-09 19:52:10 +02:00
raysan5
7ef0fb4192 REVERTED: ExportImage() changes
Always using RGBA for now.
2020-06-08 21:18:42 +02:00
raysan5
82f7dd017e REVIEWED: ImageAlphaPremultiply(), optimization 2020-06-08 18:24:53 +02:00
raysan5
40bc6afdbd REVIEWED: ImageAlphaClear(), minor optimization 2020-06-08 18:23:59 +02:00
Chang Si Yuan
6264c4901b Fix wrong height used when using scissor mode with render texture of different height from window (#1272) 2020-06-08 10:32:23 +02:00
Chang Si Yuan
73cc33b493 Fix extra memory allocated when updating color buffer in mesh (#1271) 2020-06-08 10:31:39 +02:00
raysan5
87592e2625 Update textures.c 2020-06-07 20:32:43 +02:00
raysan5
d0e9228660 REDESIGNED: ImageResizeCanvas(), optimized #1218 2020-06-07 18:33:30 +02:00
raysan5
a9fb0aa207 ImageToPOT() renamed parameter 2020-06-07 18:32:20 +02:00
raysan5
b5174a9990 REVIEWED: ImageCrop() #1218
Further optimization, moving data line-by-line
Old optimization left for reference
2020-06-07 12:57:57 +02:00
raysan5
b7d53ce314 REVIEWED: ImageToPOT() #1218
Using ImageResizeCanvas()
2020-06-07 12:56:47 +02:00
raysan5
78c3d619f9 REVIEWED: ImageAlphaCrop() #1218
Now uses GetImageAlphaBorder()
2020-06-07 12:33:42 +02:00
raysan5
02ff68e1a3 REDESIGNED: ImageCrop(), optimized #1218 2020-06-07 12:16:27 +02:00
raysan5
7cf1e76d53 REVIEWED: ExportImage(), optimized #1218
Avoid GetImageData() retrieval and free
2020-06-07 11:57:22 +02:00
raysan5
776e4a37ef REDESIGNED: ImageRotateCCW(), optimized #1218 2020-06-07 11:53:13 +02:00
raysan5
79e2fbe0c6 REDESIGNED: ImageRotateCW(), optimized #1218 2020-06-07 11:52:55 +02:00
raysan5
d278eae4a3 REDESIGNED: ImageFlipHorizontal(), optimized #1218
Added several optimized options for future reference (if required)
2020-06-07 11:52:21 +02:00
raysan5
93d6dd3023 REDESIGNED: ImageFlipVertical(), optimized #1218 2020-06-07 11:51:26 +02:00
raysan5
5d0b2c796e Remove warning from GetDirectoryPath() 2020-06-07 11:50:03 +02:00
raysan5
992fefa823 Merge branch 'master' of https://github.com/raysan5/raylib 2020-06-07 11:49:24 +02:00
raysan5
0fda4b1183 Update raysan.png 2020-06-07 11:49:10 +02:00
frithrah
e07512e213 Fixed buffer overflow in GenMeshPoly (#1269)
Co-authored-by: frithrah <simon@frithrah.com>
2020-06-05 19:13:31 +02:00
raysan5
00af1c0607 Update explosion.png 2020-06-03 01:30:07 +02:00
raysan5
9ce838806b [examples] Review/change audio resources 2020-06-03 01:29:24 +02:00
raysan5
6b9e49e965 [example] Update textures_sprite_explosion 2020-06-03 00:07:13 +02:00
raysan5
5867a63068 Update textures_sprite_button.png 2020-06-03 00:06:52 +02:00
raysan5
d8e079dad3 [example] Update textures_particles_blending 2020-06-03 00:06:47 +02:00
raysan5
3792951023 REVIEWED: GetPixelDataSize() to consider compressed data properly 2020-06-02 23:08:34 +02:00
raysan5
a4333035c7 Use TRACELOG() macro instead of TraceLog() function 2020-06-02 23:07:42 +02:00
raysan5
b00ab118c6 [examples] text_font_sdf - Corrected bug 2020-06-02 23:07:11 +02:00
raysan5
8a501ef06d Review some png images 2020-06-02 12:58:46 +02:00
raysan5
82fca43406 Replaced some resources for better licensing
Some resources used in examples have not a clear license, so, I'm replacing some of them for clearly licensed versions or resources created by me under CC0. License file to be added.
2020-05-31 23:31:43 +02:00
branlix3000
0e1d7d6430 Fixing Android build from Linux. Letting ANDROID_NDK to be modified at compile time. Default path to the ANDROID_TOOLCHAIN have changed in the latest Android command-line tools release. (#1264)
Co-authored-by: Branlix 3000 <branlix@3000.3k>
2020-05-31 21:18:33 +02:00
raysan5
fed4716c3b resources PNG chunks cleaning 2020-05-28 21:18:58 +02:00
raysan5
15e1e9ba24 Added resources license 2020-05-28 21:17:40 +02:00
raysan5
64747478fe Renamed some resources for naming consistency 2020-05-28 21:17:16 +02:00
raysan5
36a15a745c Remove unused font 2020-05-28 21:16:13 +02:00
jvocaturo
6e84120b89 fix bug in QuaternionFromVector3ToVector3 (#1263) 2020-05-27 17:52:23 +02:00
raysan5
c43e889e39 Corrected bug on TextJoin() 2020-05-27 13:45:11 +02:00
ChrisDill
aff47d1564 Added bool IsCursorOnScreen(void). (#1262)
- The Mouse struct already stores cursorOnScreen. This function simply exposes it to the usage code.
2020-05-26 11:59:25 +02:00
Ray
ae334e9a6e Update SPONSORS.md 2020-05-25 23:56:22 +02:00
raysan5
1c5df677e1 REDESIGNED: ExportWaveAsCode() to use memory buffer 2020-05-24 15:48:07 +02:00
raysan5
b0f245d8c5 Review ExportImageAsCode() comment 2020-05-24 15:47:15 +02:00
raysan5
8120547639 Added LoadWAV()/SaveWAV() memory buffer sample code
It could be useful in a future...
2020-05-24 00:20:32 +02:00
raysan5
a6fcd32339 Support WAV music streaming #1198
Switched custom WAV laoding/saving funtionality to drwav library, it also provides the required mechanisms to stream wav data.
2020-05-23 23:19:59 +02:00
raysan5
427e543d84 Corrected issue
Compression API requires functions provided by stbi_image_write (DEFLATE compression)
2020-05-23 23:17:34 +02:00
raysan5
fe5fe230b9 Update dr_wav.h 2020-05-23 23:16:40 +02:00
raysan5
394bf00ba5 REDESIGNED: ExportMesh() to use memory buffer #1232
This change could introduce an issue on dataSize precalculation...
2020-05-23 19:48:40 +02:00
raysan5
4e8e90b6df Add note comment on ExportImageAsCode() 2020-05-23 19:46:58 +02:00
raysan5
0bcb892975 REDESIGNED: LoadIQM(), LoadModelAnimations() to use mem buffers 2020-05-23 19:24:15 +02:00
raysan5
94789dd24a Review usage of sizeof(), unify conventions
All functions requiring sizeof() now follow the same convention:

NUM_ELEMENTS*NUM_SUBELEMENTS*sizeof()
2020-05-23 19:23:40 +02:00
raysan5
b95673f701 Use RL_FREE() instead of free() 2020-05-23 19:21:46 +02:00
raysan5
d3dece3343 REDESIGNED: ExportImageAsCode() to use memory buffer #1232 2020-05-23 18:24:53 +02:00
raysan5
c1e0978555 Replaced strncat() by memcpy() in some functions 2020-05-23 18:05:41 +02:00
raysan5
795c079c55 Corrected issues on LoadPKM() 2020-05-23 18:04:58 +02:00
Karlo Licudine
a33dd87c99 Added Blend Modes example. (#1261) 2020-05-22 02:30:23 +02:00
raysan5
c1bb051e61 Avoid some warnings 2020-05-22 02:26:47 +02:00
raysan5
76f8e84901 Reviewed LoadBMFont() to load data from memory #1232 2020-05-22 02:19:45 +02:00
raysan5
70cd2f1edf Tweak 2020-05-22 02:18:50 +02:00
raysan5
0e56bc2929 Replace file accesses by memory accesses
Several functions used to load external files have been reviewed to just load the full file with LoadFileData() and load data from memory from there. This way all file access functionality is centralized in utils module.

Functions reviewed: LoadDDS(), LoadPKM(), LoadKTX(), LoadPVR(), LoadASTC(), SaveKTX()
2020-05-22 01:47:30 +02:00
raysan5
a2955bc5b3 Corrected issue with multichannel on CloseAudioDevice() 2020-05-22 00:32:23 +02:00
raysan5
cdbe1b6190 Review buffer limits on rectangle drawing 2020-05-21 18:57:45 +02:00
raysan5
b3eea3d322 Avoid loading texcoords and normasl from model if not existent 2020-05-18 18:35:47 +02:00
raysan5
6acb7bcfe4 Avoid glGetStringi() on OpenGL 2.1 2020-05-18 13:24:21 +02:00
Random
d9a96c4ca0 added BLEND_SET (#1251)
* added BLEND_SET

* renamed BLEND_SET to BLEND_ADD_COLORS
2020-05-16 13:39:38 +02:00
Noor Wachid
abb94bd2ff Adding Normalize and Remap functions (#1247)
* Adding Norm and Remap functions

// Normalize input value within input range
// Remap input value within input range to output range

* Rename Norm to Normalize

To make it uniforms with Raylib's functions

* Calculate Remap without other functions
2020-05-15 13:08:28 +02:00
raysan5
b897ae092a ADDED: Ecample: embedded files loading 2020-05-14 23:58:36 +02:00
ThePituLegend
d14c51aa2a Introduced Vector2 and Vector3 Square Lenght. (#1248)
* Introduced Vector2 and Vector3 Square Lenght.

* Square length functions renamed
2020-05-14 22:31:58 +02:00
raysan5
7b001164ef Review formatting GetPRevDirectoryPath() 2020-05-14 17:37:54 +02:00
raysan5
64d44d131d Emscripten fullscreen -WIP- 2020-05-14 17:35:26 +02:00
ivn
730375faf7 fix bug in GetPrevDirectoryPath on Unix-like systems (#1246) 2020-05-14 17:30:32 +02:00
raysan5
257f232d41 WARNING: BREAKING CHANGE: Review audio looping system
Current looping system was broken, `loopCount` has been converted to `bool looping` and user can enable/disable with `music.looping = false`. `SetMusicLoopCount()` has been removed.
2020-05-14 14:00:37 +02:00
raysan5
3a33fe0fd9 Avoid LoadImageEx() usage internally
At this point LoadImageEx() could be removed from raylib... still thinking about it...
2020-05-14 13:37:52 +02:00
raysan5
65b7047111 Remove some [textures] function dependencies
- LoadFontDefault() -> Some code simplifications
 - LoadFontFromImage() -> Avoid LoadImageEx()
 - LoadFontData() -> Avoid GenImageColor(), ImageFormat()
 - LoadBMFont() -> Avoid ImageCopy(), ImageFormat()
2020-05-14 13:36:22 +02:00
raysan5
ca6016cc71 TextToInteger() always exposed 2020-05-14 13:32:57 +02:00
raysan5
4ec40e720c GenMeshCubicmap() added comments and simplification 2020-05-11 17:54:23 +02:00
Ray
45450db45a Update BINDINGS.md 2020-05-11 13:58:28 +02:00
Ray
d7b0422769 Update BINDINGS.md 2020-05-11 13:43:58 +02:00
GoldenThumbs
763aa5b8a2 Fixed Generated Normals for GenMeshCubicmap (#1244)
Just flipped the signs of `n5` and `n6` at lines `2021` and `2022`.
2020-05-11 11:41:21 +02:00
raysan5
4e3ab8f27d Update config.h.in 2020-05-09 17:37:02 +02:00
raysan5
3a4e3d8747 Update CMakeOptions.txt 2020-05-09 17:36:16 +02:00
raysan5
3a6af2cc57 Remove SUPPORT_IMAGE_DRAWING flag
ImageDraw() is actually used in multiple functions and it aslo depends on several functions...
2020-05-09 17:17:54 +02:00
raysan5
913ef1d56f Misc code reviews 2020-05-09 13:05:54 +02:00
Mickaël Malécot
0bd64b7975 Gamepad axis bug fixes and improvement (#1228)
* Fix gamepad axis count

* Fix Xbox axis drawing

* Ignore low axis values

* Revert "Fix gamepad axis count"

This reverts commit f08ae4bf

* Fix GamepadAxis API

* Fix conflict with master

* Revert Gamepad MAX definitions

* Revert MAX_GAMEPAD_AXIS update
2020-05-09 12:39:41 +02:00
raysan5
7efed56b66 Added [text] flag: SUPPORT_TEXT_MANIPULATION 2020-05-09 12:38:33 +02:00
raysan5
7a1d3d807f WARNING: RENAMED: ImageExtractPalette() -> GetImagePalette() 2020-05-09 12:07:18 +02:00
raysan5
cb3bdf09c6 Merge branch 'master' of https://github.com/raysan5/raylib 2020-05-09 12:05:08 +02:00
raysan5
959447d8ed Reorganized texture functions
Removed ImageAlphaMask() dependency on [text] LoadBMFont()
2020-05-09 12:05:00 +02:00
Ray
2d1cbe3cb3 Update .gitignore 2020-05-08 22:48:10 +02:00
sikor666
db4a618c6f Fix materials loading for IQM models (#1227) 2020-05-08 20:27:10 +02:00
armageddon421
df5c522049 Update CMakeLists.txt to fix CMake build for Raspberry Pi (#1229) 2020-05-07 22:22:09 +02:00
Ray
4e29294caa Update BINDINGS.md 2020-05-07 19:22:43 +02:00
Ray
a813c40abf Update BINDINGS.md 2020-05-07 19:19:13 +02:00
Ray
37dccd98a6 Added bindings: raylib-purebasic, clj-raylib 2020-05-07 18:37:55 +02:00
raysan5
d357b116fe Reviewed missing check for JPG 2020-05-07 18:08:35 +02:00
raysan5
6fa6757a8b Comment tweak 2020-05-07 13:39:41 +02:00
raysan5
f6ca045735 ADDED: DrawTriangle3D() and DrawTriangleStrip3D()
Those functions could be very useful for custom triangle data drawing, using internal batch system.
2020-05-07 12:46:45 +02:00
raysan5
2e8299742b Comments review 2020-05-07 12:45:44 +02:00
raysan5
67d8b43b0e Review first person movement Y waving
Some comments added
2020-05-07 12:45:23 +02:00
raysan5
fdad1f023b Avoid all MSVC compile warnings
Most warning were related to types conversion (casting required) and unsigned/signed types comparisons.

Added preprocessor directives (_CRT_SECURE_NO_DEPRECATE; _CRT_NONSTDC_NO_DEPRECATE) to avoid warnings about unsafe functions, those functions are safe while used properly and recommended alternatives are MS only.

Some external libraries still generate warnings.
2020-05-06 19:12:09 +02:00
Ray
9a1e934621 Added raylib D bindings! 2020-05-06 11:38:21 +02:00
raysan5
526c85773f Replace deprectared usleep() calls 2020-05-06 11:33:08 +02:00
Rfaile313
845596c30a No need for "LOGO_RECS_SIDE" maybe an artifact? (#1236)
Game will not compile with those four lines of code.
2020-05-06 11:27:55 +02:00
Ray
72443f8f25 Removed RaylibSharp (dead link) 2020-05-02 11:56:24 +02:00
Ray
695e937102 Added binding raylib-Forever 2020-05-02 11:48:07 +02:00
raysan5
b8055925bf Update raymath.h 2020-05-01 18:19:54 +02:00
raysan5
6a8e4795da Update core_input_multitouch.c 2020-05-01 18:16:04 +02:00
raysan5
af744b07c3 Review latest PR formatting 2020-05-01 18:04:47 +02:00
Anata
4583987fb9 Add Vector2MoveTowards function (#1233) 2020-05-01 17:50:41 +02:00
raysan5
c83477ffca WARNING: Big internal redesign!
Created RenderBatch type and related functions to allow rlgl users creating custom and separate render batches and not only rely on one internal render batch.

This feature has not been exposed on raylib yet because it implies some breaking changes. Right now a custom RenderBatch is just used internally in rlgl.
2020-05-01 17:34:43 +02:00
raysan5
51c3bef497 Review exposed #defines and allow user re-defining
There are multiple #define values around raylib, usually not exposed for redefinition, just reviewed all of them to allow users redefining them on compile time if required.

Also, multiple #define have been renamed and commented.
2020-05-01 17:31:44 +02:00
raysan5
1c15dc7292 Reviewed UWP update
Mostly code formatting tweaks
2020-04-30 21:00:09 +02:00
raysan5
0981dde9d4 Remove strcmp() requirement 2020-04-30 20:17:16 +02:00
raysan5
4ca4326bf9 Review LoadGLTF() to read from memory buffer 2020-04-30 19:51:57 +02:00
Reece Mackie
4b03860810 UWP rework (#1231)
* First draft of UWP rework.

* Read desc

- Moved UWP specific functions to uwp_events.h
- Removed BaseApp.
- Implemented example UWP lifecycle.

* Added GIF recording and screenshot support.

* Character inputs and filesystem stuff

* Fix game closing on Xbox when B is pressed.

* Fix the gamepad binding hack

* Add as many keys as I believe are possible.

* Implemented mouse locking of a sort.

* Remove rogue todo, the rest are for a game dev using this example.

* Implemented touch how I "think" it should work. I cant test this.

* Review.
2020-04-30 19:48:39 +02:00
Ray
2f454aa4b0 Added latest SPONSORS to list! Thank you very much! 2020-04-29 22:54:40 +02:00
Ray
b1a0f9873b Added raylib-beef to list 2020-04-29 21:10:11 +02:00
raysan5
ac8f436c3b Init CORE.Window.focused 2020-04-29 20:55:17 +02:00
raysan5
e65d15f6ad Merge branch 'master' of https://github.com/raysan5/raylib 2020-04-27 18:03:05 +02:00
raysan5
94ab5e2aab Review issue with vertex batch overflow #1223 2020-04-27 18:02:54 +02:00
Ray
06f6497181 Update README.md 2020-04-27 17:49:57 +02:00
raysan5
6e2d39c51b ADDED: IsWindowFocused() 2020-04-27 17:41:29 +02:00
Ray
ce2e48af52 Update to use latest emscripten and android ndk
- To support ASYNCIFY instead of EMTERPRETER
 - No need to generate a standalone toolchain for Android NDK
2020-04-26 13:46:15 +02:00
raysan5
72cc3e0530 Corrected issue #1203 2020-04-26 13:23:03 +02:00
raysan5
8e59ecb50c ADDED: GetWindowScaleDPI() 2020-04-24 23:17:32 +02:00
ivn
b73e7372d8 Fix for building examples with latest emsk (LLVM): remove EMTERPRETIFY, add ASYNCIFY (#1215) 2020-04-23 15:45:26 +02:00
Kevin Yonan
dd7dd1ac8b Mempool and other Allocators Optimization (#1211)
Optimizations of allocators.
Renamed 'Stack' to 'Arena'.
Replaced certain define constants with an anonymous enum.
Refactored MemPool to no longer require active or deferred defragging.
2020-04-22 13:11:45 +02:00
Dani Martin
0570e49d14 [android] Extend validity of the certificate (#1212)
For uploading a apk to Google Play a minimun of 25 years (9125 days) is needed for the validity of the key.

More info:
https://developer.android.com/studio/publish/app-signing
2020-04-22 13:09:41 +02:00
Ray
3494a29603 Update README.md 2020-04-21 21:19:20 +02:00
flashback-fx
596499416f Update easings.h (#1210)
Make easings.h use powf and sqrtf instead of pow and sqrt.
2020-04-21 21:17:58 +02:00
raysan5
00b3199859 Added raymath to examples 2020-04-16 13:49:19 +02:00
raysan5
c8309327f8 Merge branch 'master' of https://github.com/raysan5/raylib 2020-04-16 13:49:05 +02:00
raysan5
baf5e02f43 Remove comment 2020-04-16 13:48:47 +02:00
Ray
2f044acb4e Update new-issue-template.md 2020-04-15 20:05:19 +02:00
Ray
ff58f7e846 Update new-issue-template.md 2020-04-15 20:04:14 +02:00
Ray
736c6761a2 Create config.yml 2020-04-15 20:02:51 +02:00
Ray
c30d394efe Update new-issue-template.md 2020-04-15 19:58:51 +02:00
Stefan E. Mayer
6582084e9b Set the correct version of make on macos (#1202) 2020-04-14 19:50:53 +02:00
Ray
3f1029c281 Added binding: jaylib (Java) 2020-04-14 13:04:51 +02:00
raysan5
8d51ad567f Review UWP project -WIP- 2020-04-13 16:40:04 +02:00
G3bE
32387317bf Make raymath more consistent (#1197)
* Make raymath naming and functions more consistent

* Minor fixes

* Fix examples

* Fix Physac

* New naming rules

* Apply naming to Quaternion functions

* Apply to models.c

* Remove *MulitplyValue / *DivideValue
2020-04-13 16:32:45 +02:00
raysan5
f0fe03087a Remove tshirt design
It makes no sense to have this here...
2020-04-13 15:35:56 +02:00
raysan5
26f39e41a9 Remove games from building 2020-04-13 15:10:42 +02:00
raysan5
fd5d1dfcb6 WARNING: REMOVED raylib/games - Moved to raysan5/raylib-games
Move raylib games to another repo. It will reduce repo size for new clones.

I considered also removing the related history with [`git filter-repo`](https://github.com/newren/git-filter-repo) (the current sane alternative to the deprecated `filter-branch`) but it has some implications: It would had made a new repository with distinct history and checksums. If the repo was previously published,
the history of the new one won't have been compatible with the history others have pulled.
2020-04-13 13:31:45 +02:00
raysan5
eb04be8141 Review VSCode tasks 2020-04-13 12:07:05 +02:00
Stefan E. Mayer
c21e9a721b Fix VSCode (#1193)
* Executable is called game, not main

* Use make not mingw32-make on macOS
2020-04-13 11:51:40 +02:00
pah arif
b4af1b2cc0 add makefile to support multiple C files (#1195)
* tcc-based vscode project for windows

Signed-off-by: misterpah <misterpah@gmail.com>

* add makefile to support multiple C files
2020-04-11 20:01:28 +02:00
raysan5
5ff5be388f Merge branch 'master' of https://github.com/raysan5/raylib 2020-04-11 12:03:59 +02:00
raysan5
a7311af8c3 Corrected examples after API change: ImageDrawText*() 2020-04-11 11:26:16 +02:00
pah arif
17ee57c458 tcc-based vscode project for windows (#1191)
Signed-off-by: misterpah <misterpah@gmail.com>
2020-04-11 11:23:00 +02:00
raysan5
cc816345bf WARNING: API BREAK: Removed LoadImagePro()
Actually this function is useless and potentially dangerous, internally, a shallow copy of data was done. Same could be accomplished accesing image.data directly.
2020-04-10 19:26:36 +02:00
raysan5
b132da0ac2 WARNING: API BREAK: Reviewed ImageDrawText*() params order
To unify with DrawText*() equivalent functions
2020-04-10 19:10:15 +02:00
raysan5
d419602c99 Review display size init for RPI 2020-04-09 23:50:00 +02:00
raysan5
926651b708 Optimized ImageDrawPixel()
Now it's blazing fast. It modifies image.data directly.

Previous version could take up to 3-4 seconds to draw a line... now it takes some nanoseconds...
2020-04-09 22:44:10 +02:00
raysan5
0abe557af1 Fixed issue with ImageDrawLine() 2020-04-08 12:37:52 +02:00
Ahmad Fatoum
6c9f6cf084 Revert "CMake: Don't create symlinks on unsupporting file systems (#539)"
As noted in #539, the symlink check was to support compiling raylib on
VirtualBox vboxfs as no symlinks are supported there.

With me using Linux as daily driver outside VirtualBox now, this 'feature'
is most likely unused by anyone, but still annoys other users (#791).
Just revert it and be done with it. If there are really others building
raylib on vboxfs or a similarly crippled file system under Linux, they
should now step forward when their build breaks.

This reverts commit b8ca51fd01.
2020-04-08 11:01:26 +02:00
Shy
81c44e32c3 ignore symlink creation failure error 2020-04-08 07:05:43 +02:00
raysan5
2b5188c4b3 Updated VS2017.UWP output folders 2020-04-07 21:19:43 +02:00
raysan5
a25d3b7ff4 Update raylib.vcxproj 2020-04-07 21:14:36 +02:00
raysan5
42f09eb2b8 Delete .gitignore 2020-04-07 18:52:07 +02:00
raysan5
ef9e9bfa7d Review Android piepline
- Removed generate_android_toolchain, since version r21 AndroidNDK it's the toolchain
 - Removed external lib native_app_glue, provided by AndroidNDK
2020-04-07 17:54:08 +02:00
raysan5
f31b87fae8 Remove ANGLE project
Actually, project just adds 50MB of ANGLE libraries not related to raylib.
Also reviewed UWP project to consume ANGLE from the NuGet package.
2020-04-07 17:43:21 +02:00
raysan5
3b174876b3 Update launch.json 2020-04-07 16:43:40 +02:00
raysan5
62b7064e90 Corrected issue with depth initialization #1179 2020-04-06 19:58:28 +02:00
Ray
0a25b9d39b Update README.md 2020-04-06 13:30:32 +02:00
raysan5
5fb6155eea Removed unused Duck model. 2020-04-06 11:37:47 +02:00
Louis Johnson
4f40f8bc47 added log warning for unsupported file extension for music stream (#1176)
* added log warning for unsupported file extension for music stream

* updated error log message for music stream when file format isn't supported
2020-04-06 11:26:09 +02:00
Ray
8d0888afef Update SPONSORS.md 2020-04-05 23:26:32 +02:00
Benjamin Stigsen
2d6303e9fe Allow for empty replacement string (#1178) 2020-04-05 22:42:59 +02:00
raysan5
90fb53bccc Review android_fopen() to support SDCard access 2020-04-05 17:51:27 +02:00
raysan5
4ceb4d3bf3 Some code tweaks, comments and defines 2020-04-05 17:50:37 +02:00
Benjamin Stigsen
9c280bc7af TextReplace changes (#1172)
- Added NULL return if the replacement string (`by`) is empty
- Reordered sanity checks since there's no need to initialize variables if the strings are invalid.
2020-04-04 14:25:57 +02:00
SasLuca
8444c3f705 Fixed offset check in GenImageFontAtlas (#1171)
* Fixed offset check in GenImageFontAtlas

* Fixed code formatting to follow raylib notation rules
2020-04-02 23:53:29 +02:00
Ray
7ef114d1da Set build type to Release only #1164 2020-04-01 11:07:01 +02:00
raysan5
adb20569be Review shared library building 2020-04-01 11:06:05 +02:00
Ray
07f3a65a96 Update ROADMAP.md 2020-03-31 23:00:48 +02:00
Ray
6a8b1079c1 Update project version for release 2020-03-30 23:42:17 +02:00
Ray
703850b341 Update README.md 2020-03-30 23:28:38 +02:00
raysan5
8da6307456 Get icons back on shell.html
It seems there is some related issue on emscripten side... but I'll keep the icons here despite not displayed properly for the moment.
2020-03-30 21:34:45 +02:00
raysan5
e469f4ebf7 Update config.h, enable some file-formats by default 2020-03-30 17:42:42 +02:00
raysan5
8941cf3e66 Update textures.c 2020-03-30 17:42:19 +02:00
raysan5
68cad30646 Remove useless files 2020-03-30 17:27:03 +02:00
raysan5
fc7ec5e907 Update raylib.h 2020-03-30 17:11:35 +02:00
Dani Martin
1a948849f3 [cppcheck] Fix minor warnings in models.c and raudio.c (#1162)
Errores fixes:
models.c,2843 Either the condition 'fileData!=NULL' is redundant or there is possible null pointer dereference: fileData.
raudio.c,805, 806, 807, 808, %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
2020-03-30 17:08:01 +02:00
Ray
bba10504e2 Update HISTORY.md 2020-03-30 16:30:34 +02:00
Ray
ff11a6fbe8 Update CHANGELOG 2020-03-30 16:25:59 +02:00
Ray
27ebe78313 Update CHANGELOG 2020-03-30 16:23:37 +02:00
raysan5
44961d1975 Update core_basic_window.c 2020-03-30 16:09:09 +02:00
raysan5
e8a8d544c5 Review formating and signegness issues 2020-03-30 14:38:16 +02:00
Dani Martin
62cdb2299b [cppcheck] Improvements in SaveStorageValue() in core.c (#1160)
* [cppcheck] Improvements in SaveStorageValue() in core.c

in file core.c cppcheck shows errors only in function SaveStorageValue():

* Common realloc mistake: 'fileData' nulled but not freed upon failure
* Memory pointed to by 'fileData' is freed twice.

Validation:
* Tested examples/core/core_storage_values.c
* Launched Unit Test for this function
* Rerun CPPCHECK afer fix

* [cppcheck] Change functions header to accept only positive position in files

Changes:
* Functions SaveStorageValue(), LoadStorageValue() (core.c)
* Functions LoadFileData(), SaveFileData() (utils.c)
* Headers in raylib.h

Validation:
* Tested examples/core/core_storage_values.c
* Launched Unit Test for these functions
* Rerun CPPCHECK afer fix
2020-03-30 13:51:36 +02:00
Ray
9b66883e0b Update README.md 2020-03-30 13:29:05 +02:00
Ray
d1b0d6a6dc Update README.md 2020-03-30 13:28:30 +02:00
Ray
c47ba58494 Update README.md 2020-03-30 13:23:20 +02:00
Valentin Lemière
41582f0448 Fix "variable is reassigned before use" linter warning on raymath.h (#1158) 2020-03-29 22:03:10 +02:00
raysan5
3e76d3a3d3 Added example: shaders_spotlight 2020-03-29 14:25:09 +02:00
raysan5
733ed972f7 Reorganize image functions 2020-03-29 13:37:33 +02:00
raysan5
5d7050bdf9 Reorganize image/texture functions for consistency 2020-03-29 13:31:12 +02:00
Rob Loach
a025636fa1 Update ImageDraw*() functions to match arguments of Draw*() (#1156)
* Update ImageDraw*() functions to match arguments of Draw*()

Updated draw functions:
ImageDrawPixel()
ImageDrawPixelV()
ImageDrawCircle()
ImageDrawCircleV()
ImageDrawLine()
ImageDrawLineV()
ImageDrawRectangle()
ImageDrawRectangleV()
ImageDrawRectangleRec()

* [nodepadpp] Update Notepad++ ImageDraw defintions

This updates the Notepad++ definitions with the updated ImageDraw methods.

* [examples] Add ImageDraw calls to textures_image_drawing

* Update ImageDraw*() methods
2020-03-29 12:43:34 +02:00
Ray
3c3dfde3f9 Added binding: raylib-zig 2020-03-28 19:35:20 +01:00
Ray
5829fdb73e Added binding: raylib-ats2 2020-03-28 19:30:00 +01:00
Ray
9b74c40fc2 Update HISTORY.md 2020-03-28 19:17:51 +01:00
raysan5
66e0d774bd Revert "Update compilation warning flags (#1151)"
This reverts commit 2528854664.
2020-03-28 18:39:56 +01:00
raysan5
a5e1aff99b [example] Integrate virtual mouse in main example 2020-03-28 18:36:30 +01:00
raysan5
e333eb415b Update window rc 2020-03-28 18:27:56 +01:00
Ray
02df366a7a Update HISTORY.md 2020-03-27 20:40:00 +01:00
Ray
976a10c891 Update CHANGELOG 2020-03-27 20:31:20 +01:00
raysan5
d28e73849b Review TRACELOG() messages 2020-03-27 18:49:21 +01:00
raysan5
d7b15ac1cf Review TRACELOG() categories 2020-03-27 18:45:37 +01:00
raysan5
c0c775e45d [rlgl] Review TRACELOG() messages, categorized 2020-03-27 18:31:36 +01:00
raysan5
b5842434c2 Corrected missing semicolon 2020-03-27 18:31:16 +01:00
raysan5
c7e9951795 [core] Review TRACELOG() messages, categorized 2020-03-27 18:06:09 +01:00
raysan5
70ed975b99 [models] Review TRACELOG() messages, categorized 2020-03-27 17:43:51 +01:00
raysan5
7e2b1b4ff0 [textures] Review TRACELOG() messages 2020-03-27 17:43:38 +01:00
raysan5
915b5f370b [raudio] Review TRACELOG() messages, categorized 2020-03-27 17:43:24 +01:00
raysan5
0c6c421508 [raudio] Review TRACELOG() messages, categorized 2020-03-27 17:16:30 +01:00
raysan5
bc2c6251f8 [text] Review TRACELOG() messages, categorized 2020-03-27 17:16:07 +01:00
raysan5
b9dd459d5a [textures] Review TRACELOG() messages, categorized 2020-03-27 17:15:44 +01:00
raysan5
28da2522fe [utils] Review TRACELOG() messages, categorized 2020-03-27 17:15:26 +01:00
Dani Martin
2528854664 Update compilation warning flags (#1151)
* Update compilation warning flags

Removed the -Wall flag that allow many warnings and added manually all the warning flags that don't generate warnings in the src/external folder.
Specifically, these are some of the flags reporting errors in src/external:

-Wmissing-prototypes
-Wunused-variable
-Wunused-value
-Wunused-parameter
-Wunused-function

* Uptade compilation flags in examples with missing -std=c99
2020-03-26 18:48:34 +01:00
raysan5
7ae7a87f8a Remove trail spaces 2020-03-25 19:41:51 +01:00
raysan5
3d41c1b6cd Minor tweaks 2020-03-25 19:38:55 +01:00
raysan5
96005f2566 ADDED: IsWindowFullscreen() 2020-03-25 18:52:38 +01:00
raysan5
e37d021cd3 Enable IQM models support on config.h 2020-03-25 18:51:46 +01:00
raysan5
133a882556 Update config.h 2020-03-25 18:39:28 +01:00
raysan5
74339b9fdc [example] Review shaders_spotlight to work on GLSL 100 2020-03-25 18:39:21 +01:00
chriscamacho
2dbcef218c spotlight example, each spot has own radius, mouse countrol (#1148)
NB glsl100 shader needs testing on "bare metal"

Co-authored-by: codifies <nospam@antispam.com>
2020-03-25 10:28:16 +01:00
Random
e07281f8bd Fixed DrawTextRecEx() selection when wordwrap is ON (again) (#1149) 2020-03-25 10:27:43 +01:00
raysan5
5e670be239 REVIEWED: shaders_spotlight example
It seems something is not working properly...
2020-03-24 19:49:09 +01:00
raysan5
05abaee0e0 Update core_window_letterbox_virtual_mouse.c 2020-03-24 19:10:50 +01:00
raysan5
d657537821 Support mtl loading by tinyobj_parse_obj() #1134
I don't like this solution but well... let's use it for the moment...
2020-03-24 18:42:57 +01:00
Ray
5fe0db347c Update HISTORY.md 2020-03-24 15:03:55 +01:00
Ray
649665eac9 Update CHANGELOG 2020-03-24 15:01:09 +01:00
chriscamacho
efe359d613 as per request spotlight example (#1146)
Co-authored-by: codifies <nospam@antispam.com>
2020-03-24 14:27:14 +01:00
Anata
c45fe62abc Add files via upload (#1147)
Virtual mouse with window letterbox, and Clamp
2020-03-24 14:25:44 +01:00
Ádám Dóda
584e2d664c GenMeshHeightmap flat shading normals (#1140) 2020-03-24 13:27:49 +01:00
raysan5
51a8e1d692 Remove define not required 2020-03-24 13:26:34 +01:00
Doyle
da836a732c Android: Better track touch input returned from IsMouse*() (#1144)
* Android: Better track touch input returned from IsMouse*()

Switch to actually tracking touch input to use for "mouse" input rather
than the gestures system. The gesture system as an abstraction ontop of
raw touch input loses some information needed to map to "mouse"
input.

Before,
- IsMouseButtonReleased() triggers immediately after the initial touch
(because GESTURE_TAP activates immediately on touch) instead of waiting for the
touch to be released.
- IsMouseButtonUp() returns false, when it should just be the opposite
of IsMouseButtonDown().
- IsMouseButtonDown() returns true only after GESTURE_HOLD (which
activates after some period of time after GESTURE_TAP), when instead it
should just be true whenever there is touch input i.e. gesture !=
GESTURE_NONE or alternatively when any input is received on the screen.

After this PR, touches map closer to mouse input.
- IsMouseButtonReleased() triggers when touch is released (last frame
was touched, this frame not touched).
- IsMouseButtonUp() returns the opposite of IsMouseButtonDown()
- IsMouseButtonDown() is true when
(AMOTION_EVENT_ACTION_DOWN || AMOTION_EVENT_ACTION_MOVE) and false when
(AMOTION_EVENT_ACTION_UP)

* RPI: Include index check for RPI in GetTouchPosition()
2020-03-24 13:23:34 +01:00
raysan5
6bab884d1d Added note on examples not supporting GLSL100 2020-03-24 12:39:05 +01:00
Ahmad Fatoum
4e6db307e4 appveyor: configure for Release with Debug Info
We build the library as debug with AppVeyor and package it this way,
which is unfortunate, because on Windows it's linked against debug
variants of the C runtime. Fix this by build RelWithDebInfo instead

Fixes #1128.
2020-03-24 06:37:22 +01:00
Ahmad Fatoum
0229f9b1a4 CMakeLists.txt: report generated CMAKE_CONFIGURATION_TYPES
We might want to customize this in feature for multi-config builds (e.g.
a Visual studio build with both Debug and Release configurations).

Output the variable value for user awareness.
2020-03-24 06:37:22 +01:00
chriscamacho
6bbaca118f ended up using the 100 version shaders as off the top of my (#1142)
head can't think of any improvement I could use on the shaders for
version 120
This has been tested on Linux (Desktop) requires testing on a Rpi

Co-authored-by: codifies <nospam@antispam.com>
2020-03-23 23:07:42 +01:00
Ray
ba3b4b2d08 Set a release date for raylib 3.0! 2020-03-23 20:56:31 +01:00
raysan5
fcdb120935 Comment tweaks 2020-03-23 20:24:20 +01:00
raysan5
8f45370073 Comment tweaks 2020-03-23 20:24:09 +01:00
Ray
502bc61931 Update HISTORY.md 2020-03-23 14:30:19 +01:00
Ray
5a39b22521 Update CHANGELOG 2020-03-23 14:22:06 +01:00
Ray
6c44c9d730 Update HISTORY.md 2020-03-21 21:14:26 +01:00
Ray
a523c64718 Update CHANGELOG 2020-03-21 20:33:46 +01:00
raysan5
5aebd2a16c Review formating from PR #1138 2020-03-21 20:30:40 +01:00
Sourav Gupta
574c689ff7 Added draw functions to ImageDraw*() (#1138)
Added draw functions:
ImageClearBackground()
ImageDrawPixel()
ImageDrawLineEx()
ImageDrawCircle()
2020-03-21 20:23:50 +01:00
Ray
b178c992a1 Update README.md 2020-03-21 20:21:08 +01:00
Ray
a4d31e1dad Added raylib 3.0 notes -WIP- 2020-03-21 20:20:37 +01:00
Ray
e151487fde Review history introduction 2020-03-21 19:13:16 +01:00
Ray
061848cd0c Updated badges links 2020-03-21 18:48:04 +01:00
Ray
ab1c12c449 Update Travis/AppVeyor badges 2020-03-21 15:05:02 +01:00
Ray
8db8401bc1 Review Travis/AppVeyor badges 2020-03-21 13:50:24 +01:00
Ray
58a81dd760 Update README.md 2020-03-21 13:48:53 +01:00
Ray
a5838e40d9 Update CONTRIBUTING.md 2020-03-21 13:37:48 +01:00
Ray
78e8fd1c31 Update CHANGELOG 2020-03-21 13:32:53 +01:00
Ray
2d07d29a1c Update README.md 2020-03-21 13:29:03 +01:00
Ray
19bbcbb486 Update badges 2020-03-21 13:26:19 +01:00
Ray
b6ba3dacb9 Playing with badges 2020-03-21 13:23:20 +01:00
Ray
65d9d0aac1 Testing badges 2020-03-21 13:22:06 +01:00
Ray
b9c966f902 Playing with badges... 2020-03-21 13:01:50 +01:00
Ray
d62368f133 Update README.md 2020-03-21 12:43:27 +01:00
Ray
3d66a6c93f Added: new binding to Carp 2020-03-21 11:28:18 +01:00
Doyle
01e035e28b Android: Track touch motion across screen (#1137)
This was working in 2.6 but no longer does in current git tree.
It appears touch position is only tracked on
AMOTION_EVENT_ACTION_[DOWN|UP], which only registers the initial touch
on the screen. Subsequent movement is not tracked into CORE.

Touch position and the Gesture System appears to be updated twice in
AndroidInputCallback in what looks like perhaps a copy paste error (code
is identical) with the exception of tracking AMOTION_EVENT_ACTION_UP in
the 2nd copy of the code (but this is not necessary to track).

If you need to track the first touch or release touch position, you can
do so with checking IsMouseButton[Pressed|Released] on the same frame.

This patch makes it so the touch position is always updated, and merges the
duplicated code into 1 singular code path.
2020-03-19 16:56:48 +01:00
raysan5
4af4483f5f Added security check in case init fails #1135 2020-03-17 20:57:01 +01:00
raysan5
2344941974 Replace external libraries custom allocators by raylib ones #1074
NOTE: Two libraries still use custom allocators: glfw and stb_vorbis
2020-03-17 13:40:07 +01:00
Ray
6f41b9594a Update README.md 2020-03-16 20:46:28 +01:00
Ray
3e049c09d5 ADDED: XD Pascal bindings 2020-03-16 19:11:06 +01:00
Henrique de Lima
92e1205f40 Adding the option to change the target platform(x86/x64), Generating the .pdb file on debug builds, and correcting comments that called the script 'windows-build.bat' instead of 'build-windows.bat' (#1133) 2020-03-16 10:32:39 +01:00
raysan5
71b06caed4 Corrected typo 2020-03-15 17:06:08 +01:00
raysan5
4611406c68 REVIEWED: ImageTextEx() to support line breaks #1131
NOTE: This functionality has an important issue, line space is fixed to 1.5 font.baseSize pixels, depending on the font and how it has been generated that spacing could be too wide or too narrow...
2020-03-15 16:18:48 +01:00
Doyle
427be604b9 Android: Set display.[width, height] before screen size check (#1132)
In `InitGraphicsDevice(...)`, the Android section has a screen security check
like other platforms- but CORE.display.width, CORE.display.height are
not set yet, so the security check sets it to 0. So ensure we query the
device's screen width and height before the screen size security check.

This also gives you the ability to run a proper full-screen application
on Android without any scaling and guess work on the target device by
setting screen width and height to 0 in `InitWindow(...)` and using
`GetScreen[Width|Height]()` to get the actual values.
2020-03-15 15:56:43 +01:00
Ray
d57b5ac89a Added note on transparent framebuffer w/o X11 on RPI 2020-03-12 17:47:35 +01:00
Ray
82937e1564 Update .gitignore 2020-03-12 13:02:18 +01:00
Ray
7fa12844ed [text] TextToUpper(): Added note on diacritics 2020-03-12 13:02:09 +01:00
Ray
af011bc952 ADDED Binding: FreeBasic 2020-03-09 18:52:41 +01:00
Ray
4c728f0b54 Minor tweaks 2020-03-09 18:45:37 +01:00
Ray
5895fb6adc Address issue #1125 2020-03-09 13:01:10 +01:00
Ahmad Fatoum
eb6f8bd0ba Revert "Always use latest raylib version for cmake (#1123)" (#1126)
We didn't use the latest version, but a compatible version, which is established by raylib-config-version.cmake.

It's ok to have a minimal version, so revert b7c0d5b6dd.
2020-03-09 08:29:47 +01:00
G3bE
b7c0d5b6dd Always use latest raylib version for cmake (#1123)
* Always use latest raylib version

* Always use latest raylib version

* Always use latest raylib version
2020-03-08 18:04:29 +01:00
SasLuca
680f9d5772 Changed if to else if. (#1122) 2020-03-08 18:03:23 +01:00
Astie Teddy
20d8889a03 ADDED Bindings: raylua-lua (raylua) (#1124) 2020-03-08 18:02:37 +01:00
Ray
c67bc02dd1 Reviewed missing include 2020-03-07 21:54:54 +01:00
Ray
1b56f7917e Update raylib version 2020-03-05 19:33:54 +01:00
Ray
7639726193 ADDED Bindings: raylib-luamore, raylib-nelua, raylib-mosaic 2020-03-05 18:58:10 +01:00
Ray
fb2ed693e4 Android: Support file saving to internal data storage 2020-03-05 18:12:41 +01:00
Ray
966e8adcf9 Reviewed and Updated Android compilation scripts 2020-03-05 12:25:39 +01:00
Ray
c3386300d3 Remove comment 2020-03-04 18:23:31 +01:00
Ray
cb4c676f5d Added BlitzMax binding 2020-03-04 13:12:16 +01:00
Ray
74c486201d ADDED: LoadFileText() and SaveFileText()
Improved file access checks
2020-03-04 00:21:46 +01:00
Ray
6b8f30964d WARNING: Corrected issue with IsKeyDown() #1119 2020-03-03 16:43:15 +01:00
Ray
dc2e5c1751 Update core.c 2020-03-03 16:10:31 +01:00
Ray
645a5b2507 Avoid icons in shell
Very weird... lately icons are not properly displayed on browser!
2020-03-03 15:53:13 +01:00
Ray
3a073db029 REVIEWED: Mouse/Touch input system
After several reviews, now it seems everything works as expected.
2020-03-03 14:58:54 +01:00
Ray
a6297a2be1 Some code tweaks 2020-03-03 01:21:06 +01:00
Ray
8724cf2ea5 Support any mouse button for gesture detection 2020-03-02 13:29:36 +01:00
Ray
485787059a Review shader exaples to work on web (GLSL 100) 2020-03-02 13:27:54 +01:00
Ray
08615d3247 Review some comment 2020-03-02 12:22:57 +01:00
Ray
a1b2d96d9c Support touch drawing on web 2020-03-02 12:22:38 +01:00
i-right-i
3c2ee1cc75 Update raymath.h (#1118)
* Update raymath.h

Added Vector2Rotate Function.

* Update raymath.h
2020-03-02 10:22:08 +01:00
Ray
117696a893 Update textures_mouse_painting.c 2020-03-02 00:09:05 +01:00
Ray
2f5a7ddcc6 Added comment on IsMouseButtonDown() issue
IsMouseButtonDown() does not process touch state down properly, state is reseted every frame...
2020-03-02 00:07:06 +01:00
Ray
18a9982126 Reviewed IsMouseButtonDown() 2020-03-01 01:29:34 +01:00
Ray
41d3c47ffe Update Makefile 2020-03-01 01:28:49 +01:00
Ray
7428747ef0 REDESIGNED input system for better mouse/touch support 2020-02-29 22:10:23 +01:00
Ray
1ee6290fcf Replaced fabs() by fabsf() when required 2020-02-28 12:54:39 +01:00
brankoku
572969d8b7 LoadText() tweak (#1113)
Guarantee string is zero-terminated
2020-02-28 08:23:05 +01:00
Ray
f2247c6f0a REVIEWED: LoadText() 2020-02-28 00:32:46 +01:00
Ray
05992a6fce Tweaks 2020-02-27 16:37:32 +01:00
Ray
c8464bc731 Corrected return value 2020-02-27 16:22:34 +01:00
Ray
b2098a2d60 REDESIGN: ExportImage()
Use new file I/O ABI
2020-02-27 16:15:58 +01:00
Ray
ac73e3b5e2 REDESIGN: ExportWave()
Use new file I/O ABI
2020-02-27 16:15:20 +01:00
Ray
1be68d8cfe Tweak on variable init 2020-02-27 16:14:50 +01:00
Ray
eb86d69a38 Review default config flags 2020-02-27 16:14:31 +01:00
Ray
acfa967e89 Corrected issue with variable name 2020-02-27 13:56:27 +01:00
Ray
5ff0776235 Remove trail spaces and some tweaks 2020-02-27 13:33:09 +01:00
Ray
2a408d789c REDESIGNED: LoadImage() -WIP-
Using new file I/O ABI
2020-02-27 13:21:51 +01:00
Ray
5100cb3e7f REDESIGNED: LoadImageRaw(), LoadAnimatedGIF()
Using new file I/O ABI
2020-02-27 13:21:21 +01:00
Ray
b029fb6d31 REDESIGNED: LoadFontEx()
Using new file I/O ABI
2020-02-27 13:19:58 +01:00
Ray
245ba2a152 LoadText(): Added comment 2020-02-27 13:19:13 +01:00
Ray
89ecad1e29 Review macros 2020-02-27 13:18:55 +01:00
Ray
23bde477e5 REDESIGN: LoadStorageValue()/SaveStorageValue()
Using new file I/O ABI
2020-02-27 13:18:15 +01:00
Ray
2294947660 Update core_storage_values.c 2020-02-26 23:42:41 +01:00
Ray
5aed36e76d Tweaks on fullsccreen detection... 2020-02-26 23:42:06 +01:00
Ray
e5b5aea998 WARNING: RENAMED: Storage functions
Renamed functions for consistency:

 - StorageLoadValue() > LoadStorageValue()
 - StorageSaveValue() > SaveStorageValue()
2020-02-26 23:40:53 +01:00
Ray
fadd74358b Security check 2020-02-26 23:38:12 +01:00
Ray
7912fac815 Correct typo 2020-02-26 23:19:29 +01:00
Ray
fa4e0c1a26 Reviewed example 2020-02-26 20:47:08 +01:00
Ray
1046449339 ADDED: LoadFileData(), SaveFileData() 2020-02-26 20:29:33 +01:00
Ray
c5d5d19443 Remove trail spaces 2020-02-26 20:23:55 +01:00
Ray
0f783aab34 Remove TraceLog() dependency on standalone mode 2020-02-26 20:23:36 +01:00
Ray
7849db65e0 Remove TraceLog() dependency on standalone mode 2020-02-26 20:23:06 +01:00
Ray
9b5a796213 Use float math functions 2020-02-26 20:20:52 +01:00
Ray
32e374d941 [core] SetWindowSize() try to support PLATFORM_WEB -WIP- 2020-02-24 12:35:53 +01:00
Ray
113a580021 [rlgl] LoadText() variable scope improvement 2020-02-24 12:05:54 +01:00
Ray
a77273d8d8 Make sure current text buffer is empty #1109 2020-02-24 11:15:02 +01:00
Ray
310fd9b147 Update to latest emscripten toolchain
Corrected issue on web compilation
2020-02-22 17:21:10 +01:00
Ray
01d8642520 Merge branch 'master' of https://github.com/raysan5/raylib 2020-02-22 10:38:37 +01:00
Ray
30f3e49f3d Improve inputs on Android 2020-02-22 10:38:32 +01:00
Ray
0b8aded399 Support ToggleFullscreen() on web 2020-02-22 10:37:43 +01:00
Ray
d2aeafcf1e Update Makefile 2020-02-22 10:36:34 +01:00
Ray
81881a120c Comment tweak 2020-02-22 10:36:20 +01:00
Tyler Jessilynn Bezera
e7fdf8a13d Expand GLTF Model support (#1108)
* Update GLTF support to include loading color for albdeo (saved in the color value of the materialmap), support occlussion and emmission maps.. as well as some quality of life updates.

* clean up to use single image
2020-02-22 10:17:30 +01:00
Ray
a750bcceec Support links on WebAssembly 2020-02-21 01:13:41 +01:00
Ray
67d0bf75a7 Update Makefile paths to use emscripten upstream
Note that emscripten upstream branch implements the new asyncify implementation, expected to be faster than emterpreter one.
2020-02-20 23:00:29 +01:00
Ray
a8a21312e1 Removed TABS 2020-02-20 13:46:49 +01:00
Ray
42dad5df95 [rnet] Renamed some functions 2020-02-20 13:46:33 +01:00
Ray
e176a476c0 [rnet] Review network examples formatting 2020-02-20 12:42:37 +01:00
Ray
19390eaf09 [rnet] Examples review -WIP- 2020-02-19 18:16:20 +01:00
Ray
faff512140 [rnet] Convert to header-only
Some functions renamed
2020-02-19 18:15:59 +01:00
Ray
946a6cb280 Review mouse inputs 2020-02-19 12:44:57 +01:00
Ray
7d789763d6 Update API version 2020-02-19 12:35:30 +01:00
Ray
d62a2f793f Improved GetFPS() calculation for average 2020-02-19 12:20:15 +01:00
Ray
9eefcb7939 Update miniaudio.h 2020-02-19 12:19:41 +01:00
o3o
36bf8a60d8 Fix #1103 (#1104)
Fix 1102
2020-02-18 23:19:30 +01:00
Ray
6d1cdf25a7 [rnet] Review module formating
Align formating with other raylib modules coding style.
2020-02-18 18:15:22 +01:00
Ray
51db3b589d Review function name on RAUDIO_STANDALONE 2020-02-18 18:14:22 +01:00
Ray
b18940d3c6 Remove spaces 2020-02-18 18:03:28 +01:00
Ray
3f25c52a29 Some security checks in case music is not properly loaded 2020-02-18 16:30:52 +01:00
Ray
39e73ccc4d [text] TextLength() security check 2020-02-17 00:47:05 +01:00
Ray
df4b55d657 Comment fprintf() calls 2020-02-17 00:46:41 +01:00
Ray
80dbbef0f5 Update Notepad++ intellisense 2020-02-14 23:48:40 +01:00
Ray
23b75281ad Add function prototype 2020-02-14 23:10:02 +01:00
Ray
91b2dc2aa9 [raudio] ADDED: SetAudioStreamBufferSizeDefault()
There could be some cases where we need to define the internal audio buffer size, now it's possible.

RENAMED: InitAudioBuffer() to LoadAudioBuffer()
RENAMED: CloseAudioBuffer() to UnloadAudioBuffer()

Renamed some defines and reviewed some comments.
2020-02-14 17:13:37 +01:00
Ray
7459a5c6ef Remove "No Audio Buffer" traces 2020-02-14 11:44:50 +01:00
Ray
8820baf5cc Update miniaudio.h 2020-02-13 11:41:33 +01:00
Ray
3b3e163c48 [raudio] Corrected issue with OGG sound loading 2020-02-13 11:41:28 +01:00
Ray
83fb4613c1 Review some RPI issues 2020-02-13 00:13:56 +01:00
Ray
1b20182d33 Updated periodSize reference 2020-02-12 14:45:02 +01:00
Ray
7dfe42d6d0 Trace log comment review 2020-02-12 13:49:08 +01:00
Ray
55f0647213 [core] Avoid pixel bleeding issue on MSAA 2020-02-12 13:48:50 +01:00
Ray
484c6b360f Reviewed Cppcheck issues #1098 2020-02-12 13:16:18 +01:00
SasLuca
dec85f741a Fixed memory leaks in textures.c (#1097) 2020-02-11 22:25:27 +01:00
Ray
87d5b51256 REVIEWED: GetDirectoryPath()
Check if provided path is a full path containing system root letter: C:\
2020-02-11 19:12:49 +01:00
Ray
aa3b413390 SUPPORT_HALFBUSY_WAIT_LOOP 2020-02-11 19:01:29 +01:00
Ray
ee43a14f19 Update CHANGELOG 2020-02-11 16:52:52 +01:00
raysan5
64c23f8477 REVIEWED: VS2017.UWP project
It seems there is some problem on drawing... :(
2020-02-10 17:45:50 +01:00
raysan5
49145e90a2 Remove spacing 2020-02-10 13:16:34 +01:00
raysan5
28e12a6c6a [raudio] Update to latest miniaudio 0.10 2020-02-10 12:42:40 +01:00
raysan5
131132f17d Minor tweaks 2020-02-10 10:56:48 +01:00
raysan5
884e868e92 Review DEBUG trace log and custom allocators
Not exposing some data structures
2020-02-10 10:56:39 +01:00
raysan5
eb2483338f REVIEWED: Makefile, examples clean target #1087 2020-02-09 21:06:51 +01:00
raysan5
becd3c3831 REVIEWED: GenMeshCylinder(), solved issue #1088 2020-02-09 21:04:03 +01:00
raysan5
34fafb733f Corrected issue with toupper() usage 2020-02-09 16:11:32 +01:00
raysan5
90c129fd61 Review some libc dependency comments 2020-02-09 16:11:11 +01:00
raysan5
9922160ab4 Minor tweaks 2020-02-09 13:23:12 +01:00
Ray
1d324d5496 Update CHANGELOG 2020-02-07 18:02:09 +01:00
Ray
03c38396f3 Update CHANGELOG 2020-02-07 17:55:10 +01:00
Ray
85cecb2aae Update CHANGELOG for raylib 3.0 -WIP- 2020-02-07 17:39:29 +01:00
Ray
d15b93839b Update ROADMAP.md 2020-02-07 16:32:57 +01:00
Ray
b06497cad6 Update BINDINGS.md 2020-02-07 12:09:54 +01:00
Ray
f632e32100 Corrected typo 2020-02-07 12:09:34 +01:00
Ray
52a6d756f4 Added raylib-chibi binding 2020-02-07 12:09:05 +01:00
Ray
f4ca5b378a Review missing include 2020-02-06 18:10:52 +01:00
Ray
97054e4e0f Review ALL games to raylib 3.0 2020-02-06 18:07:25 +01:00
Ray
86bdf60887 Corrected issue with TextToUpper() and TextToLower()
This issue was breaking multiple things...
2020-02-06 17:52:33 +01:00
Ray
4b4f052fea Review game templates 2020-02-06 16:56:01 +01:00
Ray
2de92e3c07 Minor format tweaks 2020-02-06 16:44:04 +01:00
Ray
85e7856989 Update resource files 2020-02-06 16:37:38 +01:00
Ray
b4293edd70 Update GLFW to latest master 2020-02-06 16:30:48 +01:00
Ray
6c7685da3f Update external libraries 2020-02-06 16:29:57 +01:00
Ray
ea40bda88c Added func used in comments 2020-02-04 17:52:40 +01:00
Ray
1184db83f7 Review GetCurrentTime() 2020-02-04 17:06:08 +01:00
Ray
ca600b44a0 Update gestures.h 2020-02-04 17:02:06 +01:00
Ray
b5fe41f41a Review libc dependencies and remove when possible
Just for clarification, no plans to remove libc dependency, just did some code analysis to see how much raylib depend on stardard C library. My conclusions:

 - stdlib.h: primary dependency is for malloc() and free()
 - stdio.h: primary dependency is for FILE access, maybe it could go through a custom ABI?
 - string.h: just around 8 functions required
 - math.h: just around 8 functions required
 - others: 1-2 functions required for some other headers
2020-02-04 16:55:24 +01:00
Ray
3cd9e3896a tweak 2020-02-04 15:43:14 +01:00
David Reid
7024628c65 Update to miniaudio 0.10 (#1092)
* Update to miniaudio 0.10

This replaces the old ma_pcm_converter with ma_data_converter.

At this time of this commit, miniaudio 0.10 is still in the testing
phase. To make it easier to update miniaudio.h during this period, I've
temporarily moved the @raysan5 Win32 customizations to raudio.c because
there may be quite a few updates to miniaudio.h during this time.

* Use miniaudio's built-in volume control.
2020-02-04 13:43:31 +01:00
Ray
d2bb6185f1 Review issue with RLGL TraceLog() 2020-02-03 20:20:00 +01:00
Ray
c3f06b7470 Remove all trail spaces 2020-02-03 19:26:28 +01:00
Ray
a7afd8de99 Update rlgl.h 2020-02-03 19:25:05 +01:00
Ray
cde26c743c Replace TraceLog() function by TRACELOG macro
Added SUPPORT_TRACELOG_DEBUG config
2020-02-03 19:13:24 +01:00
Ray
40b73a8a91 Develop branch integration (#1091)
* [core] REDESIGNED: Implement global context

* [rlgl] REDESIGNED: Implement global context

* Reviewed globals for Android

* Review Android globals usage

* Update Android globals

* Bump raylib version to 3.0 !!!

* [raudio] REDESIGNED: Implement global context

* [raudio] Reorder functions

* [core] Tweaks on descriptions

* Issues with SUPPORT_MOUSE_GESTURES

* [camera] Use global context

* REDESIGN: Move shapes drawing texture/rec to RLGL context

* Review some issues on standalone mode

* Update to use global context

* [GAME] Upload RE-PAIR game from GGJ2020 -WIP-

* Update game: RE-PAIR

* [utils] TRACELOG macros proposal

* Update config.h
2020-02-03 18:31:30 +01:00
Ray
6f3c99a295 Update project version for release 2020-02-03 18:21:37 +01:00
Ray
9ce2331cc1 [build] Makefile examples modularization
Now examples can be compiled by module, that's useful when compilation fails at some point
2020-01-30 13:47:39 +01:00
Ray
cacd4a9d90 Some examples tweaks 2020-01-30 12:27:04 +01:00
Ray
be7f717a24 Update to be detected by GitHub 2020-01-29 14:53:19 +01:00
Ray
4992edab24 ADDED: DrawPoint3D() 2020-01-29 12:21:22 +01:00
Ray
af3df8bdd6 Review PHYSAC_NO_THREADS on WebAssembly 2020-01-29 12:10:50 +01:00
Ray
02a533768c Review bool type check 2020-01-29 12:10:09 +01:00
Ray
46046bf018 Review spacing 2020-01-29 12:09:56 +01:00
Ray
bc29720024 Renamed Mat2 to Matrix2x2 2020-01-29 12:09:35 +01:00
Ray
6a2e51ec78 Added comments related to #837 2020-01-29 11:42:55 +01:00
Ray
e6d304cdc2 Tweak to avoid compilation warning 2020-01-28 18:35:14 +01:00
Ray
4663cc03f3 Removed big examples 2020-01-28 18:34:59 +01:00
Ray
77484cb19c Update README.md 2020-01-28 18:32:48 +01:00
Ray
15345ded25 Removed big examples (models_solar_system_rlgl) 2020-01-28 18:30:55 +01:00
Ray
c715cae18d Some tweaks 2020-01-28 16:40:12 +01:00
Ray
98a7d35bab Corrected issue with matrix order multiplication #1054 2020-01-27 16:32:28 +01:00
Ray
4f7d090fb2 ADDED: DrawEllipse() and DrawEllipseLines() #1047 2020-01-27 16:21:37 +01:00
Ray
954f029118 Support touch/mouse indistinctly
REMOVED: IsTouchDetected()
2020-01-27 15:31:43 +01:00
Ray
4fa2c32906 Review touch input scaling for PLATFORM_WEB #163
Now touch inputs scale proportionally to the canvas size
2020-01-27 12:09:31 +01:00
Ray
7e9bed5c89 Review default font scale filter for HighDPI mode 2020-01-26 18:53:34 +01:00
Ray
5ec87c4c6f ADDED: TextCopy() #1083 2020-01-26 18:38:46 +01:00
Ray
05443cd0c8 Corrected bug #989 2020-01-26 18:29:13 +01:00
Ray
b02c6127a0 Minor tweaks 2020-01-26 13:27:37 +01:00
Ray
46774a8167 REVIEWED: GetDirectoryPath() 2020-01-26 13:01:35 +01:00
Ray
f28c1ef675 ADDED: IsTouchDetected() 2020-01-24 19:45:51 +01:00
Ray
eee995ec3d ADDED: GetWorldToScreenEx()
Addressing issue #1056
2020-01-24 18:54:53 +01:00
Ray
a3ca859db2 Allow MAX_BATCH_BUFFERING config at compile time 2020-01-24 18:36:20 +01:00
Ray
40d6c15798 Addressed issue #1051
Allow frustrum culling near/far distance configuration at compile time.
2020-01-24 18:35:58 +01:00
Ray
d41386d661 Minor tweaks to avoid warnings 2020-01-24 18:23:36 +01:00
Ray
7ae426c377 Redesigned TextToInteger() 2020-01-24 17:58:19 +01:00
Ray
fa0d5bbf9e Remove duplicate function 2020-01-23 21:12:50 +01:00
Ray
d10ff78822 WARNING: Renamed Vector3Multiply() to Vector3Scale()
Renamed for consistency with Vecto2Scale()
Also renamed Vector3MultiplyV() to Vector3Multiply()
2020-01-23 21:10:12 +01:00
Ray
e932d23cf4 Update cgltf.h 2020-01-22 23:24:11 +01:00
Ray
49b723e76d Correct issue with define 2020-01-22 15:11:22 +01:00
Ray
71017993ce Remove unneeded traces 2020-01-21 00:32:35 +01:00
raysan5
42d56d2f37 Added SUPPORT_HALFBUSY_WAIT_LOOP 2020-01-19 17:31:55 +01:00
raysan5
cff38308b7 Support custom allocator 2020-01-19 13:05:21 +01:00
raysan5
9c52a4932d Corrected issue with types 2020-01-19 12:49:33 +01:00
raysan5
edc1d2511d Review module to fit raylib conventions
Support custom allocators
2020-01-19 12:29:21 +01:00
raysan5
1c4dadcf68 Support custom memory allocators 2020-01-19 12:10:09 +01:00
raysan5
d797bb3e1c Support custom memory allocators 2020-01-19 11:42:16 +01:00
raysan5
bec467705e Review custom allocators 2020-01-19 11:23:38 +01:00
raysan5
fe0d04c879 Review functions modifiers 2020-01-19 11:23:27 +01:00
raysan5
406373caa9 Review functions definition modifiers 2020-01-19 11:22:28 +01:00
Victor Gallet
6a46dcb374 Fix compilation when the SUPPORT_MESH_GENERATION feature is not supported (previously, the loadModel function was using the GenMeshCube texture, if no model founded, to generate a default cube mesh (#1075) 2020-01-17 23:06:46 +01:00
Yunoinsky
7e77dc7a21 Create makefile for building android app on osx (#1070)
* Create makefile for building android app on osx

This makefile can work on macos to build android app

* Update and rename Makefile.macos.android to Makefile.Android.macos

Rename the makefile for android macos.

* Update Makefile.Android.macos

replace the user specific folder with env var $HOME
2020-01-16 16:41:49 +01:00
Ray
56e7a75a77 Update ci_src_examples_win.yml 2020-01-15 18:28:29 +01:00
Ray
0b4af7d341 Update ci_src_examples_win.yml 2020-01-15 18:25:02 +01:00
Ray
8deac79028 Update ci_src_examples_win.yml 2020-01-15 18:22:55 +01:00
Ray
2031c06880 Update ci_src_examples_win.yml 2020-01-15 18:20:16 +01:00
Ray
20e446cc7d Review Makefiles for web compilation 2020-01-15 18:00:13 +01:00
Ray
1eae4b483b Commented unnecessary printf()/puts() calls 2020-01-15 13:14:06 +01:00
Ray
1f82b0d847 Comment tweak 2020-01-15 13:13:30 +01:00
Ray
b0ce16b460 LoadFontData(): generate empty image for space
This could be required on texture packing ;)
2020-01-15 11:53:46 +01:00
Ray
237972652d GetImageAlphaBorder() return 0 in case of blank image 2020-01-15 11:52:50 +01:00
Ray
9f699af138 Merge branch 'master' of https://github.com/raysan5/raylib 2020-01-15 11:22:15 +01:00
Ray
4525c897e2 GetImageData() returns NULL if image size is 0 2020-01-15 11:22:00 +01:00
jbosh
019434a37e Fix for short non-looping sounds (#1067)
Short non-looping sounds can sometimes think they need to keep playing and will output their first few frames again. This helps to break out of all the loops instead of just this one.
2020-01-14 09:15:52 +01:00
Ray
22b7713287 IsFileExtension(): Review issue with no-extension files 2020-01-12 13:56:03 +01:00
Ray
a748c3bf25 Review VS2017 project to support x64 properly 2020-01-12 13:52:01 +01:00
Ray
cc827041a9 Update ci_src_examples_win.yml 2020-01-10 17:20:51 +01:00
Ray
95d31b0986 Update ci_src_examples_win.yml 2020-01-10 17:10:32 +01:00
Ray
e30995c65c Update ci_src_examples_win.yml 2020-01-10 17:05:38 +01:00
Ray
2829cec720 Update ci_src_examples_win.yml 2020-01-10 16:37:23 +01:00
Ray
a63a422972 Update ci_src_examples_win.yml 2020-01-10 16:13:41 +01:00
Ray
e043dad2a6 Update ci_src_examples_win.yml 2020-01-10 16:09:45 +01:00
Ray
aca9f20c2e Update ci_src_examples_win.yml 2020-01-10 16:04:04 +01:00
Ray
da51abf07f Update ci_src_examples_win.yml 2020-01-10 16:00:19 +01:00
Ray
31af42ee8e Update ci_src_examples_win.yml 2020-01-10 15:58:29 +01:00
Ray
c77f97c84a Update ci_src_examples_win.yml 2020-01-10 15:52:33 +01:00
Ray
d8f1aad494 Added CI badges 2020-01-10 13:45:30 +01:00
Ray
6b2aa173fc Update cd_src_release.yml 2020-01-10 13:05:19 +01:00
Ray
2cf8352b95 Update cd_src_release.yml 2020-01-10 13:04:48 +01:00
Ray
55e7428924 Update cd_src_release.yml 2020-01-10 12:38:53 +01:00
Ray
c7fe2c772e Update cd_src_release.yml 2020-01-10 12:04:16 +01:00
Ray
a4a10a6edd Update cd_src_release.yml 2020-01-10 11:29:08 +01:00
Ray
c2e79a212c Update cd_src_release.yml 2020-01-10 11:23:35 +01:00
Ray
680cbdf1f0 Update ci_src_examples_macos.yml 2020-01-10 11:20:43 +01:00
Ray
9961e3b0d7 Update ci_src_examples_win.yml 2020-01-10 11:10:05 +01:00
Ray
5997fa8fe1 Update ci_src_examples_win.yml 2020-01-10 11:05:49 +01:00
Ray
59a44bf5b9 Update ci_src_examples_win.yml 2020-01-10 10:56:53 +01:00
Ray
30f21438bc Update README.md 2020-01-10 00:05:31 +01:00
Ray
ebcbe292c1 Update ci_src_examples_linux.yml 2020-01-09 23:53:16 +01:00
Ray
b978dec51c Update cd_src_release.yml 2020-01-09 23:51:47 +01:00
Ray
8cef1d12f2 Create cd_src_release.yml 2020-01-09 23:45:41 +01:00
Ray
a77505c554 Update ci_src_examples_linux.yml 2020-01-09 23:39:43 +01:00
Ray
e0d4cc3143 ADDED: DrawPolyLines() 2020-01-09 18:34:20 +01:00
Ray
fcf15fe8c0 Removed comment 2020-01-09 18:33:50 +01:00
Ray
1694887f9b Update ci_src_examples_win.yml 2020-01-09 17:33:53 +01:00
Ray
0237231a8d Update ci_src_examples_win.yml 2020-01-09 17:30:35 +01:00
Ray
e88099bfd3 Update ci_src_examples_win.yml 2020-01-09 17:27:52 +01:00
Ray
887881486b Update ci_src_examples_win.yml 2020-01-09 17:27:03 +01:00
Ray
f21bd8836a Update ci_src_examples_win.yml 2020-01-09 17:21:12 +01:00
Ray
18c309fb38 Update ci_src_examples_win.yml 2020-01-09 17:13:53 +01:00
Ray
bc07636d6b Update ci_src_examples_win.yml 2020-01-09 17:06:34 +01:00
Ray
7104911236 Update ci_src_examples_win.yml 2020-01-09 16:55:12 +01:00
Ray
ca329bba0d Update ci_src_examples_win.yml 2020-01-09 16:53:00 +01:00
Ray
d1a4c1f789 Update ci_src_examples_win.yml 2020-01-09 16:50:01 +01:00
Ray
451969de1b Update ci_src_examples_macos.yml 2020-01-09 16:36:01 +01:00
Ray
7fe8d25253 Update ci_src_examples_linux.yml 2020-01-09 16:35:42 +01:00
Ray
b17937dda8 Create ci_src_examples_macos.yml 2020-01-09 16:33:57 +01:00
Ray
6f0a4a7663 Rename ccpp.yml to ci_src_examples_linux.yml 2020-01-09 16:06:58 +01:00
Ray
98f4e06a37 Create ci_src_examples_win.yml 2020-01-09 16:06:17 +01:00
Ray
1db9a85b5d Added more examples to list 2020-01-09 14:16:10 +01:00
Ray
e5c9e5e328 Added new categories 2020-01-09 13:57:24 +01:00
Ray
eb8512b43c Added some more examples 2020-01-09 13:45:34 +01:00
Ray
6321dd4614 Added shapes examples 2020-01-09 13:32:19 +01:00
Ray
689f3c086b Update README.md 2020-01-09 13:26:26 +01:00
Ray
9f79ed2972 Create core_2d_camera_platformer.png 2020-01-09 13:23:40 +01:00
Ray
421bbde1e0 Redesigning tables 2020-01-09 13:22:14 +01:00
Ray
10982fa184 Renamed directory 2020-01-09 13:14:57 +01:00
Ray
a1809fad4c Renamed directory: physac -> physics
Examples categories are independent from the module they use, despite in some cases module name matches category name.
2020-01-09 13:11:56 +01:00
Ray
8f05322263 Review example and screenshots 2020-01-09 12:58:24 +01:00
Ray
358ca7595d Review IsFileExtension() to be case-insensitive 2020-01-09 10:43:21 +01:00
Ray
89fedf0bb9 Comments review 2020-01-08 18:33:21 +01:00
Ray
4211056354 Reviewed some comments 2020-01-08 18:21:08 +01:00
Ray
6d56c99a37 Reorganized some variables for consistency 2020-01-08 17:19:06 +01:00
Ray
f46fcb8307 IsAudioBufferPlaying() replace ERROR by WARNING 2020-01-08 12:41:36 +01:00
Ray
b708965ab7 Added examples images to README 2020-01-07 19:06:44 +01:00
Ray
3c8b7a41b2 Merge branch 'master' of https://github.com/raysan5/raylib 2020-01-07 16:45:39 +01:00
Ray
a08508f6a4 Renamed LICENSE.md to LICENSE 2020-01-07 16:45:17 +01:00
Ray
7e0929e3b4 Create README.md 2020-01-07 16:26:41 +01:00
raysan5
793977db4a Review resources LICENSE 2020-01-06 19:50:26 +01:00
raysan5
b5b3bbb30b Review variable name 2020-01-06 19:49:52 +01:00
raysan5
615cb35d96 VS2017 project: Added x64 platform configuration
NOTE: When building for 64bit in raylib static mode, CloseWindow() symbol collides with user32.lib symbol. No solution for that at the moment, just compile raylib as shared library (raylib.dll), actually it can be chosen on project configurations.
2020-01-05 20:13:35 +01:00
raysan5
21c30f43d4 Update year to 2020 2020-01-05 20:01:54 +01:00
raysan5
c20ccfe274 Review PR #1040 naming and formating 2019-12-29 13:55:15 +01:00
raysan5
c0d1425aac Remove TABS 2019-12-29 13:53:05 +01:00
raysan5
350cb0a8a8 GenTextureCubemap(): renamed parameter 2019-12-29 13:52:48 +01:00
chriscamacho
cedd5efe4c fixed free camera pitch (#1040) 2019-12-29 13:47:01 +01:00
las3rlars
f8bd56b07f Normals was not correctly updated when using animated meshes (#1052)
* Normal vbo not correctly updated
2019-12-29 12:17:36 +01:00
Ray
9fbf5c8ca2 Review VS2017 project configuration 2019-12-25 10:12:59 +01:00
illegalinstruction
caa1f45643 Forcibly ensure .xm playback starts in the right place; fixes #1043. (#1045) 2019-12-21 13:02:54 +01:00
Ray
5e8b6b0157 Review flags and web compilation 2019-12-16 18:07:17 +01:00
Ray
8473e94879 Add some comments on desktop multi-touch 2019-12-16 18:06:48 +01:00
Ray
8dece6a179 Update README.md 2019-12-15 23:09:20 +01:00
Ray
ccf085ac70 Merge branch 'master' of https://github.com/raysan5/raylib 2019-12-15 23:02:35 +01:00
Ray
dde1d68a02 Remove KDevelop 2019-12-15 23:02:04 +01:00
Ray
14884a2a6c Update supported projects 2019-12-15 23:01:08 +01:00
Ray
9c62d8a400 Remove VS2015 project 2019-12-15 22:57:53 +01:00
Shylie
6e1326143e Typo fixes (#1039)
* Update SPONSORS.md

* Update SPONSORS.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2019-12-13 20:40:47 +01:00
Ray
03e6006ac8 Corrected bug on rlReadTexturePixels() 2019-12-11 23:26:42 +01:00
Ray
e614942a2d Read texture data as RGBA from FBO on GLES 2.0 2019-12-11 23:22:10 +01:00
Ray
1397242d88 Small code tweak to avoid warning 2019-12-11 23:14:32 +01:00
Ray
b8246d8592 Minor format tweaks for PR #1036 2019-12-10 00:18:29 +01:00
Justin
7eacac24d5 SetWindowMonitor made functioning again. (#1036)
* We get the video mode from the target monitor and use that to set, therefore
keeping windowed-fullscreen
* Added a GLFW_AUTO_ICONIFY 0 hint so that glfw does not minimize the window
when changing focus from a windowed fullscreen window. This is more expected
behavior for windowed full screen, when a user alt-tabs or clicks on a window in
the other monitor, they expect their windowed-fullscreen window to remaining up.
2019-12-10 00:14:56 +01:00
Ahmad Fatoum
2a64aa2abd external: glfw: reinstate export of GLFW_PKG_{DEPS,LIBS}
We were doing this before, but it was deleted during the
last GLFW update. Readd it to fix the associated macOS CI failure.

Fixes: ea5cd42e6 ("Update GLFW to version 3.4")
2019-12-05 00:29:24 +01:00
Ray
f976b03a4f Update ccpp.yml 2019-12-04 20:23:13 +01:00
Ray
8db130289e Update ccpp.yml 2019-12-04 20:11:34 +01:00
raysan5
3aad221b1e Review some shaders to work on GLSL 100
Tested on Raspberry Pi... Just note that platform is very limited by GPU...
2019-12-04 19:52:53 +01:00
Ray
ff499fe57d Update ccpp.yml 2019-12-04 18:42:50 +01:00
Ray
3c75bb5e6d Update ccpp.yml 2019-12-04 18:34:11 +01:00
Oskari Timperi
8a08a9b225 Fix IsMouseButtonReleased() when press/release events come too fast (#1032)
If press/release events for a mouse button come too fast, then using
`IsMouseButtonReleased()` does not work. This has been noticed when
using a touchpad on Linux when tapping with two fingers two emulate
right mouse button click.

The situation looks like this:

```
BeginDrawing           <-- current==released, previous==released
Pressed                <-- current=pressed
Released               <-- current=released
IsMouseButtonReleased  <-- returns false because current==previous
EndDrawing             <-- previous=released
```

The fix is to update the previous mouse button state in addition to
current mouse button state when `MouseButtonCallback()` is called by
glfw. Now the situation is as follows:

```
BeginDrawing           <-- current==released, previous==released
Pressed                <-- current=pressed, previous=released
Released               <-- current=released, previous=pressed
IsMouseButtonReleased  <-- returns true because current!=previous
EndDrawing             <-- previous=released
```
2019-12-04 18:29:11 +01:00
Ray
1b7d136daa Create ccpp.yml 2019-12-04 18:25:17 +01:00
raysan5
f346c672fb Work on macOS HighDPI issue #826 2019-12-04 18:09:56 +01:00
raysan5
08adb4b8c3 Check and testing timming #865 2019-12-04 17:59:17 +01:00
raysan5
3d936061c8 Corrected issue #1027 2019-12-04 11:05:46 +01:00
Ray
95f3b6e18e Review VSync on fullscreen mode
It seems to work ok on my old Intel HD Graphics card... it should work anywhere else
2019-12-01 13:58:29 +01:00
MasterZean
8eecbbe4aa fixes for switching full-screen and v-sync (#963)
* fixes for switching full-screen and v-sync

* requireVsync flag
2019-12-01 13:46:09 +01:00
Ray
ea5cd42e6c Update GLFW to version 3.4 2019-12-01 13:30:02 +01:00
Ray
3ffe34f9bb ADDED: DrawTextCodepoint()
- Renamed GetGlyphIndex() parameter
 - Review DrawTextEx() implementation
 - Review DrawTextRecEx() implementation
2019-12-01 13:28:14 +01:00
Ray
416a52b5bc Minor comments tweak 2019-12-01 12:55:33 +01:00
Ray
91faf72dda Rename and review: core_2d_camera_platformer 2019-11-25 13:06:56 +01:00
Ray
60e8511543 Update miniaudio.h to v0.9.8 2019-11-25 11:42:49 +01:00
Ray
97abaff4c5 Support rlPushMatrix() and rlPopMatrix() on mesh drawing 2019-11-25 11:29:04 +01:00
Ray
5ad65d9291 Minor format tweaks 2019-11-25 11:26:26 +01:00
Darryl Dixon - Piece Digital
776304e8e8 Comments (#1026)
* swapped comments, expanded comment for clarity

* revert alignments

* adjusted for consistency
2019-11-25 00:13:05 +01:00
raysan5
d5aab98ac9 Review PR #1015
Just simplified code a bit
2019-11-24 14:08:27 +01:00
brankoku
1f66f0d9a2 [text] TextFormat() caching (#1015) 2019-11-24 14:01:35 +01:00
raysan5
c1a02e9fca Review PR #1022
Actually OpenAL is not used any more, it should be using CoreAudio
2019-11-24 13:43:48 +01:00
Richard Smith
f987ac9dca fix example build on macos (#1022) 2019-11-24 13:41:23 +01:00
raysan5
1d3f230c92 Review key input queue PR #1012
Keeping original API
2019-11-24 13:39:45 +01:00
Ushio
ae301a1d23 add api FIFO based character input. (#1012)
* add api FIFO based character input.

* rename input character functions

* replace tab to space x4 #1012
2019-11-24 12:46:00 +01:00
Ushio
b132ae099b Fix camera not working problem at align z direction. #924 (#1013)
* Fix camera not working problem at align z direction. #924

* replace tab to space x4
2019-11-24 12:37:52 +01:00
Ray
2783d0d63e DrawPoint3D(): PR review 2019-11-22 00:33:50 +01:00
Eric J
5d27c1e6c9 Add DrawPoint3D() function to models.c (#1019)
Uses fewer vertexes than using DrawCube() or DrawSphere() for points.  The small line is on analogy to the code for DrawPoint() in shapes.c.
2019-11-22 00:30:19 +01:00
Kevin Yonan
d2882a68fe Adding double ended stack & Mempool Reset function (#1021) 2019-11-22 00:27:23 +01:00
Ray
2ae5849826 Update BINDINGS.md 2019-11-22 00:18:03 +01:00
Ray
25ae374f62 Added raylib binding 2019-11-20 21:46:04 +01:00
JuDelCo
8b7db29ba0 Fix Makefile missing X11 lib when building as a shared library on Linux. (#1018) 2019-11-15 19:46:20 -08:00
JuDelCo
74642ba1c6 Fix VSCode template for debugging. (#1014) 2019-11-12 19:30:45 +01:00
brankoku
96b0563249 [rlgl] Create function rlUpdateMeshAt (#1010)
* [rlgl] Create function `rlUpdateMeshAt`

* [rlgl] Update function `rlUpdateMeshAt`
2019-11-11 11:49:13 +01:00
ChrisDill
00c611a5fb [Core] Added ColorFromNormalized which is the reverse of ColorNormalize. (#1011) 2019-11-08 21:02:41 +01:00
brankoku
bba8454034 rlUpdateMesh now supports updating indices (#1009) 2019-11-06 11:43:36 +01:00
raysan5
29b9b054dd REVIEW: rlLoadTexture()
Corrected bug when loading a RenderTexture texture passing NULL data.
2019-11-04 13:40:59 +01:00
raysan5
e8b89b5ecf REVIEW: GetImageData() and GetImageAlphaBorder() 2019-11-04 13:30:55 +01:00
Pablo Marcos Oltra
5d9df629d7 Fix generation of web examples (#1007)
At least on Linux, CMake seems to add automatically
the '-rdynamic' flag. As a result, Emscripten
generates a fat HTML file that does not work.
Removing it allows HTML+JS+WASM generation.
2019-11-01 19:09:38 +01:00
Ray
dc6136e820 Review formatting for PR #1004 2019-10-29 16:03:21 +01:00
João Coelho
75b0264f35 fix various problems, thanks CppCheck :) (#1005)
* explained a bit more the core_window_letterbox example

* fixed a few 'ups' moments that could lead to mild head pain and time loss
2019-10-29 15:57:19 +01:00
Ray
64c588e9d8 Review latest PR #1003 2019-10-29 15:56:14 +01:00
Jean-Seb / jseb
862ef0524e Raysan (#1003)
* new linux makefile for Android portages

* Revert "projects: CMake: bump up minimal raylib version (#983)"

This reverts commit 82306af111.

* new PR for upstream

* for Raysan
2019-10-29 15:54:01 +01:00
Ray
d73abe73e5 REDESIGN: TextToUtf8()
ADDED: CodepointToUtf8()
2019-10-28 20:53:32 +01:00
Ray
6bf746d531 Corrected issue with function renamed 2019-10-28 20:39:39 +01:00
Ray
f6df47dfe5 ADDED: TextToUtf8() -WIP-
RENAMED: TextCountCodepoints() -> GetCodepointsCount()
2019-10-27 23:56:48 +01:00
Donald Duvall
3f12fa54f7 Update Bindings list include raylib-pas info (#1001) 2019-10-27 17:15:25 +01:00
chriscamacho
90b3dceb54 added GetMatrixProjection fixed issue with GL11 where model matrix was identity (#999) 2019-10-27 12:13:18 +01:00
Industrious Nomad
a6db31c01e updated RayMarching Demo (#997)
* Removed Unused Uniforms

uniform vec3 viewUp;
uniform float deltaTime;

* Removed Unused uniforms

uniform vec3 viewUp;
uniform float deltaTime;

* Updated Source

  Added   - #define PLATFORM_DESKTOP line for desktop users.
            This now will correctly find the proper glsl version for the raymarching.fs file.
  Removed - Uniforms --> deltaTime and viewUp. Including the code that was setting them.
            They were never used and they were triggering a log warning.
  Removed - The const from both screenWidth and screenHeight.
            Now they can be used to update the shader resolution when screen is resized.
            NOTE : This is a quick fix and probably not the best idea.
  Added   - IsWindowResized() to check if screen is resized.
            If window is resized then width, height and shader resolution are updated.
  Changed - MIT tag at bottom right color value to BLACK. Now it's easier to see.

* Closer Match to original code

* Removed the PLATFORM_DESKTOP Define
2019-10-26 09:45:15 +02:00
Ray
39e22046c1 ClearDirectoryFiles(): Corrected issue #994 2019-10-25 14:29:12 +02:00
chriscamacho
3d8b1165a8 mem leak in gltf loader (#995) 2019-10-23 10:42:17 +02:00
Ray
163a9e1f41 ClearDirectoryFiles() corrected bug 2019-10-23 00:46:41 +02:00
Ray
9b6227688f Corrected issue #992 2019-10-22 23:31:04 +02:00
Ray
3c2ce77b7b ClearDirectoryFiles(): Corrected memory leak #991 2019-10-22 23:18:42 +02:00
Ray
1878a9ea01 Corrected possible memory leak #993 2019-10-22 23:15:41 +02:00
Ray
06910eedfd Minor comment tweak 2019-10-22 23:15:26 +02:00
Ray
ca92f43c27 Review some defines 2019-10-22 00:37:10 +02:00
Ray
ea70c47a1a Review latest PR 2019-10-21 17:55:37 +02:00
Tyler Jessilynn Bezera
3f7fa6d6e7 Add multi texture support for materials in GLTF format (#979)
* Initial commit of addition for GLTF materials.. should support loading more than just albedo map.

* Clean up

* fixed seg faults and leaks

* temp don't overwrite defuse colour when rendering

* undid something dumb!

* correctly mixed diffuse map color when rendering to preserve not overwrite it
2019-10-21 17:38:23 +02:00
Ray
ab52f98480 Update text.c 2019-10-21 17:37:47 +02:00
Ray
c1d282d9e8 Corrected bug on no-extension 2019-10-21 17:37:43 +02:00
raysan5
e25f4dca1f Update external libraries 2019-10-19 17:26:58 +02:00
raysan5
68dcb55349 Corrected bug on ImageDrawRectangleLines() 2019-10-19 17:26:45 +02:00
Ray
b75511248d Remove trailing spaces 2019-10-17 17:18:03 +02:00
Ray
e40c26dea5 REVIEWED: GetCodepoints() issue
- Improved LoadBMFont()
2019-10-17 17:07:09 +02:00
Ray
7baa2975ec REDESIGNED: IsFileExtension()
Now it accepts a ';' separated list of extensions, useful to check multiple extensions
2019-10-11 20:13:11 +02:00
Ray
e0cb892d2d ADDED: GetCodepoints()
Get the unicode equivalent characters (as int array) from a UTF-8 text array... maybe this function is renamed to be clearer to users...
2019-10-11 20:12:15 +02:00
Ray
12d3e21f1b REVIEW: ImageAlphaMask()
When adding alpha mask to GRAYSCALE image, if using ImageFormat(), it could change pixel values, now we avoid that, mask is just added as an extra channel
2019-10-11 20:08:41 +02:00
chriscamacho
161c8b7d08 corrected examples Makefile target (#985) 2019-10-11 14:54:13 +02:00
elitepleb
82306af111 projects: CMake: bump up minimal raylib version (#983)
While at it, add comment to indicate what the version signifies.

[a3f: updated commit message]
2019-10-10 12:39:40 +02:00
Michael Vetter
596338b26a Check whether parsing mtl file was succesful (#982) 2019-10-03 21:05:21 +02:00
Michael Vetter
eb772bc1e0 Check whether GLTF was loaded correctly (#981) 2019-10-03 17:07:32 +02:00
Michael Vetter
047f093503 Remove dead assignments (#980)
The result of `success` is actually never used. Either we should check
for it and return or remove it. I assume just checking the last one is
okay.
2019-10-03 17:06:08 +02:00
Ray
df84f93938 Add security checks on file writting 2019-09-30 17:32:06 +02:00
Ray
a8e63b9724 Convert default shader to const strings 2019-09-25 16:45:17 +02:00
Catalin Moldovan
99e86d180b Const corectness for LoadShaderCode (#977)
* Const corectness for LoadShaderCode

* Added const for standalone variant as well.
2019-09-25 16:31:10 +02:00
AlexHCC
8adcec185e Improve code readability (#976) 2019-09-24 23:08:07 +02:00
Ray
3fcf2ee19a Example renamed 2019-09-22 22:13:22 +02:00
Ray
bdcb16e7bb Review PR and comments 2019-09-22 21:47:19 +02:00
chriscamacho
a679b0ccc0 contributed simple shader example (#973)
Contributed simple shader example
2019-09-22 21:28:50 +02:00
AlexHCC
acedf4a0d5 Fixed regular polygon shape rendering (#972) 2019-09-22 21:25:39 +02:00
Ray
1f730b3b35 Review ImageCrop() security checks 2019-09-20 15:55:55 +02:00
Ray
b331edd7a6 Let the user choose the formats 2019-09-20 15:54:10 +02:00
Ray
9d53e07883 Added preprocessor macros for GIF 2019-09-19 17:36:48 +02:00
chriscamacho
bce2dd1231 fixed leak with PBR example (#971) 2019-09-19 17:11:37 +02:00
Ray
d089e1cd34 ADDED: LoadAnimatedGIF() -WIP-
Still looking for a better way to integrate it into raylib API, maybe add a LoadImageAnim()?
2019-09-19 16:09:36 +02:00
Ray
741afde3bc Review PR formatting 2019-09-19 13:36:55 +02:00
chriscamacho
314c4061df fixs issue mem leak with LoadModel / OBJ and issue with -1 material index (#969) 2019-09-19 13:28:01 +02:00
raysan5
08165fed18 Review DecompressData() types, for consistency 2019-09-15 11:15:33 +02:00
raysan5
112874fe07 Review issue with HDR pixels loading 2019-09-14 20:07:44 +02:00
raysan5
c10348cc85 Review conditions 2019-09-14 19:01:33 +02:00
Ray
904a7ee032 Update for latest emsdk configuration
Note that latest emsdk changed paths
2019-09-13 17:08:20 +02:00
Ray
4ccf1e61be Corect typo 2019-09-13 17:07:29 +02:00
chriscamacho
6916ff58b1 fixed some memory leaks, still issue with material index allocation leaking 4 bytes (possibly double allocation) (#964) 2019-09-13 13:29:52 +02:00
Ray
e5d5f6e367 Review possible memory leak with my_strndup() 2019-09-13 12:58:42 +02:00
Ray
7caedff9ca Review weird PBR shader issue >_< 2019-09-12 19:22:47 +02:00
Ray
d9d9c6111b RENAMED: text_sprite_font > text_font_spritefont 2019-09-12 16:30:39 +02:00
Ray
8d6f179062 RENAMED: text_ttf_loading > text_font_filters 2019-09-12 16:29:26 +02:00
Ray
7e08b312d5 RENAMED: text_bmfont_ttf > text_font_loading 2019-09-12 16:28:58 +02:00
Ray
c6d2502bdb Review example crashing
Note this example is not working properly, it still requires some review.
2019-09-12 16:27:58 +02:00
Ray
a2fd427224 Comment tweak 2019-09-12 16:26:37 +02:00
Ray
74ed3d07f9 Add glTF Duck model 2019-09-12 16:26:19 +02:00
Ray
ce58b168f6 REMOVED: models_obj_viewer 2019-09-12 16:25:33 +02:00
Ray
c247c371c3 REDESIGNED: models_obj_loading > models_loading 2019-09-12 16:25:14 +02:00
Ray
0a2177b4bc ADDED: GetWindowPosition() 2019-09-10 12:43:44 +02:00
Ray
ae2452d280 ADDED small compression API
- ADDED: CompressData()
 - ADDED: DecompressData()
2019-09-09 21:56:16 +02:00
Ray
2d6bc1ff42 Update raudio.h 2019-09-09 21:54:40 +02:00
Ray
dec5f332ad Revert "Update tinyobj_loader_c.h"
This reverts commit 53b32f1c20.
2019-09-08 16:46:08 +02:00
Ray
d93f8eadf8 REVIEW: GetFileName(): Security checks 2019-09-08 01:11:53 +02:00
Ray
53b32f1c20 Update tinyobj_loader_c.h 2019-09-05 13:15:47 +02:00
Ray
402ce4e53b Update plane_diffuse.png 2019-09-04 15:04:09 +02:00
Ray
861a619053 Review dr_flac usage
Replaced DEPRECATED functions
2019-09-03 23:24:09 +02:00
Ray
fc95ceadf0 Remove sampleLeft from Music struct... -WIP-
...moved to internal AudioBuffer structure as totalFramesProcessed, now time measure works again... but there is some problem with looping...
Also note some inconsistencies between frames and samples, it seems those concepts are not considered correctly in the code.
2019-09-03 23:08:02 +02:00
chriscamacho
dde1e0671f examples makefile not deleting examples in Linux (#955)
I'm not sure why the clean command is so complex (especially given that find -type f -executable | xargs rm -fv works!)
but I fixed the version as is, to support x-pie-executable which was preventing it deleting anything on my system...
2019-08-27 19:58:49 +02:00
raysan5
4e43192561 Review latest PR 2019-08-27 13:15:56 +02:00
arvyy
97101d1003 Add screen->world and world->screen functions for 2D; add extended camera2D example (#947) 2019-08-27 13:05:28 +02:00
raysan5
37bb8e9554 UpdateModelAnimation() - Added security check 2019-08-27 12:23:30 +02:00
raysan5
41732bebe8 Formatting tweak 2019-08-27 12:22:54 +02:00
raysan5
e2183f0b99 Update version in case no config.h is being used 2019-08-27 12:10:09 +02:00
raysan5
f565ff018e REMOVED: FLAG_SHOW_LOGO
raylib logo animation has been removed. That funtionality was very restrictive, not configurable at all and hardly ever used, also, it added a coupling dependency of `core` module with `shapes` and `text` modules.
2019-08-27 11:24:04 +02:00
raysan5
8241dcf80b Review models loading, memory initialization 2019-08-27 11:16:43 +02:00
raysan5
c661cad692 Review all RL_CALLOC() calls
All data should be properly initialized by now
2019-08-27 10:56:49 +02:00
raysan5
37a6f12037 Unload model shaders and textures
They are not automatically unloaded when unloading the model!
2019-08-26 21:19:04 +02:00
raysan5
addbd88833 Expose scissor functionality 2019-08-26 21:09:03 +02:00
Zatherz
8e86f3586d IsAudioBufferProcessed -> IsAudioStreamProcessed (#951)
It appears that you've missed renaming this function here, which makes trying to compile standalone raudio.c error out.
2019-08-26 00:34:54 +02:00
Ray
e67c842faa Tweak on atlas size computing
Some generated fonts were not fitting the image...
2019-08-24 20:03:47 +02:00
Ray
061294e4d1 Update miniaudio.h 2019-08-24 10:11:32 +02:00
raysan5
20fa362700 Review comment 2019-08-21 18:59:15 +02:00
raysan5
20257f3e49 Uniform initialization not supported on GLSL 100 2019-08-20 21:17:06 +02:00
raysan5
3db13edd89 Support mouse cursor on RPI native
Reduced bunnymark limits
2019-08-20 20:39:22 +02:00
raysan5
a727f5768f Review OpenGL ES 2.0 extensions check 2019-08-20 19:33:46 +02:00
raysan5
bf0db83134 Merge branch 'master' of https://github.com/raysan5/raylib 2019-08-20 19:33:05 +02:00
raysan5
ef3b01dffc RPI: Corrected issue when creating 3d projection view 2019-08-20 19:32:12 +02:00
Ray
64575e711b Update README.md 2019-08-20 13:15:48 +02:00
Ray
3414910809 Update README.md 2019-08-20 13:15:10 +02:00
Ray
2f42b0ce85 REVIEW: TextSplit()
Just adding a security check
2019-08-19 15:09:54 +02:00
Colday96
12bcdb977a Update shapes.c for smoother collision detection (#946)
By removing the equal sign, if the 2 rects a right next to each other and not overlapping, there will be no collision detection. This is what a majority of other game libraries do and would make it easier to implement collisions for tile based games.
2019-08-19 13:32:17 +02:00
Ray
973d32f9a7 Reviewed issue #943 2019-08-19 12:17:02 +02:00
Ray
049a1c8f6d Merge branch 'master' of https://github.com/raysan5/raylib 2019-08-19 12:09:25 +02:00
Ray
4b79f63d07 new example: shaders_fog 2019-08-19 12:08:45 +02:00
Oraoto
7ebcd06652 Fix uninitialized vboId in GenMeshHeightmap (#949) 2019-08-19 10:25:26 +02:00
Ray
ce8d7042c6 PR formatting review 2019-08-16 16:15:47 +02:00
arvyy
d8b8c0f3fc change Camera2D behavior (#945) 2019-08-16 16:09:50 +02:00
raysan5
c387bc586d RENAMED: IsAudioBufferProcessed() -> IsAudioStreamProcessed()
Renamed for consistency with similar functions
2019-08-13 17:41:31 +02:00
raysan5
c629b16ebc Corrected issue on compressed textures data size 2019-08-12 12:35:23 +02:00
raysan5
cef1e6e2e2 Added notes about vertex order 2019-08-11 21:26:12 +02:00
raysan5
740834bb83 REVIEW: GetDirectoryPath() and GetPrevDirectoryPath() 2019-08-11 12:04:54 +02:00
Wayde Reitsma
2c2ccadd32 Small fix in GetMouseY (#940) 2019-08-11 11:17:20 +02:00
chriscamacho
6f2f09947f addition to raylib to create matrix from 3 euler angles (#938) 2019-08-09 17:04:52 +02:00
Ray
e6e48675cc Formating tweaks 2019-08-08 23:08:54 +02:00
raysan5
108f7f6fee Corrected small issue on miniaudio
ONly Neon processors
2019-08-08 10:32:42 +02:00
raysan5
2234158049 Merge branch 'master' of https://github.com/raysan5/raylib 2019-08-08 10:18:25 +02:00
raysan5
3ebc55fdfe Reviewed comment 2019-08-08 10:18:12 +02:00
Kevin Yonan
084fb31186 Removing '__RemoveNode' (#935)
Replaced '__RemoveNode' as it was causing invalid memory accesses with regular doubly linked list deletion algorithm.
Replaced double pointer iterator in 'MemPoolAlloc' with single pointer iterator.
Fixed undefined variables errors in 'MemPoolFree' for the freelist bucket.
2019-08-08 10:00:23 +02:00
chriscamacho
2d5cc5ddbf fixed xmloader bug, user must free model shaders and textures as they might be shared (#933) 2019-08-08 09:57:21 +02:00
Michael Vetter
f3555a1016 Fix memleak in physics_restitution example (#932) 2019-08-07 09:24:56 +02:00
Michael Vetter
5f1990e044 Fix build caused by GetImageAlphaBorder() (#931)
Fix build failure introduced in 2a913b6587
2019-08-07 09:23:15 +02:00
Ray
3d46297cc1 Update external libraries 2019-08-07 00:33:57 +02:00
Ray
439e73a8ec Change raylib version to 2.6-dev 2019-08-07 00:33:33 +02:00
Ray
3d5fa81bf2 WARNING: Redesigned structs
- Mesh, Shader, Material structs have been reviewed to minimize size when passed by value, all required code has been reviewed.
 - GetCollisionRayModel() reviewed to avoid pointer, not required because model is not modified inside the function
 - UnloadMesh() reviewed, pointer not required
 - CheckCollisionRay*() parameters name reviewed
2019-08-07 00:32:44 +02:00
Ray
2a913b6587 ADDED: GetImageAlphaBorder() 2019-08-07 00:28:05 +02:00
Ray
042499188c ADDED: DirectoryExists() and GetPrevDirectoryPath() 2019-08-07 00:27:32 +02:00
Ray
b354c10072 ADDED: DirectoryExists()
ADDED: GetPrevDirectoryPath()
2019-08-07 00:26:33 +02:00
Michael Vetter
6267fd1865 Fix memory leak in LoadGLTF() (#929)
Free texturePath in LoadGLTF()
2019-08-06 23:09:27 +02:00
culacant
f518c4e939 Fix loading multiple animations from .iqm file (#928)
* Fix loading multiple animations from .iqm file

* Fix memory leak in models_animation example

* Added export instructions to the animation example

* use raylib free

* include <stdlib.h> to appease the travis CI gods

* replace tabs with spaces
2019-08-06 23:08:58 +02:00
NimbusFox
e53e42f43d Improved Android Building (#930)
Added in a check for x86 and x86_64 branches of android

Added in $(OS) checks to see if we're running on windows or *nix

Added a default location for android ndks and sdks at /usr/lib/android
2019-08-06 23:06:26 +02:00
Ray
94abe0db88 Allow GitHub Sponsors only 2019-08-03 12:57:06 +02:00
Leandro Gabriel
89c16baf18 Replace tabs with spaces and update year of copyright notices (#927)
* Update year of copyright notices

* Fix mistake in comment

* Fix typo ("algorythms")

* Replace tabs with spaces

* Remove trailing whitespace and fix mistake in comment

* Fix ExportImageAsCode missing comment rectangle corner

* Replace tab with spaces

* Replace tabs with spaces
2019-08-03 11:07:41 +02:00
João Coelho
68ffbc06c7 explained a bit more the core_window_letterbox example (#925) 2019-08-02 15:16:43 +02:00
Kevin Yonan
f81cb1a252 End of July rmem Update (#923)
Object Pool Changes:
-- changed 'size' member name of 'union ObjInfo' to 'index' to better name its purpose.
Memory Pool Changes:
-- Added memory node buckets to store and allocate smaller, more frequent byte sizes.
-- Replaced 'memset' call to deinitialize free list data with NULL and 0 assignments.
-- Removed some no-longer-needed commented-out code.
-- Changed insertion sort code to put the largest size at the tail rather than the head.
-- Made certain pointer variables as constant pointers.
2019-07-31 11:24:33 +02:00
raysan5
1da7e1da8c Review VSCode project 2019-07-30 14:00:10 +02:00
Kevin Yonan
5775f9d224 Patched potential bug when defragging. (#920)
* Patched potential bug when defragging.

Patched a potential bug concerning the '__RemoveNode' function as, when removing certain nodes that are either at the head or tail, it can yield a free list node of size 0 bug as the previous node was removed and its size was set to 0 but not fully removed from the other nodes.

* A few more potential bug patches.
2019-07-28 21:37:31 +02:00
raysan5
38ee6156f8 Update textures_mouse_painting.c 2019-07-28 19:04:30 +02:00
raysan5
b83d165764 Replace tabs by spaces 2019-07-28 15:33:55 +02:00
raysan5
895f9613d2 Added image saved message 2019-07-28 15:26:22 +02:00
raysan5
602d2a65dd Reviewed new examples 2019-07-28 15:09:01 +02:00
ChrisDill
879c874330 Added scissor test and mouse painting examples proposed in #890 (#919)
- Updated Makefile with new examples
2019-07-28 11:12:13 +02:00
raysan5
153f078bd1 Update raygui.h 2019-07-27 12:42:18 +02:00
raysan5
9a478bef1a Avoid ricons.h 2019-07-27 12:04:47 +02:00
raysan5
a1c551c6c4 Reviewed rlTextureParameters()
Reviewed latest PR to also consider OpenGL 1.1 extension support (unprobable).
2019-07-27 11:59:41 +02:00
Reece Mackie
e44eae3cd5 Changes without CLion mess (#916) 2019-07-27 11:53:00 +02:00
Antonio Radovcic
814952c01d #917 This commit changes the path to 'shell.html' in all Makefiles (#918) 2019-07-27 11:45:49 +02:00
raysan5
6baf8bccb1 Removed functions modifiers 2019-07-27 11:44:50 +02:00
raysan5
f46ffb98a6 Update raygui.h 2019-07-27 11:44:13 +02:00
Ray
65d003507b Update FUNDING.yml 2019-07-27 09:56:24 +02:00
Ray
251f90cd31 WARNING: Replaced Music pointer by struct
Now, multiple music parameters are exposed to the user!
2019-07-26 10:26:39 +02:00
Ray
8e870f0eda Try to support stack matrices on models drawing
Not working yet... :(
2019-07-24 22:40:12 +02:00
Ray
7c05e498fc Test Camera on Android
It can break building on that platform...
2019-07-24 22:39:33 +02:00
Ray
eed53a5b44 Changed macro CLITERAL 2019-07-24 22:38:57 +02:00
Ray
9909c83012 REMOVED: LoadWaveEx()
Completely useless and actually buggy!
2019-07-24 22:38:40 +02:00
Ray
73a3d4a183 Review comments 2019-07-24 22:38:06 +02:00
Ray
ae95111006 Some variables renamed 2019-07-24 22:37:24 +02:00
Ray
8730f22371 Remove note 2019-07-24 22:37:00 +02:00
Ray
a5329efb23 Some tweaks revisiting an old game... 2019-07-24 22:36:52 +02:00
Ray
b4d67499a7 BREAKING CHANGE: Read description
Changes:

 - Font structure has been redesigned, CharInfo structure contained character rectangle within font texture, it has not much sense, considering that it was an information relative to the font atlas generated and not the character itself, so character rectangles have been moved out from CharInfo to Font.
 - CharInfo included a data parameters to contain character pixel data (usually grayscale), generated on TTF font generation. It was inconsistent with other fonts types, so, now CharInfo includes directly an Image of the glyph.
 - REDESIGNED: GenImageFontAtlas(), additional recs parameter added, loaded and filled inside the function to export atlas characters rectangles, instead of silently modify the input CharInfo data.
 - REVIEWED: ImageTextEx(), funtion retrieved the font atlas image from the GPU, that was slow and problematic in several platforms. Now it uses directly the CharInfo image. Support for unicode codepoints has also been added.
 - REDESIGNED: ImageDraw(), now it includes an additional parameter, the color tint, not only it could be useful for several situations but also function signature is more consistent with similar functions.
 - ADDED: ImageFromImage() to generate a new image from a piece of another image.
 - REVIEWED: GetNextCodepoint(), renamed parameters to be more clear.

Also all examples and games that were affected by those changes have been reviewed.
2019-07-24 15:05:14 +02:00
Ray
543c0ba30d Added Sound parameters data 2019-07-24 14:48:45 +02:00
Ahmad Fatoum
47137b1489 CMake: fix dependency build with -Draylib_USE_STATIC_LIBS=ON
Fixes #899, which made apparent three issues with how static libraries
are handled in raylib-config.cmake:

- XPREFIX is set before pkg_check_modules, which causes a duplicate
  STATIC in variables, e.g. PC_RAYLIB_STATIC_STATIC_.*
- raylib_static is searched for, but no library exists with that name
- raylib_LDFLAGS isn't populated properly

This commit fixes these.
2019-07-24 00:12:38 +02:00
Ray
7b448f59e2 Update raylib.h 2019-07-23 23:37:14 +02:00
Ray
2cb3b91913 Try to avoid collision with CoreAudio on macOS 2019-07-23 23:08:29 +02:00
Ray
2433f30b4b Reviewed ImageDraw() and ImageResizeCanvas()
Added security checks in case provided image to functions hasn't been properly loaded... just to avoid program crashes.
2019-07-23 22:24:25 +02:00
Ray
b44b7dd310 WARNING: Complete review of raudio -WIP-
This module has been completely reviewed, old structures still contained OpenAL useless data, a full module revision. Some of the changes:
 - Redesigned internal MusicData structure
 - Exposed MusicStream structure data
 - Reviewed AudioStream structure
 - Redesigned Sound structure

Still some work to do...
2019-07-23 22:21:01 +02:00
Ray
632d064b21 Review text functions return value
It needs to be freed
2019-07-22 21:29:50 +02:00
Ray
bc3983a3dd Solved issue #912 2019-07-22 21:15:25 +02:00
Kevin Yonan
f501d42e47 Increasing threshold size for traversing memory blocks (#914)
L235 - Increased the memory threshold size so that we can further reduce fragmentation by allocating memory blocks that is close to the requested size by 16 bytes.
2019-07-22 10:17:27 +02:00
Ray
4b2f6b2b5f Check buffer limit on DrawBillboardRec() 2019-07-22 00:12:51 +02:00
Ray
3fd48a14a2 Create SPONSORS.md 2019-07-18 23:19:22 +02:00
Ray
55e76dab47 Update FUNDING.yml 2019-07-16 23:32:49 +02:00
Ray
8d576aaf2b Update FUNDING.yml 2019-07-16 20:36:08 +02:00
raysan5
e5271dbdc3 Move raylib memory pool docs to raylib Wiki 2019-07-15 19:30:58 +02:00
raysan5
e8829538c9 Review rmem functions naming and coding conventions 2019-07-15 19:25:55 +02:00
Kevin Yonan
c563b53afb Submitting rmem memory and object pool module (#898)
* Submitting rmem memory and object pool module

* changed 'restrict' to '__restrict' so it can compile for MSVC

Added `const` to parameters for `MemPool_Realloc`

* Update and rename mempool README.txt to mempool_README.md

* Update mempool_README.md

* Update mempool_README.md

* Update and rename objpool README.txt to objpool_README.md

* implementing changes

* updating header for changes.

* forgot to change _RemoveNode to __RemoveNode

* removing l

* removing l

* Updating documentation on MemPool_CleanUp function

* Updating documentation on ObjPool_CleanUp function

* changed *_CleanUp function parameter

Replaced `void*` pointer to pointer param to `void**` so it's more explicit.

* Updating header to reflect changes to the *_CleanUp functions

* A single change for the mempool and a patch for the objpool.

Object Pool Patch: if you deplete the object pool to 0 free blocks and then free back one block, the last given block will be rejected because it was exactly at the memory holding the entire pool.
Mempool change: switched memory aligning the size from the constructor to when allocating.
2019-07-15 18:28:09 +02:00
Aldrin Martoq
e19616592d Adding solar system examples. (#900) 2019-07-15 18:26:47 +02:00
raysan5
24566c0cf3 Delete CODE_OF_CONDUCT.md 2019-07-15 13:41:58 +02:00
raysan5
a386cedae6 Review extensions loading and freeing 2019-07-12 14:36:20 +02:00
raysan5
83f6ae148a Merge branch 'master' of https://github.com/raysan5/raylib 2019-07-12 14:33:13 +02:00
raysan5
f9a2d89ed2 Use function GetSizeBase64() 2019-07-12 14:33:06 +02:00
Ray
b4da7b6777 Review VSCode project 2019-07-02 18:36:09 +02:00
Ray
4ad1fa85a4 Remove old OpenAL comments 2019-06-29 11:26:31 +02:00
Ray
892813de76 Review multichannel PR addition
- Capital letters at beginning
- for loop spacing and brackets
- Functions naming for consistency
- Example following examples template
- Other tweaks
2019-06-29 11:26:08 +02:00
chriscamacho
83a4eb0852 add multi channel audio to raudio (#895)
* added multi channel sound replay to raudio
added -fPIC to Makefile for Linux
added simple lighting and audio multi channel to examples Makefile

* not properly reporting audio buffer pool size...
2019-06-29 10:49:42 +02:00
Leandro Gabriel
a4e307ed96 Fix typo in comment (onlyl -> only) 2019-06-24 16:06:02 +02:00
Ray
65a21ab416 Renamed screenWidth & screenHeight 2019-06-19 16:01:47 +02:00
Ray
1b249ac1e1 Define some globals 2019-06-19 15:43:35 +02:00
Ray
e0854696b4 ADDED: DrawTriangleStrip() 2019-06-17 10:29:58 +02:00
Ray
f951f0c536 RENAMED: LoadDefaultFont() -> LoadFontDefault()
Renamed internal function for consistency with similar functions.
2019-06-16 23:42:51 +02:00
Ray
e36a80f730 Code tweaks 2019-06-16 23:37:16 +02:00
Ray
d21422687a Some formatting tweaks 2019-06-16 23:36:04 +02:00
Ray
9a7d4ccb79 Merge pull request #893 from kawa-yoiko/rlgl-quad-padding
Fix vertex padding not zeroed for quads
2019-06-15 19:58:28 +02:00
Shiqing
5baab54f93 Fix vertex padding not zeroed for quads, close #891 2019-06-15 13:51:56 +08:00
Ray
721d18589f Corrected issue with input threads (RPI) 2019-06-14 18:24:55 +02:00
Ray
dccd61bef9 Support new flag: FLAG_WINDOW_ALWAYS_RUN
Do not stop update/draw on window minimized

WARNING: SetConfigFlag() was reviewed to support int flags
2019-06-14 17:18:33 +02:00
Ray
9c991bd079 Remove example from Android building 2019-06-14 13:35:42 +02:00
Ray
81d8302d53 ADDED: shaders_basic_lighting 2019-06-14 12:59:40 +02:00
Ray
a43d49ed72 Added CMake flags
Reviewed comments
2019-06-12 12:21:23 +02:00
Ray
0c60af8981 Tweak: Change check order 2019-06-12 12:14:36 +02:00
Ray
9609ebf49a Corrected IQM function declaration 2019-06-12 12:12:59 +02:00
Ray
55380f8489 Review DEBUG mode 2019-06-12 12:08:39 +02:00
Ray
266df463cc Support externally provided compiler 2019-06-12 12:03:34 +02:00
Ray
5fec3ef895 Merge pull request #879 from DarkElvenAngel/Keyboard-patch
Keyboard patch
2019-06-12 12:00:52 +02:00
Ray
396b830db5 Update CONTRIBUTING.md 2019-06-12 11:30:18 +02:00
DarkElvenAngel
034e9ba1b8 Add files via upload 2019-06-10 17:09:53 -04:00
DarkElvenAngel
d7f4be0715 Merge pull request #1 from raysan5/master
Update
2019-06-10 16:12:06 -04:00
Ray
baf7d7d19a Update BINDINGS.md 2019-06-09 23:15:42 +02:00
Ray
632d16e27d Added raylib-python-cffi 2019-06-09 22:54:56 +02:00
Ray
f6db1ef9c5 Merge pull request #876 from XiaochuanWang/patch-2
Update Makefile
2019-06-09 21:38:37 +02:00
Ray
9b3b28c81f Merge pull request #875 from XiaochuanWang/patch-1
Update Makefile
2019-06-09 21:38:23 +02:00
XiaochuanWang
391555a063 Update Makefile
corrected file location for "raylib.rc.data", which will cause an error during compilation
2019-06-09 01:45:51 +10:00
XiaochuanWang
63e320d405 Update Makefile
a minor issue: where the location of the file "raylib.rc.data" is wrong, and this will cause an error in compilation.
2019-06-09 01:08:10 +10:00
Ray
59b7412772 Updated games building 2019-06-07 00:16:08 +02:00
Ray
718f7a0161 Remove wrong files 2019-06-06 23:56:05 +02:00
Ray
dee602464b Merge branch 'master' of https://github.com/raysan5/raylib 2019-06-06 23:52:53 +02:00
Ray
baf225dc01 Update emsdk version for testing 2019-06-06 23:52:49 +02:00
Ray
6945511e82 Update example 2019-06-06 23:52:25 +02:00
Ray
e1f3f84e84 Merge pull request #873 from msmshazan/ANGLE-fix
Changed ANGLE binaries location
2019-06-06 14:23:37 +02:00
Mohamed Shazan
eb1b2535f6 Change ANGLE binaries location 2019-06-06 16:44:37 +05:30
Ray
566a8d17c8 Update CONTRIBUTING.md 2019-06-06 12:45:24 +02:00
Ray
af38e18389 Review projects <PlatformToolset> to use default 2019-06-06 12:19:39 +02:00
Ray
37ce51b274 Merge pull request #872 from msmshazan/ANGLE-fix
Added VS2017.ANGLE Project
2019-06-06 11:51:43 +02:00
Ray
498c172d8e Review function prototype 2019-06-06 11:38:45 +02:00
Mohamed Shazan
272d9d58e3 Add VS2017.ANGLE Project 2019-06-06 15:03:03 +05:30
Ray
7b4831f1b7 Update LICENSE.md 2019-06-05 13:35:34 +02:00
Ray
bdbc05c0dc Review font 2019-06-05 13:35:22 +02:00
Ray
e3ef738264 Replace TABS by spaces 2019-06-05 13:01:58 +02:00
Ray
03720b30a1 Review contributed example 2019-06-05 12:58:53 +02:00
Ray
ddaa4a304d Review contributor info 2019-06-05 12:58:35 +02:00
Ray
24c7549698 Merge pull request #869 from codecat/example-waving-cubes
Added waving cubes example
2019-06-05 12:30:55 +02:00
Ray
c5f605e888 Merge pull request #862 from a3f/master
build: increment API_VERSION after release
2019-06-05 12:29:28 +02:00
Ray
5c8191f8a7 Merge pull request #867 from PompPenguin/master
Removed unused code for CAMERA_THIRD_PERSON
2019-06-05 12:29:00 +02:00
Codecat
923f4b9bbd Added waving cubes example 2019-06-05 10:35:20 +02:00
Ahmad Fatoum
e103320ad8 build: increment API_VERSION after release
With v2.5.0 out, increment API_VERSION, so binaries dynamically linked
against the released raylib aren't accidentally paired with a development
or later released raylib that may be incompatible.
2019-06-05 08:58:24 +02:00
PompPenguin
7367140fb4 Update camera.h
Removed unused code for CAMERA_THIRD_PERSON.
2019-06-04 18:06:10 -04:00
Ray
df7a058216 Review projects paths 2019-06-05 00:04:31 +02:00
PompPenguin
1ba5f1515d Merge pull request #1 from raysan5/master
Merge pull request #866 from PompPenguin/master
2019-06-04 18:01:17 -04:00
Ray
0b7373446d Merge pull request #866 from PompPenguin/master
Update camera.h
2019-06-04 23:46:01 +02:00
PompPenguin
767ac9bc3e Update camera.h
Updated CAMERA_THIRD_PERSON
2019-06-04 17:29:18 -04:00
Ray
6f9c176d93 Support SSH keyboard on RPI 2019-06-04 18:09:17 +02:00
Ray
538dfa010d Merge pull request #858 from NerdThings/cmake-mp3-fix
Add MP3 config to config.h.in
2019-06-02 21:48:48 +02:00
Reece Mackie
2eb7e96f4b Add MP3 config 2019-06-02 19:31:17 +01:00
Ray
093042b760 Comments review 2019-06-01 13:08:48 +02:00
Ray
434e460c18 Example instructions tweak for clarity 2019-05-31 16:42:16 +02:00
Ray
65474c621c Update raylib.c.tags 2019-05-31 11:59:06 +02:00
1210 changed files with 308315 additions and 160200 deletions

6
.github/FUNDING.yml vendored
View File

@@ -1,8 +1,8 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: raylib
github: raysan5
patreon: # raylib
open_collective: # Replace with a single Open Collective username
ko_fi: raysan
ko_fi: # raysan
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -7,6 +7,16 @@ assignees: ''
---
**WARNING: Please, read this note carefully before submitting a new issue:**
It is important to realise that **this is NOT A SUPPORT FORUM**, this is for reproducible BUGS with raylib ONLY.
There are lots of generous and helpful people ready to help you out on [raylib Discord forum](https://discord.gg/raylib) or [raylib reddit](https://www.reddit.com/r/raylib/).
Remember that asking for support questions here actively takes developer time away from improving raylib.
---
Please, before submitting a new issue verify and check:
- [ ] I tested it on latest raylib version from master branch
@@ -15,7 +25,7 @@ Please, before submitting a new issue verify and check:
### Issue description
*Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to [raylib Discord server](https://discord.gg/VkzNHUE).*
*Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to [raylib Discord server](https://discord.gg/raylib).*
### Environment

100
.github/workflows/android.yml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: Android
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/android.yml'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/android.yml'
release:
types: [published]
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: windows-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
ARCH: ["arm64", "x86_64"]
env:
RELEASE_NAME: raylib-dev_android_api29_${{ matrix.ARCH }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Release Version
run: |
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_android_api29_${{ matrix.ARCH }}" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Android NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r25
add-to-path: false
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Setup Environment
run: |
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../..
# Generating static + shared library for 64bit arquitectures and API version 29
- name: Build Library
run: |
cd src
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
shell: cmd
- name: Generate Artifacts
run: |
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
cd build
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published'

111
.github/workflows/cmake.yml vendored Normal file
View File

@@ -0,0 +1,111 @@
name: CMakeBuilds
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/cmake.yml'
- 'CMakeList.txt'
- 'CMakeOptions.txt'
- 'cmake/**'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/cmake.yml'
- 'CMakeList.txt'
- 'CMakeOptions.txt'
- 'cmake/**'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
permissions:
contents: read
jobs:
build_windows:
name: Windows Build
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: powershell
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DPLATFORM=Desktop
- name: Build
working-directory: ${{github.workspace}}/build
shell: powershell
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $env:BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: powershell
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $env:BUILD_TYPE
build_linux:
name: Linux Build
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Setup Environment
run: |
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
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPLATFORM=Desktop
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE

111
.github/workflows/linux.yml vendored Normal file
View File

@@ -0,0 +1,111 @@
name: Linux
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/linux.yml'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/linux.yml'
release:
types: [published]
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
bits: [32, 64]
include:
- bits: 32
ARCH: "i386"
ARCH_NAME: "i386"
COMPILER_PATH: "/user/bin"
- bits: 64
ARCH: "x86_64"
ARCH_NAME: "amd64"
COMPILER_PATH: "/user/bin"
env:
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Setup Release Version
run: |
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_linux_${{ matrix.ARCH_NAME }}" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Environment
run: |
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
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../../../raylib
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
# TODO: Support 32bit (i386) static/shared library building
- name: Build Library
run: |
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=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
if: matrix.bits == 32
- name: Build Library
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
- name: Generate Artifacts
run: |
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
cd build
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published'

42
.github/workflows/linux_examples.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Linux Examples
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/linux_examples.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/linux_examples.yml'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Environment
run: |
sudo apt-get update -qq
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
- name: Build Library
run: |
cd src
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC
cd ..
- name: Build Examples
run: |
cd examples
make PLATFORM=PLATFORM_DESKTOP -B
cd ..

116
.github/workflows/macos.yml vendored Normal file
View File

@@ -0,0 +1,116 @@
name: macOS
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/macos.yml'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/macos.yml'
release:
types: [published]
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: macos-latest
env:
RELEASE_NAME: raylib-dev_macos
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Release Version
run: |
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_macos" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Environment
run: |
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../..
# Generating static + shared library, note that i386 architecture is deprecated
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
- name: Build Library
run: |
cd src
clang --version
# Extract version numbers from Makefile
brew install grep
RAYLIB_API_VERSION=`ggrep -Po 'RAYLIB_API_VERSION\s*=\s\K(.*)' Makefile`
RAYLIB_VERSION=`ggrep -Po 'RAYLIB_VERSION\s*=\s\K(.*)' Makefile`
# Build raylib x86_64 static
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
mv libraylib.a /tmp/libraylib_x86_64.a
make clean
# Build raylib arm64 static
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
mv libraylib.a /tmp/libraylib_arm64.a
make clean
# Join x86_64 and arm64 static
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a /tmp/libraylib_x86_64.a /tmp/libraylib_arm64.a
# Build raylib x86_64 dynamic
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target x86_64-apple-macos10.12" -B
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib
make clean
# Build raylib arm64 dynamic
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target arm64-apple-macos11" -B
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
# Join x86_64 and arm64 dynamic
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_API_VERSION}.dylib
cd ..
- name: Generate Artifacts
run: |
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
cd build
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published'

86
.github/workflows/webassembly.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: WebAssembly
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/webassembly.yml'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/webassembly.yml'
release:
types: [published]
jobs:
build:
runs-on: windows-latest
env:
RELEASE_NAME: raylib-dev_webassembly
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.30
actions-cache-folder: 'emsdk-cache'
- name: Setup Release Version
run: |
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_webassembly" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Environment
run: |
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../..
- name: Build Library
run: |
cd src
emcc -v
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
- name: Generate Artifacts
run: |
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
copy /Y .\CHANGELOG .\build/${{ env.RELEASE_NAME }}\CHANGELOG
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
cd build
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
dir
shell: cmd
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
asset_name: ${{ env.RELEASE_NAME }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published'

150
.github/workflows/windows.yml vendored Normal file
View File

@@ -0,0 +1,150 @@
name: Windows
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/windows.yml'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/windows.yml'
release:
types: [published]
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for actions/upload-release-asset to upload release asset
runs-on: windows-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
compiler: [mingw-w64, msvc16]
bits: [32, 64]
include:
- compiler: mingw-w64
bits: 32
ARCH: "i686"
WINDRES_ARCH: pe-i386
- compiler: mingw-w64
bits: 64
ARCH: "x86_64"
WINDRES_ARCH: pe-x86-64
- compiler: msvc16
bits: 32
ARCH: "x86"
VSARCHPATH: "Win32"
- compiler: msvc16
bits: 64
ARCH: "x64"
VSARCHPATH: "x64"
env:
RELEASE_NAME: raylib-dev_win${{ matrix.bits }}_${{ matrix.compiler }}
GNUTARGET: default
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Release Version
run: |
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_win${{ matrix.bits }}_${{ matrix.compiler }}" >> $GITHUB_ENV
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Environment
run: |
dir
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../../../raylib
# Setup MSBuild.exe path if required
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
if: matrix.compiler == 'msvc16'
- name: Build Library (MinGW-w64 32bit)
run: |
cd src
x86_64-w64-mingw32-gcc.exe --version
windres.exe --version
dir C:\msys64\mingw64\bin
make PLATFORM=PLATFORM_DESKTOP CC=x86_64-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS=-m32
//windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
//make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
shell: cmd
if: |
matrix.compiler == 'mingw-w64' &&
matrix.bits == 32
- name: Build Library (MinGW-w64 64bit)
run: |
cd src
${{ matrix.ARCH }}-w64-mingw32-gcc.exe --version
windres.exe --version
dir C:\msys64\mingw64\bin
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
shell: cmd
if: |
matrix.compiler == 'mingw-w64' &&
matrix.bits == 64
- name: Build Library (MSVC16)
run: |
cd projects/VS2022
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release /property:Platform=${{ matrix.ARCH }}
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release.DLL /property:Platform=${{ matrix.ARCH }}
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release.DLL\raylib.dll .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.dll
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release.DLL\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylibdll.lib
cd ../..
shell: cmd
if: matrix.compiler == 'msvc16'
- name: Generate Artifacts
run: |
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
copy /Y .\CHANGELOG .\build\${{ env.RELEASE_NAME }}\CHANGELOG
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
cd build
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
dir
shell: cmd
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
asset_name: ${{ env.RELEASE_NAME }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published'

36
.github/workflows/windows_examples.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: Windows Examples
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/windows_examples.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/windows_examples.yml'
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Build Library (MSVC16)
run: |
cd projects/VS2019
msbuild.exe raylib.sln /property:Configuration=Release /property:Platform=x86
cd ../..
shell: cmd

78
.gitignore vendored
View File

@@ -30,15 +30,14 @@ Thumbs.db
*.cache
*.ilk
*.log
.vs
[Bb]in
[Dd]ebug/
[Dd]ebug.win32/
[Dd]ebug.DLL/
*.sbr
*.sdf
obj/
[R]elease/
[Rr]elease.win32/
_ReSharper*/
[Tt]est[Rr]esult*
ipch/
@@ -46,39 +45,21 @@ ipch/
*.db
*.opendb
packages/
!examples/models/resources/models/obj/
# Ignore compiled binaries
*.o
*.exe
*.a
*.bc
!raylib.rc.o
*.so
*.so.*
# Ignore all examples files
examples/*
# Unignore all examples dirs
!examples/*/
# Unignore all examples files with extension
!examples/*.c
!examples/*.lua
!examples/*.png
# Unignore examples Makefile
!examples/Makefile
!examples/Makefile.Android
!examples/raylib_compile_execute.bat
!examples/raylib_makefile_example.bat
# Ignore all games files
games/*
# Unignore all games dirs
!games/*/
# Unignore all games files with extension
!games/*.c
!games/*.lua
!games/*.png
# Unignore games makefile
!games/Makefile
!games/Makefile.Android
# Ignore wasm data in examples/
examples/**/*.wasm
examples/**/*.data
examples/**/*.js
examples/**/*.html
# Ignore files build by xcode
*.mode*v*
@@ -94,45 +75,32 @@ xcschememanagement.plist
xcuserdata/
DerivedData/
# Visual Studio project
project/VS2015.UWP/packages
project/VS2017/packages
# Web examples
docs/examples/web/*.html
docs/examples/web/*/*.html
!docs/examples/web/loader.html
!docs/examples/web/core/loader.html
!docs/examples/web/shapes/loader.html
!docs/examples/web/text/loader.html
!docs/examples/web/textures/loader.html
!docs/examples/web/audio/loader.html
!docs/examples/web/physac/loader.html
!docs/examples/web/shaders/loader.html
!docs/examples/web/models/loader.html
# Jetbrains project
.idea/
cmake-build-*/
# CMake stuff
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
TestingIfSymlinkWorks
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
build
!templates/android_project/Makefile
# Unignore These makefiles...
!examples/CMakeLists.txt
!games/CMakeLists.txt
# Ignore Android generated files and folders
templates/android_project/output
# Ignore GNU global tags
GPATH
GRTAGS
GTAGS
.vs
# Zig programming language
zig-cache/
zig-out/
build/
build-*/
docgen_tmp/
# Parser stuff
parser/raylib_parser

View File

@@ -1,166 +0,0 @@
language: c
dist: trusty
git:
depth: 3
# TODO we could use a 32 bit Docker container for running true 32-bit tests
services:
- docker
matrix:
include:
- os: linux
env: ARCH=i386
sudo: required
- os: linux
env: ARCH=amd64 INSTALL_GLFW=YES USE_EXTERNAL_GLFW=OFF
sudo: required
- os: linux
env: ARCH=amd64 INSTALL_GLFW=YES STATIC=OFF RELEASE=NO
sudo: required
- os: linux
env: WAYLAND=ON ARCH=amd64 RELEASE=NO
sudo: required
addons:
apt:
packages:
- libwayland-dev
- libxkbcommon-dev
- libegl1-mesa-dev
- os: osx
env: ARCH=universal
- os: osx
osx_image: xcode9.4
env: ARCH=universal SHARED=OFF RELEASE=NO
- os: linux
env: ARCH=arm64-android RELEASE=NO
sudo: required
- os: linux
env: ARCH=arm32-android RELEASE=NO
sudo: required
- os: linux
env: ARCH=html5 RELEASE=NO
sudo: required
- os: windows
compiler: gcc
env: ARCH=i386 SHARED=OFF RELEASE=NO
before_script:
before_install:
- if [ -z "$USE_EXTERNAL_GLFW" ]; then export USE_EXTERNAL_GLFW=IF_POSSIBLE; fi
- if [ -z "$SHARED" ]; then export SHARED=ON ; fi
- if [ -z "$STATIC" ]; then export STATIC=ON ; fi
- if [[ "$INSTALL_GLFW" == "YES" && "$USE_EXTERNAL_GLFW" != "OFF" ]]; then
export DONT_TEST=1;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [[ "$ARCH" == *-android ]]; then
export DONT_TEST=1;
export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
wget https://dl.google.com/android/repository/android-ndk-r17-linux-x86_64.zip;
unzip -qq android-ndk*.zip;
if [[ "$ARCH" == arm64-* ]]; then
export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
TOOLCHAIN_ARCH=arm64;
PREFIX=aarch64-linux-android-;
else
export RAYLIB_PACKAGE_SUFFIX="-Android-arm32";
TOOLCHAIN_ARCH=arm;
PREFIX=arm-linux-androideabi-;
fi;
android-ndk*/build/tools/make_standalone_toolchain.py --arch $TOOLCHAIN_ARCH --api 21 --install-dir /tmp/android-toolchain;
export PATH=/tmp/android-toolchain/bin:$PATH;
export CC=${PREFIX}clang;
export CXX=${PREFIX}clang++;
export CMAKE_ARCH_ARGS='-DPLATFORM=Android';
elif [ "$ARCH" == "html5" ]; then
export DONT_TEST=1;
export RAYLIB_PACKAGE_SUFFIX="-html5";
docker run --privileged=true -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash;
export CMAKE_ARCH_ARGS='-DPLATFORM=Web -DCMAKE_TOOLCHAIN_FILE=../cmake/emscripten.cmake';
RUNNER='docker exec -it emscripten cmake -E chdir build';
else
sudo apt-get install -y gcc-multilib
libasound2-dev:$ARCH
libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
libx11-dev:$ARCH libxrandr-dev:$ARCH libxrandr2:$ARCH libxi-dev:$ARCH
libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
if [ "$OPENAL" == "ON" ]; then sudo apt-get install -y libopenal-dev; fi;
if [ "$ARCH" == "i386" ]; then export CMAKE_ARCH_ARGS='-DCMAKE_C_FLAGS=-m32 -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib/i386-linux-gnu -DSUPPORT_FILEFORMAT_FLAC=OFF'; fi;
export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
if [ "$INSTALL_GLFW" == "YES" ]; then
pushd src/external/glfw;
cmake . -DGLFW_BUILD_DOCS=OFF
-DGLFW_BUILD_TESTS=OFF
-DGLFW_BUILD_EXAMPLES=OFF
-DGLFW_INSTALL=ON
-DBUILD_SHARED_LIBS=ON
-DGLFW_USE_WAYLAND=$WAYLAND;
make;
sudo make install;
popd;
fi;
fi;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
export RAYLIB_PACKAGE_SUFFIX="-macOS";
if [ "$INSTALL_GLFW" == "YES" ]; then brew update; brew install glfw; fi;
fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
export DONT_TEST=1;
export RAYLIB_PACKAGE_SUFFIX="-windows";
export CMAKE_ARCH_ARGS='-DPLATFORM=Desktop';
fi
- mkdir build
- $RUNNER $CC --version
script:
- cd build
- if test -n "$WAYLAND"; then
wget https://mirrors.edge.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.44.0-0ubuntu1_amd64.deb;
sudo apt-get clean;
sudo apt-get update;
sudo apt-get install dpkg;
sudo dpkg -i extra-cmake-modules_5.44.0-0ubuntu1_amd64.deb;
git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
pushd wayland-protocols;
git checkout 1.15 && ./autogen.sh --prefix=/usr && make && sudo make install;
popd;
fi
- $RUNNER cmake $CMAKE_ARCH_ARGS
-DMACOS_FATLIB=ON
-DSTATIC=$STATIC -DSHARED=$SHARED
-DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON
-DUSE_EXTERNAL_GLFW=$USE_EXTERNAL_GLFW
-DUSE_WAYLAND=$WAYLAND
-DINCLUDE_EVERYTHING=ON
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
..
- $RUNNER cmake --build . --target
- if [ "$RELEASE" != "NO" ]; then $RUNNER cmake --build . --target package; fi
- if [ -n "$RUNNER" ]; then
sudo $RUNNER cmake --build . --target install;
else
$(which sudo) $RUNNER "$(which cmake)" --build . --target install;
fi
- if [ ! "$DONT_TEST" ]; then
pkg-config --static --libs raylib;
nm -g release/libraylib.a | grep glfwGetProcAddress || (echo "libraylib.a doesn't contain GLFW symbols! Aborting..." && false);
ctest --output-on-failure;
fi
deploy:
provider: releases
api_key:
secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA=
file_glob: true
file: raylib-*.tar.gz
skip_cleanup: true
on:
repo: raysan5/raylib
branch: master
tags: true

View File

@@ -1,33 +1,153 @@
### raylib bindings
# raylib bindings and wrappers
Some people ported raylib to other languages in form of bindings or wrappers to the library, here is a list with the ones I'm aware of:
Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
- [raylib](https://github.com/raysan5/raylib) : raylib **C/C++** version (default)
- [raylib-lua](https://github.com/raysan5/raylib-lua) : raylib **Lua** binding
- [raylib-lua-ffi](https://github.com/raysan5/raylib/issues/693) : raylib **Lua** ffi binding
- [raylib-go](https://github.com/gen2brain/raylib-go) : raylib **Go** binding
- [raylib-Nim](https://gitlab.com/define-private-public/raylib-Nim) : raylib **Nim** binding
- [raylib-cr](https://github.com/AregevDev/raylib-cr) : raylib **Crystal** binding
- [cray](https://gitlab.com/Zatherz/cray) - raylib **Crystal** binding
- [Graphics::Raylib](https://metacpan.org/pod/Graphics::Raylib) : raylib **Perl** wrapper
- [raylib-pascal](https://github.com/drezgames/raylib-pascal) - raylib **Pascal** binding
- [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) : raylib **C#** binding
- [RaylibSharp](https://github.com/TheLumaio/RaylibSharp) : raylib **C#** binding
- [raylib-ruby-ffi](https://github.com/D3nX/raylib-ruby-ffi) : raylib **Ruby** binding
- [raylib-rs](https://github.com/deltaphc/raylib-rs) : raylib **Rust** binding
- [raylib-py](https://github.com/overdev/raylib-py) : raylib **Python** binding
- [raylib-haskell](https://github.com/DevJac/raylib-haskell) : raylib **Haskell** binding
- [raylib-java](https://github.com/XoanaIO/raylib-java) : raylib **Java** binding
- [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) : raylib **ChaiScript** binding
- [node-raylib](https://github.com/RobLoach/node-raylib) : **Node.js** raylib binding
- [raylib-odin](https://github.com/kevinw/raylib-odin): **Odin** raylib binding
- [raylib-factor](https://github.com/Silverbeard00/raylib-factor): **Factor** raylib binding
- *[raylib COBOL Usage example](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)*
- *raylib flat-assembler Usage example*: not uploaded yet...
### Language Bindings
Missing some language? Check the [bindings not yet in this list](https://gist.github.com/raysan5/5764cc5b885183f523fce47f098f3d9b#bindings-not-yet-in-the-official-list) or create a new binding! :)
| name | raylib version | language | license | repo |
|:------------------:|:---------------:|:---------:|:----------:|-----------------------------------------------------------|
| raylib | **4.2** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | https://github.com/raysan5/raylib |
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo |
| Raylib-cs | **4.2** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | https://github.com/ChrisDill/Raylib-cs |
| Raylib-CsLo | **4.2** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/NotNotTech/Raylib-CsLo |
| cl-raylib | **4.0** | [Common Lisp](https://common-lisp.net/) | MIT | https://github.com/longlene/cl-raylib |
| claylib/wrap | **4.2** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
| chez-raylib | auto | [Chez Scheme](https://cisco.github.io/ChezScheme/) | GPLv3 | https://github.com/Yunoinsky/chez-raylib |
| raylib-cr | **4.5-dev (7e7939e)** | [Crystal](https://crystal-lang.org/) | Apache-2.0 | https://github.com/sol-vin/raylib-cr |
| ray-cyber | **4.2** | [Cyber](https://cyberscript.dev) | MIT | https://github.com/fubark/ray-cyber |
| raylib-c3 | **4.5-dev** | [C3](https://c3-lang.org/) | MIT | https://github.com/Its-Kenta/Raylib-C3 |
| dart-raylib | **4.0** | [Dart](https://dart.dev/) | MIT | https://gitlab.com/wolfenrain/dart-raylib |
| bindbc-raylib3 | **4.0** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 |
| dray | **4.2** | [D](https://dlang.org/) | Apache-2.0 | https://github.com/redthing1/dray |
| raylib-d | **4.2** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d |
| dlang_raylib | **4.0** | [D](https://dlang.org) | MPL-2.0 |https://github.com/rc-05/dlang_raylib |
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
| raylib-factor | **4.0** | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
| raylib-freebasic | **4.2** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
| raylib-go | **4.2** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
| raylib-guile | auto | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | MIT | https://github.com/ArnautDaniel/gforth-raylib |
| h-raylib | 4.5-dev | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib |
| raylib-hx | **4.2** | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
| jaylib | **4.2** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
| raylib-j | **4.0** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J |
| raylib.jl | **4.2** | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl |
| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | ? | https://github.com/electronstudio/kaylib |
| kaylib | **4.5-dev**| [Kotlin/native](https://kotlinlang.org) | Zlib | https://codeberg.org/Kenta/Kaylib |
| raylib-lua | **4.2** | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua |
| raylua | **4.0** | [Lua](http://www.lua.org/) | MIT | https://github.com/Rabios/raylua |
| nelua-raylib | 4.0 | [nelua](https://nelua.io/) | MIT | https://github.com/AKDev21/nelua-raylib |
| Raylib-Nelua | **4.5-dev** | [nelua](https://nelua.io/) | MIT | https://github.com/Its-Kenta/Raylib-Nelua |
| NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now |
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever |
| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib |
| node-raylib | **4.0** | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib |
| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | MIT | https://github.com/Deathbat2190/raylib_odin_bindings |
| raylib-odin | **4.0** | [Odin](https://odin-lang.org/) | BSD-3Clause | https://github.com/odin-lang/Odin/tree/master/vendor/raylib |
| raylib-ocaml | **4.2** | [OCaml](https://ocaml.org/) | MIT | https://github.com/tjammer/raylib-ocaml |
| TurboRaylib | **4.2** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | https://github.com/turborium/TurboRaylib |
| Ray4Laz | **4.2** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/GuvaCode/Ray4Laz |
| Raylib.4.0.Pascal | **4.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/sysrpl/Raylib.4.0.Pascal |
| pyraylib | 3.7 | [Python](https://www.python.org/) | Zlib | https://github.com/Ho011/pyraylib |
| raylib-python-cffi | **4.2** | [Python](https://www.python.org/) | EPL-2.0 | https://github.com/electronstudio/raylib-python-cffi |
| raylibpyctbg | **4.2** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg |
| raylib-py | **4.2** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py |
| raylib-python-ctypes | **4.2** | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes |
| raylib-php | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php |
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp |
| raylibr | **4.0** | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr |
| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs |
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib |
| racket-raylib | **4.0** | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib |
| raylib-swift | **4.0** | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib |
| raylib-scopes | auto | [Scopes](http://scopes.rocks) | MIT | https://github.com/salotz/raylib-scopes |
| raylib-smallBasic | 4.1-dev | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib |
| raylib-umka | **4.2** | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | https://github.com/robloach/raylib-umka |
| raylib.v | **4.2** | [V](https://vlang.io/) | Zlib | https://github.com/irishgreencitrus/raylib.v |
| raylib-vapi | **4.2** | [Vala](https://vala.dev/) | Zlib | https://github.com/lxmcf/raylib-vapi |
| raylib-wren | **4.0** | [Wren](http://wren.io/) | ISC | https://github.com/TSnake41/raylib-wren |
| raylib-zig | **4.2** | [Zig](https://ziglang.org/) | MIT | https://github.com/Not-Nik/raylib-zig |
| raylib.zig | **4.2** | [Zig](https://ziglang.org/) | MIT | https://github.com/ryupold/raylib.zig |
| hare-raylib | auto | [Hare](https://harelang.org/) | Zlib | https://git.sr.ht/~evantj/hare-raylib |
| raylib-sunder | auto | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | https://github.com/ashn-dot-dev/raylib-sunder |
| rayed-bqn | auto | [BQN](https://mlochbaum.github.io/BQN/) | MIT | https://github.com/Brian-ED/rayed-bqn |
### Utility Wrapers
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
| name | raylib version | language | license | repo |
|:------------------:|:-------------: | :--------:|:-------:|:-------------------------------------------------------------|
| raylib-cpp | **4.2** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | https://github.com/robloach/raylib-cpp |
| claylib | **4.2** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
### Older or Unmaintained Language Bindings
These are older raylib bindings that are more than 2 versions old or have not been maintained.
| name | raylib version | language | repo |
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp |
| RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS |
| raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d |
| bindbc-raylib | 3.0 | [D](https://dlang.org/) | https://github.com/o3o/bindbc-raylib |
| go-raylib | 3.5 | [Go](https://golang.org/) | https://github.com/chunqian/go-raylib |
| raylib-goplus | 2.6-dev | [Go](https://golang.org/) | https://github.com/Lachee/raylib-goplus |
| ray-go | 2.6-dev | [Go](https://golang.org/) | https://github.com/hecate-tech/ray-go |
| raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore |
| LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib |
| raylib-lua-sol | 2.5 | [Lua](http://www.lua.org/) | https://github.com/RobLoach/raylib-lua-sol |
| raylib-lua-ffi | 2.0 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib/issues/693 |
| raylib-lua | 1.7 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib-lua |
| raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua |
| raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim |
| raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim |
| nim-raylib | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/tomc1998/nim-raylib |
| raylib-haskell | 2.0 | [Haskell](https://www.haskell.org/) | https://github.com/DevJac/raylib-haskell |
| raylib-cr | 2.5-dev | [Crystal](https://crystal-lang.org/) | https://github.com/AregevDev/raylib-cr |
| raylib.cr | 2.0 | [Crystal](https://crystal-lang.org/) | https://github.com/sam0x17/raylib.cr |
| cray | 1.8 | [Crystal](https://crystal-lang.org/) | https://gitlab.com/Zatherz/cray |
| raylib-pas | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/tazdij/raylib-pas |
| raylib-pascal | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/drezgames/raylib-pascal |
| Graphics-Raylib | 1.4 | [Perl](https://www.perl.org/) | https://github.com/athreef/Graphics-Raylib |
| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby |
| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi |
| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby |
| raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java |
| clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib |
| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib |
| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape |
| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 |
| raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript |
| raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel |
| racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d |
| raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi |
| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe |
| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib |
| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm |
| raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi |
| raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme |
| Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib |
| raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin |
| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib |
| raylib-vala | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | https://code.guddler.uk/mart/raylibVapi |
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/raylib-jai |
| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments |
| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada |
| jaylib | 3.0 | [Janet](https://janet-lang.org/) | https://github.com/janet-lang/jaylib |
| raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit |
| ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod |
| raylib-mosaic | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | https://github.com/pluckyporcupine/raylib-mosaic |
| raylib-xdpw | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | https://github.com/vtereshkov/raylib-xdpw |
| raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp |
| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb |
| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic |
| raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 |
| raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef |
| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
Missing some language or wrapper? Feel free to create a new one! :)
Usually, raylib bindings follow the convention: `raylib-{language}`
Let me know if you're writing a new binding for raylib, I will list it here and I usually
provide the icon/logo for that new language binding.
Let me know if you're writing a new binding for raylib, I will list it here!

980
CHANGELOG
View File

@@ -1,7 +1,985 @@
changelog
---------
Current Release: raylib 2.5.0 (31 May 2019)
Current Release: raylib 4.5.0 (18 March 2023)
-------------------------------------------------------------------------
Release: raylib 4.5 (18 March 2023)
-------------------------------------------------------------------------
KEY CHANGES:
- ADDED: Improved ANGLE support on Desktop platforms
- ADDED: rcamera module, simpler and more extendable
- ADDED: Support for M3D models and M3D/GLTF animations
- ADDED: Support QOA audio format (import/export)
- ADDED: rl_gputex module for compressed textures loading
- REDESIGNED: rlgl module for automatic render-batch limits checking
- REDESIGNED: rshapes module to minimize the rlgl dependency
Detailed changes:
[core] ADDED: RAYLIB_VERSION_* values to raylib.h (#2856) by @RobLoach
[core] ADDED: Basic gamepad support for Android (#2709) by @deniska
[core] ADDED: Support CAPS/NUM lock keys registering if locked
[core] ADDED: _GNU_SOURCE define on Linux (#2729)
[core] ADDED: SetWindowIcons() to set multiple icon image sizes
[core] `WARNING`: RENAMED: Exported raylib version symbol to raylib_version #2671
[core] REMOVED: Touch points on touch up events on Android (#2711) by @deniska
[core] REVIEWED: Window position setup on InitWindow() (#2732) by @RandomErrorMessage
[core] REVIEWED: Touchscreen input related functions on Android (#2702) by @deniska
[core] REVIEWED: Viewport scaling on Android after context rebind (#2703) by @deniska
[core] REVIEWED: ScanDirectoryFilesRecursively() (#2704)
[core] REVIEWED: Gamepad mappings with latest gamecontrollerdb (#2725)
[core] REVIEWED: Monitor order check on app initialization
[core] REVIEWED: Application monitor when opening (#2728, #2731) by @RandomErrorMessage
[core] REVIEWED: Gestures module to use GetTime() if available (#2733) by @RobLoach
[core] REVIEWED: Resolve GLFW3 some symbols re-definition of windows.h in glfw3native (#2643) by @daipom
[core] REVIEWED: OpenURL(), string buffer too short sometimes
[core] REVIEWED: GetRandomValue() range limit warning (#2800) by @Pere001
[core] REVIEWED: UnloadDirectoryFiles()
[core] REVIEWED: GetKeyPressed(), out of range issue (#2814) by @daipom
[core] REVIEWED: GetTime(), renamed variable 'time' to 'nanoSeconds' (#2816) by @jtainer
[core] REVIEWED: LoadShaderFromMemory(), issue with shader linkage
[core] REVIEWED: Avoid possible gamepad index as -1 (#2839)
[core] REVIEWED: SetShaderValue*(), avoid setup uniforms for invalid locations
[core] REVIEWED: GetClipboardText() on PLATFORM_WEB, permissions issues
[core] REVIEWED: Initial window position for display-sized fullscreen (#2742) by @daipom
[core] REVIEWED: Sticky touches input (#2857) by @ImazighenGhost
[core] REVIEWED: Enable GetWindowHandle() on macOS (#2915) by @Not-Nik
[core] REVIEWED: Window position always inits centered in current monitor
[core] REVIEWED: IsWindowFocused() to consider Android App state (#2935)
[core] REVIEWED: GetMonitorWidth() and GetMonitorHeight() (#2934)
[core] REVIEWED: GetWindowHandle() to return Linux window (#2938)
[core] REVIEWED: WindowDropCallback(), additional security check (#2943)
[core] REVIEWED: Security checks for emscripten_run_script() (#2954)
[utils] REVIEWED: TraceLog() message size limit overflow
[rcamera] REDESIGNED: New implementation from scratch (#2563) by @Crydsch
[rcamera] REVIEWED: Make orbital camera work as expected (#2926) by @JeffM2501
[rcamera] REVIEWED: Multiple reviews on the new implementation
[rcamera] ADDED: UpdateCameraPro(), supporting custom user inputs
[rlgl] ADDED: OpenGL ES 2.0 support on PLATFORM_DESKTOP (#2840) by @wtnbgo
[rlgl] ADDED: Separate blending modes for color and alpha, BLEND_CUSTOM_SEPARATE (#2741)
[rlgl] ADDED: rlSetBlendFactorsSeparate and custom blend mode modification checks (#2741) by @pure01fx
[rlgl] ADDED: RL_TEXTURE_MIPMAP_BIAS_RATIO support to `rlTextureParameters()` for OpenGL 3.3 #2674
[rlgl] ADDED: rlCubemapParameters() (#2862) by @GithubPrankster
[rlgl] ADDED: rlSetCullFace() (#2797) by @jtainer
[rlgl] REMOVED: Mipmaps software generation for OpenGL 1.1
[rlgl] REVIEWED: Check for extensions before enabling them (#2706) by @Not-Nik
[rlgl] REVIEWED: SSBO usage to avoid long long data types
[rlgl] REVIEWED: Enable DXT compression on __APPLE__ targets (#2694) by @Not-Nik
[rlgl] REVIEWED: enums exposed and description comments
[rlgl] REVIEWED: rlBindImageTexture(), correct data types (#2808) by @planetis-m
[rlgl] REVIEWED: rlMultMatrixf(), use const pointer (#2807) by @planetis-m
[rlgl] REVIEWED: Expose OpenGL blending mode factors and functions/equations
[rlgl] REVIEWED: rLoadTextureDepth(), issue with depth textures on WebGL (#2824)
[rlgl] REVIEWED: rlUnloadFramebuffer() (#2937)
[raymath] ADDED: Vector2LineAngle() (#2887)
[raymath] REVIEWED: Vector2Angle() (#2829, #2832) by @AlxHnr, @planetis-m
[shapes] ADDED: CheckCollisionPointPoly() (#2685) by @acejacek
[shapes] REVIEWED: DrawPixel*(), use RL_QUADS/RL_TRIANGLES (#2750) by @hatkidchan
[shapes] REVIEWED: DrawLineBezier*(), fix bezier line breaking (#2735, #2767) by @nobytesgiven
[textures] ADDED: ColorBrightness()
[textures] ADDED: ColorTint()
[textures] ADDED: ColorContrast()
[textures] ADDED: Support for PNM images (.ppm, .pgm)
[textures] ADDED: GenImagePerlinNoise()
[textures] ADDED: GenImageText(), generate grayscale image from text byte data
[textures] ADDED: ImageDrawCircleLines(), ImageDrawCircleLinesV() (#2713) by @RobLoach
[textures] ADDED: ImageBlurGaussian() (#2770) by @nobytesgiven
[textures] REVIEWED: Image fileformat support: PIC, PNM
[textures] REVIEWED: ImageTextEx() and ImageDrawTextEx() scaling (#2756) by @hatkidchan
[textures] `WARNING`: REMOVED: DrawTextureQuad()
[textures] `WARNING`: REMOVED: DrawTexturePoly(), function moved to example: `textures_polygon`
[textures] `WARNING`: REMOVED: DrawTextureTiled(),function implementation moved to the textures_tiled.c
[text] ADDED: GetCodepointPrevious()
[text] ADDED: UnloadUTF8(), aligned with LoadUTF8()
[text] `WARNING`: RENAMED: TextCodepointsToUTF8() to LoadUTF8()
[text] `WARNING`: RENAMED: GetCodepoint() -> GetCodepointNext()
[text] REDESIGNED: GetCodepointNext()
[text] REVIEWED: MeasureTextEx(), avoid crash on bad data
[text] REVIEWED: UnloadFontData(), avoid crash on invalid font data
[models] ADDED: Support M3D model file format (meshes and materials) (#2648) by @bztsrc
[models] ADDED: Support for M3D animations (#2648) by @bztsrc
[models] ADDED: GLTF animation support (#2844) by @charles-l
[models] ADDED: DrawCapsule() and DrawCapsuleWires() (#2761) by @IanBand
[models] ADDED: LoadMaterials(), MTL files loading, same code as OBJ loader (#2872) by @JeffM2501
[models] `WARNING`: REMOVED: UnloadModelKeepMeshes()
[models] `WARNING`: REMOVED: DrawCubeTexture(), DrawCubeTextureRec(), functions moved to new example: `models_draw_cube_texture`
[models] REVIEWED: DrawMesh(), using SHADER_LOC_COLOR_SPECULAR as a material map (#2908) by @haved
[models] REVIEWED: LoadM3D() vertex color support (#2878) by @GithubPrankster, @bztsrc
[models] REVIEWED: GenMeshHeightmap() (#2716)
[models] REVIEWED: LoadIQM() (#2676)
[models] REVIEWED: Simplify .vox signature check (#2752) by @CrezyDud
[models] REVIEWED: LoadIQM(), support bone names loading if available (#2882) by @PencilAmazing
[models] REVIEWED: GenMeshTangents(), avoid crash on missing texcoords data (#2927)
[audio] ADDED: Full support for QOA audio file format
[audio] ADDED: Mixed audio processor (#2929) by @hatkidchan
[audio] ADDED: IsWaveReady()`, IsSoundReady(), IsMusicReady() (#2892) by @RobLoach
[audio] `WARNING`: REMOVED: Multichannel audio API: PlaySoundMulti(), StopSoundMulti()
[audio] REVIEWED: Clear PCM buffer state when closing audio device (#2736) by @veins1
[audio] REVIEWED: Android backend selected (#2118, #2875) by @planetis-m
[audio] REVIEWED: Change default threading model for COM objects in miniaudio
[multi] ADDED: IsShaderReady(), IsImageReady(), IsFontReady() (#2892) by @RobLoach
[multi] ADDED: IsModelReady(), IsMaterialReady(), IsTextureReady(), IsRenderTextureReady() (#2895) by @RobLoach
[multi] REVIEWED: Multiple code/comment typos by @sDos280
[multi] REVIEWED: Grammar mistakes and typos (#2914) by @stickM4N
[multi] REVIEWED: Use TRACELOG() macro instead of TraceLog() in internal modules (#2881) by @RobLoach
[examples] ADDED: textures_textured_curve (#2821) by @JeffM2501
[examples] ADDED: models_draw_cube_texture
[examples] ADDED: models_loading_m3d (#2648) by @bztsrc
[examples] ADDED: shaders_write_depth (#2836) by @BugraAlptekinSari
[examples] ADDED: shaders_hybrid_render (#2919) by @BugraAlptekinSari
[examples] REMOVED: audio_multichannel_sound
[examples] RENAMED: Several shaders for naming consistency (#2707)
[examples] RENAMED: lighting_instanced.fs to lighting_instancing.fs (glsl100) (#2805) by @gtrxAC
[examples] REVIEWED: core_custom_logging.c (#2692) by @hartmannathan
[examples] REVIEWED: core_camera_2d_platformer (#2687) by @skylar779
[examples] REVIEWED: core_input_gamepad.c (#2903) by @planetis-m
[examples] REVIEWED: core_custom_frame_control
[examples] REVIEWED: core_drop_files (#2943)
[examples] REVIEWED: text_rectangle_bounds (#2746) by @SzieberthAdam
[examples] REVIEWED: textures_image_processing, added gaussian blurring (#2775) by @nobytesgiven
[examples] REVIEWED: models_billboard, highlighting rotation and draw order (#2779) by @nobytesgiven
[examples] REVIEWED: core_loading_thread, join thread on completion (#2845) by @planetis-m
[examples] REVIEWED: models_loading_gltf
[examples] REVIEWED: Shader lighting.fs for GLSL120 (#2651)
[examples] REVIEWED: text_codepoints_loading.c
[parser] REVIEWED: raylib-parser Makefile (#2765) by @Peter0x44
[build] ADDED: Packaging for distros with deb-based and rpm-based packages (#2877) by @KOLANICH
[build] ADDED: Linkage library -latomic on Linux (only required for ARM32)
[build] ADDED: Required frameworks on macOS (#2793) by @SpexGuy
[build] ADDED: WASM support for Zig build (#2901) by @Not-Nik
[build] ADDED: New raylib examples as VS2022 project (to raylib solution)
[build] REVIEWED: config.h format and inconsistencies
[build] REVIEWED: Zig build to latest master, avoid deprecated functions (#2910) by @star-tek-mb
[build] REVIEWED: CMake project template to easily target raylib version (#2700) by @RobLoach
[build] REVIEWED: PATH for PLATFORM_WEB target (#2647) by @futureapricot
[build] REVIEWED: build.zig to let user decide how to set build mode and linker fixes by @InKryption
[build] REVIEWED: Deprecation error on Android API higher than 23 (#2778) by @anggape
[build] REVIEWED: Android x86 Architecture name (#2783) by @IsaacTCB
[build] REVIEWED: examples/build.zig for the latest Zig version (#2786) by @RomanAkberov
[utils] REVIEWED: ExportDataAsCode() data types (#2787) by @RGDTAB
[build] REVIEWED: Makefile emscripten path (#2785) by @Julianiolo
[build] REVIEWED: Several compilation warnings (for strict rules)
[build] REVIEWED: All github workflows using deprecated actions
[build] REVIEWED: CMake when compiling for web (#2820) by @object71
[build] REVIEWED: DLL build on Windows (#2951) by @Skaytacium
[build] REVIEWED: Avoid MSVC warnings in raylib project (#2871) by @JeffM2501
[build] REVIEWED: Paths in .bat files to build examples (#2870) by @masoudd
[build] REVIEWED: CMake, use GLVND for old cmake versions (#2826) by @simendsjo
[build] REVIEWED: Makefile, multiple tweaks
[build] REVIEWED: CI action: linux_examples.yml
[build] REVIEWED: CI action: cmake.yml
[bindings] ADDED: h-raylib (Haskell) by @Anut-py
[bindings] ADDED: raylib-c3 (C3) by @Its-Kenta
[bindings] ADDED: raylib-umka (Umka) by @RobLoach
[bindings] ADDED: chez-raylib (Chez Scheme) by @Yunoinsky
[bindings] ADDED: raylib-python-ctypes (Python) by @sDos280
[bindings] ADDED: claylib (Common Lisp) by @shelvick
[bindings] ADDED: raylib-vapi (Vala) by @lxmcf
[bindings] ADDED: TurboRaylib (Object Pascal) by @turborium
[bindings] ADDED: Kaylib (Kotlin/Native) by @Its-Kenta
[bindings] ADDED: Raylib-Nelua (Nelua) by @Its-Kenta
[bindings] ADDED: Cyber (Cyber) by @fubark
[bindings] ADDED: raylib-sunder (Sunder) by @ashn-dot-dev
[bindings] ADDED: raylib BQN (#2962) by @Brian-ED
[misc] REVIEWED: Update external libraries to latest versions
-------------------------------------------------------------------------
Release: raylib 4.2 (11 August 2022)
-------------------------------------------------------------------------
KEY CHANGES:
- REMOVED: extras libraries (raygui, physac, rrem, reasings, raudio.h) moved to independent separate repos
- UPDATED: examples: Added creation and update raylib versions and assigned **DIFFICULTY LEVELS**!
- rres 1.0: A custom resource-processing and packaging file format, including tooling and raylib integration examples
- raygui 3.2: New version of the immediate-mode gui system for tools development with raylib
- raylib_parser: Multiple improvements of the raylib parser to automatize bindings generation
- ADDED: New file system API: Reviewed to be more aligned with raylib conventions and one advance function added
- ADDED: New audio stream processors API (_experimental_): Allowing to add custom audio stream data processors using callbacks
Detailed changes:
[multi] ADDED: Frequently Asked Questions (FAQ.md)
[multi] REVIEWED: Multiple trace log messages
[multi] REVIEWED: Avoid some float to double promotions
[multi] REVIEWED: Some functions input parametes that should be const
[multi] REVIEWED: Variables initialization, all variables are initialized on declaration
[multi] REVIEWED: Static array buffers are always re-initialized with memset()
[multi] `WARNING`: RENAMED: Some function input parameters from "length" to "size"
[core] ADDED: GetApplicatonDirectory() (#2256, #2285, #2290) by @JeffM2501
[core] ADDED: raylibVersion symbol, it could be required by some bindings (#2190)
[core] ADDED: SetWindowOpacity() (#2254) by @tusharsingh09
[core] ADDED: GetRenderWidth() and GetRenderHeight() by @ArnaudValensi
[core] ADDED: EnableEventWaiting() and DisableEventWaiting()
[core] ADDED: GetFileLength()
[core] ADDED: Modules info at initialization
[core] ADDED: Support clipboard copy/paste on web
[core] ADDED: Support OpenURL() on Android platform (#2396) by @futureapricot
[core] ADDED: Support MOUSE_PASSTHROUGH (#2516)
[core] ADDED: GetMouseWheelMoveV() (#2517) by @schveiguy
[core] `WARNING`: REMOVED: LoadStorageValue() / SaveStorageValue(), moved to example
[core] `WARNING`: RENAMED: GetDirectoryFiles() to LoadDirectoryFiles()
[core] `WARNING`: RENAMED: `ClearDroppedFiles()` to `UnloadDroppedFiles()`
[core] `WARNING`: RENAMED: GetDroppedFiles() to LoadDroppedFiles()
[core] `WARNING`: RENAMED: `ClearDirectoryFiles()` to `UnloadDirectoryFiles()`
[core] `WARNING`: REDESIGNED: WaitTime() argument from milliseconds to seconds (#2506) by @flashback-fx
[core] REVIEWED: GetMonitorWidth()/GetMonitorHeight() by @gulrak
[core] REVIEWED: GetDirectoryFiles(), maximum files allocation (#2126) by @ampers0x26
[core] REVIEWED: Expose MAX_KEYBOARD_KEYS and MAX_MOUSE_BUTTONS (#2127)
[core] REVIEWED: ExportMesh() (#2138)
[core] REVIEWED: Fullscreen switch on PLATFORM_WEB
[core] REVIEWED: GetMouseWheelMove(), fixed bug
[core] REVIEWED: GetApplicationDirectory() on macOS (#2304)
[core] REVIEWED: ToggleFullscreen()
[core] REVIEWED: Initialize/reset CORE.inputs global state (#2360)
[core] REVIEWED: MouseScrollCallback() (#2371)
[core] REVIEWED: SwapScreenBuffers() for PLATFORM_DRM
[core] REVIEWED: WaitTime(), fix regression causing video stuttering (#2503) by @flashback-fx
[core] REVIEWED: Mouse device support on PLATFORM_DRM (#2381)
[core] REVIEWED: Support OpenBSD timming functions
[core] REVIEWED: Improved boolean definitions (#2485) by @noodlecollie
[core] REVIEWED: TakeScreenshot(), use GetWindowScaleDPI() to calculate size in screenshot/recording (#2446) by @gulrak
[core] REVIEWED: Remove fps requirement for drm connector selection (#2468) by @Crydsch
[core] REVIEWED: IsFileExtension() (#2530)
[camera] REVIEWED: Some camera improvements (#2563)
[rlgl] ADDED: Premultiplied alpha blend mode (#2342) by @megagrump
[rlgl] REVIEWED: VR rendering not taking render target size into account (#2424) by @FireFlyForLife
[rlgl] REVIEWED: Set rlgl internal framebuffer (#2420)
[rlgl] REVIEWED: rlGetCompressedFormatName()
[rlgl] REVIEWED: Display OpenGL 4.3 capabilities with a compile flag (#2124) by @GithubPrankster
[rlgl] REVIEWED: rlUpdateTexture()
[rlgl] REVIEWED: Minimize buffer overflow probability
[rlgl] REVIEWED: Fix scissor mode on macOS (#2170) by @ArnaudValensi
[rlgl] REVIEWED: Clear SSBO buffers on loading (#2185)
[rlgl] REVIEWED: rlLoadShaderCode(), improved shader loading code
[rlgl] REVIEWED: Comment notes about custom blend modes (#2260) by @glorantq
[rlgl] REVIEWED: rlGenTextureMipmaps()
[rlgl] REVIEWED: rlTextureParameters()
[raymath] ADDED: Wrap() (#2522) by @Tekkitslime
[raymath] ADDED: Vector2Transform()
[raymath] ADDED: Vector2DistanceSqr() (#2376) by @AnilBK
[raymath] ADDED: Vector3DistanceSqr() (#2376) by @AnilBK
[raymath] ADDED: Vector2ClampValue(), Vector3ClampValue() (#2428) by @saccharineboi
[raymath] ADDED: Vector3RotateByAxisAngle() (#2590) by @Crydsch
[raymath] `WARNING`: REDESIGNED: Vector2Angle() returns radians instead of degrees (#2193) by @schveiguy
[raymath] `WARNING`: REMOVED: MatrixNormalize() (#2412)
[raymath] REVIEWED: Fix inverse length in Vector2Normalize() (#2189) by @HarriP
[raymath] REVIEWED: Vector2Angle() not working as expected (#2196) by @jdeokkim
[raymath] REVIEWED: Vector2Angle() and Vector3Angle() (#2203) by @trikko
[raymath] REVIEWED: QuaternionInvert(), code simplified (#2324) by @megagrump
[raymath] REVIEWED: QuaternionScale() (#2419) by @tana
[raymath] REVIEWED: Vector2Rotate(), optimized (#2340) by @jdeokkim
[raymath] REVIEWED: QuaternionFromMatrix(), QuaternionEquals() (#2591) by @kirigirihitomi
[raymath] REVIEWED: MatrixRotate*() (#2595, #2599) by @GoodNike
[shapes] REVIEWED: CheckCollision*() consistency
[shapes] REVIEWED: DrawRectanglePro(), support TRIANGLES drawing
[textures] ADDED: Support for QOI image format
[textures] REVIEWED: ImageColorTint(), GetImageColor(), ImageDrawRectangleRec(), optimized functions (#2429) by @AnilBK
[textures] REVIEWED: LoadTextureFromImage(), allow texture loading with no data transfer
[textures] REVIEWED: ImageDraw(), comment to note that f32bit is not supported (#2222)
[textures] REVIEWED: DrawTextureNPatch(), avoid batch overflow (#2401) by @JeffM2501
[textures] REVIEWED: DrawTextureTiled() (#2173)
[textures] REVIEWED: GenImageCellular() (#2178)
[textures] REVIEWED: LoadTextureCubemap() (#2223, #2224)
[textures] REVIEWED: Export format for float 32bit
[textures] REVIEWED: ExportImage(), support export ".jpeg" files
[textures] REVIEWED: ColorAlphaBlend() (#2524) by @royqh1979
[textures] REVIEWED: ImageResize() (#2572)
[textures] REVIEWED: ImageFromImage() (#2594) by @wiertek
[text] ADDED: ExportFontAsCode()
[text] ADDED: DrawTextCodepoints() (#2308) by @siddharthroy12
[text] REVIEWED: TextIsEqual(), protect from NULLs (#2121) by @lukekras
[text] REVIEWED: LoadFontEx(), comment to specify how to get the default character set (#2221) by @JeffM2501
[text] REVIEWED: GenImageFontAtlas(), increase atlas size guesstimate by @megagrump
[text] REVIEWED: GetCodepoint() (#2201)
[text] REVIEWED: GenImageFontAtlas() (#2556)
[text] REVIEWED: ExportFontAsCode() to use given font padding (#2525) by @TheTophatDemon
[models] ADDED: Reference code to load bones id and weight data for animations
[models] `WARNING`: REMOVED: GetRayCollisionModel() (#2405)
[models] REMOVED: GenMeshBinormals()
[models] REVIEWED: External library: vox_loader.h, 64bit issue (#2186)
[models] REVIEWED: Material color loading when no texture material is available (#2298) by @royqh1979
[models] REVIEWED: Fix Undefined Symbol _ftelli64 in cgltf (#2319) by @audinue
[models] REVIEWED: LoadGLTF(), fix memory leak (#2441, #2442) by @leomonta
[models] REVIEWED: DrawTriangle3D() batch limits check (#2489)
[models] REVIEWED: DrawBillboardPro() (#2494)
[models] REVIEWED: DrawMesh*() issue (#2211)
[models] REVIEWED: ExportMesh() (#2220)
[models] REVIEWED: GenMeshCylinder() (#2225)
[audio] `WARNING`: ADDED: rAudioProcessor pointer to AudioStream struct (used by Sound and Music structs)
[audio] ADDED: SetSoundPan(), SetMusicPan(), SetAudioStreamPan(), panning support (#2205) by ptarabbia
[audio] ADDED: Audio stream input callback (#2212) by ptarabbia
[audio] ADDED: Audio stream processors support (#2212) by ptarabbia
[audio] REVIEWED: GetMusicTimePlayed(), incorrect value after the stream restarted for XM audio (#2092 #2215) by @ptarabbia
[audio] REVIEWED: Turn on interpolation for XM playback (#2216) by @ptarabbia
[audio] REVIEWED: Fix crash with delay example (#2472) by @ptarabbia
[audio] REVIEWED: PlaySoundMulti() (#2231)
[audio] REVIEWED: ExportWaveAsCode()
[audio] REVIEWED: UpdateMusicStream(), reduce dynamic allocations (#2532) by @dbechrd
[audio] REVIEWED: UpdateMusicStream() to support proper stream looping (#2579) by @veins1
[utils] ADDED: ExportDataAsCode()
[utils] REVIEWED: Force flush stdout after trace messages (#2465) by @nagy
[easings] ADDED: Function descriptions (#2471) by @RobLoach
[camera] REVIEWED: Fix free camera panning in the wrong direction (#2347) by @DavidLyhedDanielsson
[examples] ADDED: core_window_should_close
[examples] ADDED: core_2d_camera_mouse_zoom (#2583) by @JeffM2501
[examples] ADDED: shapes_top_down_lights (#2199) by @JeffM2501
[examples] ADDED: textures_fog_of_war
[examples] ADDED: textures_gif_player
[examples] ADDED: text_codepoints_loading
[examples] ADDED: audio_stream_effects
[examples] REMOVED: core_quat_conversion, not working properly
[examples] REMOVED: raudio_standalone, moved to raudio repo
[examples] RENAMED: textures_rectangle -> textures_sprite_anim
[examples] REVIEWED: core_input_gamepad, improve joystick visualisation (#2390) by @kristianlm
[examples] REVIEWED: textures_draw_tiled
[examples] REVIEWED: shaders_mesh_instancing, free allocated matrices (#2425) by @AnilBK
[examples] REVIEWED: shaders_raymarching
[examples] REVIEWED: audio_raw_stream (#2205) by ptarabbia
[examples] REVIEWED: audio_music_stream
[examples] REVIEWED: shaders_mesh_instancing, simplified
[examples] REVIEWED: shaders_basic_lighting, rlights.h simplified
[examples] REVIEWED: All examples descriptions, included creation/update raylib versions
[parser] ADDED: Defines to parser (#2269) by @iskolbin
[parser] ADDED: Aliases to parser (#2444) by @lazaray
[parser] ADDED: Parse struct descriptions (#2214) by @eutro
[parser] ADDED: Parse enum descriptions and value descriptions (#2208) by @eutro
[parser] ADDED: Lua output format for parser by @iskolbin
[parser] ADDED: Makefile for raylib_parser by @iskolbin
[parser] ADDED: Support for truncating parser input (#2464) by @lazaray
[parser] ADDED: Support for calculated defines to parser (#2463) by @lazaray
[parser] REVIEWED: Update parser files (#2125) by @catmanl
[parser] REVIEWED: Fix memory leak in parser (#2136) by @ronnieholm
[parser] REVIEWED: EscapeBackslashes()
[parser] REVIEWED: Parser improvements (#2461 #2462) by @lazaray
[bindings] ADDED: License details for BINDINGS
[bindings] ADDED: dart-raylib (#2149) by @wolfenrain
[bindings] ADDED: raylib-cslo (#2169) by @jasonswearingen
[bindings] ADDED: raylib-d (#2194) by @schveiguy
[bindings] ADDED: raylib-guile (#2202) by @petelliott
[bindings] ADDED: raylib-scopes (#2238) by @salotz
[bindings] ADDED: naylib (Nim) (#2386) by @planetis-m
[bindings] ADDED: raylib.jl (Julia) (#2403) by @irishgreencitrus
[bindings] ADDED: raylib.zig (#2449) by @ryupold
[bindings] ADDED: racket-raylib (#2454) by @eutro
[bindings] ADDED: raylibr (#2611) by @ramiromagno
[bindings] ADDED: Raylib.4.0.Pascal (#2617) by @sysrpl
[bindings] REVIEWED: Multiple bindings updated to raylib 4.0
[build] ADDED: VS2022 project
[build] ADDED: Support macOS by zig build system (#2175)
[build] ADDED: Support custom modules selection on compilation
[build] ADDED: Minimal web shell for WebAssembly compilation
[build] ADDED: BSD support for zig builds (#2332) by @zigster64
[build] ADDED: Repology badge (#2367) by @jubalh
[build] ADDED: Support DLL compilation with TCC compiler (#2569) by @audinue
[build] ADDED: Missing examples to VS2022 examples solution
[build] REMOVED: VS2019 project (unmaintained)
[build] REMOVED: SUPPORT_MOUSE_CURSOR_POINT config option
[build] REVIEWED: Fixed RPi make install (#2217) by @wereii
[build] REVIEWED: Fix build results path on Linux and RPi (#2218) by @wereii
[build] REVIEWED: Makefiles debug flag
[build] REVIEWED: Fixed cross-compilation from x86-64 to RPi (#2233) by @pitpit
[build] REVIEWED: All Makefiles, simplified
[build] REVIEWED: All Makefiles, improve organization
[build] REVIEWED: All Makefiles, support CUSTOM_CFLAGS
[build] REVIEWED: Fixed compiling for Android using CMake (#2270) by @hero2002
[build] REVIEWED: Make zig build functionality available to zig programs (#2271) by @Not-Nik
[build] REVIEWED: Update CMake project template with docs and web (#2274) by @RobLoach
[build] REVIEWED: Update VSCode project to work with latest makefile and web (#2296) by @phil-shenk
[build] REVIEWED: Support audio examples compilation with external glfw (#2329) by @locriacyber
[build] REVIEWED: Fix "make clean" target failing when shell is not cmd (#2338) by @Peter0x44
[build] REVIEWED: Makefile linkage -latomic, required by miniaudio on ARM 32bit #2452
[build] REVIEWED: Update raylib-config.cmake (#2374) by @marcogmaia
[build] REVIEWED: Simplify build.zig to not require user to specify raylib path (#2383) by @Hejsil
[build] REVIEWED: Fix OpenGL 4.3 graphics option in CMake (#2427) by @GoldenThumbs
[extras] `WARNING`: REMOVED: physac from raylib sources/examples, use github.com/raysan5/physac
[extras] `WARNING`: REMOVED: raygui from raylib/src/extras, use github.com/raysan5/raygui
[extras] `WARNING`: REMOVED: rmem from raylib/src/extras, moved to github.com/raylib-extras/rmem
[extras] `WARNING`: REMOVED: easings from raylib/src/extras, moved to github.com/raylib-extras/reasings
[extras] `WARNING`: REMOVED: raudio.h from raylib/src, moved to github.com/raysan5/raudio
[misc] REVIEWED: Update some external libraries to latest versions
-------------------------------------------------------------------------
Release: raylib 4.0 - 8th Anniversary Edition (05 November 2021)
-------------------------------------------------------------------------
KEY CHANGES:
- Naming consistency and coherency: Complete review of the library: syntax, naming, comments, decriptions, logs...
- Event Automation System: Support for input events recording and automatic re-playing, useful for automated testing and more!
- Custom game-loop control: Intended for advance users that want to control the events polling and the timming mechanisms
- rlgl 4.0: Completely decoupling from platform layer and raylib, intended for standalone usage as single-file header-only
- raymath 1.5: Complete review following new conventions, to make it more portable and self-contained
- raygui 3.0: Complete review and official new release, more portable and self-contained, intended for tools development
- raylib_parser: New tool to parse raylib.h and extract all required info into custom output formats (TXT, XML, JSON...)
- Zig and Odin official support
Detailed changes:
[core] ADDED: Support canvas resizing on web (#1840) by @skylersaleh
[core] ADDED: GetMouseDelta() (#1832) by @adricoin2010
[core] ADDED: Support additional mouse buttons (#1753) by @lambertwang
[core] ADDED: SetRandomSeed() (#1994) by @TommiSinivuo
[core] ADDED: GetTouchPointId() #1972
[core] ADDED: EncodeDataBase64() and DecodeDataBase64()
[core] REMOVED: PLATFORM_UWP, difficult to maintain
[core] REMOVED: IsGamepadName()
[core] RENAMED: SwapBuffers() to SwapScreenBuffer()
[core] RENAMED: Wait() to WaitTime()
[core] RENAMED: RayHitInfo to RayCollision (#1781)
[core] RENAMED: GetRayCollisionGround() to GetRayCollisionQuad() (#1781)
[core] REVIEWED: Support mouse wheel on x-axis (#1948)
[core] REVIEWED: DisableCursor() on web by registering an empty mouse click event function in emscripten (#1900) by @grenappels
[core] REVIEWED: LoadShader() and default locations and descriptions
[core] REVIEWED: LoadShaderFromMemory() (#1851) by @Ruminant
[core] REVIEWED: WaitTime(), avoid global variables dependency to make the function is self-contained (#1841)
[core] REVIEWED: SetWindowSize() to work on web (#1847) by @nikki93
[core] REVIEWED: Raspberry RPI/DRM keyboard blocking render loop (#1879) @luizpestana
[core] REVIEWED: Android multi-touch (#1869) by @humbe
[core] REVIEWED: Implemented GetGamepadName() for emscripten by @nbarkhina
[core] REVIEWED: HighDPI support (#1987) by @ArnaudValensi
[core] REVIEWED: KeyCallback(), register keys independently of the actions
[rlgl] ADDED: GRAPHIC_API_OPENGL_43
[rlgl] ADDED: rlUpdateVertexBufferElements() (#1915)
[rlgl] ADDED: rlActiveDrawBuffers() (#1911)
[rlgl] ADDED: rlEnableColorBlend()/rlDisableColorBlend()
[rlgl] ADDED: rlGetPixelFormatName()
[rlgl] REVIEWED: rlUpdateVertexBuffer (#1914) by @630Studios
[rlgl] REVIEWED: rlDrawVertexArrayElements() (#1891)
[rlgl] REVIEWED: Wrong normal matrix calculation (#1870)
[raymath] ADDED: Vector3Angle()
[raymath] REVIEWED: QuaternionFromAxisAngle() (#1892)
[raymath] REVIEWED: QuaternionToMatrix() returning transposed result. (#1793) by @object71
[shapes] ADDED: RenderPolyLinesEx() (#1758) by @lambertwang
[shapes] ADDED: DrawLineBezierCubic() (#2021) by @SAOMDVN
[textures] ADDED: GetImageColor() #2024
[textures] REMOVED: GenImagePerlinNoise()
[textures] RENAMED: GetTextureData() to LoadImageFromTexture()
[textures] RENAMED: GetScreenData() to LoadImageFromScreen()
[textures] REVIEWED: ExportImage() to use SaveFileData() (#1779)
[textures] REVIEWED: LoadImageAnim() #2005
[text] ADDED: Security check in case of not valid font
[text] ADDED: `GetGlyphInfo()` to get glyph info for a specific codepoint
[text] ADDED: `GetGlyphAtlasRec()` to get glyph rectangle within the generated font atlas
[text] ADDED: DrawTextPro() with text rotation support, WARNING: DrawTextPro() requires including `rlgl.h`, before it was only dependant on `textures` module.
[text] ADDED: UnloadCodepoints() to safely free loaded codepoints
[text] REMOVED: DrawTextRec() and DrawTextRecEx(), moved to example, those functions could be very specific depending on user needs so it's better to give the user the full source in case of special requirements instead of allowing a function with +10 input parameters.
[text] RENAMED: struct `CharInfo` to `GlyphInfo`, actually that's the correct naming for the data contained. It contains the character glyph metrics and the glyph image; in the past it also contained rectangle within the font atlas but that data has been moved to `Font` struct directly, so, `GlyphInfo` is a more correct name.
[text] RENAMED: `CodepointToUtf8()` to `CodepointToUTF8()`, capitalization of UTF-8 is the correct form, it would also require de hyphen but it can be omitted in this case.
[text] RENAMED: `TextToUtf8()` to `TextCodepointsToUTF8` for consistency and more detail on the functionality.
[text] RENAMED: GetCodepoints() to LoadCodepoints(), now codepoint array data is loaded dynamically instead of reusing a limited static buffer.
[text] RENAMED: GetNextCodepoint() to GetCodepoint()
[models] ADDED: MagikaVoxel VOX models loading
[models] ADDED: GenMeshCone() (#1903)
[models] ADDED: GetModelBoundingBox()
[models] ADDED: DrawBillboardPro() (#1759) by @nobytesgiven
[models] ADDED: DrawCubeTextureRec() (#2001) by @tdgroot
[models] ADDED: DrawCylinderEx() and DrawCylinderWiresEx() (#2049) by @Horrowind
[models] REMOVED: DrawBillboardEx()
[models] RENAMED: MeshBoundingBox() to GetMeshBoundingBox()
[models] RENAMED: MeshTangents() to GenMeshTangents()
[models] RENAMED: MeshBinormals() to GenMeshBinormals()
[models] REVIEWED: GenMeshTangents() (#1877) by @630Studios
[models] REVIEWED: CheckCollisionBoxSphere() by @Crydsch
[models] REVIEWED: GetRayCollisionQuad() by @Crydsch
[models] REVIEWED: LoadGLTF(), fixed missing transformations and nonroot skinning by @MrDiver
[models] REVIEWED: LoadGLTF(), rewriten from scratch, removed animations support (broken)
[models] REVIEWED: Decouple DrawMesh() and DrawMeshInstanced() (#1958)
[models] REVIEWED: Support vertex color attribute for GLTF and IQM (#1790) by @object71
[models] REVIEWED: DrawBillboardPro() (#1941) by @GithubPrankster
[models] REDESIGNED: Major review of glTF loading functionality (#1849) by @object71
[audio] ADDED: SeekMusicStream() (#2006) by @GithubPrankster
[audio] REMOVED: GetAudioStreamBufferSizeDefault()
[audio] RENAMED: InitAudioStream() to LoadAudioStream()
[audio] RENAMED: CloseAudioStream() to UnloadAudioStream()
[audio] RENAMED: IsMusicPlaying() to IsMusicStreamPlaying()
[audio] REVIEWED: ExportWaveAsCode()
[audio] REDESIGNED: Use frameCount on audio instead of sampleCount
[utils] REVIEWED: exit() on LOG_FATAL instead of LOG_ERROR (#1796)
[examples] ADDED: core_custom_frame_control
[examples] ADDED: core_basic_screen_manager
[examples] ADDED: core_split_screen (#1806) by @JeffM2501
[examples] ADDED: core_smooth_pixelperfect (#1771) by @NotManyIdeasDev
[examples] ADDED: shaders_texture_outline (#1883) by @GoldenThumbs
[examples] ADDED: models_loading_vox (#1940) by @procfxgen
[examples] ADDED: rlgl_compute_shader by @TSnake41 (#2088)
[examples] REMOVED: models_material_pbr
[examples] REMOVED: models_gltf_animation
[examples] REVIEWED: core_3d_picking
[examples] REVIEWED: core_input_mouse
[examples] REVIEWED: core_vr_simulator, RenderTexture usage
[examples] REVIEWED: core_window_letterbox, RenderTexture usage
[examples] REVIEWED: shapes_basic_shapes
[examples] REVIEWED: shapes_logo_raylib_anim
[examples] REVIEWED: textures_to_image
[examples] REVIEWED: text_rectangle_bounds
[examples] REVIEWED: text_unicode
[examples] REVIEWED: text_draw_3d
[examples] REVIEWED: models_loading
[examples] REVIEWED: models_skybox (#1792) (#1778)
[examples] REVIEWED: models_mesh_picking
[examples] REVIEWED: models_yaw_pitch_roll
[examples] REVIEWED: models_rlgl_solar_system
[examples] REVIEWED: shaders_custom_uniform, RenderTexture usage
[examples] REVIEWED: shaders_eratosthenes, RenderTexture usage
[examples] REVIEWED: shaders_julia_set, RenderTexture usage
[examples] REVIEWED: shaders_postprocessing, RenderTexture usage
[examples] REVIEWED: shaders_basic_lighting, simplified (#1865)
[examples] REVIEWED: audio_raw_stream.c
[examples] REVIEWED: raudio_standalone
[examples] REVIEWED: raylib_opengl_interop
[examples] REVIEWED: rlgl_standalone.c
[examples] REVIEWED: Resources licenses
[examples] REVIEWED: models resources reorganization
[templates] REMOVED: Moved to a separate repo: https://github.com/raysan5/raylib-game-template
[build] ADDED: Zig build file (#2014) by @TommiSinivuo
[build] ADDED: Android VS2019 solution (#2013) by @Kronka
[build] REMOVED: VS2017 project, outdated
[build] RENAMED: All raylib modules prefixed with 'r' (core -> rcore)
[build] RENAMED: SUPPORT_MOUSE_CURSOR_NATIVE to SUPPORT_MOUSE_CURSOR_POINT
[build] REVIEWED: examples/examples_template.c
[build] REVIEWED: Makefile to latest Emscripten SDK r23
[build] REVIEWED: Makefile for latest Android NDK r32 LTS
[build] REVIEWED: raylib resource files
[build] Moved some extra raylib libraries to /extras/ directory
[*] UPDATED: Multiple bindings to latest version
[*] UPDATED: Most external libraries to latest versions (except GLFW)
[*] Multiple code improvements and fixes by multiple contributors!
-------------------------------------------------------------------------
Release: raylib 3.7 (26 April 2021)
-------------------------------------------------------------------------
KEY CHANGES:
- [rlgl] REDESIGNED: Greater abstraction level, some functionality moved to core module
- [rlgl] REVIEWED: Instancing and stereo rendering
- [core] REDESIGNED: VR simulator, fbo/shader exposed to user
- [utils] ADDED: File access callbacks system
- [models] ADDED: glTF animations support (#1551) by @object71
- [audio] ADDED: Music streaming support from memory (#1606) by @nezvers
- [*] RENAMED: enum types and enum values for consistency
Detailed changes:
[core] ADDED: LoadVrStereoConfig()
[core] ADDED: UnloadVrStereoConfig()
[core] ADDED: BeginVrStereoMode()
[core] ADDED: EndVrStereoMode()
[core] ADDED: GetCurrentMonitor() (#1485) by @object71
[core] ADDED: SetGamepadMappings() (#1506)
[core] RENAMED: struct Camera: camera.type to camera.projection
[core] RENAMED: LoadShaderCode() to LoadShaderFromMemory() (#1690)
[core] RENAMED: SetMatrixProjection() to rlSetMatrixProjection()
[core] RENAMED: SetMatrixModelview() to rlSetMatrixModelview()
[core] RENAMED: GetMatrixModelview() to rlGetMatrixModelview()
[core] RENAMED: GetMatrixProjection() to rlGetMatrixProjection()
[core] RENAMED: GetShaderDefault() to rlGetShaderDefault()
[core] RENAMED: GetTextureDefault() to rlGetTextureDefault()
[core] REMOVED: GetShapesTexture()
[core] REMOVED: GetShapesTextureRec()
[core] REMOVED: GetMouseCursor()
[core] REMOVED: SetTraceLogExit()
[core] REVIEWED: GetFileName() and GetDirectoryPath() (#1534) by @gilzoide
[core] REVIEWED: Wait() to support FreeBSD (#1618)
[core] REVIEWED: HighDPI support on macOS retina (#1510)
[core] REDESIGNED: GetFileExtension(), includes the .dot
[core] REDESIGNED: IsFileExtension(), includes the .dot
[core] REDESIGNED: Compresion API to use sdefl/sinfl libs
[rlgl] ADDED: SUPPORT_GL_DETAILS_INFO config flag
[rlgl] REMOVED: GenTexture*() functions (#721)
[rlgl] REVIEWED: rlLoadShaderDefault()
[rlgl] REDESIGNED: rlLoadExtensions(), more details exposed
[raymath] REVIEWED: QuaternionFromEuler() (#1651)
[raymath] REVIEWED: MatrixRotateZYX() (#1642)
[shapes] ADDED: DrawLineBezierQuad() (#1468) by @epsilon-phase
[shapes] ADDED: CheckCollisionLines()
[shapes] ADDED: CheckCollisionPointLine() by @mkupiec1
[shapes] REVIEWED: CheckCollisionPointTriangle() by @mkupiec1
[shapes] REDESIGNED: SetShapesTexture()
[shapes] REDESIGNED: DrawCircleSector(), to use float params
[shapes] REDESIGNED: DrawCircleSectorLines(), to use float params
[shapes] REDESIGNED: DrawRing(), to use float params
[shapes] REDESIGNED: DrawRingLines(), to use float params
[textures] ADDED: DrawTexturePoly() and example (#1677) by @chriscamacho
[textures] ADDED: UnloadImageColors() for allocs consistency
[textures] RENAMED: GetImageData() to LoadImageColors()
[textures] REVIEWED: ImageClearBackground() and ImageDrawRectangleRec() (#1487) by @JeffM2501
[textures] REVIEWED: DrawTexturePro() and DrawRectanglePro() transformations (#1632) by @ChrisDill
[text] REDESIGNED: DrawFPS()
[models] ADDED: UploadMesh() (#1529)
[models] ADDED: UpdateMeshBuffer()
[models] ADDED: DrawMesh()
[models] ADDED: DrawMeshInstanced()
[models] ADDED: UnloadModelAnimations() (#1648) by @object71
[models] REMOVED: DrawGizmo()
[models] REMOVED: LoadMeshes()
[models] REMOVED: MeshNormalsSmooth()
[models] REVIEWED: DrawLine3D() (#1643)
[audio] REVIEWED: Multichannel sound system (#1548)
[audio] REVIEWED: jar_xm library (#1701) by @jmorel33
[utils] ADDED: SetLoadFileDataCallback()
[utils] ADDED: SetSaveFileDataCallback()
[utils] ADDED: SetLoadFileTextCallback()
[utils] ADDED: SetSaveFileTextCallback()
[examples] ADDED: text_draw_3d (#1689) by @Demizdor
[examples] ADDED: textures_poly (#1677) by @chriscamacho
[examples] ADDED: models_gltf_model (#1551) by @object71
[examples] RENAMED: shaders_rlgl_mesh_instanced to shaders_mesh_intancing
[examples] REDESIGNED: shaders_rlgl_mesh_instanced by @moliad
[examples] REDESIGNED: core_vr_simulator
[examples] REDESIGNED: models_yaw_pitch_roll
[build] ADDED: Config flag: SUPPORT_STANDARD_FILEIO
[build] ADDED: Config flag: SUPPORT_WINMM_HIGHRES_TIMER (#1641)
[build] ADDED: Config flag: SUPPORT_GL_DETAILS_INFO
[build] ADDED: Examples projects to VS2019 solution
[build] REVIEWED: Makefile to support PLATFORM_RPI (#1580)
[build] REVIEWED: Multiple typecast warnings by @JeffM2501
[build] REDESIGNED: VS2019 project build paths
[build] REDESIGNED: CMake build system by @object71
[*] RENAMED: Several functions parameters for consistency
[*] UPDATED: Multiple bindings to latest version
[*] UPDATED: All external libraries to latest versions
[*] Multiple code improvements and fixes by multiple contributors!
-------------------------------------------------------------------------
Release: raylib 3.5 - 7th Anniversary Edition (25 December 2020)
-------------------------------------------------------------------------
KEY CHANGES:
- [core] ADDED: PLATFORM_DRM to support RPI4 and other devices (#1388) by @kernelkinetic
- [core] REDESIGNED: Window states management system through FLAGS
- [rlgl] ADDED: RenderBatch type and related functions to allow custom batching (internal only)
- [rlgl] REDESIGNED: Framebuffers API to support multiple attachment types (#721)
- [textures] REDESIGNED: Image*() functions, big performance improvements (software rendering)
- [*] REVIEWED: Multiple functions to replace file accesses by memory accesses
- [*] ADDED: GitHub Actions CI to support multiple raylib build configurations
Detailed changes:
[core] ADDED: SetWindowState() / ClearWindowState() -> New flags added!
[core] ADDED: IsWindowFocused()
[core] ADDED: GetWindowScaleDPI()
[core] ADDED: GetMonitorRefreshRate() (#1289) by @Shylie
[core] ADDED: IsCursorOnScreen() (#1262) by @ChrisDill
[core] ADDED: SetMouseCursor() and GetMouseCursor() for standard Desktop cursors (#1407) by @chances
[core] REMOVED: struct RenderTexture2D: depthTexture variable
[core] REMOVED: HideWindow() / UnhideWindow() -> Use SetWindowState()
[core] REMOVED: DecorateWindow() / UndecorateWindow() -> Use SetWindowState()
[core] RENAMED: GetExtension() to GetFileExtension()
[core] REVIEWED: Several structs to reduce size and padding
[core] REVIEWED: struct Texture maps to Texture2D and TextureCubemap
[core] REVIEWED: ToggleFullscreen() (#1287)
[core] REVIEWED: InitWindow(), support empty title for window (#1323)
[core] REVIEWED: RPI: Mouse movements are bound to the screen resolution (#1392) (#1410) by @kernelkinetic
[core] REVIEWED: GetPrevDirectoryPath() fixes on Unix-like systems (#1246) by @ivan-cx
[core] REPLACED: rgif.h by msf_gif.h for automatic gif recording
[core] REDESIGNED: GetMouseWheelMove() to return float movement for precise scrolling (#1397) by @Doy-lee
[core] REDESIGNED: GetKeyPressed(), and added GetCharPressed() (#1336)
[core] UWP rework with improvements (#1231) by @Rover656
[core] Gamepad axis bug fixes and improvement (#1228) by @mmalecot
[core] Updated joystick mappings with latest version of gamecontrollerdb (#1381) by @coderoth
[rlgl] Corrected issue with OpenGL 1.1 support
[rlgl] ADDED: rlDrawMeshInstanced() (#1318) by @seanpringle
[rlgl] ADDED: rlCheckErrors (#1321) by @seanpringle
[rlgl] ADDED: BLEND_SET blending mode (#1251) by @RandomErrorMessage
[rlgl] ADDED: rlSetLineWidth(), rlGetLineWidth(), rlEnableSmoothLines(), rlDisableSmoothLines() (#1457) by @JeffM2501
[rlgl] RENAMED: rlUnproject() to Vector3Unproject() [raymath]
[rlgl] REVIEWED: Replace rlglDraw() calls by DrawRenderBatch() internal calls
[rlgl] REVIEWED: GenTextureCubemap(), use rlgl functionality only
[rlgl] REVIEWED: rlFramebufferAttach() to support texture layers
[rlgl] REVIEWED: GenDrawCube() and GenDrawQuad()
[rlgl] REVIEWED: Issues with vertex batch overflow (#1223)
[rlgl] REVIEWED: rlUpdateTexture(), issue with offsets
[rlgl] REDESIGNED: GenTexture*() to use the new fbo API (#721)
[raymath] ADDED: Normalize() and Remap() functions (#1247) by @NoorWachid
[raymath] ADDED: Vector2Reflect() (#1400) by @daniel-junior-dube
[raymath] ADDED: Vector2LengthSqr() and Vector3LengthSqr() (#1248) by @ThePituLegend
[raymath] ADDED: Vector2MoveTowards() function (#1233) by @anatagawa
[raymath] REVIEWED: Some functions consistency (#1197) by @Not-Nik
[raymath] REVIEWED: QuaternionFromVector3ToVector3() (#1263) by @jvocaturo
[raymath] REVIEWED: MatrixLookAt(), optimized (#1442) by @RandomErrorMessage
[shapes] ADDED: CheckCollisionLines(), by @Elkantor
[text] Avoid [textures] functions dependencies
[text] ADDED: Config flag: SUPPORT_TEXT_MANIPULATION
[text] ADDED: LoadFontFromMemory() (TTF only) (#1327)
[text] ADDED: UnloadFontData()
[text] RENAMED: FormatText() -> TextFormat()
[text] REVIEWED: Font struct, added charsPadding (#1432)
[text] REVIEWED: TextJoin()
[text] REVIEWED: TextReplace() (#1172)
[text] REVIEWED: LoadBMFont() to load data from memory (#1232)
[text] REVIEWED: GenImageFontAtlas(), fixed offset (#1171)
[text] REDESIGNED: LoadFontData(), reviewed input parameters
[text] REDESIGNED: LoadFontDefault(), some code simplifications
[text] REDESIGNED: LoadFontFromImage(), avoid LoadImageEx()
[text] REDESIGNED: LoadFontData(), avoid GenImageColor(), ImageFormat()
[text] REDESIGNED: LoadBMFont(), avoid ImageCopy(), ImageFormat(), ImageAlphaMask()
[textures] Move Color functions from [core] to [textures] module
[textures] ADDED: ColorAlphaBlend()
[textures] ADDED: GetPixelColor()
[textures] ADDED: SetPixelColor()
[textures] ADDED: LoadImageFromMemory() (#1327)
[textures] ADDED: LoadImageAnim() to load animated sequence of images
[textures] ADDED: DrawTextureTiled() (#1291) - @Demizdor
[textures] ADDED: UpdateTextureRec()
[textures] ADDED: UnloadImageColors(), UnloadImagePalette(), UnloadWaveSamples()
[textures] REMOVED: Config flag: SUPPORT_IMAGE_DRAWING
[textures] REMOVED: LoadImageEx()
[textures] REMOVED: LoadImagePro()
[textures] REMOVED: GetImageDataNormalized(), not exposed in the API
[textures] RENAMED: ImageExtractPalette() to GetImagePalette()
[textures] RENAMED: Fade() to ColorAlpha(), added #define for compatibility
[textures] RENAMED: GetImageData() -> LoadImageColors()
[textures] RENAMED: GetImagePalette() -> LoadImagePalette()
[textures] RENAMED: GetWaveData() -> LoadWaveSamples()
[textures] REVIEWED: GetPixelDataSize() to consider compressed data properly
[textures] REVIEWED: GetTextureData(), allow retrieving 32bit float data
[textures] REVIEWED: ImageDrawText*() params order
[textures] REVIEWED: ColorAlphaBlend(), support tint color
[textures] REVIEWED: ColorAlphaBlend(), integers-version, optimized (#1218)
[textures] REVIEWED: ImageDraw(), consider negative source offset properly (#1283)
[textures] REVIEWED: ImageDraw(), optimizations test (#1218)
[textures] REVIEWED: ImageResizeCanvas(), optimization (#1218)
[textures] REVIEWED: ExportImage(), optimized
[textures] REVIEWED: ImageAlphaPremultiply(), optimization
[textures] REVIEWED: ImageAlphaClear(), minor optimization
[textures] REVIEWED: ImageToPOT(), renamed parameter
[textures] REVIEWED: ImageCrop() (#1218)
[textures] REVIEWED: ImageToPOT() (#1218)
[textures] REVIEWED: ImageAlphaCrop() (#1218)
[textures] REVIEWED: ExportImage(), optimized (#1218)
[textures] REDESIGNED: ImageCrop(), optimized (#1218)
[textures] REDESIGNED: ImageRotateCCW(), optimized (#1218)
[textures] REDESIGNED: ImageRotateCW(), optimized (#1218)
[textures] REDESIGNED: ImageFlipHorizontal(), optimized (#1218)
[textures] REDESIGNED: ImageFlipVertical(), optimized (#1218)
[textures] REDESIGNED: ImageResizeCanvas(), optimized (#1218)
[textures] REDESIGNED: ImageDrawPixel(), optimized
[textures] REDESIGNED: ImageDrawLine(), optimized
[textures] REDESIGNED: ImageDraw(), optimized (#1218)
[textures] REDESIGNED: ImageResize(), optimized (#1218)
[textures] REDESIGNED: ImageFromImage(), optimized (#1218)
[textures] REDESIGNED: ImageDraw(), optimization (#1218)
[textures] REDESIGNED: ImageAlphaClear(), optimized (#1218)
[textures] REDESIGNED: ExportImageAsCode() to use memory buffer (#1232)
[textures] REDESIGNED: ColorFromHSV()
[models] ADDED: DrawTriangle3D() and DrawTriangleStrip3D()
[models] ADDED: UnloadModelKeepMeshes()
[models] REVIEWED: LoadModel(), avoid loading texcoords and normals from model if not existent
[models] REVIEWED: GenMeshCubicmap(), added comments and simplification
[models] REVIEWED: GenMeshCubicmap(), fixed generated normals (#1244) by @GoldenThumbs
[models] REVIEWED: GenMeshPoly(), fixed buffer overflow (#1269) by @frithrah
[models] REVIEWED: LoadOBJ(): Allow for multiple materials in obj files (#1408) by @chriscamacho and @codifies
[models] REVIEWED: LoadIQM() materials loading (#1227) by @sikor666
[models] REVIEWED: LoadGLTF() to read from memory buffer
[models] REVIEWED: UpdateMesh(), fix extra memory allocated when updating color buffer (#1271) by @4yn
[models] REVIEWED: MeshNormalsSmooth() (#1317) by @seanpringle
[models] REVIEWED: DrawGrid() (#1417)
[models] REDESIGNED: ExportMesh() to use memory buffer (#1232)
[models] REDESIGNED: LoadIQM() and LoadModelAnimations() to use memory buffers
[audio] ADDED: LoadWaveFromMemory() (#1327)
[audio] REMOVED: SetMusicLoopCount()
[audio] REVIEWED: Several functions, sampleCount vs frameCount (#1423)
[audio] REVIEWED: SaveWAV() to use memory write insted of file
[audio] REVIEWED: LoadMusicStream(), support WAV music streaming (#1198)
[audio] REVIEWED: Support multiple WAV sampleSize for MusicStream (#1340)
[audio] REVIEWED: SetAudioBufferPitch()
[audio] REDESIGNED: Audio looping system
[audio] REDESIGNED: LoadSound(): Use memory loading (WAV, OGG, MP3, FLAC) (#1312)
[audio] REDESIGNED: ExportWaveAsCode() to use memory buffers
[utils] ADDED: MemAlloc() / MemFree() (#1440)
[utils] ADDED: UnloadFileData() / UnloadFileText()
[utils] REVIEWED: android_fopen() to support SDCard access
[utils] REDESIGNED: SaveFile*() functions to expose file access results (#1420)
[rmem] REVIEWED: MemPool and other allocators optimization (#1211) by @assyrianic
[examples] ADDED: core/core_window_flags
[examples] ADDED: core/core_quat_conversion by @chriscamacho and @codifies
[examples] ADDED: textures/textures_blend_modes (#1261) by @accidentalrebel
[examples] ADDED: textures/textures_draw_tiled (#1291) by @Demizdor
[examples] ADDED: shaders/shaders_hot_reloading (#1198)
[examples] ADDED: shaders/shaders_rlgl_mesh_instanced (#1318) by @seanpringle
[examples] ADDED: shaders/shaders_multi_sampler2d
[examples] ADDED: others/embedded_files_loading
[examples] REVIEWED: textures/textures_raw_data (#1286)
[examples] REVIEWED: textures/textures_sprite_explosion, replace resources
[examples] REVIEWED: textures/textures_particles_blending, replace resources
[examples] REVIEWED: textures/textures_image_processing, support mouse
[examples] REVIEWED: models/models_skybox to work on OpenGL ES 2.0
[examples] REVIEWED: audio/resources, use open license resources
[examples] REVIEWED: others/raudio_standalone.c
[build] ADDED: New config.h configuration options exposing multiple #define values
[build] REMOVED: ANGLE VS2017 template project
[build] REVIEWED: All MSVC compile warnings
[build] Updated Makefile for web (#1332) by @rfaile313
[build] Updated build pipelines to use latest emscripten and Android NDK
[build] Updated emscriptem build script to generate .a on WebAssembly
[build] Updated Android build for Linux, supporting ANDROID_NDK at compile time by @branlix3000
[build] Updated VSCode project template tasks
[build] Updated VS2017.UWP project template by @Rover656
[build] Updated Android build pipeline
[build] REMOVED: AppVeyor and Travis CI build systems
[*] Moved raysan5/raylib/games to independent repo: raysan5/raylib-games
[*] Replaced several examples resources with more open licensed alternatives
[*] Updated BINDINGS.md with NEW bindings and added raylib version binding!
[*] Updated all external libraries to latest versions
[*] Multiple code improvements and small fixes
-----------------------------------------------
Release: raylib 3.0 (01 April 2020)
-----------------------------------------------
KEY CHANGES:
- Global context states used on all modules.
- Custom memory allocators for all modules and dependencies.
- Centralized file access system and memory data loading.
- Structures reviewed to reduce size and always be used as pass-by-value.
- Tracelog messages completely reviewed and categorized.
- raudio module reviewed to accomodate new Music struct and new miniaudio.
- text module reviewed to improve fonts generation and text management functions.
- Multiple new examples added and categorized examples table.
- GitHub Actions CI implemented for Windows, Linux and macOS.
Detailed changes:
[build] ADDED: VS2017.ANGLE project, by @msmshazan
[build] ADDED: VS2017 project support for x64 platform configuration
[build] ADDED: Makefile for Android building on macOS, by @Yunoinsky
[build] ADDED: Makefile for Android building on Linux, by @pamarcos
[build] REMOVED: VS2015 project
[build] REVIEWED: VSCode project
[build] REVIEWED: Makefile build system
[build] REVIEWED: Android building, by @NimbusFox
[build] REVIEWED: Compilation with CLion IDE, by @Rover656
[build] REVIEWED: Generation of web examples, by @pamarcos
[build] REVIEWED: Makefiles path to 'shell.html', by @niorad
[build] REVIEWED: VS2017 64bit compilation issues, by @spec-chum
[build] REVIEWED: Multiple fixes on projects building, by @ChrisDill, @JuDelCo, @electronstudio
[core] ADDED: Support touch/mouse indistinctly
[core] ADDED: FLAG_WINDOW_ALWAYS_RUN to avoid pause on minimize
[core] ADDED: Config flag SUPPORT_HALFBUSY_WAIT_LOOP
[core] ADDED: RPI mouse cursor point support on native mode
[core] ADDED: GetWorldToScreen2D()- Get screen space position for a 2d camera world space position, by @arvyy
[core] ADDED: GetScreenToWorld2D() - Get world space position for a 2d camera screen space position, by @arvyy
[core] ADDED: GetWorldToScreenEx() - Get size position for a 3d world space position
[core] ADDED: DirectoryExists() - Check if a directory path exists
[core] ADDED: GetPrevDirectoryPath() - Get previous directory path for a given path
[core] ADDED: CompressData() - Compress data (DEFLATE algorythm)
[core] ADDED: DecompressData() - Decompress data (DEFLATE algorythm)
[core] ADDED: GetWindowPosition() - Get window position XY on monitor
[core] ADDED: LoadFileData() - Load file data as byte array (read)
[core] ADDED: SaveFileData() - Save data to file from byte array (write)
[core] ADDED: LoadFileText() - Load text data from file (read), returns a '\0' terminated string
[core] ADDED: SaveFileText() - Save text data to file (write), string must be '\0' terminated
[core] REMOVED: Show raylib logo at initialization
[core] REVIEWED: GetFileName(), security checks
[core] REVIEWED: LoadStorageValue(), by @danimartin82
[core] REVIEWED: SaveStorageValue(), by @danimartin82
[core] REVIEWED: IsMouseButtonReleased(), when press/release events come too fast, by @oswjk
[core] REVIEWED: SetWindowMonitor(), by @DropsOfSerenity
[core] REVIEWED: IsFileExtension() to be case-insensitive
[core] REVIEWED: IsFileExtension() when checking no-extension files
[core] REVIEWED: Default font scale filter for HighDPI mode
[core] REVIEWED: Touch input scaling for PLATFORM_WEB
[core] REVIEWED: RPI input system, by @DarkElvenAngel
[core] REVIEWED: RPI input threads issues
[core] REVIEWED: OpenGL extensions loading and freeing
[core] REVIEWED: GetDirectoryPath()
[core] REVIEWED: Camera2D behavior, by @arvyy
[core] REVIEWED: OpenGL ES 2.0 extensions check
[rlgl] ADDED: Flags to allow frustrum culling near/far distance configuration at compile time
[rlgl] ADDED: Flags to sllow MAX_BATCH_BUFFERING config at compile time
[rlgl] ADDED: GetMatrixProjection(), by @chriscamacho
[rlgl] ADDED: rlUpdateMeshAt() - Update vertex or index data on GPU, at index, by @brankoku
[rlgl] REVIEWED: Vertex padding not zeroed for quads, by @kawa-yoiko
[rlgl] REVIEWED: Read texture data as RGBA from FBO on GLES 2.0
[rlgl] REVIEWED: LoadShaderCode() for const correctness, by @heretique
[rlgl] REVIEWED: rlLoadTexture()
[rlgl] REVIEWED: rlReadTexturePixels()
[rlgl] REVIEWED: rlUpdateMesh() to supports updating indices, by @brankoku
[rlgl] REVIEWED: GenTextureCubemap(), renamed parameters for consistency
[rlgl] REVIEWED: HDR pixels loading
[raymath] ADDED: MatrixRotateXYZ(), by @chriscamacho
[raymath] RENAMED: Vector3Multiply() to Vector3Scale()
[camera] REVIEWED: Free camera pitch, by @chriscamacho
[camera] REVIEWED: Camera not working properly at z-align, by @Ushio
[shapes] ADDED: DrawTriangleStrip() - Draw a triangle strip defined by points
[shapes] ADDED: DrawEllipse() - Draw ellipse
[shapes] ADDED: DrawEllipseLines() - Draw ellipse outline
[shapes] ADDED: DrawPolyLines() - Draw a polygon outline of n sides
[shapes] REVIEWED: DrawPoly() shape rendering, by @AlexHCC
[textures] ADDED: LoadAnimatedGIF() - Load animated GIF file
[textures] ADDED: GetImageAlphaBorder() - Get image alpha border rectangle
[textures] ADDED: ImageFromImage() - Create an image from another image piece
[textures] ADDED: ImageClearBackground(), by @iamsouravgupta
[textures] ADDED: ImageDrawPixel(), by @iamsouravgupta
[textures] ADDED: ImageDrawCircle(), by @iamsouravgupta
[textures] ADDED: ImageDrawLineEx(), by @iamsouravgupta
[textures] ADDED: ImageDrawPixelV(), by @RobLoach
[textures] ADDED: ImageDrawCircleV(), by @RobLoach
[textures] ADDED: ImageDrawLineV(), by @RobLoach
[textures] ADDED: ImageDrawRectangleV(), by @RobLoach
[textures] ADDED: ImageDrawRectangleRec(), by @RobLoach
[textures] REVIEWED: ImageDrawPixel(), by @RobLoach
[textures] REVIEWED: ImageDrawLine(), by @RobLoach
[textures] REVIEWED: ImageDrawCircle(), by @RobLoach
[textures] REVIEWED: ImageDrawRectangle(), by @RobLoach
[textures] REVIEWED: ImageDraw(), now it supports color tint parameter
[textures] REVIEWED: ImageResizeCanvas()
[textures] REVIEWED: ImageCrop() with security checks
[textures] REVIEWED: ImageAlphaMask()
[textures] REVIEWED: ImageDrawRectangleLines()
[textures] REVIEWED: GetImageData()
[text] ADDED: TextCopy() - Copy one string to another, returns bytes copied
[text] ADDED: GetCodepoints() - Get all codepoints in a string
[text] ADDED: CodepointToUtf8() - Encode codepoint into utf8 text
[text] ADDED: DrawTextCodepoint() - Draw one character (codepoint)
[text] RENAMED: LoadDefaultFont() -> LoadFontDefault()
[text] RENAMED: TextCountCodepoints() -> GetCodepointsCount()
[text] REVIEWED: TextFormat(), to support caching, by @brankoku
[text] REVIEWED: LoadFontData(), generate empty image for space character
[text] REVIEWED: TextSplit()
[text] REVIEWED: TextToInteger()
[text] REVIEWED: GetNextCodepoint(), renamed parameters for clarity
[text] REVIEWED: GenImageFontAtlas(), improved atlas size computing
[text] REDESIGNED: struct Font, character rectangles have been moved out from CharInfo to Font
[text] REDESIGNED: struct CharInfo, now includes directly an Image of the glyph
[text] REDESIGNED: GenImageFontAtlas(), additional recs parameter added
[text] REDESIGNED: ImageTextEx(), to avoid font retrieval from GPU
[models] ADDED: Support rlPushMatrix() and rlPopMatrix() on mesh drawing
[models] ADDED: DrawPoint3D() - Draw a point in 3D space, actually a small line, by @ProfJski
[models] ADDED: Multi texture support for materials in GLTF format, by @Gamerfiend, @chriscamacho
[models] REVIEWED: LoadGLTF(), fixed memory leak, by @jubalh
[models] REVIEWED: LoadIQM(), support multiple animations loading, by @culacant
[models] REVIEWED: GetCollisionRayModel(), to avoid pointers
[models] REVIEWED: CheckCollisionRay*(), parameters renamed
[models] REVIEWED: UnloadMesh(), to avoid pointers
[models] REVIEWED: LoadModel(), memory initialization
[models] REVIEWED: UpdateModelAnimation(), added security checks
[models] REVIEWED: Multiple fixes on models loading, by @jubalh
[models] REVIEWED: Normals updated when using animated meshes, by @@las3rlars
[models] REVIEWED: Compilation when the SUPPORT_MESH_GENERATION not set, by @@Elkantor
[raudio] ADDED: Multi-channel audio playing, by @chriscamacho
[raudio] REMOVED: LoadWaveEx()
[raudio] RENAMED: IsAudioBufferProcessed() to IsAudioStreamProcessed()
[raudio] REVIEWED: Ensure .xm playback starts in the right place, by @illegalinstruction
[raudio] REVIEWED: Fix short non-looping sounds, by @jbosh
[raudio] REVIEWED: Modules playing time to full length
[raudio] REDESIGNED: Replaced Music pointer by struct
[raudio] REDESIGNED: Removed sampleLeft from Music struct
[examples] ADDED: core_scissor_test, by @ChrisDill
[examples] ADDED: core_2d_camera_platformer, by @arvyy
[examples] ADDED: textures_mouse_painting, by @ChrisDill
[examples] ADDED: models_waving_cubes, by @codecat
[examples] ADDED: models_solar_system, by @aldrinmartoq
[examples] ADDED: shaders_fog, by @chriscamacho
[examples] ADDED: shaders_texture_waves, by @Anata
[examples] ADDED: shaders_basic_lighting, by @chriscamacho
[examples] ADDED: shaders_simple_mask, by @chriscamacho
[examples] ADDED: audio_multichannel_sound, by @chriscamacho
[examples] ADDED: shaders_spotlight, by @chriscamacho
[examples] RENAMED: text_sprite_font > text_font_spritefont
[examples] RENAMED: text_ttf_loading > text_font_filters
[examples] RENAMED: text_bmfont_ttf > text_font_loading
[examples] REMOVED: models_obj_viewer
[examples] REMOVED: models_solar_system
[examples] REVIEWED: models_obj_loading > models_loading
[examples] REVIEWED: models_materials_pbr, shader issues
[examples] REVIEWED: core_window_letterbox, detailed explanation, by @jotac0
[examples] REVIEWED: core_window_letterbox, virtual mouse, by @anatagawa
[games] ADDED: GGJ2020 game - RE-PAIR
[*] Misc fixes and tweaks, by @yaram, @oraoto, @zatherz, @piecedigital, @Shylie
[*] Update ALL supported projects (Notepad++, VS2017)
[*] Update ALL external libraries to latest versions (29.Jan.2020)
[*] Update ALL examples and games
[*] Update BINDINGS list
-----------------------------------------------
Release: raylib 2.5 (May 2019)

View File

@@ -1,54 +1,45 @@
cmake_minimum_required(VERSION 3.0)
project(raylib)
# Avoid excessive expansion of variables in conditionals. In particular, if
# "PLATFORM" is "DRM" than:
#
# if (${PLATFORM} MATCHES "DRM")
#
# may expand e.g to:
#
# if (/usr/lib/aarch64-linux-gnu/libdrm.so MATCHES "DRM")
#
# See https://cmake.org/cmake/help/latest/policy/CMP0054.html
cmake_policy(SET CMP0054 NEW)
# Directory for easier includes
# Anywhere you see include(...) you can check <root>/cmake for that file
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Config options
option(BUILD_EXAMPLES "Build the examples." ON)
option(BUILD_GAMES "Build the example games." ON)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
endif()
# 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 (CMAKE_C_STANDARD 99)
set(RAYLIB_IS_MAIN FALSE)
endif()
include(AddIfFlagCompiles)
add_if_flag_compiles(-Werror=pointer-arith CMAKE_C_FLAGS)
add_if_flag_compiles(-Werror=implicit-function-declaration CMAKE_C_FLAGS)
# src/external/jar_xm.h does shady stuff
add_if_flag_compiles(-fno-strict-aliasing CMAKE_C_FLAGS)
# Sets compiler flags and language standard
include(CompilerFlags)
include(CheckFileSystemSymlinkSupport)
# Registers build options that are exposed to cmake
include(CMakeOptions.txt)
if (ENABLE_ASAN)
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_compiles(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
if (ENABLE_UBSAN)
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_compiles(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
if (ENABLE_MSAN)
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_compiles(-fsanitize=memory CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
# Enforces a few environment and compiler configurations
include(BuildOptions)
if (ENABLE_MSAN AND ENABLE_ASAN)
MESSAGE(WARNING "Compiling with both AddressSanitizer and MemorySanitizer is not recommended")
endif()
add_subdirectory(src)
# Main sources directory (the second parameter sets the output directory name to raylib)
add_subdirectory(src raylib)
if (${BUILD_EXAMPLES})
MESSAGE(STATUS "Building examples is enabled")
add_subdirectory(examples)
endif()
if (${BUILD_GAMES})
add_subdirectory(games)
endif()
enable_testing()

95
CMakeOptions.txt Normal file
View File

@@ -0,0 +1,95 @@
### Config options ###
include(CMakeDependentOption)
include(EnumOption)
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM" "Platform to build for.")
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0" "Force a specific OpenGL Version?")
# Configuration options
option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
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_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
option(WITH_PIC "Compile static library as position-independent code" OFF)
option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF)
option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF)
cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON)
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
if(UNIX AND NOT APPLE)
option(USE_WAYLAND "Use Wayland for window creation" OFF)
endif()
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")
# raylib modules included
cmake_dependent_option(SUPPORT_MODULE_RSHAPES "Include module: rshapes" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RTEXTURES "Include module: rtextures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RTEXT "Include module: rtext" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RMODELS "Include module: rmodels" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MODULE_RAUDIO "Include module: raudio" ON CUSTOMIZE_BUILD ON)
# rcore.c
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" OFF CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
# rshapes.c
cmake_dependent_option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON CUSTOMIZE_BUILD ON)
# rtextures.c
cmake_dependent_option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_PNM "Support loading PNM as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
# rtext.c
cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_TEXT_MANIPULATION "Support text manipulation functions" ON CUSTOMIZE_BUILD ON)
# rmodels.c
cmake_dependent_option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_VOX "Support loading VOX file format" ON CUSTOMIZE_BUILD ON)
# raudio.c
cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF)
# utils.c
cmake_dependent_option(SUPPORT_STANDARD_FILEIO "Support standard file io library (stdio.h)" ON CUSTOMIZE_BUILD ON)
cmake_dependent_option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON CUSTOMIZE_BUILD ON)

View File

@@ -1,46 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ray@raylib.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -4,28 +4,28 @@ Hello contributors! Welcome to raylib!
Do you enjoy raylib and want to contribute? Nice! You can help with the following points:
- C programming - Can you write/review/test/improve the code?
- Documentation/Tutorials/Example - Can you write some tutorial/example?
- Web Development - Can you help [with the web](https://github.com/raysan5/raylib.com)?
- Porting to other platforms - Can you port and compile raylib on another systems?
- Testing - Can you find some bugs on raylib?
- `C programming` - Can you write/review/test/improve the code?
- `Documentation/Tutorials/Example` - Can you write some tutorial/example?
- `Porting to other platforms` - Can you port/adapt/compile raylib on other systems?
- `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)?
- `Testing` - Can you find some bugs in raylib?
This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules.
Use your best judgement, and feel free to propose changes to this document in a pull-request.
Use your best judgement, and feel free to propose changes to this document in a pull request.
### raylib philosophy
- raylib is a tool to enjoy videogames programming, every single function in raylib should be a tutorial on itself.
- raylib is SIMPLE and EASY-TO-USE, I tried to keep it compact with a small set of functions, if a function is too complex or is not clearly useful, better not to include it.
- raylib is open source and free; educators and institutions can use this tool to TEACH videogames programming completely by free.
- raylib is collaborative; contribution of tutorials / code-examples / bugs-solving / code-comments are highly appreciated.
- raylib's license (and its external libs respective licenses) allow using it for commercial products.
- raylib is a tool to **ENJOY** videogames programming, every function in raylib is designed as a mini-tutorial on itself.
- raylib is **SIMPLE** and **EASY-TO-USE**, I tried to keep it compact with a small set of functions, if a function is too complex, better not including it.
- raylib is open source and free; educators and institutions can use this tool to **TEACH** videogames programming completely for free.
- raylib is collaborative; contribution of tutorials / code examples / bug fixes / code comments are highly appreciated.
- raylib's license (and its external libs respective licenses) allow using raylib on commercial projects.
### Some interesting reads to start with
- [raylib history](HISTORY.md)
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
- [raylib license](LICENSE.md)
- [raylib license](LICENSE)
- [raylib roadmap](ROADMAP.md)
[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone for edit.
@@ -36,11 +36,11 @@ Feel free to review it if required, just take care not to break something.
Despite being written in C, raylib does not follow the standard Hungarian notation for C,
it [follows Pascal-case/camel-case notation](https://github.com/raysan5/raylib/wiki/raylib-coding-conventions),
more common on C# language. All code formatting decisions have been carefully taken
to make it easier for students to read, write and understand code.
to make it easier for students/users to read, write and understand code.
Source code is extensively commented for that purpose, raylib primary learning method is:
> learn by reading code and examples
> `Learn by reading code and examples`
For detailed information on building raylib and examples, please check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
@@ -53,13 +53,13 @@ To open new issue for raylib (bug, enhancement, discussion...), just try to foll
title and clear description, as much relevant information as possible, and a code sample demonstrating the unexpected behavior.
- If applies, 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.
If don't know the 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!
### Sending a Pull-Request
- Make sure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
- Don't send big pull-requests (lots of changelists), they are difficult to review. It's better to send small pull-request, one at a time.
- Don't send big pull requests (lots of changelists), they are difficult to review. It's better to send small pull requests, one at a time.
- Verify that changes don't break the build (at least on Windows platform). As many platforms where you can test it, the better, but don't worry
if you cannot test all the platforms.
@@ -68,69 +68,9 @@ To open new issue for raylib (bug, enhancement, discussion...), just try to foll
If you have any doubt, don't hesitate to [contact me](mailto:ray@raylib.com)!.
You can write me a direct mail but you can also contact me on the following networks:
- [raylib reddit](https://www.reddit.com/r/raylib/) - A good place for discussions or to ask for help.
- [raylib Discord](https://discord.gg/VkzNHUE) - A direct communication channel for project discussions.
- [raylib Discord](https://discord.gg/raylib) - A direct communication channel for project discussions.
- [raylib twitter](https://twitter.com/raysan5) - My personal twitter account, I usually post about raylib, you can send me PMs.
- [raylib reddit](https://www.reddit.com/r/raylib/) - A good place for discussions or to ask for help.
- [raylib web](http://www.raylib.com/) - On top-right corner there is a bunch of networks where you can find me.
Thank you very much for your time! :)
----
Here is a list of raylib contributors, these people have invested part of their time
contributing (in some way or another) to make the raylib project better. Huge thanks to all of them!
- [Zopokx](https://github.com/Zopokx) for testing the web.
- [Elendow](http://www.elendow.com) for testing and helping on web development.
- Victor Dual for implementing and testing 3D shapes functions.
- Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules.
- Kevin Gato for improving texture internal formats support and helping on raygui development.
- Daniel Nicolas for improving texture internal formats support and helping on raygui development.
- Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler).
- [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing PBR materials and lighting systems... among multiple other improvements and multiple tools and games.
- Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5.
- Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5.
- [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions.
- [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system.
- [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game.
- [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system.
- [Marcelo Paez](https://github.com/paezao) for helping on OSX High DPI display issue.
- [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for an amazing contribution to raylib Lua module.
- [Teodor Stoenescu](https://github.com/teodor-stoenescu) for improvements on OBJ object loading.
- [RDR8](https://github.com/RDR8) for helping with Linux build improvements.
- [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system.
- [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building.
- [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c)
- [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support.
- [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain.
- [Michael Vetter](https://github.com/jubalh) for improvements on build system and his work on Suse Linux package... and multiple fixes!
- [Wilhem Barbier](https://github.com/nounoursheureux) for adding Image generation functions and some fixes.
- [Benjamin Summerton](https://github.com/define-private-public) for improving OSX building and his amazing work on CMake build sytem.
- [MartinFX](https://github.com/Martinfx) for adding compilation support for FreeBSD OS and derivatives.
- [Wilhem Barbier](https://github.com/nounoursheureux) for supporting default shaders on shader loading, if shader not provided.
- [Ahmad Fatoum](https://github.com/a3f) for implementing CI support for raylib (Travis and AppVeyor) and great improvements on build system.
- [SamNChiet](https://github.com/SamNChiet) for a greatly improved UWP input implementation.
- [David Reid](https://github.com/mackron) for a complete review of audio module to support his amazing miniaudio library.
- [Kai](https://github.com/questor) for multiple code reviews and improvements.
- [RDR8](https://github.com/RDR8) for improvements on Makefiles for Linux.
- [Max Danielsson](https://github.com/autious) for adding support for orthographic 3d camera projection
- [Lumaio](https://github.com/TheLumaio) for his great work on GBuffers and GetCollisionRayModel().
- [Jonas Daeyaert](https://github.com/culacant) for an amazing work on IQM animated models support.
- [Seth Archambault](https://github.com/SethArchambault) for the work on Android Gamepad support (SNES model).
- [D3nX](https://github.com/D3nX) for adding Code::Blocks project template.
- [Jak Barnes](https://github.com/Syphonx) for a great work on `rnet`, new raylib network module
- [Vlad Adrian](https://github.com/Demizdor) for an amazing work on Unicode support, new shapes functions and raygui.
- [Reece Mackie](https://github.com/Rover656) for a great work on improving UWP support
- [flashback-fx](flashback-fx) for improving easings library and example
- [Jorge A. Gomes](https://github.com/overdev) for adding nine-patch textures support and example
- [Berni8k](https://github.com/Berni8k) for improving Raspberry Pi input system, using evdev
- [Wilhem Barbier](https://github.com/wbrbr) for implementing glTF loading support and solving several issues
- [Marco Lizza](https://github.com/MarcoLizza) for improving logging system and multiple issues
- [Anata](https://github.com/anatagawa) for creating amazing examples and contributing with them
- [Narice](https://github.com/narice) made easings.h includable as standalone header
- [Eric J.](https://github.com/ProfJski) for shaders_eratosthenes example contribution
Please, if I forget someone in this list, excuse me and send a PR!

94
CONVENTIONS.md Normal file
View File

@@ -0,0 +1,94 @@
## C Coding Style Conventions
Here it is a list with some of the code conventions used by raylib:
Code element | Convention | Example
--- | :---: | ---
Defines | ALL_CAPS | `#define PLATFORM_DESKTOP`
Macros | ALL_CAPS | `#define MIN(a,b) (((a)<(b))?(a):(b))`
Variables | lowerCase | `int screenWidth = 0;`, `float targetFrameTime = 0.016f;`
Local variables | lowerCase | `Vector2 playerPosition = { 0 };`
Global variables | lowerCase | `bool windowReady = false;`
Constants | lowerCase | `const int maxValue = 8;`
Pointers | MyType *pointer | `Texture2D *array = NULL;`
float values | always x.xf | `float gravity = 10.0f`
Operators | value1*value2 | `int product = value*6;`
Operators | value1/value2 | `int division = value/4;`
Operators | value1 + value2 | `int sum = value + 10;`
Operators | value1 - value2 | `int res = value - 5;`
Enum | TitleCase | `enum TextureFormat`
Enum members | ALL_CAPS | `PIXELFORMAT_UNCOMPRESSED_R8G8B8`
Struct | TitleCase | `struct Texture2D`, `struct Material`
Struct members | lowerCase | `texture.width`, `color.r`
Functions | TitleCase | `InitWindow()`, `LoadImageFromMemory()`
Functions params | lowerCase | `width`, `height`
Ternary Operator | (condition)? result1 : result2 | `printf("Value is 0: %s", (value == 0)? "yes" : "no");`
Some other conventions to follow:
- **ALWAYS** initialize all defined variables.
- **Do not use TABS**, use 4 spaces instead.
- Avoid trailing spaces, please, avoid them
- Control flow statements always are followed **by a space**:
```c
if (condition) value = 0;
while (!WindowShouldClose())
{
}
for (int i = 0; i < NUM_VALUES; i++) printf("%i", i);
// Be careful with the switch formatting!
switch (value)
{
case 0:
{
} break;
case 2: break;
default: break;
}
```
- All conditions checks are **always between parenthesis** but not boolean values:
```c
if ((value > 1) && (value < 50) && valueActive)
{
}
```
- When dealing with braces or curly brackets, open-close them in aligned mode:
```c
void SomeFunction()
{
// TODO: Do something here!
}
```
**If proposing new functions, please try to use a clear naming for function-name and functions-parameters, in case of doubt, open an issue for discussion.**
## Files and Directories Naming Conventions
- Directories will be named using `snake_case`: `resources/models`, `resources/fonts`
- Files will be named using `snake_case`: `main_title.png`, `cubicmap.png`, `sound.wav`
_NOTE: Avoid any space or special character in the files/dir naming!_
## Games/Examples Directories Organization Conventions
- Data files should be organized by context and usage in the game, think about the loading requirements for data and put all the resources that need to be loaded at the same time together.
- Use descriptive names for the files, it would be perfect if just reading the name of the file, it was possible to know what is that file and where fits in the game.
- Here it is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font).
```
resources/audio/fx/long_jump.wav
resources/audio/music/main_theme.ogg
resources/screens/logo/logo.png
resources/screens/title/title.png
resources/screens/gameplay/background.png
resources/characters/player.png
resources/characters/enemy_slime.png
resources/common/font_arial.ttf
resources/common/gui.png
```

137
FAQ.md Normal file
View File

@@ -0,0 +1,137 @@
# Frequently Asked Questions
- [What is raylib?](#what-is-raylib)
- [What can I do with raylib?](#what-can-i-do-with-raylib)
- [Which kinds of games can I make with raylib?](#which-kinds-of-games-can-i-make-with-raylib)
- [Can I create non-game applications with raylib?](#can-i-create-non-game-applications-with-raylib)
- [How can I learn to use raylib? Is there some official documentation or tutorials?](#how-can-i-learn-to-use-raylib-is-there-some-official-documentation-or-tutorials)
- [How much does it cost?](#how-much-does-it-cost)
- [What is the raylib license?](#what-is-the-raylib-license)
- [What platforms are supported by raylib?](#what-platforms-are-supported-by-raylib)
- [What programming languages can I use with raylib?](#what-programming-languages-can-i-use-with-raylib)
- [Why is it coded in C?](#why-is-it-coded-in-c)
- [Is raylib a videogames engine?](#is-raylib-a-videogames-engine)
- [What does raylib provide that other engines or libraries don't?](#what-does-raylib-provide-that-other-engines-or-libraries-dont)
- [How does raylib compare to Unity/Unreal/Godot?](#how-does-raylib-compare-to-unityunrealgodot)
- [What development tools are required for raylib?](#what-development-tools-are-required-for-raylib)
- [Which are raylib external dependencies?](#which-are-raylib-external-dependencies)
- [Can I use raylib with other technologies or libraries?](#can-i-use-raylib-with-other-technologies-or-libraries)
- [What file formats are supported by raylib?](#what-file-formats-are-supported-by-raylib)
- [Does raylib support the Vulkan API?](#does-raylib-support-the-vulkan-api)
- [What could I expect to see in raylib in the future?](#what-could-i-expect-to-see-in-raylib-in-the-future)
- [Who are the raylib developers?](#who-are-the-raylib-developers)
### What is raylib?
raylib is a C programming library, designed to be simple and easy-to-use. It provides a set of functions intended for graphics/multimedia applications programming.
### What can I do with raylib?
raylib can be used to create any kind of graphics/multimedia applications: videogames, tools, mobile apps, web applications... Actually it can be used to create any application that requires something to be shown in a display with graphic hardware acceleration (OpenGL); including [IoT](https://en.wikipedia.org/wiki/Internet_of_things) devices with a graphics display.
### Which kinds of games can I make with raylib?
With enough time and effort any kind of game/application can be created but small-mid sized 2d videogames are the best fit. The raylib [examples](https://www.raylib.com/examples.html)/[games](https://www.raylib.com/games.html) and [raylibtech](https://raylibtech.itch.io/) tools are an example of what can be accomplished with raylib.
### Can I create non-game applications with raylib?
Yes, raylib can be used to create any kind of application, not just videogames. For example, it can be used to create [desktop/web tools](https://raylibtech.itch.io/) or also applications for an IoT devices like [Raspberry Pi](https://www.raspberrypi.org/).
### How can I learn to use raylib? Is there some official documentation or tutorials?
raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look to [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching.
raylib also provides a big [collection of examples](https://www.raylib.com/examples.html), to showcase the multiple functionality usage (+120 examples). Examples are categorized by the internal module functionality and also define an estimated level of difficulty to guide the users checking them.
There is also a [FAQ on the raylib Wiki](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions) with common technical questions.
There are also many tutorials on the internet and YouTube created by the growing raylib community along the years.
[raylib Discord Community](https://discord.gg/raylib) is also a great place to join and ask questions, the community is very friendly and always ready to help.
### How much does it cost?
raylib is [free and open source](https://github.com/raysan5/raylib). Anyone can use raylib library for free to create games/tools/apps but also the source code of raylib is open for anyone to check it, modify it, adapt it as required or just learn how it works internally.
### What is the raylib license?
raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details.
### What platforms are supported by raylib?
raylib source code can be compiled for the following platforms:
- Windows (7, 8.1, 10, 11)
- Linux - Desktop (multiple distributions, X11 and Wayland based)
- Linux - Native (no windowing system, [DRM](https://en.wikipedia.org/wiki/Direct_Rendering_Manager))
- macOS (multiple versions, including ARM64)
- FreeBSD, OpenBSD, NetBSD, DragonFly
- Raspberry Pi (desktop and native)
- Android (multiple API versions and architectures)
- HTML5 (WebAssembly)
- Haiku
raylib code has also been ported to several [homebrew](https://en.wikipedia.org/wiki/Homebrew_(video_games)) platforms: N3DS, Switch, PS4, PSVita.
Also note that raylib is a low-level library that can be easily ported to any platform with OpenGL support (or similar API).
### What programming languages can I use with raylib?
raylib original version is coded in C language (using some C99 features) but it has bindings to +60 programming languages. Check [BINDINGS.md](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) for details.
### Why is it coded in C?
It's a simple language, no high-level code abstractions like [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming), just data types and functions. It's a very enjoyable language to code.
### Is raylib a videogames engine?
I personally consider raylib a graphics library with some high-level features rather than an engine. The line that separates a library/framework from an engine could be very confusing; raylib provides all the required functionality to create simple games or small applications but it does not provide 3 elements that I personally consider any "engine" should provide: Screen manager, GameObject/Entity manager and Resource Manager. Still, most users do not need those elements or just code simple approaches on their own.
### What does raylib provide that other engines or libraries don't?
I would say "simplicity" and "enjoyment" at a really low-level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
### How does raylib compare to Unity/Unreal/Godot?
Those engines are usually big and complex to use, providing lot of functionality. They require some time to learn and test, they usually abstract many parts of the game development process and they usually provide a set of tools to assist users on their creations (like a GUI editor).
raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low-level to create graphics applications in a more handmade way.
### What development tools are required for raylib?
To develop raylib programs you only need a text editor (with recommended code syntax highlighting) and a compiler.
A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advance configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials.
### What are raylib's external dependencies?
raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file-formats.
A detailed list of raylib dependencies could be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies).
### Can I use raylib with other technologies or libraries?
Yes, raylib can be used with other libraries that provide specific functionality. There are multiple examples of raylib integrations with libraries like Spine, Tiled, Dear Imgui and several physics engines.
### What file formats are supported by raylib?
raylib can load data from multiple standard file formats:
- Image/Textures: PNG, BMP, TGA, JPG, GIF, QOI, PSD, DDS, HDR, KTX, ASTC, PKM, PVR
- Fonts: FNT (sprite font), TTF, OTF
- Models/Meshes: OBJ, IQM, GLTF, VOX
- Audio: WAV, OGG, MP3, FLAC, XM, MOD
### Does raylib support the Vulkan API?
No, raylib is built on top of OpenGL API, and there are currently no plans to support any other graphics APIs. In any case, raylib uses rlgl as an abstraction layer to support different OpenGL versions. If really required, a Vulkan backend equivalent could be added but creating that abstraction layer would imply a considerable amount of work.
### What could I expect to see in raylib in the future?
The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features are regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable.
### Who are the raylib developers?
The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there's 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib.
The full list of raylib contributors can be seen [on GitHub](https://github.com/raysan5/raylib/graphs/contributors).

View File

@@ -1,19 +1,19 @@
![raylib logo](logo/raylib_256x256.png)
history
-------
introduction
------------
I've developed videogames since 2006 and in 2012 I started teaching videogames development to young people with artistic profile, most of them had never written a single line of code.
I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profile, most of students had never written a single line of code.
I started with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found WinBGI; it was great and it worked very well with students, in just a couple of weeks that people that had never written a single line of code were able to program (and understand) a simple PONG and some of them even a BREAKOUT!
I decided to start with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found [WinBGI](http://www.codecutter.net/tools/winbgim/); it was great and it worked very well with students, in just a couple of weeks, those students that had never written a single line of code were able to program (and understand) a simple PONG game, some of them even a BREAKOUT!
But WinBGI was not the clearer and most organized lib. There were a lot of things I found confusing and some function names were not clear enough for most of the students; not to mention points like no transparencies support or no hardware acceleration.
But WinBGI was not the clearer and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration.
So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, the most important, primarily intended to learn videogames programming.
Most of my videogames coding experience was in C# and XNA and I really love it (in fact, my students learn C# after C), so, I decided to use C# language notation and XNA naming conventions. That way, students can jump from raylib to XNA, MonoGame or similar libs extremely easily.
My previous videogames development experience was mostly in C# and [XNA](https://en.wikipedia.org/wiki/Microsoft_XNA) and I really loved it, so, I decided to use C# language style notation and XNA naming conventions. That way, students were able to move from raylib to XNA, MonoGame or similar libs extremely easily.
raylib started as a weekend project and after three months of hard work, raylib 1.0 was published on November 2013.
raylib started as a weekend project and after three months of hard work, **raylib 1.0 was published on November 2013**.
Enjoy it.
@@ -22,9 +22,9 @@ notes on raylib 1.1
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
- A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
[rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
- [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support.
@@ -33,13 +33,13 @@ Lots of code changes and lot of testing have concluded in this amazing new rayli
notes on raylib 1.2
-------------------
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch.
A new display initialization system has been created to support multiple resolutions, adding black bars if required; user only defines desired screen size and it gets properly displayed.
- A new display initialization system has been created to support multiple resolutions, adding black bars if required; user only defines desired screen size and it gets properly displayed.
Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
- Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
@@ -50,15 +50,15 @@ notes on raylib 1.3
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality, improves tremendously textures module and also provides some new modules (camera system, gestures system, immediate-mode gui).
Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder.
- Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder.
Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
- Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/camera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_first_person.c).
- A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_first_person.c).
New [gestures](https://github.com/raysan5/raylib/blob/master/src/gestures.h) module simplifies gestures detection on Android and HTML5 programs.
- New [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module simplifies gestures detection on Android and HTML5 programs.
[raygui](https://github.com/raysan5/raylib/blob/master/src/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional.
- [raygui](https://github.com/raysan5/raylib/blob/master/src/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional.
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
@@ -69,17 +69,17 @@ notes on raylib 1.4
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage.
- First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage.
SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
- SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
New [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) physics module for basic 2D physics support. Still in development but already functional. Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
- New [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) physics module for basic 2D physics support. Still in development but already functional. Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
[raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
- [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
[gestures](https://github.com/raysan5/raylib/blob/master/src/gestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
- [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental).
- Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental).
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions,
and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/src/easings.h) module has also been added for values animation.
@@ -94,19 +94,19 @@ notes on raylib 1.5
On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added.
VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c).
- VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c).
New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
- New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
- New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
- Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
- Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
- Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core_2d_camera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes.
@@ -119,17 +119,17 @@ notes on raylib 1.6
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality.
- Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality.
Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
- Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
[Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
- [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
- Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
- Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
- Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
@@ -140,15 +140,15 @@ notes on raylib 1.7
On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are:
More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, funtions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
- More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, funtions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality.
- Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality.
Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
- Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems.
- New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems.
Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
- Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timing improvements, public log system, rres file format support, automatic GIF recording...
@@ -159,17 +159,17 @@ notes on raylib 1.8
October 2017, around 5 months after latest raylib version, another release is published: raylib 1.8. Again, several modules of the library have been reviewed and some new functionality added. Main changes of this new release are:
[Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses.
- [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses.
[Parametric mesh generation](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing.
- [Parametric mesh generation](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing.
PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference.
- PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference.
Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts.
- Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts.
[rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions.
- [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions.
[raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) library has been also reviewed to align with other advance math libraries like [GLM](https://github.com/g-truc/glm). Matrix math has been improved and simplified, some new Quaternion functions have been added and Vector3 functions have been renamed all around the library for consistency with new Vector2 functionality.
- [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) library has been also reviewed to align with other advance math libraries like [GLM](https://github.com/g-truc/glm). Matrix math has been improved and simplified, some new Quaternion functions have been added and Vector3 functions have been renamed all around the library for consistency with new Vector2 functionality.
Additionally, as always, examples and templates have been reviewed to work with new version (some new examples have been added), all external libraries have been updated to latest stable version and latest Notepad++ and MinGW have been configured to work with new raylib. For a full list of changes, just check [CHANGELOG](CHANGELOG).
@@ -182,17 +182,17 @@ It's been 9 month since last raylib version was published, a lots of things have
In **raylib 2.0** the full API has been carefully reviewed for better consistency, some new functionality has been added and the overall raylib experience has been greatly improved... The key features of new version are:
**Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependant ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library.
- **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependant ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library.
**Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtly, the perfect low-level companion for raylib audio module!
- **Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtly, the perfect low-level companion for raylib audio module!
**Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplyfing the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release!
- **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplyfing the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release!
**More platforms supported and tested**, including BSD family (FreeBSD, openBSD, NetBSD, DragonFly) and Linux-based family platforms (openSUSE, Debian, Ubuntu, Arch, NixOS...). raylib has already been added to some package managers! Oh, and last but not less important, **Android 64bit** is already supported by raylib!
- **More platforms supported and tested**, including BSD family (FreeBSD, openBSD, NetBSD, DragonFly) and Linux-based family platforms (openSUSE, Debian, Ubuntu, Arch, NixOS...). raylib has already been added to some package managers! Oh, and last but not less important, **Android 64bit** is already supported by raylib!
**Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provide by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds!
- **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provide by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds!
Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file-formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired!
- Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file-formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired!
A part of that, lots of new features, like a brand **new font rendering and packaging system** for TTF fonts with **SDF support** (thanks to the amazing STB headers), new functions for **CPU image data manipulation**, new orthographic 3d camera mode, a complete review of `raymath.h` single-file header-only library for better consistency and performance, new examples and way, [way more](https://github.com/raysan5/raylib/blob/master/CHANGELOG).
@@ -203,25 +203,232 @@ notes on raylib 2.5
After almost one years since latest raylib installment, here it is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here it is a short recap with the highlight improvements.
New **window management and filesystem functions** to query monitor information, deal with clipboard, check directory files info and even launch a URL with default system web browser. Experimental **High-DPI monitor support** has also been added through a compile flag.
- New **window management and file system functions** to query monitor information, deal with clipboard, check directory files info and even launch a URL with default system web browser. Experimental **High-DPI monitor support** has also been added through a compile flag.
**Redesigned Gamepad mechanism**, now generic for all platforms and gamepads, no more specific gamepad configurations.
- **Redesigned Gamepad mechanism**, now generic for all platforms and gamepads, no more specific gamepad configurations.
**Redesigned UWP input system**, now raylib supports UWP seamlessly, previous implementation required a custom input system implemented in user code.
`rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behaviour.
- `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behaviour.
**VR simulator** has been reviewed to **allow custom configuration of Head-Mounted-Device parameters and distortion shader**, `core_vr_simulator` has been properly adapted to showcase this new functionality, now the VR simulator is a generic configurable stereo rendering system that allows any VR device simulation with just a few lines of code or even dynamic tweaking of HMD parameters.
- **VR simulator** has been reviewed to **allow custom configuration of Head-Mounted-Device parameters and distortion shader**, `core_vr_simulator` has been properly adapted to showcase this new functionality, now the VR simulator is a generic configurable stereo rendering system that allows any VR device simulation with just a few lines of code or even dynamic tweaking of HMD parameters.
Support for **Unicode text drawing**; now raylib processes UTF8 strings on drawing, supporting Unicode codepoints, allowing rendering mostly any existent language (as long as the font with the glyphs is provided). An amazing example showing this feature has also been added: `text_unicode`.
- Support for **Unicode text drawing**; now raylib processes UTF8 strings on drawing, supporting Unicode codepoints, allowing rendering mostly any existent language (as long as the font with the glyphs is provided). An amazing example showing this feature has also been added: `text_unicode`.
Brand **new text management API**, with the addition of multiple functions to deal with string data, including functionality like replace, insert, join, split, append, to uppercase, to lower... Note that most of those functions are intended for text management on rendering, using pre-loaded internal buffers, avoiding new memory allocation that user should free manually.
- Brand **new text management API**, with the addition of multiple functions to deal with string data, including functionality like replace, insert, join, split, append, to uppercase, to lower... Note that most of those functions are intended for text management on rendering, using pre-loaded internal buffers, avoiding new memory allocation that user should free manually.
Multiple **new shapes and textures drawing functions** to support rings (`DrawRing()`, `DrawRingLines()`), circle sectors (`DrawCircleSector()`, `DrawCircleSectorLines()`), rounded rectangles (`DrawRectangleRounded()`, `DrawRectangleRoundedLines()`) and also n-patch textures (`DrawTextureNPatch()`), detailed examples have been added to illustrate all this new functionality.
- Multiple **new shapes and textures drawing functions** to support rings (`DrawRing()`, `DrawRingLines()`), circle sectors (`DrawCircleSector()`, `DrawCircleSectorLines()`), rounded rectangles (`DrawRectangleRounded()`, `DrawRectangleRoundedLines()`) and also n-patch textures (`DrawTextureNPatch()`), detailed examples have been added to illustrate all this new functionality.
Experimental **cubemap support**, to automatically load multiple cubemap layouts (`LoadTextureCubemap()`). It required some internal `rlgl` redesign to allow cubemap textures.
- Experimental **cubemap support**, to automatically load multiple cubemap layouts (`LoadTextureCubemap()`). It required some internal `rlgl` redesign to allow cubemap textures.
**Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accomodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added.
- **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accomodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added.
This is a just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones.
It has been a long year of hard work to make raylib a solid technology to develop new products over it.
notes on raylib 3.0
-------------------
After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has reveived a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other progamming [language bindings](BINDINGS.md).
- All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variables naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired.
- All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easely hook their own memory allocations mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074.
- All **I/O file accesses** from raylib are being moved to **memory data access**, now all I/O file access is centralized into just four functions: `LoadFileData()`, `SaveFileData()`, `LoadFileText()`, `SaveFileText()`. Users can just update those functions to any I/O file system. This change makes it easier to integrate raylib with **Virtual File Systems** or custom I/O file implementations.
- All **raylib data structures** have been reviewed and optimized for pass-by-value usage. One of raylib distinctive design decisions is that most of its functions receive and return data by value. This design makes raylib really simple for newcomers, avoiding pointers and allowing complete access to all structures data in a simple way. The downside is that data is copied on stack every function call and that copy could be costly so, all raylib data structures have been optimized to **stay under 64 bytes** for fast copy and retrieve.
- All **raylib tracelog messages** have been reviewd and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages.
- `raudio` module has been internally reviewed to accomodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio).
- `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accomodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding.
- **Multiple new examples added** (most of them contributed by raylib users) and all examples reviewed for correct execution on most of the supported platforms, specially Web and Raspberry Pi. A detailed categorized table has been created on github for easy examples navigation and code access.
- New **GitHub Actions CI** system has been implemented for Windows, Linux and macOS code and examples compilation on every new commit or PR to make sure library keeps stable and usable with no breaking bugs.
Note that only key changes are listed here but there is way more! About **30 new functions**, multiple functions reviewed, bindings to [+40 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) and great samples/demos/tutorials [created by the community](https://discord.gg/raylib), including raylib integration with [Spine](https://github.com/WEREMSOFT/spine-raylib-runtimes), [Unity](https://unitycoder.com/blog/2019/12/09/using-raylib-dll-in-unity/), [Tiled](https://github.com/OnACoffeeBreak/raylib_tiled_import_with_tmx), [Nuklear](http://bedroomcoders.co.uk/implementing-a-3d-gui-with-raylib/), [enet](https://github.com/nxrighthere/NetDynamics) and [more](https://github.com/raysan5/raylib/issues/1079)!
It has been **10 months of improvements** to create the best raylib ever.
Welcome to **raylib 3.0**.
notes on raylib 3.5 - 7th Anniversary Edition
---------------------------------------------
It's December 25th... this crazy 2020 is about to finish and finally the holidays gave me some time to put a new version of raylib. It's been **9 months since last release** and last November raylib become 7 years old... I was not able to release this new version back then but here it is. Many changes and improvements have happened in those months and, even, last August, raylib was awarded with an [Epic Megagrant](https://www.unrealengine.com/en-US/blog/epic-megagrants-fall-2020-update)! Bindings list kept growing to [+50 programming languages](BINDINGS.md) and some new platforms have been supported. Let's see this new version details:
First, some general numbers of this new update:
- **+650** commits since previous RELEASE
- **+30** functions ADDED (for a TOTAL of **475**!)
- **+90** functions REVIEWED/REDESIGNED
- **+30** contributors (for a TOTAL of **170**!)
- **+8** new examples (for a TOTAL of **+120**!)
Here the list with some highlights for `raylib 3.5`.
- NEW **Platform** supported: **Raspberry Pi 4 native mode** (no X11 windows) through [DRM](https://en.wikipedia.org/wiki/Direct_Rendering_Manager) subsystem and GBM API. Actually this is a really interesting improvement because it opens the door to raylib to support other embedded platforms (Odroid, GameShell, NanoPi...). Also worth mentioning the un-official homebrew ports of raylib for [PS4](https://github.com/orbisdev/orbisdev-orbisGl2) and [PSVita](https://github.com/psp2dev/raylib4Vita).
- NEW **configuration options** exposed: For custom raylib builds, `config.h` now exposes **more than 150 flags and defines** to build raylib with only the desired features, for example, it allows to build a minimal raylib library in just some KB removing all external data filetypes supported, very useful to generate **small executables or embedded devices**.
- NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file-accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out!
- NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advance users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently.
- NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advance Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API.
- Improved **software rendering**: raylib `Image*()` API is intended for software rendering, for those cases when **no GPU or no Window is available**. Those functions operate directly with **multi-format** pixel data on RAM and they have been completely redesigned to be way faster, specially for small resolutions and retro-gaming. Low-end embedded devices like **microcontrollers with custom displays** could benefit of this raylib functionality!
- File **loading from memory**: Multiple functions have been redesigned to load data from memory buffers **instead of directly accessing the files**, now all raylib file loading/saving goes through a couple of functions that load data into memory. This feature allows **custom virtual-file-systems** and it gives more control to the user to access data already loaded in memory (i.e. images, fonts, sounds...).
- NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hidding, focusing, topmost and more.
- NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the diferent generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed.
A part of those changes, many new functions have been added, some redundant functions removed and many functions have been reviewed for consistency with the full API (function name, parameters name and order, code formatting...). Again, this release represents is a **great improvement for raylib and marks the way forward** for the library. Make sure to check [CHANGELOG](CHANGELOG) for details! Hope you enjoy it!
Happy holidays! :)
notes on raylib 3.7
-------------------
April 2021, it's been about 4 months since last raylib release and here it is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April the 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version:
Let's start with some numbers:
- **+100** closed issues (for a TOTAL of **+900**!)
- **+400** commits since previous RELEASE
- **+50** functions ADDED (**+30** of them to rlgl API)
- **+30** functions REVIEWED/REDESIGNED
- **+40** new contributors (for a TOTAL of **+210**!)
Highlights for `raylib 3.7`:
- **REDESIGNED: `rlgl` module for greater abstraction level**. This suppose an **important change in raylib architecture**, now `rlgl` functionality is self-contained in the module and used by higher-level layers (specially by `core` module), those upper layers are the ones that expose functionality to the main API when required, for example the `Shaders`, `Mesh` and `Materials` functionality. Multiple `rlgl` functions have been renamed for consistency, in this case, following the `rl*()` prefix convention. Functions have also been reorganized internally by categories and `GenTexture*()` functions have been removed from the library and moved to [`models_material_pbr`](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) example.
- **REDESIGNED: VR simulator and stereo rendering mechanism**. A **brand new API** has been added, more comprehensive and better integrated with raylib, the **new stereo rendering** can be combined with `RenderTexture` and `Shader` API allowing the user to **manage fbo and distortion shader directly**. Also, the new rendering mechanism supports **instancing on stereo rendering**! Check the updated [`core_vr_simulator`](https://github.com/raysan5/raylib/blob/master/examples/core/core_vr_simulator.c) example for reference!
- **ADDED: New file access callbacks system**. Several new callback functions have been added to the API to allow custom file loaders. A [nice example](https://github.com/RobLoach/raylib-physfs) it's the **raylib integration with a virtual file system** [PhysFS](https://icculus.org/physfs/).
- **ADDED: glTF animations support**. glTF is the preferred models file format to be used with raylib and along the addition of a models animation API on latest raylib versions, now animations support for glTF format has come to raylib, thanks for this great contribution to [Hristo Stamenov](@object71)
- **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streamming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD.
- **RENAMED: enums values for consistency**. Most raylib enums names and values names have been renamed for consistency, now all value names start with the type of data they represent. It increases clarity and readability when using those values and also **improves overall library consistency**.
Beside those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment!
Happy **gamedev/tools/graphics** programming! :)
notes on raylib 4.0 - 8th Anniversary Edition
---------------------------------------------
It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflexion point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long term version (LTS), stable and complete enough for any new graphic/game/tool application development.
Let's start with some numbers:
- **+130** closed issues (for a TOTAL of **+1030**!)
- **+550** commits since previous RELEASE
- **+20** functions ADDED to raylib API
- **+60** functions ADDED to rlgl API
- **+40** functions RENAMED/REVIEWED/REDESIGNED
- **+60** new contributors (for a TOTAL of **+275**!)
Highlights for `raylib 4.0`:
- **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent.
- **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental.
- **Custom game-loop control**: As requested by some advance users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advance users that want to control the events polling and also the timming mechanisms of their games.
- [**`rlgl 4.0`**](https://github.com/raysan5/raylib/blob/master/src/rlgl.h): This module has been completely **decoupled from platform layer** and raylib, now `rlgl` single-file header-only library only depends on the multiple OpenGL backends supported, even the dependency on `raymath` has been removed. Additionally, **support for OpenGL 4.3** has been added, supporting compute shaders and Shader Storage Buffer Objects (SSBO). Now `rlgl` can be used as a complete standalone portable library to wrap several OpenGL version and providing **a simple and easy-to-use pseudo-OpenGL immediate-mode API**.
- [**`raymath 1.5`**](https://github.com/raysan5/raylib/blob/master/src/raymath.h): This module has been reviewed and some new conventions have been adopted to make it **more portable and self-contained**:
- Functions are self-contained, no function use other raymath function inside, required code is directly re-implemented
- Functions input parameters are always received by value
- Functions use always a "result" variable for return
- Angles are always in radians (`DEG2RAD`/`RAD2DEG` macros provided for convenience)
- [**`raygui 3.0`**](https://github.com/raysan5/raygui): The **official raylib immediate-mode gui library** (included in `raylib/src/extras`) has been updated to a new version, embedding the icons collection and adding mulstiple improvements. It has been simplified and constrained for a better focus on its task: provide a simple and easy-to-use immediate-mode-gui library for small tools development.
- [**`raylib_parser`**](https://github.com/raysan5/raylib/tree/master/parser): Added **new tool to parse `raylib.h`** and tokenize its enums, structs and functions, extracting all required info (name, params, descriptions...) into custom output formats (TXT, XML, JSON...) for further processing. This tool is specially useful to **automatize bindings generation**. Hopefully, this tool will make life easier to binding creators to update their bindings for raylib 4.0 or adding new ones!
- **Zig and Odin official support for raylib**: Those two new amazing programming languages are officially supporting raylib, `Zig` lists raylib as an [official example for C interoperatibility](https://ziglang.org/learn/samples/#c-interoperability) and Odin [officially supports raylib as a vendor library](https://github.com/odin-lang/Odin/tree/master/vendor/raylib). Both languages also have several bingings to raylib. Additionally, Zig build system supported has been added to compile raylib library and examples.
Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes!
Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :)
notes on raylib 4.2
-------------------
**New raylib release!** Nine months after latest raylib, here it is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing!
Some numbers to start with:
- **+200** closed issues (for a TOTAL of **1230**!)
- **+540** commits since previous RELEASE (for a TOTAL of **+6000**!)
- **+20** functions ADDED to raylib API (for a TOTAL of **502**!)
- **+60** functions REVIEWED/REDESIGNED
- **+70** new contributors (for a TOTAL of **+360**!)
Highlights for `raylib 4.2`:
- **raylib extra libraries cleanup**: raylib has been on diet and all the _extra_ libraries included on previous releases have been removed from raylib. Now raylib only includes the original **7** raylib modules: `rcore`, `rlgl`, `rshapes`, `rtextures`, `rtext`, `rmodels` and `raudio`. But no worries, _extra_ libraries have not been deleted, they have been moved to their own repos for better maintainability and more focus on its functionality. The libraries moved out from raylib repo are: [`raygui`](https://github.com/raysan5/raygui), [`physac`](https://github.com/raysan5/physac), [`rmem`](https://github.com/raylib-extras/rmem), [`reasings`](https://github.com/raylib-extras/reasings) and [`raudio`](https://github.com/raysan5/raudio) (standalone mode). On that same line, a new **amazing GitHub group:** [`raylib-extras`](https://github.com/raylib-extras) has been created by @JeffM2501 to contain raylib extra libraries as well as other raylib add-ons provided by the community. Jeff has done an amazing work on that line, providing multiple libraries and examples for raylib, like [custom first-person and third person camera systems](https://github.com/raylib-extras/extras-c/tree/main/cameras), [Dear ImGui raylib integration](https://github.com/raylib-extras/rlImGui), [multiple specific examples](https://github.com/raylib-extras/examples-c) and even a complete [RPG Game Example](https://github.com/raylib-extras/RPGExample)! Great work Jeff! :D
- **raylib examples review**: The +120 raylib examples have been reviewed to add clearer information about when the were first created (raylib version used) and when they were updated for the last time. But the greatest improvement for users has been the **addition of an estimated difficulty level** for every example, [web has been updated accordingly](https://www.raylib.com/examples.html) to reflect those difficulty levels. Now examples are classified with **1 to 4 stars** depending on difficulty to help users with their learning process. Personally, I think this "small" addition could be a game-changer to better guide new users on the library adoption! Additionally, this new raylib release includes 7 new examples; the most interesting one: [`text_codepoints_loading`](https://www.raylib.com/examples/text/loader.html?name=text_codepoints_loading) that illustrates how to load and draw custom codepoints from a font file, very useful for Asian languages.
- [**`rres 1.0`**](https://github.com/raysan5/rres): New `rres` **resources packaging file-format**, including a [`rres-raylib`](https://github.com/raysan5/rres/blob/master/src/rres-raylib.h) library implementation and [`rrespacker`](https://raylibtech.itch.io/rrespacker) tool. `rres` file format has been [under development for +8 years](https://github.com/raysan5/rres#design-history) and it was originally created to be part of raylib. It was highly inspired by _XNA XNB_ resources file format but design has changed a lot along the years. This first release of the format specs is engine-agnostic and has been designed to be portable to any engine, including lots of professional features like data processing, compression and encryption.
- [**`raygui 3.2`**](https://github.com/raysan5/raygui): The **official raylib immediate-mode gui library** designed for tools development has been updated to a new version aligned with raylib 4.2. Multiple controls have been reviewed for library consistency, now all controls follow a similar function signature. It has been battle-tested with the development of +8 published tools in the last months. The tools can be seen and used for free in the [raylib technologies tools page](https://raylibtech.itch.io/). Worth mentioning that several of those **tools have been open sourced** for anyone to use, compile, contribute or learn how the code works.
- [**`raylib_parser`**](https://github.com/raysan5/raylib/tree/master/parser): Multiple contributors **using the tool to automatize bindings creation** have contributed with improvements of this **tool to parse `raylib.h`** (and other raylib-style headers) to tokenize its enums, structs and functions. Processed data can be exported to custom file formats (i.e XML, JSON, LUA) for bindings generation or even docs generation if required.
- **New file system API**: Current API has been redesigned to be more comprehensive and better aligned with raylib naming conventions, two new functions are provided `LoadDirectoryFiles()`/`LoadDirectoryFilesEx()` to load a `FilePathList` for provided path, supporting extension filtering and recursive directory scan. `LoadDroppedFiles()` has been renamed to better reflect its internal functionality. Now, all raylib functions that start with `Load*()` allocate memory internally and a equivalent `Unload*()` function is defined to take care of that memory internally when not required any more!
- **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advance users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib.
As always, there are more improvements than the key features listed, make sure to check raylib [CHANGELOG](CHANGELOG) for the detailed list of changes; for this release a `WARNING` flag has been added to all the changes that could affect bindings or productivity code. **raylib keeps improving one more version** and a special focus on maintainability has been put on the library for the future. Specific/advance functionality will be provided through **raylib-extras** repos and raylib main repo devlelopment will be focused on what made raylib popular: being a simple and easy-to-use library to **enjoy videogames programming**.
**Enjoy gamedev/tools/graphics programming!** :)
notes on raylib 4.5
-------------------
It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here it is a small summary highlighting this new **rayib 4.5**.
Some numbers for this release:
- **+100** closed issues (for a TOTAL of **+1340**!)
- **+350** commits since previous RELEASE (for a TOTAL of **+6350**!)
- **+25** functions ADDED to raylib API (for a TOTAL of **516**!)
- **+40** functions REVIEWED/REDESIGNED
- **+40** new contributors (for a TOTAL of **405**!)
Highlights for `raylib 4.5`:
- **`NEW` Improved ANGLE support on Desktop platforms**: Support for OpenGL ES 2.0 on Desktop platforms (Windows, Linux, macOS) has been reviewed by @wtnbgo GitHub user. Now raylib can be compiled on desktop for OpenGL ES 2.0 and linked against [`ANGLE`](https://github.com/google/angle). This _small_ addition open the door to building raylib for all **ANGLE supported backends: Direct3D 11, Vulkan and Metal**. Please note that this new feature is still experimental and requires further testing!
- **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advance users have **full control over camera inputs and movement/rotation speeds**!
- **`NEW` Support for M3D models and M3D/GLTF animations**: 3d models animations support has been a limited aspect of raylib for long time, some versions ago IQM animations were supported but raylib 4.5 also adds support for the brand new [M3D file format](https://bztsrc.gitlab.io/model3d/), including animations and the long expected support for **GLTF animations**! The new M3D file format is **simple, portable, feature complete, extensible and open source**. It also provides a complete set of tools to export/visualize M3D models from/to Blender! Now raylib supports up to **3 model file-formats with animations**: `IQM`, `GLTF` and `M3D`.
- **`NEW` Support QOA audio format (import/export)**: Just a couple of months ago the new [QOA file format](https://qoaformat.org/) was published, a very simple, portable and open source quite-ok-audio file format. raylib already supports it, added to `raudio` module and including audio loading from file, loading from memory, streaming from file, streaming from memory and **exporting to QOA** audio format. **Because simplicity really matters to raylib!**
- **`NEW` Module for compressed textures loading**: [`rl_gputex`](https://github.com/raysan5/raylib/blob/master/src/external/rl_gputex.h), a portable single-file header-only small library to load compressed texture file-formats (DDS, PKM, KTX, PVR, ASTC). Provided functionality is not new to raylib but it was part of the raylib `rtextures` module, now it has been moved into a separate self-contained library, **improving portability**. Note that this module is only intended to **load compressed data from files, ready to be uploaded to GPU**, no compression/decompression functionality is provided. This change is a first step towards a better modularization of raylib library.
- **Reviewed `rlgl` module for automatic limits checking**: Again, [`rlgl`](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been reviewed to simplify usage. Now users do not need to worry about reaching the internal render-batch limits when they send their triangles to draw 2d/3d, `rlgl` manages it automatically! This change allows a **great simplification for other modules** like `rshapes`, `rtextures` and `rmodels` that do not need to worry about bufffer overflows and can just define as many vertex as desired!
- **Reviewed `rshapes` module to minimize the rlgl dependency**: Now `rshapes` 2d shapes drawing functions **only depend on 6 low-level functions**: `rlBegin()`, `rlEnd()`, `rlVertex3f()`, `rlTexCoord2f()`, `rlNormal3f()`, `rlSetTexture()`. With only those pseudo-OpenGl 1.1 minimal functionality, everything can be drawn! This improvement converts `rshapes` module in a **self-contained, portable shapes-drawing library that can be used independently of raylib**, as far as entry points for those 6 functions are provided by the user. It even allows to be used for software rendering, with the proper backend!
- **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselfs.
As usual, those are only some highlights but there is much more! New image generators, new color transformation functionality, improved blending support for color/alpha, etc... Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! Please, note that all breaking changes have been flagged with a `WARNING` in the CHANGELOG, specially useful for binding creators!
**raylib keeps improving one more version** with a special focus on maintainability and sustainability. Always working towards making the library more **simple and easy-to-use**.
Let's keep **enjoying games/tools/graphics programming!** :)

View File

@@ -1,8 +1,4 @@

This game sources are licensed under an unmodified zlib/libpng license,
which is an OSI-certified, BSD-like license:
Copyright (c) 2013-2017 Ramon Santamaria (@raysan5)
Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.

View File

@@ -1,51 +0,0 @@
license
=======
source code
-----------
raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
BSD-like license that allows static linking with closed source software:
Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you
wrote the original software. If you use this software in a product, an acknowledgment
in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented
as being the original software.
3. This notice may not be removed or altered from any source distribution.
fonts
------
The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/master/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:
* Alpha Beta - Brian Kent (AEnigma)
* Setback - Brian Kent (AEnigma)
* Jupiter Crash - Brian Kent (AEnigma)
* Alagard - Hewett Tsoi
* Romulus - Hewett Tsoi
* Mecha - Captain Falcon
* PixelPlay - Aleksander Shevchuk
* PixAntiqua - Gerhard Großmann
2d art
------
[scarfy spritesheet](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and are licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
[cyberpunk street environments](https://github.com/raysan5/raylib/blob/master/examples/textures/resources) have been created by Luis Zuno ([@ansimuz](https://twitter.com/ansimuz)) and are licensed as [CC-BY-3.0](http://creativecommons.org/licenses/by/3.0/)
3d models
---------
[medieval city 3d models and textures](https://github.com/raysan5/raylib/tree/master/examples/models/resources/medieval) have been created by Alberto Cano and are licensed as [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode)

148
README.md
View File

@@ -1,78 +1,144 @@
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_256x256.png" width=256>
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">
**raylib is a simple and easy-to-use library to enjoy videogames programming.**
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's specially well suited for prototyping, tooling, graphical applications, embedded systems and education.
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no auto-debugging... just coding in the most pure spartan-programmers way.*
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
Ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html)
Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
---
[![Build Status](https://travis-ci.org/raysan5/raylib.svg?branch=master)](https://travis-ci.org/raysan5/raylib)
[![https://ci.appveyor.com/api/projects/status/github/raysan5/raylib?svg=true](https://ci.appveyor.com/api/projects/status/github/raysan5/raylib?svg=true)](https://ci.appveyor.com/project/raysan5/raylib)
[![Chat on Discord](https://img.shields.io/discord/426912293134270465.svg?logo=discord)](https://discord.gg/VkzNHUE)
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE.md)
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow)](https://twitter.com/raysan5)
<br>
[![GitHub Releases Downloads](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases)
[![GitHub Stars](https://img.shields.io/github/stars/raysan5/raylib?style=flat&label=stars)](https://github.com/raysan5/raylib/stargazers)
[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/4.2.0)](https://github.com/raysan5/raylib/commits/master)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/raysan5?label=sponsors)](https://github.com/sponsors/raysan5)
[![Packaging Status](https://repology.org/badge/tiny-repos/raylib.svg)](https://repology.org/project/raylib/versions)
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE)
[![Discord Members](https://img.shields.io/discord/426912293134270465.svg?label=Discord&logo=discord)](https://discord.gg/raylib)
[![Subreddit Subscribers](https://img.shields.io/reddit/subreddit-subscribers/raylib?label=reddit%20r%2Fraylib&logo=reddit)](https://www.reddit.com/r/raylib/)
[![Youtube Subscribers](https://img.shields.io/youtube/channel/subscribers/UC8WIBkhYb5sBNqXO1mZ7WSQ?style=flat&label=Youtube&logo=youtube)](https://www.youtube.com/c/raylib)
[![Twitch Status](https://img.shields.io/twitch/status/raysan5?style=flat&label=Twitch&logo=twitch)](https://www.twitch.tv/raysan5)
[![Windows](https://github.com/raysan5/raylib/workflows/Windows/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWindows)
[![Linux](https://github.com/raysan5/raylib/workflows/Linux/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ALinux)
[![macOS](https://github.com/raysan5/raylib/workflows/macOS/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AmacOS)
[![Android](https://github.com/raysan5/raylib/workflows/Android/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AAndroid)
[![WebAssembly](https://github.com/raysan5/raylib/workflows/WebAssembly/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWebAssembly)
[![CMakeBuilds](https://github.com/raysan5/raylib/workflows/CMakeBuilds/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ACMakeBuilds)
[![Windows Examples](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml)
[![Linux Examples](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml)
features
--------
- **NO external dependencies**, all required libraries are bundled into raylib
- Multiple platforms supported: **Windows, Linux, MacOS, Android... and many more!**
- Written in plain C code (C99) in PascalCase/camelCase notation
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3 or ES 2.0**)
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
- Written in plain C code (C99) using PascalCase/camelCase notation
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3 or ES 2.0**)
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
- Multiple **Fonts** formats supported (XNA fonts, AngelCode fonts, TTF)
- Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
- Multiple **Fonts** formats supported (TTF, Image fonts, AngelCode fonts)
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
- Flexible Materials system, supporting classic maps and **PBR maps**
- **Animated 3D models** supported (skeletal bones animation)
- Shaders support, including model and postprocessing shaders.
- **Animated 3D models** supported (skeletal bones animation) (IQM)
- Shaders support, including model and **postprocessing** shaders.
- **Powerful math module** for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h)
- Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
- **VR stereo rendering** support with configurable HMD device parameters
- Huge examples collection with [+95 code examples](https://www.raylib.com/examples.html)!
- Bindings to [+25 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
- Huge examples collection with [+120 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
- Bindings to [+60 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
- **Free and open source**.
basic example
--------------
This is a basic raylib example, it creates a window and it draws the text `"Congrats! You created your first window!"` in the middle of the screen. Check this example [running live on web here](https://www.raylib.com/examples/core/loader.html?name=core_basic_window).
```c
#include "raylib.h"
raylib uses on its [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module the outstanding [GLFW3](http://www.glfw.org/) library, embedded in the form of [rglfw](https://github.com/raysan5/raylib/blob/master/src/rglfw.c) module, to avoid external dependencies.
int main(void)
{
InitWindow(800, 450, "raylib [core] example - basic window");
raylib uses on its [raudio](https://github.com/raysan5/raylib/blob/master/src/raudio.c) module, the amazing [miniaudio](https://github.com/dr-soft/miniaudio) library to support multiple platforms and multiple audio backends.
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
raylib uses internally multiple single-file header-only libraries to support different fileformats loading and saving, all those libraries are embedded with raylib and available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies) for a detailed list.
CloseWindow();
*On Android platform, `native_app_glue module` module (provided by Android NDK) and native Android libraries are used to manage window/context, inputs and activity life cycle.*
*On Raspberry Pi platform (native mode), `Videocore API` and `EGL` libraries are used for window/context management. Inputs are processed using `evdev` Linux libraries*
return 0;
}
```
build and installation
----------------------
Binary releases for Windows, Linux and macOS are available at the [Github Releases page](https://github.com/raysan5/raylib/releases). raylib is also available via multiple package managers on multiple OS distributions. Check [raylib Wiki](https://github.com/raysan5/raylib/wiki) for more info.
raylib binary releases for Windows, Linux, macOS, Android and HTML5 are available at the [Github Releases page](https://github.com/raysan5/raylib/releases).
If you wish to build raylib yourself, [the raylib Wiki](https://github.com/raysan5/raylib/wiki) also contains detailed instructions on how to approach that.
raylib is also available via multiple [package managers](https://github.com/raysan5/raylib/issues/613) on multiple OS distributions.
raylib has been developed using two tools:
#### Installing and building raylib on multiple platforms
* Notepad++ (text editor) - [http://notepad-plus-plus.org](http://notepad-plus-plus.org/)
* MinGW (GCC compiler) - [http://www.mingw.org](http://www.mingw.org/)
[raylib Wiki](https://github.com/raysan5/raylib/wiki#development-platforms) contains detailed instructions on building and usage on multiple platforms.
Those are the tools recommended to enjoy raylib development.
- [Working on Windows](https://github.com/raysan5/raylib/wiki/Working-on-Windows)
- [Working on macOS](https://github.com/raysan5/raylib/wiki/Working-on-macOS)
- [Working on GNU Linux](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)
- [Working on Chrome OS](https://github.com/raysan5/raylib/wiki/Working-on-Chrome-OS)
- [Working on FreeBSD](https://github.com/raysan5/raylib/wiki/Working-on-FreeBSD)
- [Working on Raspberry Pi](https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi)
- [Working for Android](https://github.com/raysan5/raylib/wiki/Working-for-Android)
- [Working for Web (HTML5)](https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5))
- [Working anywhere with CMake](https://github.com/raysan5/raylib/wiki/Working-with-CMake)
contact
-------
*Note that the Wiki is open for edit, if you find some issues while building raylib for your target platform, feel free to edit the Wiki or open an issue related to it.*
* Webpage: [http://www.raylib.com](http://www.raylib.com)
* Discord: [https://discord.gg/raylib](https://discord.gg/VkzNHUE)
* Twitter: [http://www.twitter.com/raysan5](http://www.twitter.com/raysan5)
* Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
* Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
* Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
* YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/channel/UC8WIBkhYb5sBNqXO1mZ7WSQ)
#### Setup raylib with multiple IDEs
If you are using raylib and you enjoy it, please, join our [Discord server](https://discord.gg/VkzNHUE).
raylib has been developed on Windows platform using [Notepad++](https://notepad-plus-plus.org/) and [MinGW GCC](https://www.mingw-w64.org/) compiler but it can be used with other IDEs on multiple platforms.
[Projects directory](https://github.com/raysan5/raylib/tree/master/projects) contains several ready-to-use **project templates** to build raylib and code examples with multiple IDEs.
*Note that there are lots of IDEs supported, some of the provided templates could require some review, so please, if you find some issue with a template or you think they could be improved, feel free to send a PR or open a related issue.*
learning and docs
------------------
raylib is designed to be learned using [the examples](https://github.com/raysan5/raylib/tree/master/examples) as the main reference. There is no standard API documentation but there is a [**cheatsheet**](https://www.raylib.com/cheatsheet/cheatsheet.html) containing all the functions available on the library a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works.
Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here are the relevant links:
- [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html)
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
- [raylib library design](https://github.com/raysan5/raylib/wiki)
- [raylib examples collection](https://github.com/raysan5/raylib/tree/master/examples)
- [raylib games collection](https://github.com/raysan5/raylib-games)
contact and networks
---------------------
raylib is present in several networks and raylib community is growing everyday. If you are using raylib and enjoying it, feel free to join us in any of these networks. The most active network is our [Discord server](https://discord.gg/raylib)! :)
- Webpage: [https://www.raylib.com](https://www.raylib.com)
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
- Twitter: [https://www.twitter.com/raysan5](https://www.twitter.com/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)
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
- YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/c/raylib)
license
-------
raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE.md) for further details.
raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.
raylib uses internally some libraries for window/graphics/inputs management and also to support different file formats loading, all those libraries are embedded with and are available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib dependencies LICENSES](https://github.com/raysan5/raylib/wiki/raylib-dependencies) on raylib Wiki for details.

View File

@@ -1,16 +1,40 @@
roadmap
-------
# raylib roadmap
Here it is a wish-list with features and ideas to improve the library. Note that features listed here are quite high-level and could be long term additions for the library. Current version of raylib is complete and functional but there is a lot of room for improvement.
Here it is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
[raylib source code](https://github.com/raysan5/raylib/tree/master/src) has some *TODO* marks around code with pending things to review and improve.
Also, check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
- [raylib wishlist 2021](https://github.com/raysan5/raylib/discussions/1502)
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
**raylib 2.x**
- [ ] rnet: raylib network module
- [ ] rres: raylib resource packer
- [ ] rlvk: raylib Vulkan API support (GRAPHICS_API_VULKAN)
- [ ] Basic CPU/GPU stats sytem (memory, draws, time...)
_Current version of raylib is complete and functional but there is always room for improvements._
**raylib 4.x**
- [ ] Split core module into separate platforms?
- [ ] Basic 2d software renderer, using `Image` provided API
- [ ] Redesign gestures system, improve touch inputs management
- [ ] Redesign audio module, implement miniaudio high-level provided features
- [x] Redesign camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143), https://github.com/raysan5/raylib/discussions/2507)
- [x] Better documentation and improved examples, reviewed webpage with examples complexity level
- [x] Focus on HTML5 ([raylib 5k gamejam](https://itch.io/jam/raylib-5k-gamejam)) and embedded platforms (RPI and similar SOCs)
- [x] Additional support libraries: [raygui](https://github.com/raysan5/raygui), [rres](https://github.com/raysan5/rres)
**raylib 4.0**
- [x] Improved consistency and coherency in raylib API
- [x] Continuous Deployment using GitHub Actions
- [x] rlgl improvements for standalone usage (avoid raylib coupling)
- Basic CPU/GPU stats system (memory, draws, time...) ([#1295](https://github.com/raysan5/raylib/issues/1295)) - _DISCARDED_
- Software rendering backend (avoiding OpenGL) ([#1370](https://github.com/raysan5/raylib/issues/1370)) - _DISCARDED_
- Network module (UDP): `rnet` ([#753](https://github.com/raysan5/raylib/issues/753)) - _DISCARDED_ - Use [nbnet](https://github.com/nathhB/nbnet).
**raylib 3.0**
- [x] Custom memory allocators support
- [x] Global variables moved to global context
- [x] Optimize data structures for pass-by-value
- [x] Trace log messages redesign ([#1065](https://github.com/raysan5/raylib/issues/1065))
- [x] Continuous Integration using GitHub Actions
**raylib 2.5**
- [x] Support Animated models

View File

@@ -1,65 +0,0 @@
#os: Visual Studio 2015
clone_depth: 5
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
init:
- cmake -E remove c:\programdata\chocolatey\bin\cpack.exe
- set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=%
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- if [%BITS%]==[32] set MINGW=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32
- if [%BITS%]==[64] set MINGW=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64
- if [%COMPILER%]==[mingw] set PATH=%MINGW%\bin;%PATH%
- set RAYLIB_PACKAGE_SUFFIX=-Win%BITS%-%COMPILER%
- set VERBOSE=1
environment:
matrix:
- compiler: mingw
bits: 32
examples: ON
- compiler: mingw
bits: 64
examples: ON
- compiler: msvc15
bits: 32
examples: OFF
- compiler: msvc15
bits: 64
examples: OFF
before_build:
- if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles"
- if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015"
- if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64"
- mkdir build
- cd build
build_script:
- cmake -G %GENERATOR% -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% -DINCLUDE_EVERYTHING=ON ..
- cmake --build . --target install
after_build:
- cmake --build . --target package
before_test:
test_script:
artifacts:
- path: 'build\*.zip'
deploy:
- provider: GitHub
auth_token:
secure: OxKnnT3tlkPl9365cOO84rDWU4UkHIYJc0D3r3Tv7rB3HaR2BBhlhCnl7g3nuOJy
artifact: /.*\.zip/
draft: false
prerelease: false
force_update: true
on:
branch: master
appveyor_repo_tag: true # deploy on tag push only

18
build.zig Normal file
View File

@@ -0,0 +1,18 @@
const std = @import("std");
const raylib = @import("src/build.zig");
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard optimization options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});
const lib = raylib.addRaylib(b, target, optimize);
lib.installHeader("src/raylib.h", "raylib.h");
lib.install();
}

18
cmake/BuildOptions.cmake Normal file
View File

@@ -0,0 +1,18 @@
if(${PLATFORM} MATCHES "Desktop" AND APPLE)
if(MACOS_FATLIB)
if (CMAKE_OSX_ARCHITECTURES)
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
endif()
endif()
endif()
# This helps support the case where emsdk toolchain file is used
# either by setting it with -DCMAKE_TOOLCHAIN_FILE=<path_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
# or by using "emcmake cmake -B build -S ." as described in https://emscripten.org/docs/compiling/Building-Projects.html
if(EMSCRIPTEN)
SET(PLATFORM Web CACHE STRING "Forcing PLATFORM_WEB because EMSCRIPTEN was detected")
endif()
# vim: ft=cmake

View File

@@ -1,43 +0,0 @@
# Set a default build type if none was specified
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
# Taken from the https://github.com/OpenChemistry/tomviz project
# Copyright (c) 2014-2017, Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,13 +0,0 @@
# Populates a ${FILESYSTEM_LACKS_SYMLINKS} variable
message(STATUS "Testing if file system supports symlinks")
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink CMakeLists.txt "${CMAKE_CURRENT_BINARY_DIR}/TestingIfSymlinkWorks"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE FILESYSTEM_LACKS_SYMLINKS
)
If (FILESYSTEM_LACKS_SYMLINKS)
message(STATUS "Testing if file system supports symlinks -- unsupported")
else()
message(STATUS "Testing if file system supports symlinks -- supported")
endif()

View File

@@ -0,0 +1,115 @@
# Adding compile definitions
target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}")
target_compile_definitions("raylib" PUBLIC "${GRAPHICS}")
function(define_if target variable)
if (${${variable}})
message(STATUS "${variable}=${${variable}}")
target_compile_definitions(${target} PUBLIC "${variable}")
endif ()
endfunction()
if (${CUSTOMIZE_BUILD})
target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS)
define_if("raylib" USE_AUDIO)
define_if("raylib" SUPPORT_MODULE_RSHAPES)
define_if("raylib" SUPPORT_MODULE_RTEXTURES)
define_if("raylib" SUPPORT_MODULE_RTEXT)
define_if("raylib" SUPPORT_MODULE_RMODELS)
define_if("raylib" SUPPORT_MODULE_RAUDIO)
define_if("raylib" SUPPORT_CAMERA_SYSTEM)
define_if("raylib" SUPPORT_GESTURES_SYSTEM)
define_if("raylib" SUPPORT_MOUSE_GESTURES)
define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI)
define_if("raylib" SUPPORT_DEFAULT_FONT)
define_if("raylib" SUPPORT_SCREEN_CAPTURE)
define_if("raylib" SUPPORT_GIF_RECORDING)
define_if("raylib" SUPPORT_BUSY_WAIT_LOOP)
define_if("raylib" SUPPORT_EVENTS_WAITING)
define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER)
define_if("raylib" SUPPORT_COMPRESSION_API)
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
define_if("raylib" SUPPORT_IMAGE_EXPORT)
define_if("raylib" SUPPORT_IMAGE_GENERATION)
define_if("raylib" SUPPORT_IMAGE_MANIPULATION)
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
define_if("raylib" SUPPORT_FILEFORMAT_PNM)
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
define_if("raylib" SUPPORT_FILEFORMAT_BMP)
define_if("raylib" SUPPORT_FILEFORMAT_TGA)
define_if("raylib" SUPPORT_FILEFORMAT_JPG)
define_if("raylib" SUPPORT_FILEFORMAT_GIF)
define_if("raylib" SUPPORT_FILEFORMAT_QOI)
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
define_if("raylib" SUPPORT_MESH_GENERATION)
define_if("raylib" SUPPORT_FILEFORMAT_OBJ)
define_if("raylib" SUPPORT_FILEFORMAT_MTL)
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
define_if("raylib" SUPPORT_FILEFORMAT_VOX)
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
define_if("raylib" SUPPORT_FILEFORMAT_XM)
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
define_if("raylib" SUPPORT_STANDARD_FILEIO)
define_if("raylib" SUPPORT_TRACELOG)
if (UNIX AND NOT APPLE)
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096")
else ()
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=512")
endif ()
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPADS=4")
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_AXIS=8")
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_BUTTONS=32")
target_compile_definitions("raylib" PUBLIC "MAX_TOUCH_POINTS=10")
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"")
target_compile_definitions("raylib" PUBLIC "MAX_CHAR_PRESSED_QUEUE=16")
target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64")
if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11")
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=8192")
elseif (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES2")
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=2048")
endif ()
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_DRAWCALLS=256")
target_compile_definitions("raylib" PUBLIC "MAX_MATRIX_STACK_SIZE=32")
target_compile_definitions("raylib" PUBLIC "MAX_SHADER_LOCATIONS=32")
target_compile_definitions("raylib" PUBLIC "MAX_MATERIAL_MAPS=12")
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_NEAR=0.01")
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_FAR=1000.0")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_POSITION=\"vertexPosition\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD=\"vertexTexCoord\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_NORMAL=\"vertexNormal\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_COLOR=\"vertexColor\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TANGENT=\"vertexTangent\"")
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2=\"vertexTexCoord2\"")
target_compile_definitions("raylib" PUBLIC "MAX_TEXT_BUFFER_LENGTH=1024")
target_compile_definitions("raylib" PUBLIC "MAX_TEXT_UNICODE_CHARS=512")
target_compile_definitions("raylib" PUBLIC "MAX_TEXTSPLIT_COUNT=128")
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_FORMAT=ma_format_f32")
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_CHANNELS=2")
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_SAMPLE_RATE=44100")
target_compile_definitions("raylib" PUBLIC "DEFAULT_AUDIO_BUFFER_SIZE=4096")
target_compile_definitions("raylib" PUBLIC "MAX_TRACELOG_MSG_LENGTH=128")
target_compile_definitions("raylib" PUBLIC "MAX_UWP_MESSAGES=512")
endif ()

79
cmake/CompilerFlags.cmake Normal file
View File

@@ -0,0 +1,79 @@
include(AddIfFlagCompiles)
# Makes +/- operations on void pointers be considered an error
# https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
add_if_flag_compiles(-Werror=pointer-arith CMAKE_C_FLAGS)
# Generates error whenever a function is used before being declared
# https://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Warning-Options.html
add_if_flag_compiles(-Werror=implicit-function-declaration CMAKE_C_FLAGS)
# Allows some casting of pointers without generating a warning
add_if_flag_compiles(-fno-strict-aliasing CMAKE_C_FLAGS)
if (ENABLE_MSAN AND ENABLE_ASAN)
# MSAN and ASAN both work on memory - ASAN does more things
MESSAGE(WARNING "Compiling with both AddressSanitizer and MemorySanitizer is not recommended")
endif()
if (ENABLE_ASAN)
# If enabled it would generate errors/warnings for all kinds of memory errors
# (like returning a stack variable by reference)
# https://clang.llvm.org/docs/AddressSanitizer.html
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_compiles(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
if (ENABLE_UBSAN)
# If enabled this will generate errors for undefined behavior points
# (like adding +1 to the maximum int value)
# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_compiles(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
if (ENABLE_MSAN)
# If enabled this will generate warnings for places where uninitialized memory is used
# https://clang.llvm.org/docs/MemorySanitizer.html
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_compiles(-fsanitize=memory CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_if_flag_compiles(-std=gnu99 CMAKE_C_FLAGS)
endif()
else()
set (CMAKE_C_STANDARD 99)
endif()
if(${PLATFORM} MATCHES "Android")
# If enabled will remove dead code during the linking process
# https://gcc.gnu.org/onlinedocs/gnat_ugn/Compilation-options.html
add_if_flag_compiles(-ffunction-sections CMAKE_C_FLAGS)
# If enabled will generate some exception data (usually disabled for C programs)
# https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Code-Gen-Options.html
add_if_flag_compiles(-funwind-tables CMAKE_C_FLAGS)
# If enabled adds stack protection guards around functions that allocate memory
# https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_cjh1548250046139.htm
add_if_flag_compiles(-fstack-protector-strong CMAKE_C_FLAGS)
# Marks that the library will not be compiled with an executable stack
add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS)
# Do not expand symbolic links or resolve paths like "/./" or "/../", etc.
# https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS)
endif()

36
cmake/GlfwImport.cmake Normal file
View File

@@ -0,0 +1,36 @@
if(USE_EXTERNAL_GLFW STREQUAL "ON")
find_package(glfw3 3.3.3 REQUIRED)
elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE")
find_package(glfw3 3.3.3 QUIET)
endif()
if (glfw3_FOUND)
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
endif()
# Explicitly check against "ON", because USE_EXTERNAL_GLFW is a tristate option
# Also adding only on desktop (web also uses glfw but it is more limited and is added using an emcc linker flag)
if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MATCHES "Desktop")
MESSAGE(STATUS "Using raylib's GLFW")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE)
set(WAS_SHARED ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE)
add_subdirectory(external/glfw)
set(BUILD_SHARED_LIBS ${WAS_SHARED} CACHE BOOL " " FORCE)
unset(WAS_SHARED)
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
include_directories(BEFORE SYSTEM external/glfw/include)
elseif("${PLATFORM}" STREQUAL "DRM")
MESSAGE(STATUS "No GLFW required on PLATFORM_DRM")
else()
MESSAGE(STATUS "Using external GLFW")
set(GLFW_PKG_DEPS glfw3)
endif()

View File

@@ -0,0 +1,29 @@
install(
TARGETS raylib EXPORT raylib-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
# PKG_CONFIG_LIBS_PRIVATE is used in raylib.pc.in
if (NOT BUILD_SHARED_LIBS)
include(LibraryPathToLinkerFlags)
library_path_to_linker_flags(__PKG_CONFIG_LIBS_PRIVATE "${LIBS_PRIVATE}")
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})
string(REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
elseif (BUILD_SHARED_LIBS)
set(PKG_CONFIG_LIBS_EXTRA "")
endif ()
join_paths(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
configure_file(../raylib.pc.in raylib.pc @ONLY)
configure_file(../cmake/raylib-config-version.cmake raylib-config-version.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib")
install(FILES ${PROJECT_SOURCE_DIR}/../cmake/raylib-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib")
# populates raylib_{FOUND, INCLUDE_DIRS, LIBRARIES, LDFLAGS, DEFINITIONS}
include(PopulateConfigVariablesLocally)
populate_config_variables_locally(raylib)

26
cmake/JoinPaths.cmake Normal file
View File

@@ -0,0 +1,26 @@
# This module provides function for joining paths
# known from most languages
#
# Original license:
# SPDX-License-Identifier: (MIT OR CC0-1.0)
# Explicit permission given to distribute this module under
# the terms of the project as described in /LICENSE.rst.
# Copyright 2020 Jan Tojnar
# https://github.com/jtojnar/cmake-snips
#
# Modelled after Pythons os.path.join
# https://docs.python.org/3.7/library/os.path.html#os.path.join
# Windows not supported
function(join_paths joined_path first_path_segment)
set(temp_path "${first_path_segment}")
foreach(current_segment IN LISTS ARGN)
if(NOT ("${current_segment}" STREQUAL ""))
if(IS_ABSOLUTE "${current_segment}")
set(temp_path "${current_segment}")
else()
set(temp_path "${temp_path}/${current_segment}")
endif()
endif()
endforeach()
set(${joined_path} "${temp_path}" PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,122 @@
# Set OpenGL_GL_PREFERENCE to new "GLVND" even when legacy library exists and
# cmake is <= 3.10
#
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html for more
# information.
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
if (${PLATFORM} MATCHES "Desktop")
set(PLATFORM_CPP "PLATFORM_DESKTOP")
if (APPLE)
# Need to force OpenGL 3.3 on OS X
# See: https://github.com/raysan5/raylib/issues/341
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
find_library(OPENGL_LIBRARY OpenGL)
set(LIBS_PRIVATE ${OPENGL_LIBRARY})
link_libraries("${LIBS_PRIVATE}")
if (NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0")
add_definitions(-DGL_SILENCE_DEPRECATION)
MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!")
endif ()
elseif (WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
find_package(OpenGL QUIET)
set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm)
else ()
find_library(pthread NAMES pthread)
find_package(OpenGL QUIET)
if ("${OPENGL_LIBRARIES}" STREQUAL "")
set(OPENGL_LIBRARIES "GL")
endif ()
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
find_library(OSS_LIBRARY ossaudio)
endif ()
set(LIBS_PRIVATE m atomic pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
if (USE_AUDIO)
set(LIBS_PRIVATE ${LIBS_PRIVATE} dl)
endif ()
endif ()
elseif (${PLATFORM} MATCHES "Web")
set(PLATFORM_CPP "PLATFORM_WEB")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
elseif (${PLATFORM} MATCHES "Android")
set(PLATFORM_CPP "PLATFORM_ANDROID")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
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)
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)
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
elseif (${PLATFORM} MATCHES "Raspberry Pi")
set(PLATFORM_CPP "PLATFORM_RPI")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
add_definitions(-D_DEFAULT_SOURCE)
find_library(GLESV2 brcmGLESv2 HINTS /opt/vc/lib)
find_library(EGL brcmEGL HINTS /opt/vc/lib)
find_library(BCMHOST bcm_host HINTS /opt/vc/lib)
include_directories(/opt/vc/include /opt/vc/include/interface/vmcs_host/linux /opt/vc/include/interface/vcos/pthreads)
link_directories(/opt/vc/lib)
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl)
elseif ("${PLATFORM}" MATCHES "DRM")
set(PLATFORM_CPP "PLATFORM_DRM")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
add_definitions(-D_DEFAULT_SOURCE)
add_definitions(-DEGL_NO_X11)
add_definitions(-DPLATFORM_DRM)
find_library(GLESV2 GLESv2)
find_library(EGL EGL)
find_library(DRM drm)
find_library(GBM gbm)
if (NOT CMAKE_CROSSCOMPILING)
include_directories(/usr/include/libdrm)
endif ()
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
endif ()
if (NOT ${OPENGL_VERSION})
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
if (${OPENGL_VERSION} MATCHES "4.3")
set(GRAPHICS "GRAPHICS_API_OPENGL_43")
elseif (${OPENGL_VERSION} MATCHES "3.3")
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
elseif (${OPENGL_VERSION} MATCHES "2.1")
set(GRAPHICS "GRAPHICS_API_OPENGL_21")
elseif (${OPENGL_VERSION} MATCHES "1.1")
set(GRAPHICS "GRAPHICS_API_OPENGL_11")
elseif (${OPENGL_VERSION} MATCHES "ES 2.0")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
endif ()
if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail")
endif ()
endif ()
if (NOT GRAPHICS)
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
endif ()
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
if (${PLATFORM} MATCHES "Desktop")
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
endif ()

View File

@@ -0,0 +1,18 @@
# Packaging
SET(CPACK_PACKAGE_NAME "raylib")
SET(CPACK_PACKAGE_CONTACT "raysan5")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to enjoy videogames programming")
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
SET(CPACK_GENERATOR "ZIP;TGZ;DEB;RPM") # Remove this, if you want the NSIS installer on Windows
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # can be used to generate deps, slow and requires tools.
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libatomic1, libc6, libglfw3, libglu1-mesa | libglu1, libglx0, libopengl0")
SET(CPACK_DEBIAN_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-dev")
SET(CPACK_RPM_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-devel")
include(CPack)

View File

@@ -1,15 +0,0 @@
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER emcc)
SET(CMAKE_CXX_COMPILER em++)
if(NOT DEFINED CMAKE_AR)
find_program(CMAKE_AR NAMES emar)
endif()
if(NOT DEFINED CMAKE_RANLIB)
find_program(CMAKE_RANLIB NAMES emranlib)
endif()
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

View File

@@ -11,65 +11,69 @@
# raylib_LDFLAGS - The linker flags needed with raylib
# raylib_DEFINITIONS - Compiler switches required for using raylib
set(XPREFIX PC_RAYLIB)
if (raylib_USE_STATIC_LIBS)
set(XPREFIX ${XPREFIX}_STATIC)
endif()
if (NOT TARGET raylib)
set(XPREFIX PC_RAYLIB)
find_package(PkgConfig QUIET)
pkg_check_modules(${XPREFIX} QUIET raylib)
set(raylib_DEFINITIONS ${${XPREFIX}_CFLAGS})
find_package(PkgConfig QUIET)
pkg_check_modules(${XPREFIX} QUIET raylib)
find_path(raylib_INCLUDE_DIR
NAMES raylib.h
HINTS ${${XPREFIX}_INCLUDE_DIRS}
)
if (raylib_USE_STATIC_LIBS)
set(XPREFIX ${XPREFIX}_STATIC)
endif()
set(raylib_DEFINITIONS ${${XPREFIX}_CFLAGS})
find_path(raylib_INCLUDE_DIR
NAMES raylib.h
HINTS ${${XPREFIX}_INCLUDE_DIRS}
)
set(RAYLIB_NAMES raylib)
if (raylib_USE_STATIC_LIBS)
set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES})
endif()
if (raylib_USE_STATIC_LIBS)
find_library(raylib_LIBRARY
NAMES raylib_static
NAMES ${RAYLIB_NAMES}
HINTS ${${XPREFIX}_LIBRARY_DIRS}
)
else ()
find_library(raylib_LIBRARY
NAMES raylib
HINTS ${${XPREFIX}_LIBRARY_DIRS}
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_LDFLAGS ${${XPREFIX}_LDFLAGS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(raylib DEFAULT_MSG
raylib_LIBRARY
raylib_INCLUDE_DIR
)
endif ()
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_LDFLAGS ${${XPREFIX}_LDFLAGS})
mark_as_advanced(raylib_LIBRARY raylib_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(raylib DEFAULT_MSG
raylib_LIBRARY
raylib_INCLUDE_DIR
)
if (raylib_USE_STATIC_LIBS)
add_library(raylib STATIC IMPORTED GLOBAL)
else()
add_library(raylib SHARED IMPORTED GLOBAL)
endif()
string (REPLACE ";" " " raylib_LDFLAGS "${raylib_LDFLAGS}")
mark_as_advanced(raylib_LIBRARY raylib_INCLUDE_DIR)
set_target_properties(raylib
PROPERTIES
IMPORTED_LOCATION "${raylib_LIBRARIES}"
IMPORTED_IMPLIB "${raylib_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${raylib_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${raylib_LDFLAGS}"
INTERFACE_COMPILE_OPTIONS "${raylib_DEFINITIONS}"
)
if (raylib_USE_STATIC_LIBS)
add_library(raylib STATIC IMPORTED GLOBAL)
else()
add_library(raylib SHARED IMPORTED GLOBAL)
endif()
string (REPLACE ";" " " raylib_LDFLAGS "${raylib_LDFLAGS}")
set_target_properties(raylib
PROPERTIES
IMPORTED_LOCATION "${raylib_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${raylib_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${raylib_LDFLAGS}"
INTERFACE_COMPILE_OPTIONS "${raylib_DEFINITIONS}"
)
if (raylib_VERBOSE)
message(STATUS "raylib_FOUND: ${raylib_FOUND}")
message(STATUS "raylib_INCLUDE_DIRS: ${raylib_INCLUDE_DIRS}")
message(STATUS "raylib_LIBRARIES: ${raylib_LIBRARIES}")
message(STATUS "raylib_LDFLAGS: ${raylib_LDFLAGS}")
message(STATUS "raylib_DEFINITIONS: ${raylib_DEFINITIONS}")
if (raylib_VERBOSE)
message(STATUS "raylib_FOUND: ${raylib_FOUND}")
message(STATUS "raylib_INCLUDE_DIRS: ${raylib_INCLUDE_DIRS}")
message(STATUS "raylib_LIBRARIES: ${raylib_LIBRARIES}")
message(STATUS "raylib_LDFLAGS: ${raylib_LDFLAGS}")
message(STATUS "raylib_DEFINITIONS: ${raylib_DEFINITIONS}")
endif()
endif()

View File

@@ -1,21 +0,0 @@
#!/bin/sh
# Test if including/linking/running an installed raylib works
set -x
export LD_RUN_PATH=/usr/local/lib
CFLAGS="-Wall -Wextra -Werror $CFLAGS"
if [ "$ARCH" = "i386" ]; then
CFLAGS="-m32 $CLFAGS"
fi
cat << EOF | ${CC:-cc} -otest -xc - $(pkg-config --libs --cflags $@ raylib.pc) $CFLAGS && exec ./test
#include <stdlib.h>
#include <raylib.h>
int main(void)
{
int num = GetRandomValue(42, 1337);
return 42 <= num && num <= 1337 ? EXIT_SUCCESS : EXIT_FAILURE;
}
EOF

View File

@@ -1,132 +1,146 @@
# Setup the project and settings
project(examples)
# Get the sources together
set(example_dirs audio core models others shaders shapes text textures)
# Directories that contain examples
set(example_dirs
audio
core
models
others
shaders
shapes
text
textures
)
# Next few lines will check for existence of symbols or header files
# They are needed for the physac example and threads examples
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=199309L)
include(CheckSymbolExists)
check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC)
check_symbol_exists(QueryPerformanceCounter windows.h HAVE_QPC)
include(CheckSymbolExists)
check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC)
check_symbol_exists(QueryPerformanceCounter windows.h HAVE_QPC)
set(CMAKE_REQUIRED_DEFINITIONS)
if(HAVE_QPC OR HAVE_CLOCK_MONOTONIC)
set(example_dirs ${example_dirs} physac)
endif()
set(example_sources)
set(example_resources)
foreach(example_dir ${example_dirs})
# Get the .c files
file(GLOB sources ${example_dir}/*.c)
list(APPEND example_sources ${sources})
# Any any resources
file(GLOB resources ${example_dir}/resources/*)
list(APPEND example_resources ${resources})
endforeach()
if (APPLE AND NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0")
add_definitions(-DGL_SILENCE_DEPRECATION)
MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!")
endif()
set(OUTPUT_EXT)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
if (HAVE_QPC OR HAVE_CLOCK_MONOTONIC)
set(example_dirs ${example_dirs} physac)
endif ()
include(CheckIncludeFile)
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
if (CMAKE_USE_PTHREADS_INIT AND HAVE_STDATOMIC_H)
add_if_flag_compiles("-std=c11" CMAKE_C_FLAGS)
if(THREADS_HAVE_PTHREAD_ARG)
add_if_flag_compiles("-pthread" CMAKE_C_FLAGS)
endif()
if(CMAKE_THREAD_LIBS_INIT)
link_libraries("${CMAKE_THREAD_LIBS_INIT}")
endif()
else()
# Items requiring pthreads
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_loading_thread.c)
endif()
add_if_flag_compiles("-std=c11" CMAKE_C_FLAGS)
if (THREADS_HAVE_PTHREAD_ARG)
add_if_flag_compiles("-pthread" CMAKE_C_FLAGS)
endif ()
if (CMAKE_THREAD_LIBS_INIT)
link_libraries("${CMAKE_THREAD_LIBS_INIT}")
endif ()
endif ()
if (APPLE AND NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0")
add_definitions(-DGL_SILENCE_DEPRECATION)
MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!")
endif ()
# Collect all source files and resource files
# into a CMake variable
set(example_sources)
set(example_resources)
foreach (example_dir ${example_dirs})
# Get the .c files
file(GLOB sources ${example_dir}/*.c)
list(APPEND example_sources ${sources})
# Any any resources
file(GLOB resources ${example_dir}/resources/*)
list(APPEND example_resources ${resources})
endforeach ()
if(NOT CMAKE_USE_PTHREADS_INIT OR NOT HAVE_STDATOMIC_H)
# Items requiring pthreads
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_loading_thread.c)
endif ()
if (${PLATFORM} MATCHES "Android")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_first_person.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_world_screen.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_cubicmap.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_skybox.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_generation.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_heightmap.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_billboard.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_solar_system.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_full_solar_system.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_solar_system.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_obj_viewer.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_animation.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_first_person_maze.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_magicavoxel_loading.c)
if(${PLATFORM} MATCHES "Android")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_first_person.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_world_screen.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_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_palette_switch.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_basic_lighting.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_material_pbr.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_cubicmap.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_skybox.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_generation.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_heightmap.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_billboard.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_solar_system.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_obj_viewer.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_animation.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_first_person_maze.c)
elseif (${PLATFORM} MATCHES "Web")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
# Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
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_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_palette_switch.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
elseif(${PLATFORM} MATCHES "Web")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1")
# Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
# Remove the -rdynamic flag because otherwise emscripten
# does not generate HTML+JS+WASM files, only a non-working
# and fat HTML
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
set(OUTPUT_EXT ".html")
elseif ("${PLATFORM}" STREQUAL "DRM")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
endif()
endif ()
include_directories(BEFORE SYSTEM others/external/include)
if (NOT TARGET raylib)
find_package(raylib 2.0 REQUIRED)
endif()
find_package(raylib 2.0 REQUIRED)
endif ()
# Do each example
foreach(example_source ${example_sources})
# Create the basename for the example
get_filename_component(example_name ${example_source} NAME)
string(REPLACE ".c" "${OUTPUT_EXT}" example_name ${example_name})
# Setup the example
add_executable(${example_name} ${example_source})
target_link_libraries(${example_name} raylib)
string(REGEX MATCH ".*/.*/" resources_dir ${example_source})
string(APPEND resources_dir "resources")
if(${PLATFORM} MATCHES "Web" AND EXISTS ${resources_dir})
# The local resources path needs to be mapped to /resources virtual path
string(APPEND resources_dir "@resources")
set_target_properties(${example_name} PROPERTIES LINK_FLAGS "--preload-file ${resources_dir}")
endif()
endforeach()
if (${PLATFORM} MATCHES "Desktop")
# rlgl_standalone can't be linked with raylib because of duplicate rlgl symbols
foreach (example_source "others/rlgl_standalone.c")
foreach (example_source ${example_sources})
# Create the basename for the example
get_filename_component(example_name ${example_source} NAME)
string(REPLACE ".c" "${OUTPUT_EXT}" example_name ${example_name})
add_executable(${example_name} ${example_source})
add_dependencies(${example_name} raylib)
target_link_libraries(${example_name} ${raylib_LDFLAGS})
target_include_directories(${example_name} PRIVATE ${raylib_INCLUDE_DIRS})
string(REPLACE ".c" "" example_name ${example_name})
endforeach()
endif()
# Setup the example
add_executable(${example_name} ${example_source})
target_link_libraries(${example_name} raylib)
string(REGEX MATCH ".*/.*/" resources_dir ${example_source})
string(APPEND resources_dir "resources")
if (${PLATFORM} MATCHES "Web" AND EXISTS ${resources_dir})
# The local resources path needs to be mapped to /resources virtual path
string(APPEND resources_dir "@resources")
set_target_properties(${example_name} PROPERTIES LINK_FLAGS "--preload-file ${resources_dir}")
endif ()
endforeach ()
# Copy all of the resource files to the destination
file(COPY ${example_resources} DESTINATION "resources/")

View File

@@ -2,7 +2,7 @@
#
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
#
# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
# Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
@@ -23,127 +23,125 @@
.PHONY: all clean
# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP
# Define required raylib variables
PROJECT_NAME ?= raylib_examples
RAYLIB_VERSION ?= 2.5.0
RAYLIB_API_VERSION ?= 2
RAYLIB_PATH ?= ..
PROJECT_NAME ?= raylib_examples
RAYLIB_VERSION ?= 4.5.0
RAYLIB_PATH ?= ..
# Define default options
# Locations of raylib.h and libraylib.a/libraylib.so
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
RAYLIB_INCLUDE_PATH ?= /usr/local/include
RAYLIB_LIB_PATH ?= /usr/local/lib
# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP
# Locations of your newly installed library and associated headers. See ../src/Makefile
# On Linux, if you have installed raylib but cannot compile the examples, check that
# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations.
# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED.
# To enable compile-time linking to a special version of libraylib.so, change these variables here.
# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below.
# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime,
# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH.
# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
DESTDIR ?= /usr/local
RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
# Build mode for project: DEBUG or RELEASE
BUILD_MODE ?= RELEASE
# Use external GLFW library instead of rglfw module
# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3
USE_EXTERNAL_GLFW ?= FALSE
# Use 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
USE_WAYLAND_DISPLAY ?= FALSE
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# PLATFORM_WEB: Default properties
BUILD_WEB_ASYNCIFY ?= TRUE
BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
BUILD_WEB_HEAP_SIZE ?= 134217728
BUILD_WEB_RESOURCES ?= TRUE
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
# Use cross-compiler for PLATFORM_RPI
ifeq ($(PLATFORM),PLATFORM_RPI)
USE_RPI_CROSS_COMPILER ?= FALSE
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
endif
endif
# Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
PLATFORM_OS=WINDOWS
PLATFORM_OS = WINDOWS
else
UNAMEOS=$(shell uname)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
PLATFORM_OS = LINUX
endif
ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=BSD
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX
PLATFORM_OS = OSX
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
UNAMEOS=$(shell uname)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
PLATFORM_OS = LINUX
endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
endif
endif
# RAYLIB_PATH adjustment for different platforms.
# If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
# Required for ldconfig or other tools that do not perform path expansion.
# RAYLIB_PATH adjustment for LINUX platform
# TODO: Do we really need this?
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_PREFIX ?= ..
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
RAYLIB_PREFIX ?= ..
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
endif
endif
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki.
# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX.
# Default path for raylib on Raspberry Pi
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH ?= /home/pi/raylib
RAYLIB_PATH ?= /home/pi/raylib
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
RAYLIB_PATH ?= /home/pi/raylib
endif
# Define raylib release directory for compiled library
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH ?= C:/emsdk
EMSCRIPTEN_VERSION ?= 1.38.31
CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
NODE_VERSION = 8.9.1_64bit
export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
ifeq ($(PLATFORM_OS),WINDOWS)
# Emscripten required variables
EMSDK_PATH ?= C:/emsdk
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
endif
endif
# Define raylib release directory for compiled library.
# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries
# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH
# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux
# without formal installation from ../src/Makefile. It aids portability and is useful if you have
# multiple versions of raylib, have raylib installed to a non-standard location, or want to
# bundle libraylib.so with your game. Change it to your liking.
# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH,
# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute.
# To see which libraries a built example is linking to, ldd core/core_basic_window;
# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing.
EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH)
# Define default C compiler: gcc
# NOTE: define g++ compiler if using C++
# Define default C compiler: CC
#------------------------------------------------------------------------------------------------
CC = gcc
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
@@ -170,16 +168,24 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
CC = emcc
endif
# Define default make program: Mingw32-make
MAKE = mingw32-make
# Define default make program: MAKE
#------------------------------------------------------------------------------------------------
MAKE ?= make
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX)
MAKE = make
ifeq ($(PLATFORM_OS),WINDOWS)
MAKE = mingw32-make
endif
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKE = mingw32-make
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
MAKE = mingw32-make
endif
# Define compiler flags:
# Define compiler flags: CFLAGS
#------------------------------------------------------------------------------------------------
# -O1 defines optimization level
# -g include debug information on compilation
# -s strip unnecessary data from build
@@ -187,114 +193,148 @@ endif
# -std=c99 defines C language mode (standard C from 1999 revision)
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
# -Wno-unused-value ignore unused return values of some functions (i.e. fread())
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
ifeq ($(BUILD_MODE),DEBUG)
CFLAGS += -g
CFLAGS += -g -D_DEBUG
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS += -s ASSERTIONS=1 --profiling
endif
else
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
CFLAGS += -O3
else
CFLAGS += -Os
endif
else
CFLAGS += -O2
endif
endif
# Additional flags for compiler (if desired)
# -Wextra enables some extra warning flags that are not enabled by -Wall
# -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration
# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
# -Werror=implicit-function-declaration catch function calls without prior declaration
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# resource file contains windows executable icon and properties
# -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows
endif
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_LIBTYPE),STATIC)
CFLAGS += -D_DEFAULT_SOURCE
endif
ifeq ($(RAYLIB_LIBTYPE),SHARED)
# Explicitly enable runtime link to libraylib.so
CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
CFLAGS += -Wl,-rpath,$(RAYLIB_RELEASE_PATH)
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS += -std=gnu99
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
CFLAGS += -std=gnu99 -DEGL_NO_X11
endif
# Define include paths for required headers: INCLUDE_PATHS
# NOTE: Some external/extras libraries could be required (stb, easings...)
#------------------------------------------------------------------------------------------------
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
# Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
endif
ifeq ($(PLATFORM_OS),LINUX)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
INCLUDE_PATHS += -I/usr/include/libdrm
endif
# Define library paths containing required libs: LDFLAGS
#------------------------------------------------------------------------------------------------
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# NOTE: The resource .rc file contains windows executable icon and properties
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
# -Wl,--subsystem,windows hides the console window
ifeq ($(BUILD_MODE), RELEASE)
LDFLAGS += -Wl,--subsystem,windows
endif
endif
ifeq ($(PLATFORM_OS),LINUX)
LDFLAGS += -L$(RAYLIB_LIB_PATH)
endif
ifeq ($(PLATFORM_OS),BSD)
LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -s USE_GLFW=3 # Use glfw3 library (context/input management)
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -s USE_PTHREADS=1 # multithreading support
# -s WASM=0 # disable Web Assembly, emitted by default
# -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
# -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
# -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# --profiling # include information for code profiling
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
CFLAGS += -Os -s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 --preload-file $(dir $<)resources@resources
ifeq ($(BUILD_MODE), DEBUG)
CFLAGS += -s ASSERTIONS=1 --profiling
# --source-map-base # allow debugging in browser with source map
LDFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -s FORCE_FILESYSTEM=1
# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
LDFLAGS += -s ASYNCIFY
endif
# NOTE: Simple raylib examples are compiled to be interpreter by emterpreter, that way,
# Add resources building if required
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
endif
# Add debug mode flags if required
ifeq ($(BUILD_MODE),DEBUG)
LDFLAGS += -s ASSERTIONS=1 --profiling
endif
# Define a custom shell .html and output extension
LDFLAGS += --shell-file $(BUILD_WEB_SHELL)
EXT = .html
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
# we can compile same code for ALL platforms with no change required, but, working on bigger
# projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
# logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
# Define a custom shell .html and output extension
CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html
EXT = .html
endif
# Define include paths for required headers
# NOTE: Several external required libraries (stb and others)
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
# Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_RPI)
# RPI required libraries
INCLUDE_PATHS += -I/opt/vc/include
INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),BSD)
# Consider -L$(RAYLIB_H_INSTALL_PATH)
INCLUDE_PATHS += -I/usr/local/include
endif
ifeq ($(PLATFORM_OS),LINUX)
# Reset everything.
# Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include
INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external
endif
LDFLAGS += -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
endif
# Define library paths containing required libs.
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),BSD)
# Consider -L$(RAYLIB_INSTALL_PATH)
LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif
ifeq ($(PLATFORM_OS),LINUX)
# Reset everything.
# Precedence: immediately local, installed version, raysan5 provided libs
LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH)
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
LDFLAGS += -L/opt/vc/lib
endif
# Define any libraries required on linking
# if you want to link libraries (libname.so or libname.a), use the -lname
# Define libraries required on linking: LDLIBS
# NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
#------------------------------------------------------------------------------------------------
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compilation
# NOTE: WinMM library required to set high-res timer resolution
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
# Required for physac examples
LDLIBS += -static -lpthread
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compiling
@@ -314,11 +354,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for OSX 10.9 desktop compiling
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
endif
ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
@@ -336,16 +379,26 @@ endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl -latomic
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
LDLIBS += -lvchiq_arm -lvcos
endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
# Libraries for DRM compiling
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# Libraries for web (HTML5) compiling
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
endif
# Define all source files required
EXAMPLES = \
# Define source code object files required
#------------------------------------------------------------------------------------------------
CORE = \
core/core_basic_window \
core/core_basic_screen_manager \
core/core_input_keys \
core/core_input_mouse \
core/core_input_mouse_wheel \
@@ -353,18 +406,28 @@ EXAMPLES = \
core/core_input_multitouch \
core/core_input_gestures \
core/core_2d_camera \
core/core_2d_camera_platformer \
core/core_2d_camera_mouse_zoom \
core/core_3d_camera_mode \
core/core_3d_camera_free \
core/core_3d_camera_first_person \
core/core_3d_picking \
core/core_world_screen \
core/core_custom_logging \
core/core_window_letterbox \
core/core_drop_files \
core/core_random_values \
core/core_scissor_test \
core/core_storage_values \
core/core_vr_simulator \
core/core_loading_thread \
core/core_window_flags \
core/core_window_letterbox \
core/core_window_should_close \
core/core_split_screen \
core/core_smooth_pixelperfect \
core/core_custom_frame_control
SHAPES = \
shapes/shapes_basic_shapes \
shapes/shapes_bouncing_ball \
shapes/shapes_colors_palette \
@@ -380,18 +443,11 @@ EXAMPLES = \
shapes/shapes_draw_ring \
shapes/shapes_draw_circle_sector \
shapes/shapes_draw_rectangle_rounded \
text/text_raylib_fonts \
text/text_sprite_fonts \
text/text_ttf_loading \
text/text_bmfont_ttf \
text/text_font_sdf \
text/text_format_text \
text/text_input_box \
text/text_writing_anim \
text/text_rectangle_bounds \
text/text_unicode \
shapes/shapes_top_down_lights
TEXTURES = \
textures/textures_logo_raylib \
textures/textures_rectangle \
textures/textures_mouse_painting \
textures/textures_srcrec_dstrec \
textures/textures_image_drawing \
textures/textures_image_generation \
@@ -403,25 +459,53 @@ EXAMPLES = \
textures/textures_particles_blending \
textures/textures_npatch_drawing \
textures/textures_background_scrolling \
textures/textures_sprite_anim \
textures/textures_sprite_button \
textures/textures_sprite_explosion \
textures/textures_textured_curve \
textures/textures_bunnymark \
textures/textures_blend_modes \
textures/textures_draw_tiled \
textures/textures_polygon \
textures/textures_gif_player \
textures/textures_fog_of_war
TEXT = \
text/text_raylib_fonts \
text/text_font_spritefont \
text/text_font_loading \
text/text_font_filters \
text/text_font_sdf \
text/text_format_text \
text/text_input_box \
text/text_writing_anim \
text/text_rectangle_bounds \
text/text_unicode \
text/text_draw_3d \
text/text_codepoints_loading
MODELS = \
models/models_animation \
models/models_billboard \
models/models_box_collisions \
models/models_cubicmap \
models/models_draw_cube_texture \
models/models_first_person_maze \
models/models_geometric_shapes \
models/models_material_pbr \
models/models_mesh_generation \
models/models_mesh_picking \
models/models_obj_loading \
models/models_obj_viewer \
models/models_loading \
models/models_loading_vox \
models/models_loading_gltf \
models/models_loading_m3d \
models/models_orthographic_projection \
models/models_rlgl_solar_system \
models/models_skybox \
models/models_yaw_pitch_roll \
models/models_heightmap \
models/models_waving_cubes
SHADERS = \
shaders/shaders_model_shader \
shaders/shaders_shapes_textures \
shaders/shaders_custom_uniform \
@@ -430,23 +514,41 @@ EXAMPLES = \
shaders/shaders_raymarching \
shaders/shaders_texture_drawing \
shaders/shaders_texture_waves \
shaders/shaders_texture_outline \
shaders/shaders_julia_set \
shaders/shaders_eratosthenes \
shaders/shaders_basic_lighting \
shaders/shaders_fog \
shaders/shaders_simple_mask \
shaders/shaders_spotlight \
shaders/shaders_hot_reloading \
shaders/shaders_mesh_instancing \
shaders/shaders_multi_sample2d \
shaders/shaders_write_depth \
shaders/shaders_hybrid_render
AUDIO = \
audio/audio_module_playing \
audio/audio_music_stream \
audio/audio_raw_stream \
audio/audio_sound_loading \
physac/physics_demo \
physac/physics_friction \
physac/physics_movement \
physac/physics_restitution \
physac/physics_shatter
audio/audio_stream_effects \
audio/audio_mixed_processor
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
# Define processes to execute
#------------------------------------------------------------------------------------------------
# Default target entry
all: $(EXAMPLES)
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
core: $(CORE)
shapes: $(SHAPES)
textures: $(TEXTURES)
text: $(TEXT)
models: $(MODELS)
shaders: $(SHADERS)
audio: $(AUDIO)
# Generic compilation pattern
# NOTE: Examples must be ready for Android compilation!
@@ -464,7 +566,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
del *.o *.exe /s
endif
ifeq ($(PLATFORM_OS),LINUX)
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM_OS),OSX)
find . -type f -perm +ugo+x -delete
@@ -475,8 +578,15 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
del *.o *.html *.js
ifeq ($(PLATFORM_OS),WINDOWS)
del *.wasm *.html *.js *.data
else
rm -f */*.wasm */*.html */*.js */*.data
endif
endif
@echo Cleaning done

View File

@@ -2,7 +2,7 @@
#
# raylib makefile for Android project (APK building)
#
# Copyright (c) 2017 Ramon Santamaria (@raysan5)
# Copyright (c) 2017-2023 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
@@ -26,53 +26,80 @@ PLATFORM ?= PLATFORM_ANDROID
RAYLIB_PATH ?= ..\..
# Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version
ANDROID_ARCH ?= ARM
ANDROID_API_VERSION = 21
# Starting in 2019 using ARM64 is mandatory for published apps,
# Starting on August 2020, minimum required target API is Android 10 (API level 29)
ANDROID_ARCH ?= ARM64
ANDROID_API_VERSION = 29
# Android required path variables
# NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself
ifeq ($(OS),Windows_NT)
ANDROID_NDK = C:/android-ndk
ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64
else
ANDROID_NDK ?= /usr/lib/android/ndk
ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64
endif
ifeq ($(ANDROID_ARCH),ARM)
ANDROID_ARCH_NAME = armeabi-v7a
endif
ifeq ($(ANDROID_ARCH),ARM64)
ANDROID_ARCH_NAME = arm64-v8a
endif
ifeq ($(ANDROID_ARCH),x86)
ANDROID_ARCH_NAME = x86
endif
ifeq ($(ANDROID_ARCH),x86_64)
ANDROID_ARCH_NAME = x86_64
endif
# Required path variables
# NOTE: JAVA_HOME must be set to JDK
JAVA_HOME ?= C:/JavaJDK
ANDROID_HOME = C:/android-sdk
ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1
# NOTE: JAVA_HOME must be set to JDK (using OpenJDK 13)
JAVA_HOME ?= C:/open-jdk
ANDROID_HOME ?= C:/android-sdk
ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3
ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools
# Android project configuration variables
PROJECT_NAME ?= raylib_game
PROJECT_LIBRARY_NAME ?= main
PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME)
PROJECT_BUILD_ID ?= android
PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME)
PROJECT_RESOURCES_PATH ?= resources
PROJECT_SOURCE_FILES ?= raylib_game.c
NATIVE_APP_GLUE_PATH = $(ANDROID_NDK)/sources/android/native_app_glue
# Some source files are placed in directories, when compiling to some
# output directory other than source, that directory must pre-exist.
# Here we get a list of required folders that need to be created on
# code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors.
PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES)))
PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES)))
# Android app configuration variables
APP_LABEL_NAME ?= rGame
APP_COMPANY_NAME ?= raylib
APP_PRODUCT_NAME ?= rgame
APP_VERSION_CODE ?= 1
APP_VERSION_NAME ?= 1.0
APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png
APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png
APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png
APP_LABEL_NAME ?= rGame
APP_COMPANY_NAME ?= raylib
APP_PRODUCT_NAME ?= rgame
APP_VERSION_CODE ?= 1
APP_VERSION_NAME ?= 1.0
APP_ICON_LDPI ?= $(RAYLIB_PATH)/logo/raylib_36x36.png
APP_ICON_MDPI ?= $(RAYLIB_PATH)/logo/raylib_48x48.png
APP_ICON_HDPI ?= $(RAYLIB_PATH)/logo/raylib_72x72.png
APP_SCREEN_ORIENTATION ?= landscape
APP_KEYSTORE_PASS ?= raylib
APP_KEYSTORE_PASS ?= raylib
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
RAYLIB_LIBTYPE ?= STATIC
# Library path for libraylib.a/libraylib.so
RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src
RAYLIB_LIB_PATH = $(RAYLIB_PATH)/src
# Define copy command depending on OS
ifeq ($(OS),Windows_NT)
COPY_COMMAND ?= copy /Y
else
COPY_COMMAND ?= cp -f
endif
# Shared libs must be added to APK if required
# NOTE: Generated NativeLoader.java automatically load those libraries
@@ -81,15 +108,22 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED)
endif
# Compiler and archiver
# NOTE: GCC is being deprecated in Android NDK r16
ifeq ($(ANDROID_ARCH),ARM)
CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang
CC = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar
endif
ifeq ($(ANDROID_ARCH),ARM64)
CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang
CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar
endif
ifeq ($(ANDROID_ARCH),x86)
CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar
endif
ifeq ($(ANDROID_ARCH),x86_64)
CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar
endif
# Compiler flags for arquitecture
ifeq ($(ANDROID_ARCH),ARM)
@@ -106,7 +140,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
# Paths containing required header files
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE_PATH)
# Linker options
LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a
@@ -136,13 +170,15 @@ all: create_temp_project_dirs \
compile_project_class \
compile_project_class_dex \
create_project_apk_package \
sign_project_apk_package \
zipalign_project_apk_package
zipalign_project_apk_package \
sign_project_apk_package
# Create required temp directories for APK building
create_temp_project_dirs:
ifeq ($(OS),Windows_NT)
if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH)
if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj
if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj\src
if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src
if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com
if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)
@@ -158,36 +194,62 @@ create_temp_project_dirs:
if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets
if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH)
if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens
else
mkdir -p $(PROJECT_BUILD_PATH)
mkdir -p $(PROJECT_BUILD_PATH)/obj
mkdir -p $(PROJECT_BUILD_PATH)/obj/src
mkdir -p $(PROJECT_BUILD_PATH)/src
mkdir -p $(PROJECT_BUILD_PATH)/src/com
mkdir -p $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)
mkdir -p $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)
mkdir -p $(PROJECT_BUILD_PATH)/lib
mkdir -p $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)
mkdir -p $(PROJECT_BUILD_PATH)/bin
mkdir -p $(PROJECT_BUILD_PATH)/res
mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-ldpi
mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-mdpi
mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-hdpi
mkdir -p $(PROJECT_BUILD_PATH)/res/values
mkdir -p $(PROJECT_BUILD_PATH)/assets
mkdir -p $(PROJECT_BUILD_PATH)/assets/$(PROJECT_RESOURCES_PATH)
mkdir -p $(PROJECT_BUILD_PATH)/obj/screens
endif
$(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir)))
define create_dir
if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1)
mkdir -p $(PROJECT_BUILD_PATH)/obj/$(1)
endef
# Copy required shared libs for integration into APK
# NOTE: If using shared libs they are loaded by generated NativeLoader.java
copy_project_required_libs:
ifeq ($(RAYLIB_LIBTYPE),SHARED)
copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so
$(COPY_COMMAND) $(RAYLIB_LIB_PATH)/libraylib.so $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/libraylib.so
endif
ifeq ($(RAYLIB_LIBTYPE),STATIC)
copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a
$(COPY_COMMAND) $(RAYLIB_LIB_PATH)/libraylib.a $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/libraylib.a
endif
# Copy project required resources: strings.xml, icon.png, assets
# NOTE: Required strings.xml is generated and game resources are copied to assets folder
# TODO: Review xcopy usage, it can not be found in some systems!
copy_project_resources:
copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y
copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y
copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y
$(COPY_COMMAND) $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)/res/drawable-ldpi/icon.png
$(COPY_COMMAND) $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)/res/drawable-mdpi/icon.png
$(COPY_COMMAND) $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)/res/drawable-hdpi/icon.png
ifeq ($(OS),Windows_NT)
@echo ^<?xml version="1.0" encoding="utf-8"^?^> > $(PROJECT_BUILD_PATH)/res/values/strings.xml
@echo ^<resources^>^<string name="app_name"^>$(APP_LABEL_NAME)^</string^>^</resources^> >> $(PROJECT_BUILD_PATH)/res/values/strings.xml
if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F
else
@echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>" > $(PROJECT_BUILD_PATH)/res/values/strings.xml
@echo "<resources><string name=\"app_name\">$(APP_LABEL_NAME)</string></resources>" >> $(PROJECT_BUILD_PATH)/res/values/strings.xml
@[ -d "$(PROJECT_RESOURCES_PATH)" ] || cp -rf $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)/assets/$(PROJECT_RESOURCES_PATH)
endif
# Generate NativeLoader.java to load required shared libraries
# NOTE: Probably not the bet way to generate this file... but it works.
generate_loader_script:
ifeq ($(OS),Windows_NT)
@echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@@ -198,10 +260,23 @@ endif
@echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
else
@echo "package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME);" > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo "" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo "public class NativeLoader extends android.app.NativeActivity {" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo " static {" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
ifeq ($(RAYLIB_LIBTYPE),SHARED)
@echo " System.loadLibrary(\"raylib\");" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
endif
@echo " System.loadLibrary(\"$(PROJECT_LIBRARY_NAME)\");" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo " }" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo "}" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
endif
# Generate AndroidManifest.xml with all the required options
# NOTE: Probably not the bet way to generate this file... but it works.
generate_android_manifest:
ifeq ($(OS),Windows_NT)
@echo ^<?xml version="1.0" encoding="utf-8"^?^> > $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<manifest xmlns:android="http://schemas.android.com/apk/res/android" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@@ -222,11 +297,37 @@ generate_android_manifest:
@echo ^</activity^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^</application^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^</manifest^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
else
@echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>" > $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " package=\"com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)\" " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " android:versionCode=\"$(APP_VERSION_CODE)\" android:versionName=\"$(APP_VERSION_NAME)\" >" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <uses-sdk android:minSdkVersion=\"$(ANDROID_API_VERSION)\" />" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <application android:allowBackup=\"false\" android:label=\"@string/app_name\" android:icon=\"@drawable/icon\" >" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <activity android:name=\"com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME).NativeLoader\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " android:configChanges=\"orientation|keyboardHidden|screenSize\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " android:screenOrientation=\"$(APP_SCREEN_ORIENTATION)\" android:launchMode=\"singleTask\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " android:clearTaskOnLaunch=\"true\">" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <meta-data android:name=\"android.app.lib_name\" android:value=\"$(PROJECT_LIBRARY_NAME)\" />" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <intent-filter>" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <action android:name=\"android.intent.action.MAIN\" />" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " <category android:name=\"android.intent.category.LAUNCHER\" />" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " </intent-filter>" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " </activity>" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo " </application>" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo "</manifest>" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
endif
# Generate storekey for APK signing: $(PROJECT_NAME).keystore
# NOTE: Configure here your Distinguished Names (-dname) if required!
generate_apk_keystore:
if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA
ifeq ($(OS),Windows_NT)
if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 10000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA
else
@[ -f "$(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore" ] || $(JAVA_HOME)/bin/keytool -genkeypair -validity 10000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA
endif
# Config project package and resource using AndroidManifest.xml and res/values/strings.xml
# NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java
@@ -235,7 +336,7 @@ config_project_package:
# Compile native_app_glue code as static library: obj/libnative_app_glue.a
compile_native_app_glue:
$(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS)
$(CC) -c $(NATIVE_APP_GLUE_PATH)/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS)
$(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o
# Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so
@@ -249,7 +350,7 @@ $(PROJECT_BUILD_PATH)/obj/%.o:%.c
# Compile project .java code into .class (Java bytecode)
compile_project_class:
$(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar;$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
$(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar -d $(PROJECT_BUILD_PATH)/obj $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
# Compile .class files into Dalvik executable bytecode (.dex)
# NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT)
@@ -274,7 +375,7 @@ zipalign_project_apk_package:
# Install $(PROJECT_NAME).apk to default emulator/device
# NOTE: Use -e (emulator) or -d (device) parameters if required
install:
$(ANDROID_PLATFORM_TOOLS)/adb install --abi $(ANDROID_ARCH_NAME) -rds $(PROJECT_NAME).apk
$(ANDROID_PLATFORM_TOOLS)/adb install $(PROJECT_NAME).apk
# Check supported ABI for the device (armeabi-v7a, arm64-v8a, x86, x86_64)
check_device_abi:
@@ -287,7 +388,7 @@ logcat:
# Install and monitorize $(PROJECT_NAME).apk to default emulator/device
deploy:
$(ANDROID_PLATFORM_TOOLS)/adb install -r $(PROJECT_NAME).apk
$(ANDROID_PLATFORM_TOOLS)/adb install $(PROJECT_NAME).apk
$(ANDROID_PLATFORM_TOOLS)/adb logcat -c
$(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S
@@ -295,6 +396,10 @@ deploy:
# Clean everything
clean:
ifeq ($(OS),Windows_NT)
del $(PROJECT_BUILD_PATH)\* /f /s /q
rmdir $(PROJECT_BUILD_PATH) /s /q
else
rm -r $(PROJECT_BUILD_PATH)
endif
@echo Cleaning done

1076
examples/Makefile.Web Normal file

File diff suppressed because it is too large Load Diff

203
examples/README.md Normal file
View File

@@ -0,0 +1,203 @@
## Building the Examples
The examples assume you have already built the `raylib` library in `../src`.
### With GNU make
- `make` builds all examples
- `make [module]` builds all examples for a particular module (e.g `make core`)
### With Zig
The [Zig](https://ziglang.org/) toolchain can compile `C` and `C++` in addition to `Zig`.
You may find it easier to use than other toolchains, especially when it comes to cross-compiling.
- `zig build` to compile all examples
- `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`)
## EXAMPLES LIST
### category: core
Examples using raylib core 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 |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 01 | [core_basic_window](core/core_basic_window.c) | <img src="core/core_basic_window.png" alt="core_basic_window" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 02 | [core_input_keys](core/core_input_keys.c) | <img src="core/core_input_keys.png" alt="core_input_keys" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 03 | [core_input_mouse](core/core_input_mouse.c) | <img src="core/core_input_mouse.png" alt="core_input_mouse" width="80"> | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
| 04 | [core_input_mouse_wheel](core/core_input_mouse_wheel.c) | <img src="core/core_input_mouse_wheel.png" alt="core_input_mouse_wheel" width="80"> | ⭐️☆☆☆ | 1.1 | 1.3 | [Ray](https://github.com/raysan5) |
| 05 | [core_input_gamepad](core/core_input_gamepad.c) | <img src="core/core_input_gamepad.png" alt="core_input_gamepad" width="80"> | ⭐️☆☆☆ | 1.1 | **4.2** | [Ray](https://github.com/raysan5) |
| 06 | [core_input_multitouch](core/core_input_multitouch.c) | <img src="core/core_input_multitouch.png" alt="core_input_multitouch" width="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) |
| 08 | [core_2d_camera](core/core_2d_camera.c) | <img src="core/core_2d_camera.png" alt="core_2d_camera" width="80"> | ⭐️⭐️☆☆ | 1.5 | 3.0 | [Ray](https://github.com/raysan5) |
| 09 | [core_2d_camera_mouse_zoom](core/core_2d_camera_mouse_zoom.c) | <img src="core/core_2d_camera_mouse_zoom.png" alt="core_2d_camera_mouse_zoom" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
| 10 | [core_2d_camera_platformer](core/core_2d_camera_platformer.c) | <img src="core/core_2d_camera_platformer.png" alt="core_2d_camera_platformer" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [avyy](https://github.com/avyy) |
| 11 | [core_3d_camera_mode](core/core_3d_camera_mode.c) | <img src="core/core_3d_camera_mode.png" alt="core_3d_camera_mode" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 12 | [core_3d_camera_free](core/core_3d_camera_free.c) | <img src="core/core_3d_camera_free.png" alt="core_3d_camera_free" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 13 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | <img src="core/core_3d_camera_first_person.png" alt="core_3d_camera_first_person" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 14 | [core_3d_picking](core/core_3d_picking.c) | <img src="core/core_3d_picking.png" alt="core_3d_picking" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 15 | [core_world_screen](core/core_world_screen.c) | <img src="core/core_world_screen.png" alt="core_world_screen" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.4 | [Ray](https://github.com/raysan5) |
| 16 | [core_custom_logging](core/core_custom_logging.c) | <img src="core/core_custom_logging.png" alt="core_custom_logging" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Pablo Marcos Oltra](https://github.com/pamarcos) |
| 17 | [core_window_flags](core/core_window_flags.c) | <img src="core/core_window_flags.png" alt="core_window_flags" width="80"> | ⭐️⭐️⭐️☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 18 | [core_window_letterbox](core/core_window_letterbox.c) | <img src="core/core_window_letterbox.png" alt="core_window_letterbox" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Anata](https://github.com/anatagawa) |
| 19 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
| 20 | [core_drop_files](core/core_drop_files.c) | <img src="core/core_drop_files.png" alt="core_drop_files" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
| 21 | [core_random_values](core/core_random_values.c) | <img src="core/core_random_values.png" alt="core_random_values" width="80"> | ⭐️☆☆☆ | 1.1 | 1.1 | [Ray](https://github.com/raysan5) |
| 22 | [core_storage_values](core/core_storage_values.c) | <img src="core/core_storage_values.png" alt="core_storage_values" width="80"> | ⭐️⭐️☆☆ | 1.4 | **4.2** | [Ray](https://github.com/raysan5) |
| 23 | [core_vr_simulator](core/core_vr_simulator.c) | <img src="core/core_vr_simulator.png" alt="core_vr_simulator" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 24 | [core_loading_thread](core/core_loading_thread.c) | <img src="core/core_loading_thread.png" alt="core_loading_thread" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.0 | [Ray](https://github.com/raysan5) |
| 25 | [core_scissor_test](core/core_scissor_test.c) | <img src="core/core_scissor_test.png" alt="core_scissor_test" width="80"> | ⭐️☆☆☆ | 2.5 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
| 26 | [core_basic_screen_manager](core/core_basic_screen_manager.c) | <img src="core/core_basic_screen_manager.png" alt="core_basic_screen_manager" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
| 27 | [core_custom_frame_control](core/core_custom_frame_control.c) | <img src="core/core_custom_frame_control.png" alt="core_custom_frame_control" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Ray](https://github.com/raysan5) |
| 28 | [core_smooth_pixelperfect](core/core_smooth_pixelperfect.c) | <img src="core/core_smooth_pixelperfect.png" alt="core_smooth_pixelperfect" width="80"> | ⭐️⭐️⭐️☆ | 3.7 | **4.0** | [Giancamillo Alessandroni](https://github.com/NotManyIdeasDev) |
| 29 | [core_split_screen](core/core_split_screen.c) | <img src="core/core_split_screen.png" alt="core_split_screen" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.0** | [Jeffery Myers](https://github.com/JeffM2501) |
| 30 | [core_window_should_close](core/core_window_should_close.c) | <img src="core/core_window_should_close.png" alt="core_window_should_close" width="80"> | ⭐️⭐️☆☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
### category: shapes
Examples using raylib shapes drawing functionality, provided by raylib [shapes](../src/shapes.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 31 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | <img src="shapes/shapes_basic_shapes.png" alt="shapes_basic_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | **4.0** | [Ray](https://github.com/raysan5) |
| 32 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | <img src="shapes/shapes_bouncing_ball.png" alt="shapes_bouncing_ball" width="80"> | ⭐️☆☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 33 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | <img src="shapes/shapes_colors_palette.png" alt="shapes_colors_palette" width="80"> | ⭐️⭐️☆☆ | 1.0 | 2.5 | [Ray](https://github.com/raysan5) |
| 34 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | <img src="shapes/shapes_logo_raylib.png" alt="shapes_logo_raylib" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 35 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | <img src="shapes/shapes_logo_raylib_anim.png" alt="shapes_logo_raylib_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 36 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | <img src="shapes/shapes_rectangle_scaling.png" alt="shapes_rectangle_scaling" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 37 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | <img src="shapes/shapes_lines_bezier.png" alt="shapes_lines_bezier" width="80"> | ⭐️☆☆☆ | 1.7 | 1.7 | [Ray](https://github.com/raysan5) |
| 38 | [shapes_collision_area](shapes/shapes_collision_area.c) | <img src="shapes/shapes_collision_area.png" alt="shapes_collision_area" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 39 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | <img src="shapes/shapes_following_eyes.png" alt="shapes_following_eyes" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 40 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | <img src="shapes/shapes_easings_ball_anim.png" alt="shapes_easings_ball_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 41 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | <img src="shapes/shapes_easings_box_anim.png" alt="shapes_easings_box_anim" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 42 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | <img src="shapes/shapes_easings_rectangle_array.png" alt="shapes_easings_rectangle_array" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 43 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | <img src="shapes/shapes_draw_ring.png" alt="shapes_draw_ring" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 44 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | <img src="shapes/shapes_draw_circle_sector.png" alt="shapes_draw_circle_sector" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 45 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | <img src="shapes/shapes_draw_rectangle_rounded.png" alt="shapes_draw_rectangle_rounded" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 2.5 | [Vlad Adrian](https://github.com/demizdor) |
| 46 | [shapes_top_down_lights](shapes/shapes_top_down_lights.c) | <img src="shapes/shapes_top_down_lights.png" alt="shapes_top_down_lights" width="80"> | ⭐️⭐️⭐️⭐️ | **4.2** | **4.2** | [Jeffery Myers](https://github.com/JeffM2501) |
### category: textures
Examples using raylib textures functionality, including image/textures loading/generation and drawing, provided by raylib [textures](../src/textures.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 47 | [textures_logo_raylib](textures/textures_logo_raylib.c) | <img src="textures/textures_logo_raylib.png" alt="textures_logo_raylib" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 48 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | <img src="textures/textures_srcrec_dstrec.png" alt="textures_srcrec_dstrec" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 49 | [textures_image_drawing](textures/textures_image_drawing.c) | <img src="textures/textures_image_drawing.png" alt="textures_image_drawing" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
| 50 | [textures_image_generation](textures/textures_image_generation.c) | <img src="textures/textures_image_generation.png" alt="textures_image_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | 1.8 | [Ray](https://github.com/raysan5) |
| 51 | [textures_image_loading](textures/textures_image_loading.c) | <img src="textures/textures_image_loading.png" alt="textures_image_loading" width="80"> | ⭐️☆☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 52 | [textures_image_processing](textures/textures_image_processing.c) | <img src="textures/textures_image_processing.png" alt="textures_image_processing" width="80"> | ⭐️⭐️⭐️☆ | 1.4 | 3.5 | [Ray](https://github.com/raysan5) |
| 53 | [textures_image_text](textures/textures_image_text.c) | <img src="textures/textures_image_text.png" alt="textures_image_text" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
| 54 | [textures_to_image](textures/textures_to_image.c) | <img src="textures/textures_to_image.png" alt="textures_to_image" width="80"> | ⭐️☆☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 55 | [textures_raw_data](textures/textures_raw_data.c) | <img src="textures/textures_raw_data.png" alt="textures_raw_data" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
| 56 | [textures_particles_blending](textures/textures_particles_blending.c) | <img src="textures/textures_particles_blending.png" alt="textures_particles_blending" width="80"> | ⭐️☆☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
| 57 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | <img src="textures/textures_npatch_drawing.png" alt="textures_npatch_drawing" width="80"> | ⭐️⭐️⭐️☆ | 2.0 | 2.5 | [Jorge A. Gomes](https://github.com/overdev) |
| 58 | [textures_background_scrolling](textures/textures_background_scrolling.c) | <img src="textures/textures_background_scrolling.png" alt="textures_background_scrolling" width="80"> | ⭐️☆☆☆ | 2.0 | 2.5 | [Ray](https://github.com/raysan5) |
| 59 | [textures_sprite_anim](textures/textures_sprite_anim.c) | <img src="textures/textures_sprite_anim.png" alt="textures_sprite_anim" width="80"> | ⭐️⭐️☆☆ | 1.3 | 1.3 | [Ray](https://github.com/raysan5) |
| 60 | [textures_sprite_button](textures/textures_sprite_button.c) | <img src="textures/textures_sprite_button.png" alt="textures_sprite_button" width="80"> | ⭐️⭐️☆☆ | 2.5 | 2.5 | [Ray](https://github.com/raysan5) |
| 61 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | <img src="textures/textures_sprite_explosion.png" alt="textures_sprite_explosion" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 62 | [textures_bunnymark](textures/textures_bunnymark.c) | <img src="textures/textures_bunnymark.png" alt="textures_bunnymark" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | 2.5 | [Ray](https://github.com/raysan5) |
| 63 | [textures_mouse_painting](textures/textures_mouse_painting.c) | <img src="textures/textures_mouse_painting.png" alt="textures_mouse_painting" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Chris Dill](https://github.com/MysteriousSpace) |
| 64 | [textures_blend_modes](textures/textures_blend_modes.c) | <img src="textures/textures_blend_modes.png" alt="textures_blend_modes" width="80"> | ⭐️☆☆☆ | 3.5 | 3.5 | [Karlo Licudine](https://github.com/accidentalrebel) |
| 65 | [textures_draw_tiled](textures/textures_draw_tiled.c) | <img src="textures/textures_draw_tiled.png" alt="textures_draw_tiled" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | **4.2** | [Vlad Adrian](https://github.com/demizdor) |
| 66 | [textures_polygon](textures/textures_polygon.c) | <img src="textures/textures_polygon.png" alt="textures_polygon" width="80"> | ⭐️☆☆☆ | 3.7 | 3.7 | [Chris Camacho](https://github.com/codifies) |
| 67 | [textures_fog_of_war](textures/textures_fog_of_war.c) | <img src="textures/textures_fog_of_war.png" alt="textures_fog_of_war" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
| 68 | [textures_gif_player](textures/textures_gif_player.c) | <img src="textures/textures_gif_player.png" alt="textures_gif_player" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
### category: text
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/text.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 69 | [text_raylib_fonts](text/text_raylib_fonts.c) | <img src="text/text_raylib_fonts.png" alt="text_raylib_fonts" width="80"> | ⭐️☆☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
| 70 | [text_font_spritefont](text/text_font_spritefont.c) | <img src="text/text_font_spritefont.png" alt="text_font_spritefont" width="80"> | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) |
| 71 | [text_font_filters](text/text_font_filters.c) | <img src="text/text_font_filters.png" alt="text_font_filters" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
| 72 | [text_font_loading](text/text_font_loading.c) | <img src="text/text_font_loading.png" alt="text_font_loading" width="80"> | ⭐️☆☆☆ | 1.4 | 3.0 | [Ray](https://github.com/raysan5) |
| 73 | [text_font_sdf](text/text_font_sdf.c) | <img src="text/text_font_sdf.png" alt="text_font_sdf" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 74 | [text_format_text](text/text_format_text.c) | <img src="text/text_format_text.png" alt="text_format_text" width="80"> | ⭐️☆☆☆ | 1.1 | 3.0 | [Ray](https://github.com/raysan5) |
| 75 | [text_input_box](text/text_input_box.c) | <img src="text/text_input_box.png" alt="text_input_box" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.5 | [Ray](https://github.com/raysan5) |
| 76 | [text_writing_anim](text/text_writing_anim.c) | <img src="text/text_writing_anim.png" alt="text_writing_anim" width="80"> | ⭐️⭐️☆☆ | 1.4 | 1.4 | [Ray](https://github.com/raysan5) |
| 77 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | <img src="text/text_rectangle_bounds.png" alt="text_rectangle_bounds" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
| 78 | [text_unicode](text/text_unicode.c) | <img src="text/text_unicode.png" alt="text_unicode" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
| 79 | [text_draw_3d](text/text_draw_3d.c) | <img src="text/text_draw_3d.png" alt="text_draw_3d" width="80"> | ⭐️⭐️⭐️⭐️ | 3.5 | **4.0** | [Vlad Adrian](https://github.com/demizdor) |
| 80 | [text_codepoints_loading](text/text_codepoints_loading.c) | <img src="text/text_codepoints_loading.png" alt="text_codepoints_loading" width="80"> | ⭐️⭐️⭐️☆ | **4.2** | **4.2** | [Ray](https://github.com/raysan5) |
### category: models
Examples using raylib models functionality, including models loading/generation and drawing, provided by raylib [models](../src/models.c) module.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 81 | [models_animation](models/models_animation.c) | <img src="models/models_animation.png" alt="models_animation" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [culacant](https://github.com/culacant) |
| 82 | [models_billboard](models/models_billboard.c) | <img src="models/models_billboard.png" alt="models_billboard" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
| 83 | [models_box_collisions](models/models_box_collisions.c) | <img src="models/models_box_collisions.png" alt="models_box_collisions" width="80"> | ⭐️☆☆☆ | 1.3 | 3.5 | [Ray](https://github.com/raysan5) |
| 84 | [models_cubicmap](models/models_cubicmap.c) | <img src="models/models_cubicmap.png" alt="models_cubicmap" width="80"> | ⭐️⭐️☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
| 85 | [models_first_person_maze](models/models_first_person_maze.c) | <img src="models/models_first_person_maze.png" alt="models_first_person_maze" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 86 | [models_geometric_shapes](models/models_geometric_shapes.c) | <img src="models/models_geometric_shapes.png" alt="models_geometric_shapes" width="80"> | ⭐️☆☆☆ | 1.0 | 3.5 | [Ray](https://github.com/raysan5) |
| 87 | [models_mesh_generation](models/models_mesh_generation.c) | <img src="models/models_mesh_generation.png" alt="models_mesh_generation" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
| 88 | [models_mesh_picking](models/models_mesh_picking.c) | <img src="models/models_mesh_picking.png" alt="models_mesh_picking" width="80"> | ⭐️⭐️⭐️☆ | 1.7 | **4.0** | [Joel Davis](https://github.com/joeld42) |
| 89 | [models_loading](models/models_loading.c) | <img src="models/models_loading.png" alt="models_loading" width="80"> | ⭐️☆☆☆ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 90 | [models_loading_gltf](models/models_loading_gltf.c) | <img src="models/models_loading_gltf.png" alt="models_loading_gltf" width="80"> | ⭐️☆☆☆ | 3.7 | **4.2** | [Ray](https://github.com/raysan5) |
| 91 | [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) |
| 92 | [models_loading_m3d](models/models_loading_m3d.c) | <img src="models/models_loading_m3d.png" alt="models_loading_m3d" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) |
| 93 | [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
| 94 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
| 95 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) |
| 96 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) |
| 97 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
| 98 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
### category: shaders
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 |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 99 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) |
| 100 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) |
| 101 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
| 102 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 103 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
| 104 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
| 105 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) |
| 106 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) |
| 107 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) |
| 108 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
| 109 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) |
| 110 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) |
| 111 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
| 112 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
| 113 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) |
| 114 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) |
| 115 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 116 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
### category: audio
Examples using raylib audio functionality, including sound/music loading and playing. This functionality is provided by raylib [raudio](../src/raudio.c) module. Note this module can be used standalone independently of raylib, check [raudio_standalone](others/raudio_standalone.c) example.
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 117 | [audio_module_playing](audio/audio_module_playing.c) | <img src="audio/audio_module_playing.png" alt="audio_module_playing" width="80"> | ⭐️☆☆☆ | 1.5 | 3.5 | [Ray](https://github.com/raysan5) |
| 118 | [audio_music_stream](audio/audio_music_stream.c) | <img src="audio/audio_music_stream.png" alt="audio_music_stream" width="80"> | ⭐️☆☆☆ | 1.3 | **4.2** | [Ray](https://github.com/raysan5) |
| 119 | [audio_raw_stream](audio/audio_raw_stream.c) | <img src="audio/audio_raw_stream.png" alt="audio_raw_stream" width="80"> | ⭐️⭐️⭐️☆ | 1.6 | **4.2** | [Ray](https://github.com/raysan5) |
| 120 | [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) |
### category: others
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 |
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
| 122 | [rlgl_standalone](others/rlgl_standalone.c) | <img src="others/rlgl_standalone.png" alt="rlgl_standalone" width="80"> | ⭐️⭐️⭐️⭐️ | 1.6 | **4.0** | [Ray](https://github.com/raysan5) |
| 123 | [rlgl_compute_shader](others/rlgl_compute_shader.c) | <img src="others/rlgl_compute_shader.png" alt="rlgl_compute_shader" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Teddy Astie](https://github.com/tsnake41) |
| 124 | [easings_testbed](others/easings_testbed.c) | <img src="others/easings_testbed.png" alt="easings_testbed" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.0 | [Juan Miguel López](https://github.com/flashback-fx) |
| 125 | [raylib_opengl_interop](others/raylib_opengl_interop.c) | <img src="others/raylib_opengl_interop.png" alt="raylib_opengl_interop" width="80"> | ⭐️⭐️⭐️⭐️ | **4.0** | **4.0** | [Stephan Soller](https://github.com/arkanis) |
| 126 | [embedded_files_loading](others/embedded_files_loading.c) | <img src="others/embedded_files_loading.png" alt="embedded_files_loading" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Kristian Holmgren](https://github.com/defutura) |
As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with!

View File

@@ -0,0 +1,123 @@
/*******************************************************************************************
*
* raylib [audio] example - Mixed audio processing
*
* Example originally created with raylib 4.2, last time updated with raylib 4.2
*
* Example contributed by hkc (@hatkidchan) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2023 hkc (@hatkidchan)
*
********************************************************************************************/
#include "raylib.h"
#include <math.h>
static float exponent = 1.0f; // Audio exponentiation value
static float averageVolume[400] = { 0.0f }; // Average volume history
//------------------------------------------------------------------------------------
// Audio processing function
//------------------------------------------------------------------------------------
void ProcessAudio(void *buffer, unsigned int frames)
{
float *samples = (float *)buffer; // Samples internally stored as <float>s
float average = 0.0f; // Temporary average volume
for (unsigned int frame = 0; frame < frames; frame++)
{
float *left = &samples[frame * 2 + 0], *right = &samples[frame * 2 + 1];
*left = powf(fabsf(*left), exponent) * ( (*left < 0.0f)? -1.0f : 1.0f );
*right = powf(fabsf(*right), exponent) * ( (*right < 0.0f)? -1.0f : 1.0f );
average += fabsf(*left) / frames; // accumulating average volume
average += fabsf(*right) / frames;
}
// Moving history to the left
for (int i = 0; i < 399; i++) averageVolume[i] = averageVolume[i + 1];
averageVolume[399] = average; // Adding last average value
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [audio] example - processing mixed output");
InitAudioDevice(); // Initialize audio device
AttachAudioMixedProcessor(ProcessAudio);
Music music = LoadMusicStream("resources/country.mp3");
Sound sound = LoadSound("resources/coin.wav");
PlayMusicStream(music);
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // Update music buffer with new stream data
// Modify processing variables
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_LEFT)) exponent -= 0.05f;
if (IsKeyPressed(KEY_RIGHT)) exponent += 0.05f;
if (exponent <= 0.5f) exponent = 0.5f;
if (exponent >= 3.0f) exponent = 3.0f;
if (IsKeyPressed(KEY_SPACE)) PlaySound(sound);
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
DrawText(TextFormat("EXPONENT = %.2f", exponent), 215, 180, 20, LIGHTGRAY);
DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
for (int i = 0; i < 400; i++)
{
DrawLine(201 + i, 232 - averageVolume[i] * 32, 201 + i, 232, MAROON);
}
DrawRectangleLines(199, 199, 402, 34, GRAY);
DrawText("PRESS SPACE TO PLAY OTHER SOUND", 200, 250, 20, LIGHTGRAY);
DrawText("USE LEFT AND RIGHT ARROWS TO ALTER DISTORTION", 140, 280, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadMusicStream(music); // Unload music stream buffers from RAM
DetachAudioMixedProcessor(ProcessAudio); // Disconnect audio processor
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -2,12 +2,12 @@
*
* raylib [audio] example - Module playing (streaming)
*
* NOTE: This example requires OpenAL Soft library installed
* Example originally created with raylib 1.5, last time updated with raylib 3.5
*
* This example has been created using raylib 1.5 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
* Copyright (c) 2016-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -23,6 +23,9 @@ typedef struct {
Color color;
} CircleWave;
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -39,22 +42,24 @@ int main(void)
Color colors[14] = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE };
// Creates ome circles for visual effect
// Creates some circles for visual effect
CircleWave circles[MAX_CIRCLES] = { 0 };
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
{
circles[i].alpha = 0.0f;
circles[i].radius = GetRandomValue(10, 40);
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius);
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius);
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
circles[i].radius = (float)GetRandomValue(10, 40);
circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f;
circles[i].color = colors[GetRandomValue(0, 13)];
}
Music xm = LoadMusicStream("resources/chiptun1.mod");
Music music = LoadMusicStream("resources/mini1111.xm");
music.looping = false;
float pitch = 1.0f;
PlayMusicStream(xm);
PlayMusicStream(music);
float timePlayed = 0.0f;
bool pause = false;
@@ -67,13 +72,13 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(xm); // Update music buffer with new stream data
UpdateMusicStream(music); // Update music buffer with new stream data
// Restart music playing (stop and play)
if (IsKeyPressed(KEY_SPACE))
{
StopMusicStream(xm);
PlayMusicStream(xm);
StopMusicStream(music);
PlayMusicStream(music);
}
// Pause/Resume music playing
@@ -81,12 +86,17 @@ int main(void)
{
pause = !pause;
if (pause) PauseMusicStream(xm);
else ResumeMusicStream(xm);
if (pause) PauseMusicStream(music);
else ResumeMusicStream(music);
}
if (IsKeyDown(KEY_DOWN)) pitch -= 0.01f;
else if (IsKeyDown(KEY_UP)) pitch += 0.01f;
SetMusicPitch(music, pitch);
// Get timePlayed scaled to bar dimensions
timePlayed = GetMusicTimePlayed(xm)/GetMusicTimeLength(xm)*(screenWidth - 40);
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*(screenWidth - 40);
// Color circles animation
for (int i = MAX_CIRCLES - 1; (i >= 0) && !pause; i--)
@@ -99,11 +109,11 @@ int main(void)
if (circles[i].alpha <= 0.0f)
{
circles[i].alpha = 0.0f;
circles[i].radius = GetRandomValue(10, 40);
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius);
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius);
circles[i].radius = (float)GetRandomValue(10, 40);
circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
circles[i].color = colors[GetRandomValue(0, 13)];
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f;
}
}
//----------------------------------------------------------------------------------
@@ -130,7 +140,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadMusicStream(xm); // Unload music stream buffers from RAM
UnloadMusicStream(music); // Unload music stream buffers from RAM
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)

View File

@@ -2,17 +2,20 @@
*
* raylib [audio] example - Music playing (streaming)
*
* NOTE: This example requires OpenAL Soft library installed
* Example originally created with raylib 1.3, last time updated with raylib 4.0
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -24,14 +27,14 @@ int main(void)
InitAudioDevice(); // Initialize audio device
Music music = LoadMusicStream("resources/guitar_noodling.ogg");
Music music = LoadMusicStream("resources/country.mp3");
PlayMusicStream(music);
float timePlayed = 0.0f;
bool pause = false;
float timePlayed = 0.0f; // Time played normalized [0.0f..1.0f]
bool pause = false; // Music playing paused
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
SetTargetFPS(30); // Set our game to run at 30 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
@@ -57,10 +60,10 @@ int main(void)
else ResumeMusicStream(music);
}
// Get timePlayed scaled to bar dimensions (400 pixels)
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*400;
// Get normalized time played for current music stream
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
if (timePlayed > 400) StopMusicStream(music);
if (timePlayed > 1.0f) timePlayed = 1.0f; // Make sure time played is no longer than music
//----------------------------------------------------------------------------------
// Draw
@@ -72,7 +75,7 @@ int main(void)
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
DrawRectangle(200, 200, 400, 12, LIGHTGRAY);
DrawRectangle(200, 200, (int)timePlayed, 12, MAROON);
DrawRectangle(200, 200, (int)(timePlayed*400.0f), 12, MAROON);
DrawRectangleLines(200, 200, 400, 12, GRAY);
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, LIGHTGRAY);

View File

@@ -2,12 +2,14 @@
*
* raylib [audio] example - Raw audio streaming
*
* NOTE: This example requires OpenAL Soft library installed
* Example originally created with raylib 1.6, last time updated with raylib 4.2
*
* This example has been created using raylib 1.6 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example created by Ramon Santamaria (@raysan5) and reviewed by James Hofmann (@triplefox)
*
* Copyright (c) 2015-2019 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5) and James Hofmann (@triplefox)
*
********************************************************************************************/
@@ -20,6 +22,38 @@
#define MAX_SAMPLES 512
#define MAX_SAMPLES_PER_UPDATE 4096
// Cycles per second (hz)
float frequency = 440.0f;
// Audio frequency, for smoothing
float audioFrequency = 440.0f;
// Previous value, used to test if sine needs to be rewritten, and to smoothly modulate frequency
float oldFrequency = 1.0f;
// Index for audio rendering
float sineIdx = 0.0f;
// Audio input processing callback
void AudioInputCallback(void *buffer, unsigned int frames)
{
audioFrequency = frequency + (audioFrequency - frequency)*0.95f;
audioFrequency += 1.0f;
audioFrequency -= 1.0f;
float incr = audioFrequency/44100.0f;
short *d = (short *)buffer;
for (unsigned int i = 0; i < frames; i++)
{
d[i] = (short)(32000.0f*sinf(2*PI*sineIdx));
sineIdx += incr;
if (sineIdx > 1.0f) sineIdx -= 1.0f;
}
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -31,8 +65,12 @@ int main(void)
InitAudioDevice(); // Initialize audio device
// Init raw audio stream (sample rate: 22050, sample size: 16bit-short, channels: 1-mono)
AudioStream stream = InitAudioStream(22050, 16, 1);
SetAudioStreamBufferSizeDefault(MAX_SAMPLES_PER_UPDATE);
// Init raw audio stream (sample rate: 44100, sample size: 16bit-short, channels: 1-mono)
AudioStream stream = LoadAudioStream(44100, 16, 1);
SetAudioStreamCallback(stream, AudioInputCallback);
// Buffer for the single cycle waveform we are synthesizing
short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES);
@@ -45,6 +83,7 @@ int main(void)
// Position read in to determine next frequency
Vector2 mousePosition = { -100.0f, -100.0f };
/*
// Cycles per second (hz)
float frequency = 440.0f;
@@ -53,6 +92,7 @@ int main(void)
// Cursor to read and copy the samples of the sine wave buffer
int readCursor = 0;
*/
// Computed size in samples of the sine wave
int waveLength = 1;
@@ -71,35 +111,44 @@ int main(void)
// Sample mouse input.
mousePosition = GetMousePosition();
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON))
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT))
{
float fp = (float)(mousePosition.y);
frequency = 40.0f + (float)(fp);
float pan = (float)(mousePosition.x) / (float)screenWidth;
SetAudioStreamPan(stream, pan);
}
// Rewrite the sine wave.
// Rewrite the sine wave
// Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc.
if (frequency != oldFrequency)
{
// Compute wavelength. Limit size in both directions.
int oldWavelength = waveLength;
//int oldWavelength = waveLength;
waveLength = (int)(22050/frequency);
if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2;
if (waveLength < 1) waveLength = 1;
// Write sine wave.
// Write sine wave
for (int i = 0; i < waveLength*2; i++)
{
data[i] = (short)(sinf(((2*PI*(float)i/waveLength)))*32000);
}
// Make sure the rest of the line is flat
for (int j = waveLength*2; j < MAX_SAMPLES; j++)
{
data[j] = (short)0;
}
// Scale read cursor's position to minimize transition artifacts
readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));
//readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));
oldFrequency = frequency;
}
/*
// Refill audio stream if required
if (IsAudioBufferProcessed(stream))
if (IsAudioStreamProcessed(stream))
{
// Synthesize a buffer that is exactly the requested size
int writeCursor = 0;
@@ -126,6 +175,7 @@ int main(void)
// Copy finished frame to audio stream
UpdateAudioStream(stream, writeBuf, MAX_SAMPLES_PER_UPDATE);
}
*/
//----------------------------------------------------------------------------------
// Draw
@@ -134,14 +184,14 @@ int main(void)
ClearBackground(RAYWHITE);
DrawText(FormatText("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED);
DrawText("click mouse button to change frequency", 10, 10, 20, DARKGRAY);
DrawText(TextFormat("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED);
DrawText("click mouse button to change frequency or pan", 10, 10, 20, DARKGRAY);
// Draw the current buffer state proportionate to the screen
for (int i = 0; i < screenWidth; i++)
{
position.x = i;
position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000;
position.x = (float)i;
position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000.0f;
DrawPixelV(position, RED);
}
@@ -155,7 +205,7 @@ int main(void)
free(data); // Unload sine wave data
free(writeBuf); // Unload write buffer
CloseAudioStream(stream); // Close raw audio stream and delete buffers from RAM
UnloadAudioStream(stream); // Close raw audio stream and delete buffers from RAM
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
CloseWindow(); // Close window and OpenGL context

View File

@@ -2,17 +2,20 @@
*
* raylib [audio] example - Sound loading and playing
*
* NOTE: This example requires OpenAL Soft library installed
* Example originally created with raylib 1.1, last time updated with raylib 3.5
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -25,7 +28,7 @@ int main(void)
InitAudioDevice(); // Initialize audio device
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
Sound fxOgg = LoadSound("resources/tanatana.ogg"); // Load OGG audio file
Sound fxOgg = LoadSound("resources/target.ogg"); // Load OGG audio file
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------

View File

@@ -0,0 +1,179 @@
/*******************************************************************************************
*
* raylib [audio] example - Music stream processing effects
*
* Example originally created with raylib 4.2, last time updated with raylib 4.2
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2022-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <stdlib.h> // Required for: NULL
// Required delay effect variables
static float *delayBuffer = NULL;
static unsigned int delayBufferSize = 0;
static unsigned int delayReadIndex = 2;
static unsigned int delayWriteIndex = 0;
//------------------------------------------------------------------------------------
// Module Functions Declaration
//------------------------------------------------------------------------------------
static void AudioProcessEffectLPF(void *buffer, unsigned int frames); // Audio effect: lowpass filter
static void AudioProcessEffectDelay(void *buffer, unsigned int frames); // Audio effect: delay
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [audio] example - stream effects");
InitAudioDevice(); // Initialize audio device
Music music = LoadMusicStream("resources/country.mp3");
// Allocate buffer for the delay effect
delayBufferSize = 48000*2; // 1 second delay (device sampleRate*channels)
delayBuffer = (float *)RL_CALLOC(delayBufferSize, sizeof(float));
PlayMusicStream(music);
float timePlayed = 0.0f; // Time played normalized [0.0f..1.0f]
bool pause = false; // Music playing paused
bool enableEffectLPF = false; // Enable effect low-pass-filter
bool enableEffectDelay = false; // Enable effect delay (1 second)
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // Update music buffer with new stream data
// Restart music playing (stop and play)
if (IsKeyPressed(KEY_SPACE))
{
StopMusicStream(music);
PlayMusicStream(music);
}
// Pause/Resume music playing
if (IsKeyPressed(KEY_P))
{
pause = !pause;
if (pause) PauseMusicStream(music);
else ResumeMusicStream(music);
}
// Add/Remove effect: lowpass filter
if (IsKeyPressed(KEY_F))
{
enableEffectLPF = !enableEffectLPF;
if (enableEffectLPF) AttachAudioStreamProcessor(music.stream, AudioProcessEffectLPF);
else DetachAudioStreamProcessor(music.stream, AudioProcessEffectLPF);
}
// Add/Remove effect: delay
if (IsKeyPressed(KEY_D))
{
enableEffectDelay = !enableEffectDelay;
if (enableEffectDelay) AttachAudioStreamProcessor(music.stream, AudioProcessEffectDelay);
else DetachAudioStreamProcessor(music.stream, AudioProcessEffectDelay);
}
// Get normalized time played for current music stream
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
if (timePlayed > 1.0f) timePlayed = 1.0f; // Make sure time played is no longer than music
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("MUSIC SHOULD BE PLAYING!", 245, 150, 20, LIGHTGRAY);
DrawRectangle(200, 180, 400, 12, LIGHTGRAY);
DrawRectangle(200, 180, (int)(timePlayed*400.0f), 12, MAROON);
DrawRectangleLines(200, 180, 400, 12, GRAY);
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 230, 20, LIGHTGRAY);
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 260, 20, LIGHTGRAY);
DrawText(TextFormat("PRESS F TO TOGGLE LPF EFFECT: %s", enableEffectLPF? "ON" : "OFF"), 200, 320, 20, GRAY);
DrawText(TextFormat("PRESS D TO TOGGLE DELAY EFFECT: %s", enableEffectDelay? "ON" : "OFF"), 180, 350, 20, GRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadMusicStream(music); // Unload music stream buffers from RAM
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
RL_FREE(delayBuffer); // Free delay buffer
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
//------------------------------------------------------------------------------------
// Module Functions Definition
//------------------------------------------------------------------------------------
// Audio effect: lowpass filter
static void AudioProcessEffectLPF(void *buffer, unsigned int frames)
{
static float low[2] = { 0.0f, 0.0f };
static const float cutoff = 70.0f / 44100.0f; // 70 Hz lowpass filter
const float k = cutoff / (cutoff + 0.1591549431f); // RC filter formula
for (unsigned int i = 0; i < frames*2; i += 2)
{
float l = ((float *)buffer)[i], r = ((float *)buffer)[i + 1];
low[0] += k * (l - low[0]);
low[1] += k * (r - low[1]);
((float *)buffer)[i] = low[0];
((float *)buffer)[i + 1] = low[1];
}
}
// Audio effect: delay
static void AudioProcessEffectDelay(void *buffer, unsigned int frames)
{
for (unsigned int i = 0; i < frames*2; i += 2)
{
float leftDelay = delayBuffer[delayReadIndex++]; // ERROR: Reading buffer -> WHY??? Maybe thread related???
float rightDelay = delayBuffer[delayReadIndex++];
if (delayReadIndex == delayBufferSize) delayReadIndex = 0;
((float *)buffer)[i] = 0.5f*((float *)buffer)[i] + 0.5f*leftDelay;
((float *)buffer)[i + 1] = 0.5f*((float *)buffer)[i + 1] + 0.5f*rightDelay;
delayBuffer[delayWriteIndex++] = ((float *)buffer)[i];
delayBuffer[delayWriteIndex++] = ((float *)buffer)[i + 1];
if (delayWriteIndex == delayBufferSize) delayWriteIndex = 0;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,10 @@
| resource | author | licence | notes |
| :------------------- | :---------: | :------ | :---- |
| country.mp3 | [@emegeme](https://github.com/emegeme) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Originally created for "DART that TARGET" game |
| target.ogg | [@emegeme](https://github.com/emegeme) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Originally created for "DART that TARGET" game |
| target.flac | [@emegeme](https://github.com/emegeme) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Originally created for "DART that TARGET" game |
| coin.wav | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Made with [rFXGen](https://raylibtech.itch.io/rfxgen) |
| sound.wav | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Made with [rFXGen](https://raylibtech.itch.io/rfxgen) |
| spring.wav | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Made with [rFXGen](https://raylibtech.itch.io/rfxgen) |
| weird.wav | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | Made with [rFXGen](https://raylibtech.itch.io/rfxgen) |
| mini1111.xm | [tPORt](https://modarchive.org/index.php?request=view_by_moduleid&query=51891) | [Mod Archive Distribution license](https://modarchive.org/index.php?terms-upload) | - |

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

105
examples/build.zig Normal file
View File

@@ -0,0 +1,105 @@
const std = @import("std");
const builtin = @import("builtin");
fn add_module(comptime module: []const u8, b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.OptimizeMode) !*std.Build.Step {
if (target.getOsTag() == .emscripten) {
@panic("Emscripten building via Zig unsupported");
}
const all = b.step(module, "All " ++ module ++ " examples");
const dir = try std.fs.cwd().openIterableDir(module, .{});
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.getOsTag() == .windows) continue;
const exe = b.addExecutable(.{
.name = name,
.target = target,
.optimize = optimize,
});
exe.addCSourceFile(path, &[_][]const u8{});
exe.linkLibC();
exe.addObjectFile(switch (target.getOsTag()) {
.windows => "../src/raylib.lib",
.linux => "../src/libraylib.a",
.macos => "../src/libraylib.a",
.emscripten => "../src/libraylib.a",
else => @panic("Unsupported OS"),
});
exe.addIncludePath("../src");
exe.addIncludePath("../src/external");
exe.addIncludePath("../src/external/glfw/include");
switch (target.getOsTag()) {
.windows => {
exe.linkSystemLibrary("winmm");
exe.linkSystemLibrary("gdi32");
exe.linkSystemLibrary("opengl32");
exe.addIncludePath("external/glfw/deps/mingw");
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");
},
}
exe.setOutputDir(module);
var run = exe.run();
run.step.dependOn(&b.addInstallArtifact(exe).step);
run.cwd = module;
b.step(name, name).dependOn(&run.step);
all.dependOn(&exe.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));
}

View File

@@ -2,10 +2,12 @@
*
* raylib [core] example - 2d camera
*
* This example has been created using raylib 1.5 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.5, last time updated with raylib 3.0
*
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2016-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -13,6 +15,9 @@
#define MAX_BUILDINGS 100
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -30,19 +35,19 @@ int main(void)
for (int i = 0; i < MAX_BUILDINGS; i++)
{
buildings[i].width = GetRandomValue(50, 200);
buildings[i].height = GetRandomValue(100, 800);
buildings[i].y = screenHeight - 130 - buildings[i].height;
buildings[i].x = -6000 + spacing;
buildings[i].width = (float)GetRandomValue(50, 200);
buildings[i].height = (float)GetRandomValue(100, 800);
buildings[i].y = screenHeight - 130.0f - buildings[i].height;
buildings[i].x = -6000.0f + spacing;
spacing += buildings[i].width;
spacing += (int)buildings[i].width;
buildColors[i] = (Color){ GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255 };
}
Camera2D camera = { 0 };
camera.target = (Vector2){ player.x + 20, player.y + 20 };
camera.offset = (Vector2){ 0, 0 };
camera.target = (Vector2){ player.x + 20.0f, player.y + 20.0f };
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
@@ -54,16 +59,9 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyDown(KEY_RIGHT))
{
player.x += 2; // Player movement
camera.offset.x -= 2; // Camera displacement with player movement
}
else if (IsKeyDown(KEY_LEFT))
{
player.x -= 2; // Player movement
camera.offset.x += 2; // Camera displacement with player movement
}
// Player movement
if (IsKeyDown(KEY_RIGHT)) player.x += 2;
else if (IsKeyDown(KEY_LEFT)) player.x -= 2;
// Camera target follows player
camera.target = (Vector2){ player.x + 20, player.y + 20 };
@@ -104,8 +102,8 @@ int main(void)
DrawRectangleRec(player, RED);
DrawLine(camera.target.x, -screenHeight*10, camera.target.x, screenHeight*10, GREEN);
DrawLine(-screenWidth*10, camera.target.y, screenWidth*10, camera.target.y, GREEN);
DrawLine((int)camera.target.x, -screenHeight*10, (int)camera.target.x, screenHeight*10, GREEN);
DrawLine(-screenWidth*10, (int)camera.target.y, screenWidth*10, (int)camera.target.y, GREEN);
EndMode2D();

View File

@@ -0,0 +1,105 @@
/*******************************************************************************************
*
* raylib [core] example - 2d camera mouse zoom
*
* Example originally created with raylib 4.2, last time updated with raylib 4.2
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2022-2023 Jeffery Myers (@JeffM2501)
*
********************************************************************************************/
#include "raylib.h"
#include "rlgl.h"
#include "raymath.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main ()
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera mouse zoom");
Camera2D camera = { 0 };
camera.zoom = 1.0f;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// Translate based on mouse right click
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
{
Vector2 delta = GetMouseDelta();
delta = Vector2Scale(delta, -1.0f/camera.zoom);
camera.target = Vector2Add(camera.target, delta);
}
// Zoom based on mouse wheel
float wheel = GetMouseWheelMove();
if (wheel != 0)
{
// Get the world point that is under the mouse
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
// Set the offset to where the mouse is
camera.offset = GetMousePosition();
// Set the target to match, so that the camera maps the world space point
// under the cursor to the screen space point under the cursor at any zoom
camera.target = mouseWorldPos;
// Zoom increment
const float zoomIncrement = 0.125f;
camera.zoom += (wheel*zoomIncrement);
if (camera.zoom < zoomIncrement) camera.zoom = zoomIncrement;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(BLACK);
BeginMode2D(camera);
// Draw the 3d grid, rotated 90 degrees and centered around 0,0
// just so we have something in the XY plane
rlPushMatrix();
rlTranslatef(0, 25*50, 0);
rlRotatef(90, 1, 0, 0);
DrawGrid(100, 50);
rlPopMatrix();
// Draw a reference circle
DrawCircle(100, 100, 50, YELLOW);
EndMode2D();
DrawText("Mouse right button drag to move, mouse wheel to zoom", 10, 10, 20, WHITE);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,298 @@
/*******************************************************************************************
*
* raylib [core] example - 2d camera platformer
*
* 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 licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2023 arvyy (@arvyy)
*
********************************************************************************************/
#include "raylib.h"
#include "raymath.h"
#define G 400
#define PLAYER_JUMP_SPD 350.0f
#define PLAYER_HOR_SPD 200.0f
typedef struct Player {
Vector2 position;
float speed;
bool canJump;
} Player;
typedef struct EnvItem {
Rectangle rect;
int blocking;
Color color;
} EnvItem;
//----------------------------------------------------------------------------------
// Module functions declaration
//----------------------------------------------------------------------------------
void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float delta);
void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
void UpdateCameraEvenOutOnLanding(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera");
Player player = { 0 };
player.position = (Vector2){ 400, 280 };
player.speed = 0;
player.canJump = false;
EnvItem envItems[] = {
{{ 0, 0, 1000, 400 }, 0, LIGHTGRAY },
{{ 0, 400, 1000, 200 }, 1, GRAY },
{{ 300, 200, 400, 10 }, 1, GRAY },
{{ 250, 300, 100, 10 }, 1, GRAY },
{{ 650, 300, 100, 10 }, 1, GRAY }
};
int envItemsLength = sizeof(envItems)/sizeof(envItems[0]);
Camera2D camera = { 0 };
camera.target = player.position;
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
// Store pointers to the multiple update camera functions
void (*cameraUpdaters[])(Camera2D*, Player*, EnvItem*, int, float, int, int) = {
UpdateCameraCenter,
UpdateCameraCenterInsideMap,
UpdateCameraCenterSmoothFollow,
UpdateCameraEvenOutOnLanding,
UpdateCameraPlayerBoundsPush
};
int cameraOption = 0;
int cameraUpdatersLength = sizeof(cameraUpdaters)/sizeof(cameraUpdaters[0]);
char *cameraDescriptions[] = {
"Follow player center",
"Follow player center, but clamp to map edges",
"Follow player center; smoothed",
"Follow player center horizontally; updateplayer center vertically after landing",
"Player push camera on getting too close to screen edge"
};
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose())
{
// Update
//----------------------------------------------------------------------------------
float deltaTime = GetFrameTime();
UpdatePlayer(&player, envItems, envItemsLength, deltaTime);
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
else if (camera.zoom < 0.25f) camera.zoom = 0.25f;
if (IsKeyPressed(KEY_R))
{
camera.zoom = 1.0f;
player.position = (Vector2){ 400, 280 };
}
if (IsKeyPressed(KEY_C)) cameraOption = (cameraOption + 1)%cameraUpdatersLength;
// Call update camera function by its pointer
cameraUpdaters[cameraOption](&camera, &player, envItems, envItemsLength, deltaTime, screenWidth, screenHeight);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(LIGHTGRAY);
BeginMode2D(camera);
for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color);
Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40, 40 };
DrawRectangleRec(playerRect, RED);
EndMode2D();
DrawText("Controls:", 20, 20, 10, BLACK);
DrawText("- Right/Left to move", 40, 40, 10, DARKGRAY);
DrawText("- Space to jump", 40, 60, 10, DARKGRAY);
DrawText("- Mouse Wheel to Zoom in-out, R to reset zoom", 40, 80, 10, DARKGRAY);
DrawText("- C to change camera mode", 40, 100, 10, DARKGRAY);
DrawText("Current camera mode:", 20, 120, 10, BLACK);
DrawText(cameraDescriptions[cameraOption], 40, 140, 10, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float delta)
{
if (IsKeyDown(KEY_LEFT)) player->position.x -= PLAYER_HOR_SPD*delta;
if (IsKeyDown(KEY_RIGHT)) player->position.x += PLAYER_HOR_SPD*delta;
if (IsKeyDown(KEY_SPACE) && player->canJump)
{
player->speed = -PLAYER_JUMP_SPD;
player->canJump = false;
}
int hitObstacle = 0;
for (int i = 0; i < envItemsLength; i++)
{
EnvItem *ei = envItems + i;
Vector2 *p = &(player->position);
if (ei->blocking &&
ei->rect.x <= p->x &&
ei->rect.x + ei->rect.width >= p->x &&
ei->rect.y >= p->y &&
ei->rect.y <= p->y + player->speed*delta)
{
hitObstacle = 1;
player->speed = 0.0f;
p->y = ei->rect.y;
}
}
if (!hitObstacle)
{
player->position.y += player->speed*delta;
player->speed += G*delta;
player->canJump = false;
}
else player->canJump = true;
}
void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
{
camera->offset = (Vector2){ width/2.0f, height/2.0f };
camera->target = player->position;
}
void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
{
camera->target = player->position;
camera->offset = (Vector2){ width/2.0f, height/2.0f };
float minX = 1000, minY = 1000, maxX = -1000, maxY = -1000;
for (int i = 0; i < envItemsLength; i++)
{
EnvItem *ei = envItems + i;
minX = fminf(ei->rect.x, minX);
maxX = fmaxf(ei->rect.x + ei->rect.width, maxX);
minY = fminf(ei->rect.y, minY);
maxY = fmaxf(ei->rect.y + ei->rect.height, maxY);
}
Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, *camera);
Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, *camera);
if (max.x < width) camera->offset.x = width - (max.x - width/2);
if (max.y < height) camera->offset.y = height - (max.y - height/2);
if (min.x > 0) camera->offset.x = width/2 - min.x;
if (min.y > 0) camera->offset.y = height/2 - min.y;
}
void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
{
static float minSpeed = 30;
static float minEffectLength = 10;
static float fractionSpeed = 0.8f;
camera->offset = (Vector2){ width/2.0f, height/2.0f };
Vector2 diff = Vector2Subtract(player->position, camera->target);
float length = Vector2Length(diff);
if (length > minEffectLength)
{
float speed = fmaxf(fractionSpeed*length, minSpeed);
camera->target = Vector2Add(camera->target, Vector2Scale(diff, speed*delta/length));
}
}
void UpdateCameraEvenOutOnLanding(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
{
static float evenOutSpeed = 700;
static int eveningOut = false;
static float evenOutTarget;
camera->offset = (Vector2){ width/2.0f, height/2.0f };
camera->target.x = player->position.x;
if (eveningOut)
{
if (evenOutTarget > camera->target.y)
{
camera->target.y += evenOutSpeed*delta;
if (camera->target.y > evenOutTarget)
{
camera->target.y = evenOutTarget;
eveningOut = 0;
}
}
else
{
camera->target.y -= evenOutSpeed*delta;
if (camera->target.y < evenOutTarget)
{
camera->target.y = evenOutTarget;
eveningOut = 0;
}
}
}
else
{
if (player->canJump && (player->speed == 0) && (player->position.y != camera->target.y))
{
eveningOut = 1;
evenOutTarget = player->position.y;
}
}
}
void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
{
static Vector2 bbox = { 0.2f, 0.2f };
Vector2 bboxWorldMin = GetScreenToWorld2D((Vector2){ (1 - bbox.x)*0.5f*width, (1 - bbox.y)*0.5f*height }, *camera);
Vector2 bboxWorldMax = GetScreenToWorld2D((Vector2){ (1 + bbox.x)*0.5f*width, (1 + bbox.y)*0.5f*height }, *camera);
camera->offset = (Vector2){ (1 - bbox.x)*0.5f * width, (1 - bbox.y)*0.5f*height };
if (player->position.x < bboxWorldMin.x) camera->target.x = player->position.x;
if (player->position.y < bboxWorldMin.y) camera->target.y = player->position.y;
if (player->position.x > bboxWorldMax.x) camera->target.x = bboxWorldMin.x + (player->position.x - bboxWorldMax.x);
if (player->position.y > bboxWorldMax.y) camera->target.y = bboxWorldMin.y + (player->position.y - bboxWorldMax.y);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -2,17 +2,23 @@
*
* raylib [core] example - 3d camera first person
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.3, last time updated with raylib 1.3
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "rcamera.h"
#define MAX_COLUMNS 20
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -24,35 +30,113 @@ int main(void)
// Define the camera to look into our 3d world (position, target, up vector)
Camera camera = { 0 };
camera.position = (Vector3){ 4.0f, 2.0f, 4.0f };
camera.target = (Vector3){ 0.0f, 1.8f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.fovy = 60.0f;
camera.type = CAMERA_PERSPECTIVE;
camera.position = (Vector3){ 0.0f, 2.0f, 4.0f }; // Camera position
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 60.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
int cameraMode = CAMERA_FIRST_PERSON;
// Generates some random columns
float heights[MAX_COLUMNS] = { 0.0f };
float heights[MAX_COLUMNS] = { 0 };
Vector3 positions[MAX_COLUMNS] = { 0 };
Color colors[MAX_COLUMNS] = { 0 };
for (int i = 0; i < MAX_COLUMNS; i++)
{
heights[i] = (float)GetRandomValue(1, 12);
positions[i] = (Vector3){ GetRandomValue(-15, 15), heights[i]/2, GetRandomValue(-15, 15) };
positions[i] = (Vector3){ (float)GetRandomValue(-15, 15), heights[i]/2.0f, (float)GetRandomValue(-15, 15) };
colors[i] = (Color){ GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255 };
}
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode
DisableCursor(); // Limit cursor to relative movement inside the window
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera); // Update camera
// Switch camera mode
if (IsKeyPressed(KEY_ONE))
{
cameraMode = CAMERA_FREE;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
if (IsKeyPressed(KEY_TWO))
{
cameraMode = CAMERA_FIRST_PERSON;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
if (IsKeyPressed(KEY_THREE))
{
cameraMode = CAMERA_THIRD_PERSON;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
if (IsKeyPressed(KEY_FOUR))
{
cameraMode = CAMERA_ORBITAL;
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Reset roll
}
// Switch camera projection
if (IsKeyPressed(KEY_P))
{
if (camera.projection == CAMERA_PERSPECTIVE)
{
// Create isometric view
cameraMode = CAMERA_THIRD_PERSON;
// Note: The target distance is related to the render distance in the orthographic projection
camera.position = (Vector3){ 0.0f, 2.0f, -100.0f };
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.projection = CAMERA_ORTHOGRAPHIC;
camera.fovy = 20.0f; // near plane width in CAMERA_ORTHOGRAPHIC
CameraYaw(&camera, -135 * DEG2RAD, true);
CameraPitch(&camera, -45 * DEG2RAD, true, true, false);
}
else if (camera.projection == CAMERA_ORTHOGRAPHIC)
{
// Reset to default view
cameraMode = CAMERA_THIRD_PERSON;
camera.position = (Vector3){ 0.0f, 2.0f, 10.0f };
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.projection = CAMERA_PERSPECTIVE;
camera.fovy = 60.0f;
}
}
// Update camera computes movement internally depending on the camera mode
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
// For advance camera controls, it's reecommended to compute camera movement manually
UpdateCamera(&camera, cameraMode); // Update camera
/*
// Camera PRO usage example (EXPERIMENTAL)
// This new camera function allows custom movement/rotation values to be directly provided
// as input parameters, with this approach, rcamera module is internally independent of raylib inputs
UpdateCameraPro(&camera,
(Vector3){
(IsKeyDown(KEY_W) || IsKeyDown(KEY_UP))*0.1f - // Move forward-backward
(IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN))*0.1f,
(IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT))*0.1f - // Move right-left
(IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT))*0.1f,
0.0f // Move up-down
},
(Vector3){
GetMouseDelta().x*0.05f, // Rotation: yaw
GetMouseDelta().y*0.05f, // Rotation: pitch
0.0f // Rotation: roll
},
GetMouseWheelMove()*2.0f); // Move to target (zoom)
*/
//----------------------------------------------------------------------------------
// Draw
@@ -75,14 +159,39 @@ int main(void)
DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, MAROON);
}
// Draw player cube
if (cameraMode == CAMERA_THIRD_PERSON)
{
DrawCube(camera.target, 0.5f, 0.5f, 0.5f, PURPLE);
DrawCubeWires(camera.target, 0.5f, 0.5f, 0.5f, DARKPURPLE);
}
EndMode3D();
DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5f));
DrawRectangleLines( 10, 10, 220, 70, BLUE);
// Draw info boxes
DrawRectangle(5, 5, 330, 100, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(5, 5, 330, 100, BLUE);
DrawText("First person camera default controls:", 20, 20, 10, BLACK);
DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY);
DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY);
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("- Camera mode keys: 1, 2, 3, 4", 15, 60, 10, BLACK);
DrawText("- Zoom keys: num-plus, num-minus or mouse scroll", 15, 75, 10, BLACK);
DrawText("- Camera projection key: P", 15, 90, 10, BLACK);
DrawRectangle(600, 5, 195, 100, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(600, 5, 195, 100, BLUE);
DrawText("Camera status:", 610, 15, 10, BLACK);
DrawText(TextFormat("- Mode: %s", (cameraMode == CAMERA_FREE) ? "FREE" :
(cameraMode == CAMERA_FIRST_PERSON) ? "FIRST_PERSON" :
(cameraMode == CAMERA_THIRD_PERSON) ? "THIRD_PERSON" :
(cameraMode == CAMERA_ORBITAL) ? "ORBITAL" : "CUSTOM"), 610, 30, 10, BLACK);
DrawText(TextFormat("- Projection: %s", (camera.projection == CAMERA_PERSPECTIVE) ? "PERSPECTIVE" :
(camera.projection == CAMERA_ORTHOGRAPHIC) ? "ORTHOGRAPHIC" : "CUSTOM"), 610, 45, 10, BLACK);
DrawText(TextFormat("- Position: (%06.3f, %06.3f, %06.3f)", camera.position.x, camera.position.y, camera.position.z), 610, 60, 10, BLACK);
DrawText(TextFormat("- Target: (%06.3f, %06.3f, %06.3f)", camera.target.x, camera.target.y, camera.target.z), 610, 75, 10, BLACK);
DrawText(TextFormat("- Up: (%06.3f, %06.3f, %06.3f)", camera.up.x, camera.up.y, camera.up.z), 610, 90, 10, BLACK);
EndDrawing();
//----------------------------------------------------------------------------------

View File

@@ -2,15 +2,20 @@
*
* raylib [core] example - Initialize 3d camera free
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.3, last time updated with raylib 1.3
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -26,11 +31,11 @@ int main(void)
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera mode type
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
DisableCursor(); // Limit cursor to relative movement inside the window
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -40,7 +45,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera); // Update camera
UpdateCamera(&camera, CAMERA_FREE);
if (IsKeyDown('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
//----------------------------------------------------------------------------------

View File

@@ -2,15 +2,20 @@
*
* raylib [core] example - Initialize 3d camera mode
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -26,7 +31,7 @@ int main(void)
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera mode type
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };

View File

@@ -2,15 +2,20 @@
*
* raylib [core] example - Picking in 3d mode
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.3, last time updated with raylib 4.0
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -26,16 +31,13 @@ int main(void)
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera mode type
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
Vector3 cubePosition = { 0.0f, 1.0f, 0.0f };
Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };
Ray ray = { 0 }; // Picking line ray
bool collision = false;
SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
RayCollision collision = { 0 }; // Ray collision hit info
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -45,20 +47,27 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera); // Update camera
if (IsCursorHidden()) UpdateCamera(&camera, CAMERA_FIRST_PERSON);
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
// Toggle camera controls
if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT))
{
if (!collision)
if (IsCursorHidden()) EnableCursor();
else DisableCursor();
}
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
if (!collision.hit)
{
ray = GetMouseRay(GetMousePosition(), camera);
// Check collision between ray and box
collision = CheckCollisionRayBox(ray,
collision = GetRayCollisionBox(ray,
(BoundingBox){(Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 },
(Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 }});
}
else collision = false;
else collision.hit = false;
}
//----------------------------------------------------------------------------------
@@ -70,7 +79,7 @@ int main(void)
BeginMode3D(camera);
if (collision)
if (collision.hit)
{
DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RED);
DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, MAROON);
@@ -88,9 +97,11 @@ int main(void)
EndMode3D();
DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY);
DrawText("Try clicking on the box with your mouse!", 240, 10, 20, DARKGRAY);
if(collision) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, screenHeight * 0.1f, 30, GREEN);
if (collision.hit) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, (int)(screenHeight * 0.1f), 30, GREEN);
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, GRAY);
DrawFPS(10, 10);

View File

@@ -1,35 +1,36 @@
/*******************************************************************************************
*
* raylib - Simple Game template
* raylib [core] examples - basic screen manager
*
* <Game title>
* <Game description>
* NOTE: This example illustrates a very simple screen manager based on a states machines
*
* This game has been created using raylib (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 4.0, last time updated with raylib 4.0
*
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//----------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------
typedef enum GameScreen { LOGO = 0, TITLE, GAMEPLAY, ENDING } GameScreen;
//----------------------------------------------------------------------------------
// Main entry point
//----------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization (Note windowTitle is unused on Android)
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib template - simple game");
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic screen manager");
GameScreen currentScreen = LOGO;

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -12,15 +12,20 @@
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization

View File

@@ -1,62 +0,0 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
int main(int argc, char* argv[])
{
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

View File

@@ -2,14 +2,16 @@
*
* raylib [core] example - Basic window (adapted for HTML5 platform)
*
* This example is prepared to compile for PLATFORM_WEB, PLATFORM_DESKTOP and PLATFORM_RPI
* NOTE: This example is prepared to compile for PLATFORM_WEB, PLATFORM_DESKTOP and PLATFORM_RPI
* As you will notice, code structure is slightly diferent to the other examples...
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.3, last time updated with raylib 1.3
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -24,18 +26,18 @@
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
const int screenWidth = 800;
const int screenHeight = 450;
//----------------------------------------------------------------------------------
// Module Functions Declaration
// Module functions declaration
//----------------------------------------------------------------------------------
void UpdateDrawFrame(void); // Update and Draw one frame
//----------------------------------------------------------------------------------
// Main Enry Point
//----------------------------------------------------------------------------------
int main()
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------

View File

@@ -0,0 +1,130 @@
/*******************************************************************************************
*
* raylib [core] example - custom frame control
*
* NOTE: WARNING: This is an example for advance users willing to have full control over
* the frame processes. By default, EndDrawing() calls the following processes:
* 1. Draw remaining batch data: rlDrawRenderBatchActive()
* 2. SwapScreenBuffer()
* 3. Frame time control: WaitTime()
* 4. PollInputEvents()
*
* 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.
*
* Note that enabling this flag invalidates some functions:
* - GetFrameTime()
* - SetTargetFPS()
* - GetFPS()
*
* Example originally created with raylib 4.0, last time updated with raylib 4.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - custom frame control");
// Custom timming variables
double previousTime = GetTime(); // Previous time measure
double currentTime = 0.0; // Current time measure
double updateDrawTime = 0.0; // Update + Draw time
double waitTime = 0.0; // Wait time (if target fps required)
float deltaTime = 0.0f; // Frame time (Update + Draw + Wait time)
float timeCounter = 0.0f; // Accumulative time counter (seconds)
float position = 0.0f; // Circle position
bool pause = false; // Pause control flag
int targetFPS = 60; // Our initial target fps
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
if (IsKeyPressed(KEY_UP)) targetFPS += 20;
else if (IsKeyPressed(KEY_DOWN)) targetFPS -= 20;
if (targetFPS < 0) targetFPS = 0;
if (!pause)
{
position += 200*deltaTime; // We move at 200 pixels per second
if (position >= GetScreenWidth()) position = 0;
timeCounter += deltaTime; // We count time (seconds)
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
for (int i = 0; i < GetScreenWidth()/200; i++) DrawRectangle(200*i, 0, 1, GetScreenHeight(), SKYBLUE);
DrawCircle((int)position, GetScreenHeight()/2 - 25, 50, RED);
DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), (int)position - 40, GetScreenHeight()/2 - 100, 20, MAROON);
DrawText(TextFormat("PosX: %03.0f", position), (int)position - 50, GetScreenHeight()/2 + 40, 20, BLACK);
DrawText("Circle is moving at a constant 200 pixels/sec,\nindependently of the frame rate.", 10, 10, 20, DARKGRAY);
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 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("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
EndDrawing();
// NOTE: In case raylib is configured to SUPPORT_CUSTOM_FRAME_CONTROL,
// Events polling, screen buffer swap and frame time control must be managed by the user
SwapScreenBuffer(); // Flip the back buffer to screen (front buffer)
currentTime = GetTime();
updateDrawTime = currentTime - previousTime;
if (targetFPS > 0) // We want a fixed frame rate
{
waitTime = (1.0f/(float)targetFPS) - updateDrawTime;
if (waitTime > 0.0)
{
WaitTime((float)waitTime);
currentTime = GetTime();
deltaTime = (float)(currentTime - previousTime);
}
}
else deltaTime = (float)updateDrawTime; // Framerate could be variable
previousTime = currentTime;
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -2,12 +2,14 @@
*
* raylib [core] example - Custom logging
*
* This example has been created using raylib 2.1 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* 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)
*
* Copyright (c) 2018 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2018-2023 Pablo Marcos Oltra (@pamarcos) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -16,8 +18,8 @@
#include <stdio.h> // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen()
#include <time.h> // Required for: time_t, tm, time(), localtime(), strftime()
// Custom logging funtion
void LogCustom(int msgType, const char *text, va_list args)
// Custom logging function
void CustomLog(int msgType, const char *text, va_list args)
{
char timeStr[64] = { 0 };
time_t now = time(NULL);
@@ -39,16 +41,18 @@ void LogCustom(int msgType, const char *text, va_list args)
printf("\n");
}
int main(int argc, char* argv[])
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
// First thing we do is setting our custom logger to ensure everything raylib logs
// will use our own logger instead of its internal one
SetTraceLogCallback(LogCustom);
// Set custom logger
SetTraceLogCallback(CustomLog);
InitWindow(screenWidth, screenHeight, "raylib [core] example - custom logging");

View File

@@ -2,17 +2,27 @@
*
* raylib [core] example - Windows drop files
*
* This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
* NOTE: This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.3, last time updated with raylib 4.2
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <stdlib.h> // Required for: calloc(), free()
#define MAX_FILEPATH_RECORDED 4096
#define MAX_FILEPATH_SIZE 2048
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -22,8 +32,14 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [core] example - drop files");
int count = 0;
char **droppedFiles = { 0 };
int filePathCounter = 0;
char *filePaths[MAX_FILEPATH_RECORDED] = { 0 }; // We will register a maximum of filepaths
// Allocate space for the required file paths
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
{
filePaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_SIZE, 1);
}
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -35,7 +51,18 @@ int main(void)
//----------------------------------------------------------------------------------
if (IsFileDropped())
{
droppedFiles = GetDroppedFiles(&count);
FilePathList droppedFiles = LoadDroppedFiles();
for (int i = 0, offset = filePathCounter; i < droppedFiles.count; i++)
{
if (filePathCounter < (MAX_FILEPATH_RECORDED - 1))
{
TextCopy(filePaths[offset + i], droppedFiles.paths[i]);
filePathCounter++;
}
}
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
}
//----------------------------------------------------------------------------------
@@ -45,20 +72,20 @@ int main(void)
ClearBackground(RAYWHITE);
if (count == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY);
if (filePathCounter == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY);
else
{
DrawText("Dropped files:", 100, 40, 20, DARKGRAY);
for (int i = 0; i < count; i++)
for (unsigned int i = 0; i < filePathCounter; i++)
{
if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f));
DrawText(droppedFiles[i], 120, 100 + 40*i, 10, GRAY);
DrawText(filePaths[i], 120, 100 + 40*i, 10, GRAY);
}
DrawText("Drop new files...", 100, 110 + 40*count, 20, DARKGRAY);
DrawText("Drop new files...", 100, 110 + 40*filePathCounter, 20, DARKGRAY);
}
EndDrawing();
@@ -67,7 +94,10 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
ClearDroppedFiles(); // Clear internal buffers
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
{
RL_FREE(filePaths[i]); // Free allocated memory for all filepaths
}
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View File

@@ -8,16 +8,19 @@
* - PLAYSTATION(R)3 Controller
* Check raylib.h for buttons configuration
*
* This example has been created using raylib 2.5 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.1, last time updated with raylib 4.2
*
* Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
// NOTE: Gamepad name ID depends on drivers and OS
#define XBOX360_LEGACY_NAME_ID "Xbox Controller"
#if defined(PLATFORM_RPI)
#define XBOX360_NAME_ID "Microsoft X-Box 360 pad"
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
@@ -26,6 +29,9 @@
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
#endif
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -57,102 +63,102 @@ int main(void)
ClearBackground(RAYWHITE);
if (IsGamepadAvailable(GAMEPAD_PLAYER1))
if (IsGamepadAvailable(0))
{
DrawText(FormatText("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK);
DrawText(TextFormat("GP1: %s", GetGamepadName(0)), 10, 10, 10, BLACK);
if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID))
if (TextIsEqual(GetGamepadName(0), XBOX360_NAME_ID) || TextIsEqual(GetGamepadName(0), XBOX360_LEGACY_NAME_ID))
{
DrawTexture(texXboxPad, 0, 0, DARKGRAY);
// Draw buttons: xbox home
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(394, 89, 19, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(394, 89, 19, RED);
// Draw buttons: basic
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(436, 150, 9, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(352, 150, 9, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(501, 151, 15, BLUE);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(536, 187, 15, LIME);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(572, 151, 15, MAROON);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(536, 115, 15, GOLD);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(436, 150, 9, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(352, 150, 9, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(501, 151, 15, BLUE);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(536, 187, 15, LIME);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(572, 151, 15, MAROON);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(536, 115, 15, GOLD);
// Draw buttons: d-pad
DrawRectangle(317, 202, 19, 71, BLACK);
DrawRectangle(293, 228, 69, 19, BLACK);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(317, 202, 19, 26, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(292, 228, 25, 19, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(317, 202, 19, 26, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(292, 228, 25, 19, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED);
// Draw buttons: left-right back
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(259, 61, 20, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(259, 61, 20, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED);
// Draw axis: left joystick
DrawCircle(259, 152, 39, BLACK);
DrawCircle(259, 152, 34, LIGHTGRAY);
DrawCircle(259 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X)*20),
152 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK);
DrawCircle(259 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X)*20),
152 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK);
// Draw axis: right joystick
DrawCircle(461, 237, 38, BLACK);
DrawCircle(461, 237, 33, LIGHTGRAY);
DrawCircle(461 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_X)*20),
237 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
DrawCircle(461 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20),
237 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
// Draw axis: left-right triggers
DrawRectangle(170, 30, 15, 70, GRAY);
DrawRectangle(604, 30, 15, 70, GRAY);
DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER))/2.0f)*70), RED);
DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER))/2.0f)*70), RED);
DrawRectangle(170, 30, 15, (int)(((1 + GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER))/2)*70), RED);
DrawRectangle(604, 30, 15, (int)(((1 + GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER))/2)*70), RED);
//DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
//DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
}
else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID))
else if (TextIsEqual(GetGamepadName(0), PS3_NAME_ID))
{
DrawTexture(texPs3Pad, 0, 0, DARKGRAY);
// Draw buttons: ps
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(396, 222, 13, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(396, 222, 13, RED);
// Draw buttons: basic
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawRectangle(328, 170, 32, 13, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(557, 144, 13, LIME);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(586, 173, 13, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(557, 203, 13, VIOLET);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(527, 173, 13, PINK);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawRectangle(328, 170, 32, 13, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(557, 144, 13, LIME);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(586, 173, 13, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(557, 203, 13, VIOLET);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(527, 173, 13, PINK);
// Draw buttons: d-pad
DrawRectangle(225, 132, 24, 84, BLACK);
DrawRectangle(195, 161, 84, 25, BLACK);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(225, 132, 24, 29, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(195, 161, 30, 25, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(225, 132, 24, 29, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(195, 161, 30, 25, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED);
// Draw buttons: left-right back buttons
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(239, 82, 20, RED);
if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(557, 82, 20, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(239, 82, 20, RED);
if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(557, 82, 20, RED);
// Draw axis: left joystick
DrawCircle(319, 255, 35, BLACK);
DrawCircle(319, 255, 31, LIGHTGRAY);
DrawCircle(319 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X)*20),
255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK);
DrawCircle(319 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) * 20),
255 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) * 20), 25, BLACK);
// Draw axis: right joystick
DrawCircle(475, 255, 35, BLACK);
DrawCircle(475, 255, 31, LIGHTGRAY);
DrawCircle(475 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_X)*20),
255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK);
DrawCircle(475 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X) * 20),
255 + (int)(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y) * 20), 25, BLACK);
// Draw axis: left-right triggers
DrawRectangle(169, 48, 15, 70, GRAY);
DrawRectangle(611, 48, 15, 70, GRAY);
DrawRectangle(169, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER))/2.0f)*70), RED);
DrawRectangle(611, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER))/2.0f)*70), RED);
DrawRectangle(169, 48, 15, (int)(((1 - GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)) / 2) * 70), RED);
DrawRectangle(611, 48, 15, (int)(((1 - GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)) / 2) * 70), RED);
}
else
{
@@ -161,14 +167,14 @@ int main(void)
// TODO: Draw generic gamepad
}
DrawText(FormatText("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON);
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(0)), 10, 50, 10, MAROON);
for (int i = 0; i < GetGamepadAxisCount(GAMEPAD_PLAYER1); i++)
for (int i = 0; i < GetGamepadAxisCount(0); i++)
{
DrawText(FormatText("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY);
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(0, i)), 20, 70 + 20*i, 10, DARKGRAY);
}
if (GetGamepadButtonPressed() != -1) DrawText(FormatText("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
if (GetGamepadButtonPressed() != GAMEPAD_BUTTON_UNKNOWN) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
}
else

View File

@@ -2,18 +2,22 @@
*
* raylib [core] example - Input Gestures Detection
*
* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.4, last time updated with raylib 4.2
*
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2016-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <string.h>
#define MAX_GESTURE_STRINGS 20
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -24,7 +28,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [core] example - input gestures");
Vector2 touchPosition = { 0, 0 };
Rectangle touchArea = { 220, 10, screenWidth - 230, screenHeight - 20 };
Rectangle touchArea = { 220, 10, screenWidth - 230.0f, screenHeight - 20.0f };
int gesturesCount = 0;
char gestureStrings[MAX_GESTURE_STRINGS][32];
@@ -53,16 +57,16 @@ int main(void)
// Store gesture string
switch (currentGesture)
{
case GESTURE_TAP: strcpy(gestureStrings[gesturesCount], "GESTURE TAP"); break;
case GESTURE_DOUBLETAP: strcpy(gestureStrings[gesturesCount], "GESTURE DOUBLETAP"); break;
case GESTURE_HOLD: strcpy(gestureStrings[gesturesCount], "GESTURE HOLD"); break;
case GESTURE_DRAG: strcpy(gestureStrings[gesturesCount], "GESTURE DRAG"); break;
case GESTURE_SWIPE_RIGHT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE RIGHT"); break;
case GESTURE_SWIPE_LEFT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
case GESTURE_SWIPE_UP: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
case GESTURE_SWIPE_DOWN: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
case GESTURE_PINCH_IN: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH IN"); break;
case GESTURE_PINCH_OUT: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH OUT"); break;
case GESTURE_TAP: TextCopy(gestureStrings[gesturesCount], "GESTURE TAP"); break;
case GESTURE_DOUBLETAP: TextCopy(gestureStrings[gesturesCount], "GESTURE DOUBLETAP"); break;
case GESTURE_HOLD: TextCopy(gestureStrings[gesturesCount], "GESTURE HOLD"); break;
case GESTURE_DRAG: TextCopy(gestureStrings[gesturesCount], "GESTURE DRAG"); break;
case GESTURE_SWIPE_RIGHT: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE RIGHT"); break;
case GESTURE_SWIPE_LEFT: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
case GESTURE_SWIPE_UP: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
case GESTURE_SWIPE_DOWN: TextCopy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
case GESTURE_PINCH_IN: TextCopy(gestureStrings[gesturesCount], "GESTURE PINCH IN"); break;
case GESTURE_PINCH_OUT: TextCopy(gestureStrings[gesturesCount], "GESTURE PINCH OUT"); break;
default: break;
}
@@ -71,7 +75,7 @@ int main(void)
// Reset gestures strings
if (gesturesCount >= MAX_GESTURE_STRINGS)
{
for (int i = 0; i < MAX_GESTURE_STRINGS; i++) strcpy(gestureStrings[i], "\0");
for (int i = 0; i < MAX_GESTURE_STRINGS; i++) TextCopy(gestureStrings[i], "\0");
gesturesCount = 0;
}

View File

@@ -2,15 +2,20 @@
*
* raylib [core] example - Keyboard input
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization

View File

@@ -2,15 +2,20 @@
*
* raylib [core] example - Mouse input
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.0, last time updated with raylib 4.0
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -33,9 +38,13 @@ int main(void)
//----------------------------------------------------------------------------------
ballPosition = GetMousePosition();
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) ballColor = MAROON;
else if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) ballColor = LIME;
else if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) ballColor = DARKBLUE;
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) ballColor = MAROON;
else if (IsMouseButtonPressed(MOUSE_BUTTON_MIDDLE)) ballColor = LIME;
else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) ballColor = DARKBLUE;
else if (IsMouseButtonPressed(MOUSE_BUTTON_SIDE)) ballColor = PURPLE;
else if (IsMouseButtonPressed(MOUSE_BUTTON_EXTRA)) ballColor = YELLOW;
else if (IsMouseButtonPressed(MOUSE_BUTTON_FORWARD)) ballColor = ORANGE;
else if (IsMouseButtonPressed(MOUSE_BUTTON_BACK)) ballColor = BEIGE;
//----------------------------------------------------------------------------------
// Draw

View File

@@ -2,15 +2,20 @@
*
* raylib [core] examples - Mouse wheel input
*
* This test has been created using raylib 1.1 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.1, last time updated with raylib 1.3
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -43,7 +48,7 @@ int main(void)
DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON);
DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, GRAY);
DrawText(FormatText("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY);
DrawText(TextFormat("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View File

@@ -2,17 +2,24 @@
*
* raylib [core] example - Input multitouch
*
* This example has been created using raylib 2.1 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* 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)
*
* Copyright (c) 2019 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2023 Berni (@Berni8k) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#define MAX_TOUCH_POINTS 10
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -22,11 +29,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [core] example - input multitouch");
Vector2 ballPosition = { -100.0f, -100.0f };
Color ballColor = BEIGE;
int touchCounter = 0;
Vector2 touchPosition = { 0.0f };
Vector2 touchPositions[MAX_TOUCH_POINTS] = { 0 };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//---------------------------------------------------------------------------------------
@@ -36,19 +39,12 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
ballPosition = GetMousePosition();
ballColor = BEIGE;
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) ballColor = MAROON;
if (IsMouseButtonDown(MOUSE_MIDDLE_BUTTON)) ballColor = LIME;
if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) ballColor = DARKBLUE;
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) touchCounter = 10;
if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) touchCounter = 10;
if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) touchCounter = 10;
if (touchCounter > 0) touchCounter--;
// Get the touch point count ( how many fingers are touching the screen )
int tCount = GetTouchPointCount();
// Clamp touch points available ( set the maximum touch points allowed )
if(tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
// Get touch points positions
for (int i = 0; i < tCount; ++i) touchPositions[i] = GetTouchPosition(i);
//----------------------------------------------------------------------------------
// Draw
@@ -57,24 +53,18 @@ int main(void)
ClearBackground(RAYWHITE);
// Multitouch
for (int i = 0; i < MAX_TOUCH_POINTS; ++i)
for (int i = 0; i < tCount; ++i)
{
touchPosition = GetTouchPosition(i); // Get the touch point
if ((touchPosition.x >= 0) && (touchPosition.y >= 0)) // Make sure point is not (-1,-1) as this means there is no touch for it
// Make sure point is not (0, 0) as this means there is no touch for it
if ((touchPositions[i].x > 0) && (touchPositions[i].y > 0))
{
// Draw circle and touch index number
DrawCircleV(touchPosition, 34, ORANGE);
DrawText(FormatText("%d", i), touchPosition.x - 10, touchPosition.y - 70, 40, BLACK);
DrawCircleV(touchPositions[i], 34, ORANGE);
DrawText(TextFormat("%d", i), (int)touchPositions[i].x - 10, (int)touchPositions[i].y - 70, 40, BLACK);
}
}
// Draw the normal mouse location
DrawCircleV(ballPosition, 30 + (touchCounter*3), ballColor);
DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY);
DrawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, DARKGRAY);
DrawText("touch the screen at multiple locations to get multiple balls", 10, 10, 20, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View File

@@ -1,14 +1,15 @@
/*******************************************************************************************
*
* raylib example - loading thread
* raylib [core] example - loading thread
*
* NOTE: This example requires linking with pthreads library,
* on MinGW, it can be accomplished passing -static parameter to compiler
* NOTE: This example requires linking with pthreads library on MinGW,
* it can be accomplished passing -static parameter to compiler
*
* This example has been created using raylib 2.5 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 2.5, last time updated with raylib 3.0
*
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -22,11 +23,14 @@
// Using C11 atomics for synchronization
// NOTE: A plain bool (or any plain data type for that matter) can't be used for inter-thread synchronization
static atomic_bool dataLoaded = ATOMIC_VAR_INIT(false); // Data Loaded completion indicator
static atomic_bool dataLoaded = false; // Data Loaded completion indicator
static void *LoadDataThread(void *arg); // Loading data thread function declaration
static int dataProgress = 0; // Data progress accumulator
static atomic_int dataProgress = 0; // Data progress accumulator
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -65,9 +69,13 @@ int main(void)
case STATE_LOADING:
{
framesCounter++;
if (atomic_load(&dataLoaded))
if (atomic_load_explicit(&dataLoaded, memory_order_relaxed))
{
framesCounter = 0;
int error = pthread_join(threadId, NULL);
if (error != 0) TraceLog(LOG_ERROR, "Error joining loading thread");
else TraceLog(LOG_INFO, "Loading thread terminated successfully");
state = STATE_FINISHED;
}
} break;
@@ -76,8 +84,8 @@ int main(void)
if (IsKeyPressed(KEY_ENTER))
{
// Reset everything to launch again
atomic_store(&dataLoaded, false);
dataProgress = 0;
atomic_store_explicit(&dataLoaded, false, memory_order_relaxed);
atomic_store_explicit(&dataProgress, 0, memory_order_relaxed);
state = STATE_WAITING;
}
} break;
@@ -96,7 +104,7 @@ int main(void)
case STATE_WAITING: DrawText("PRESS ENTER to START LOADING DATA", 150, 170, 20, DARKGRAY); break;
case STATE_LOADING:
{
DrawRectangle(150, 200, dataProgress, 60, SKYBLUE);
DrawRectangle(150, 200, atomic_load_explicit(&dataProgress, memory_order_relaxed), 60, SKYBLUE);
if ((framesCounter/15)%2) DrawText("LOADING DATA...", 240, 210, 40, DARKBLUE);
} break;
@@ -137,11 +145,11 @@ static void *LoadDataThread(void *arg)
// We accumulate time over a global variable to be used in
// main thread as a progress bar
dataProgress = timeCounter/10;
atomic_store_explicit(&dataProgress, timeCounter/10, memory_order_relaxed);
}
// When data has finished loading, we set global variable
atomic_store(&dataLoaded, true);
atomic_store_explicit(&dataLoaded, true, memory_order_relaxed);
return NULL;
}

View File

@@ -2,15 +2,20 @@
*
* raylib [core] example - Generate random values
*
* This example has been created using raylib 1.1 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.1, last time updated with raylib 1.1
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -20,10 +25,12 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [core] example - generate random values");
int framesCounter = 0; // Variable used to count frames
// SetRandomSeed(0xaabbccff); // Set a custom random seed if desired, by default: "time(NULL)"
int randValue = GetRandomValue(-8, 5); // Get a random integer number between -8 and 5 (both included)
int framesCounter = 0; // Variable used to count frames
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -50,7 +57,7 @@ int main(void)
DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, MAROON);
DrawText(FormatText("%i", randValue), 360, 180, 80, LIGHTGRAY);
DrawText(TextFormat("%i", randValue), 360, 180, 80, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View File

@@ -0,0 +1,76 @@
/*******************************************************************************************
*
* raylib [core] example - Scissor test
*
* 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 licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2023 Chris Dill (@MysteriousSpace)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - scissor test");
Rectangle scissorArea = { 0, 0, 300, 300 };
bool scissorMode = true;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_S)) scissorMode = !scissorMode;
// Centre the scissor area around the mouse position
scissorArea.x = GetMouseX() - scissorArea.width/2;
scissorArea.y = GetMouseY() - scissorArea.height/2;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
if (scissorMode) BeginScissorMode((int)scissorArea.x, (int)scissorArea.y, (int)scissorArea.width, (int)scissorArea.height);
// Draw full screen rectangle and some text
// NOTE: Only part defined by scissor area will be rendered
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RED);
DrawText("Move the mouse around to reveal this text!", 190, 200, 20, LIGHTGRAY);
if (scissorMode) EndScissorMode();
DrawRectangleLinesEx(scissorArea, 1, BLACK);
DrawText("Press S to toggle scissor test", 10, 10, 20, BLACK);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,122 @@
/*******************************************************************************************
*
* raylib [core] example - smooth pixel-perfect camera
*
* Example originally created with raylib 3.7, last time updated with raylib 4.0
*
* Example contributed by Giancamillo Alessandroni (@NotManyIdeasDev) and
* reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2023 Giancamillo Alessandroni (@NotManyIdeasDev) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <math.h> // Required for: sinf(), cosf()
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
const int virtualScreenWidth = 160;
const int virtualScreenHeight = 90;
const float virtualRatio = (float)screenWidth/(float)virtualScreenWidth;
InitWindow(screenWidth, screenHeight, "raylib [core] example - smooth pixel-perfect camera");
Camera2D worldSpaceCamera = { 0 }; // Game world camera
worldSpaceCamera.zoom = 1.0f;
Camera2D screenSpaceCamera = { 0 }; // Smoothing camera
screenSpaceCamera.zoom = 1.0f;
RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight); // This is where we'll draw all our objects.
Rectangle rec01 = { 70.0f, 35.0f, 20.0f, 20.0f };
Rectangle rec02 = { 90.0f, 55.0f, 30.0f, 10.0f };
Rectangle rec03 = { 80.0f, 65.0f, 15.0f, 25.0f };
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
Rectangle sourceRec = { 0.0f, 0.0f, (float)target.texture.width, -(float)target.texture.height };
Rectangle destRec = { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) };
Vector2 origin = { 0.0f, 0.0f };
float rotation = 0.0f;
float cameraX = 0.0f;
float cameraY = 0.0f;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
rotation += 60.0f*GetFrameTime(); // Rotate the rectangles, 60 degrees per second
// Make the camera move to demonstrate the effect
cameraX = (sinf(GetTime())*50.0f) - 10.0f;
cameraY = cosf(GetTime())*30.0f;
// Set the camera's target to the values computed above
screenSpaceCamera.target = (Vector2){ cameraX, cameraY };
// Round worldSpace coordinates, keep decimals into screenSpace coordinates
worldSpaceCamera.target.x = (int)screenSpaceCamera.target.x;
screenSpaceCamera.target.x -= worldSpaceCamera.target.x;
screenSpaceCamera.target.x *= virtualRatio;
worldSpaceCamera.target.y = (int)screenSpaceCamera.target.y;
screenSpaceCamera.target.y -= worldSpaceCamera.target.y;
screenSpaceCamera.target.y *= virtualRatio;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginTextureMode(target);
ClearBackground(RAYWHITE);
BeginMode2D(worldSpaceCamera);
DrawRectanglePro(rec01, origin, rotation, BLACK);
DrawRectanglePro(rec02, origin, -rotation, RED);
DrawRectanglePro(rec03, origin, rotation + 45.0f, BLUE);
EndMode2D();
EndTextureMode();
BeginDrawing();
ClearBackground(RED);
BeginMode2D(screenSpaceCamera);
DrawTexturePro(target.texture, sourceRec, destRec, origin, 0.0f, WHITE);
EndMode2D();
DrawText(TextFormat("Screen resolution: %ix%i", screenWidth, screenHeight), 10, 10, 20, DARKBLUE);
DrawText(TextFormat("World resolution: %ix%i", virtualScreenWidth, virtualScreenHeight), 10, 40, 20, DARKGREEN);
DrawFPS(GetScreenWidth() - 95, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadRenderTexture(target); // Unload render texture
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,151 @@
/*******************************************************************************************
*
* raylib [core] example - split screen
*
* 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 licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2021-2023 Jeffery Myers (@JeffM2501)
*
********************************************************************************************/
#include "raylib.h"
Camera cameraPlayer1 = { 0 };
Camera cameraPlayer2 = { 0 };
// Scene drawing
void DrawScene(void)
{
int count = 5;
float spacing = 4;
// Grid of cube trees on a plane to make a "world"
DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane
for (float x = -count*spacing; x <= count*spacing; x += spacing)
{
for (float z = -count*spacing; z <= count*spacing; z += spacing)
{
DrawCube((Vector3) { x, 1.5f, z }, 1, 1, 1, LIME);
DrawCube((Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN);
}
}
// Draw a cube at each player's position
DrawCube(cameraPlayer1.position, 1, 1, 1, RED);
DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE);
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - split screen");
// Setup player 1 camera and screen
cameraPlayer1.fovy = 45.0f;
cameraPlayer1.up.y = 1.0f;
cameraPlayer1.target.y = 1.0f;
cameraPlayer1.position.z = -3.0f;
cameraPlayer1.position.y = 1.0f;
RenderTexture screenPlayer1 = LoadRenderTexture(screenWidth/2, screenHeight);
// Setup player two camera and screen
cameraPlayer2.fovy = 45.0f;
cameraPlayer2.up.y = 1.0f;
cameraPlayer2.target.y = 3.0f;
cameraPlayer2.position.x = -3.0f;
cameraPlayer2.position.y = 3.0f;
RenderTexture screenPlayer2 = LoadRenderTexture(screenWidth / 2, screenHeight);
// Build a flipped rectangle the size of the split view to use for drawing later
Rectangle splitScreenRect = { 0.0f, 0.0f, (float)screenPlayer1.texture.width, (float)-screenPlayer1.texture.height };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// If 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
float offsetThisFrame = 10.0f*GetFrameTime();
// Move Player1 forward and backwards (no turning)
if (IsKeyDown(KEY_W))
{
cameraPlayer1.position.z += offsetThisFrame;
cameraPlayer1.target.z += offsetThisFrame;
}
else if (IsKeyDown(KEY_S))
{
cameraPlayer1.position.z -= offsetThisFrame;
cameraPlayer1.target.z -= offsetThisFrame;
}
// Move Player2 forward and backwards (no turning)
if (IsKeyDown(KEY_UP))
{
cameraPlayer2.position.x += offsetThisFrame;
cameraPlayer2.target.x += offsetThisFrame;
}
else if (IsKeyDown(KEY_DOWN))
{
cameraPlayer2.position.x -= offsetThisFrame;
cameraPlayer2.target.x -= offsetThisFrame;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
// Draw Player1 view to the render texture
BeginTextureMode(screenPlayer1);
ClearBackground(SKYBLUE);
BeginMode3D(cameraPlayer1);
DrawScene();
EndMode3D();
DrawText("PLAYER1 W/S to move", 10, 10, 20, RED);
EndTextureMode();
// Draw Player2 view to the render texture
BeginTextureMode(screenPlayer2);
ClearBackground(SKYBLUE);
BeginMode3D(cameraPlayer2);
DrawScene();
EndMode3D();
DrawText("PLAYER2 UP/DOWN to move", 10, 10, 20, BLUE);
EndTextureMode();
// Draw both views render textures to the screen side by side
BeginDrawing();
ClearBackground(BLACK);
DrawTextureRec(screenPlayer1.texture, splitScreenRect, (Vector2){ 0, 0 }, WHITE);
DrawTextureRec(screenPlayer2.texture, splitScreenRect, (Vector2){ screenWidth/2.0f, 0 }, WHITE);
EndDrawing();
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadRenderTexture(screenPlayer1); // Unload render texture
UnloadRenderTexture(screenPlayer2); // Unload render texture
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -2,18 +2,34 @@
*
* raylib [core] example - Storage save/load values
*
* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 1.4, last time updated with raylib 4.2
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
// NOTE: Storage positions must start with 0, directly related to file memory layout
typedef enum { STORAGE_SCORE = 0, STORAGE_HISCORE } StorageData;
#include <stdlib.h> // Required for: calloc(), free()
#define STORAGE_DATA_FILE "storage.data" // Storage file
// NOTE: Storage positions must start with 0, directly related to file memory layout
typedef enum {
STORAGE_POSITION_SCORE = 0,
STORAGE_POSITION_HISCORE = 1
} StorageData;
// Persistent storage functions
static bool SaveStorageValue(unsigned int position, int value);
static int LoadStorageValue(unsigned int position);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -43,14 +59,14 @@ int main(void)
if (IsKeyPressed(KEY_ENTER))
{
StorageSaveValue(STORAGE_SCORE, score);
StorageSaveValue(STORAGE_HISCORE, hiscore);
SaveStorageValue(STORAGE_POSITION_SCORE, score);
SaveStorageValue(STORAGE_POSITION_HISCORE, hiscore);
}
else if (IsKeyPressed(KEY_SPACE))
{
// NOTE: If requested position could not be found, value 0 is returned
score = StorageLoadValue(STORAGE_SCORE);
hiscore = StorageLoadValue(STORAGE_HISCORE);
score = LoadStorageValue(STORAGE_POSITION_SCORE);
hiscore = LoadStorageValue(STORAGE_POSITION_HISCORE);
}
framesCounter++;
@@ -62,10 +78,10 @@ int main(void)
ClearBackground(RAYWHITE);
DrawText(FormatText("SCORE: %i", score), 280, 130, 40, MAROON);
DrawText(FormatText("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK);
DrawText(TextFormat("SCORE: %i", score), 280, 130, 40, MAROON);
DrawText(TextFormat("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK);
DrawText(FormatText("frames: %i", framesCounter), 10, 10, 20, LIME);
DrawText(TextFormat("frames: %i", framesCounter), 10, 10, 20, LIME);
DrawText("Press R to generate random numbers", 220, 40, 20, LIGHTGRAY);
DrawText("Press ENTER to SAVE values", 250, 310, 20, LIGHTGRAY);
@@ -82,3 +98,96 @@ int main(void)
return 0;
}
// Save integer value to storage file (to defined position)
// NOTE: Storage positions is directly related to file memory layout (4 bytes each integer)
bool SaveStorageValue(unsigned int position, int value)
{
bool success = false;
unsigned int dataSize = 0;
unsigned int newDataSize = 0;
unsigned char *fileData = LoadFileData(STORAGE_DATA_FILE, &dataSize);
unsigned char *newFileData = NULL;
if (fileData != NULL)
{
if (dataSize <= (position*sizeof(int)))
{
// Increase data size up to position and store value
newDataSize = (position + 1)*sizeof(int);
newFileData = (unsigned char *)RL_REALLOC(fileData, newDataSize);
if (newFileData != NULL)
{
// RL_REALLOC succeded
int *dataPtr = (int *)newFileData;
dataPtr[position] = value;
}
else
{
// RL_REALLOC failed
TraceLog(LOG_WARNING, "FILEIO: [%s] Failed to realloc data (%u), position in bytes (%u) bigger than actual file size", STORAGE_DATA_FILE, dataSize, position*sizeof(int));
// We store the old size of the file
newFileData = fileData;
newDataSize = dataSize;
}
}
else
{
// Store the old size of the file
newFileData = fileData;
newDataSize = dataSize;
// Replace value on selected position
int *dataPtr = (int *)newFileData;
dataPtr[position] = value;
}
success = SaveFileData(STORAGE_DATA_FILE, newFileData, newDataSize);
RL_FREE(newFileData);
TraceLog(LOG_INFO, "FILEIO: [%s] Saved storage value: %i", STORAGE_DATA_FILE, value);
}
else
{
TraceLog(LOG_INFO, "FILEIO: [%s] File created successfully", STORAGE_DATA_FILE);
dataSize = (position + 1)*sizeof(int);
fileData = (unsigned char *)RL_MALLOC(dataSize);
int *dataPtr = (int *)fileData;
dataPtr[position] = value;
success = SaveFileData(STORAGE_DATA_FILE, fileData, dataSize);
UnloadFileData(fileData);
TraceLog(LOG_INFO, "FILEIO: [%s] Saved storage value: %i", STORAGE_DATA_FILE, value);
}
return success;
}
// Load integer value from storage file (from defined position)
// NOTE: If requested position could not be found, value 0 is returned
int LoadStorageValue(unsigned int position)
{
int value = 0;
unsigned int dataSize = 0;
unsigned char *fileData = LoadFileData(STORAGE_DATA_FILE, &dataSize);
if (fileData != NULL)
{
if (dataSize < (position*4)) TraceLog(LOG_WARNING, "FILEIO: [%s] Failed to find storage position: %i", STORAGE_DATA_FILE, position);
else
{
int *dataPtr = (int *)fileData;
value = dataPtr[position];
}
UnloadFileData(fileData);
TraceLog(LOG_INFO, "FILEIO: [%s] Loaded storage value: %i", STORAGE_DATA_FILE, value);
}
return value;
}

View File

@@ -2,21 +2,26 @@
*
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
*
* This example has been created using raylib 1.7 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Example originally created with raylib 2.5, last time updated with raylib 4.0
*
* Copyright (c) 2017 Ramon Santamaria (@raysan5)
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2017-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#if defined(PLATFORM_DESKTOP)
#define GLSL_VERSION 330
#define GLSL_VERSION 330
#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
#define GLSL_VERSION 100
#define GLSL_VERSION 100
#endif
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
@@ -25,52 +30,76 @@ int main(void)
const int screenHeight = 450;
// NOTE: screenWidth/screenHeight should match VR device aspect ratio
SetConfigFlags(FLAG_MSAA_4X_HINT);
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
// Init VR simulator (Oculus Rift CV1 parameters)
InitVrSimulator();
// VR device parameters definition
VrDeviceInfo device = {
// Oculus Rift CV1 parameters for simulator
.hResolution = 2160, // Horizontal resolution in pixels
.vResolution = 1200, // Vertical resolution in pixels
.hScreenSize = 0.133793f, // Horizontal size in meters
.vScreenSize = 0.0669f, // Vertical size in meters
.vScreenCenter = 0.04678f, // Screen center in meters
.eyeToScreenDistance = 0.041f, // Distance between eye and display in meters
.lensSeparationDistance = 0.07f, // Lens separation distance in meters
.interpupillaryDistance = 0.07f, // IPD (distance between pupils) in meters
VrDeviceInfo hmd = { 0 }; // VR device parameters (head-mounted-device)
// NOTE: CV1 uses fresnel-hybrid-asymmetric lenses with specific compute shaders
// Following parameters are just an approximation to CV1 distortion stereo rendering
.lensDistortionValues[0] = 1.0f, // Lens distortion constant parameter 0
.lensDistortionValues[1] = 0.22f, // Lens distortion constant parameter 1
.lensDistortionValues[2] = 0.24f, // Lens distortion constant parameter 2
.lensDistortionValues[3] = 0.0f, // Lens distortion constant parameter 3
.chromaAbCorrection[0] = 0.996f, // Chromatic aberration correction parameter 0
.chromaAbCorrection[1] = -0.004f, // Chromatic aberration correction parameter 1
.chromaAbCorrection[2] = 1.014f, // Chromatic aberration correction parameter 2
.chromaAbCorrection[3] = 0.0f, // Chromatic aberration correction parameter 3
};
// Oculus Rift CV1 parameters for simulator
hmd.hResolution = 2160; // HMD horizontal resolution in pixels
hmd.vResolution = 1200; // HMD vertical resolution in pixels
hmd.hScreenSize = 0.133793f; // HMD horizontal size in meters
hmd.vScreenSize = 0.0669f; // HMD vertical size in meters
hmd.vScreenCenter = 0.04678f; // HMD screen center in meters
hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters
hmd.lensSeparationDistance = 0.07f; // HMD lens separation distance in meters
hmd.interpupillaryDistance = 0.07f; // HMD IPD (distance between pupils) in meters
// NOTE: CV1 uses a Fresnel-hybrid-asymmetric lenses with specific distortion compute shaders.
// Following parameters are an approximation to distortion stereo rendering but results differ from actual device.
hmd.lensDistortionValues[0] = 1.0f; // HMD lens distortion constant parameter 0
hmd.lensDistortionValues[1] = 0.22f; // HMD lens distortion constant parameter 1
hmd.lensDistortionValues[2] = 0.24f; // HMD lens distortion constant parameter 2
hmd.lensDistortionValues[3] = 0.0f; // HMD lens distortion constant parameter 3
hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0
hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1
hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2
hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3
// Load VR stereo config for VR device parameteres (Oculus Rift CV1 parameters)
VrStereoConfig config = LoadVrStereoConfig(device);
// Distortion shader (uses device lens distortion and chroma)
Shader distortion = LoadShader(0, FormatText("resources/distortion%i.fs", GLSL_VERSION));
Shader distortion = LoadShader(0, TextFormat("resources/distortion%i.fs", GLSL_VERSION));
SetVrConfiguration(hmd, distortion); // Set Vr device parameters for stereo rendering
// Update distortion shader with lens and distortion-scale parameters
SetShaderValue(distortion, GetShaderLocation(distortion, "leftLensCenter"),
config.leftLensCenter, SHADER_UNIFORM_VEC2);
SetShaderValue(distortion, GetShaderLocation(distortion, "rightLensCenter"),
config.rightLensCenter, SHADER_UNIFORM_VEC2);
SetShaderValue(distortion, GetShaderLocation(distortion, "leftScreenCenter"),
config.leftScreenCenter, SHADER_UNIFORM_VEC2);
SetShaderValue(distortion, GetShaderLocation(distortion, "rightScreenCenter"),
config.rightScreenCenter, SHADER_UNIFORM_VEC2);
SetShaderValue(distortion, GetShaderLocation(distortion, "scale"),
config.scale, SHADER_UNIFORM_VEC2);
SetShaderValue(distortion, GetShaderLocation(distortion, "scaleIn"),
config.scaleIn, SHADER_UNIFORM_VEC2);
SetShaderValue(distortion, GetShaderLocation(distortion, "deviceWarpParam"),
device.lensDistortionValues, SHADER_UNIFORM_VEC4);
SetShaderValue(distortion, GetShaderLocation(distortion, "chromaAbParam"),
device.chromaAbCorrection, SHADER_UNIFORM_VEC4);
// Initialize framebuffer for stereo rendering
// NOTE: Screen size should match HMD aspect ratio
RenderTexture2D target = LoadRenderTexture(device.hResolution, device.vResolution);
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
Rectangle sourceRec = { 0.0f, 0.0f, (float)target.texture.width, -(float)target.texture.height };
Rectangle destRec = { 0.0f, 0.0f, (float)GetScreenWidth(), (float)GetScreenHeight() };
// Define the camera to look into our 3d world
Camera camera = { 0 };
camera.position = (Vector3){ 5.0f, 2.0f, 5.0f }; // Camera position
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector
camera.fovy = 60.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera type
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set first person camera mode
DisableCursor(); // Limit cursor to relative movement inside the window
SetTargetFPS(90); // Set our game to run at 90 frames-per-second
//--------------------------------------------------------------------------------------
@@ -80,43 +109,42 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera); // Update camera (simulator mode)
if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
BeginTextureMode(target);
ClearBackground(RAYWHITE);
BeginVrDrawing();
BeginVrStereoMode(config);
BeginMode3D(camera);
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
DrawGrid(40, 1.0f);
EndMode3D();
EndVrStereoMode();
EndTextureMode();
EndVrDrawing();
BeginDrawing();
ClearBackground(RAYWHITE);
BeginShaderMode(distortion);
DrawTexturePro(target.texture, sourceRec, destRec, (Vector2){ 0.0f, 0.0f }, 0.0f, WHITE);
EndShaderMode();
DrawFPS(10, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadShader(distortion); // Unload distortion shader
UnloadVrStereoConfig(config); // Unload stereo config
CloseVrSimulator(); // Close VR simulator
UnloadRenderTexture(target); // Unload stereo render fbo
UnloadShader(distortion); // Unload distortion shader
CloseWindow(); // Close window and OpenGL context
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;

View File

@@ -0,0 +1,196 @@
/*******************************************************************************************
*
* raylib [core] example - window flags
*
* 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,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2020-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//---------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
// Possible window flags
/*
FLAG_VSYNC_HINT
FLAG_FULLSCREEN_MODE -> not working properly -> wrong scaling!
FLAG_WINDOW_RESIZABLE
FLAG_WINDOW_UNDECORATED
FLAG_WINDOW_TRANSPARENT
FLAG_WINDOW_HIDDEN
FLAG_WINDOW_MINIMIZED -> Not supported on window creation
FLAG_WINDOW_MAXIMIZED -> Not supported on window creation
FLAG_WINDOW_UNFOCUSED
FLAG_WINDOW_TOPMOST
FLAG_WINDOW_HIGHDPI -> errors after minimize-resize, fb size is recalculated
FLAG_WINDOW_ALWAYS_RUN
FLAG_MSAA_4X_HINT
*/
// Set configuration flags for window creation
//SetConfigFlags(FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT | FLAG_WINDOW_HIGHDPI);
InitWindow(screenWidth, screenHeight, "raylib [core] example - window flags");
Vector2 ballPosition = { GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f };
Vector2 ballSpeed = { 5.0f, 4.0f };
float ballRadius = 20;
int framesCounter = 0;
//SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//----------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//-----------------------------------------------------
if (IsKeyPressed(KEY_F)) ToggleFullscreen(); // modifies window size when scaling!
if (IsKeyPressed(KEY_R))
{
if (IsWindowState(FLAG_WINDOW_RESIZABLE)) ClearWindowState(FLAG_WINDOW_RESIZABLE);
else SetWindowState(FLAG_WINDOW_RESIZABLE);
}
if (IsKeyPressed(KEY_D))
{
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) ClearWindowState(FLAG_WINDOW_UNDECORATED);
else SetWindowState(FLAG_WINDOW_UNDECORATED);
}
if (IsKeyPressed(KEY_H))
{
if (!IsWindowState(FLAG_WINDOW_HIDDEN)) SetWindowState(FLAG_WINDOW_HIDDEN);
framesCounter = 0;
}
if (IsWindowState(FLAG_WINDOW_HIDDEN))
{
framesCounter++;
if (framesCounter >= 240) ClearWindowState(FLAG_WINDOW_HIDDEN); // Show window after 3 seconds
}
if (IsKeyPressed(KEY_N))
{
if (!IsWindowState(FLAG_WINDOW_MINIMIZED)) MinimizeWindow();
framesCounter = 0;
}
if (IsWindowState(FLAG_WINDOW_MINIMIZED))
{
framesCounter++;
if (framesCounter >= 240) RestoreWindow(); // Restore window after 3 seconds
}
if (IsKeyPressed(KEY_M))
{
// NOTE: Requires FLAG_WINDOW_RESIZABLE enabled!
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) RestoreWindow();
else MaximizeWindow();
}
if (IsKeyPressed(KEY_U))
{
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) ClearWindowState(FLAG_WINDOW_UNFOCUSED);
else SetWindowState(FLAG_WINDOW_UNFOCUSED);
}
if (IsKeyPressed(KEY_T))
{
if (IsWindowState(FLAG_WINDOW_TOPMOST)) ClearWindowState(FLAG_WINDOW_TOPMOST);
else SetWindowState(FLAG_WINDOW_TOPMOST);
}
if (IsKeyPressed(KEY_A))
{
if (IsWindowState(FLAG_WINDOW_ALWAYS_RUN)) ClearWindowState(FLAG_WINDOW_ALWAYS_RUN);
else SetWindowState(FLAG_WINDOW_ALWAYS_RUN);
}
if (IsKeyPressed(KEY_V))
{
if (IsWindowState(FLAG_VSYNC_HINT)) ClearWindowState(FLAG_VSYNC_HINT);
else SetWindowState(FLAG_VSYNC_HINT);
}
// Bouncing ball logic
ballPosition.x += ballSpeed.x;
ballPosition.y += ballSpeed.y;
if ((ballPosition.x >= (GetScreenWidth() - ballRadius)) || (ballPosition.x <= ballRadius)) ballSpeed.x *= -1.0f;
if ((ballPosition.y >= (GetScreenHeight() - ballRadius)) || (ballPosition.y <= ballRadius)) ballSpeed.y *= -1.0f;
//-----------------------------------------------------
// Draw
//-----------------------------------------------------
BeginDrawing();
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) ClearBackground(BLANK);
else ClearBackground(RAYWHITE);
DrawCircleV(ballPosition, ballRadius, MAROON);
DrawRectangleLinesEx((Rectangle) { 0, 0, (float)GetScreenWidth(), (float)GetScreenHeight() }, 4, RAYWHITE);
DrawCircleV(GetMousePosition(), 10, DARKBLUE);
DrawFPS(10, 10);
DrawText(TextFormat("Screen Size: [%i, %i]", GetScreenWidth(), GetScreenHeight()), 10, 40, 10, GREEN);
// Draw window state info
DrawText("Following flags can be set after window creation:", 10, 60, 10, GRAY);
if (IsWindowState(FLAG_FULLSCREEN_MODE)) DrawText("[F] FLAG_FULLSCREEN_MODE: on", 10, 80, 10, LIME);
else DrawText("[F] FLAG_FULLSCREEN_MODE: off", 10, 80, 10, MAROON);
if (IsWindowState(FLAG_WINDOW_RESIZABLE)) DrawText("[R] FLAG_WINDOW_RESIZABLE: on", 10, 100, 10, LIME);
else DrawText("[R] FLAG_WINDOW_RESIZABLE: off", 10, 100, 10, MAROON);
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);
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);
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);
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);
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
else DrawText("[U] FLAG_WINDOW_UNFOCUSED: off", 10, 200, 10, MAROON);
if (IsWindowState(FLAG_WINDOW_TOPMOST)) DrawText("[T] FLAG_WINDOW_TOPMOST: on", 10, 220, 10, LIME);
else DrawText("[T] FLAG_WINDOW_TOPMOST: off", 10, 220, 10, MAROON);
if (IsWindowState(FLAG_WINDOW_ALWAYS_RUN)) DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: on", 10, 240, 10, LIME);
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);
else DrawText("[V] FLAG_VSYNC_HINT: off", 10, 260, 10, MAROON);
DrawText("Following flags can only be set before window creation:", 10, 300, 10, GRAY);
if (IsWindowState(FLAG_WINDOW_HIGHDPI)) DrawText("FLAG_WINDOW_HIGHDPI: on", 10, 320, 10, LIME);
else DrawText("FLAG_WINDOW_HIGHDPI: off", 10, 320, 10, MAROON);
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) DrawText("FLAG_WINDOW_TRANSPARENT: on", 10, 340, 10, LIME);
else DrawText("FLAG_WINDOW_TRANSPARENT: off", 10, 340, 10, MAROON);
if (IsWindowState(FLAG_MSAA_4X_HINT)) DrawText("FLAG_MSAA_4X_HINT: on", 10, 360, 10, LIME);
else DrawText("FLAG_MSAA_4X_HINT: off", 10, 360, 10, MAROON);
EndDrawing();
//-----------------------------------------------------
}
// De-Initialization
//---------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//----------------------------------------------------------
return 0;
}

Some files were not shown because too many files have changed in this diff Show More